repltalk 2.0.4 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: repltalk
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.4
4
+ version: 3.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - CodingCactus
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-19 00:00:00.000000000 Z
11
+ date: 2021-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http
@@ -50,15 +50,17 @@ dependencies:
50
50
  - - ">="
51
51
  - !ruby/object:Gem::Version
52
52
  version: 2.5.1
53
- description: With the repltalk gem, you can easily interect with the repltalk graphql
54
- api. See https://github.com/Coding-Cactus/repltalk for documentation
53
+ description: With the ReplTalk gem, you can easily interect with the repltalk GraphQL
54
+ API. See https://github.com/Coding-Cactus/repltalk for documentation.
55
55
  email: codingcactus.cc@gmail.com
56
56
  executables: []
57
57
  extensions: []
58
58
  extra_rdoc_files: []
59
59
  files:
60
- - lib/queries.rb
61
60
  - lib/repltalk.rb
61
+ - lib/repltalk/client.rb
62
+ - lib/repltalk/graphql.rb
63
+ - lib/repltalk/structures.rb
62
64
  homepage: https://github.com/Coding-Cactus/repltalk
63
65
  licenses:
64
66
  - MIT
@@ -83,5 +85,5 @@ rubyforge_project:
83
85
  rubygems_version: 2.7.6
84
86
  signing_key:
85
87
  specification_version: 4
86
- summary: A ruby client for the repltalk api
88
+ summary: A Ruby client for the ReplTalk API
87
89
  test_files: []
data/lib/queries.rb DELETED
@@ -1,458 +0,0 @@
1
- class Fields
2
- @@roles = "
3
- id
4
- name
5
- key
6
- tagline
7
- "
8
-
9
- @@organization = "
10
- id
11
- name
12
- country
13
- postalCode
14
- state
15
- city
16
- timeCreated
17
- "
18
-
19
- @@subscription = "
20
- id
21
- planId
22
- quantity
23
- timeCreated
24
- "
25
-
26
- @@language = "
27
- id
28
- key
29
- displayName
30
- tagline
31
- icon
32
- category
33
- "
34
-
35
- @@board = "
36
- id
37
- name
38
- color
39
- description
40
- "
41
-
42
- @@user = "
43
- id
44
- fullName
45
- username
46
- image
47
- bio
48
- karma
49
- isHacker
50
- timeCreated
51
- roles {
52
- #{@@roles}
53
- }
54
- organization {
55
- #{@@organization}
56
- }
57
- subscription {
58
- #{@@subscription}
59
- }
60
- languages {
61
- #{@@language}
62
- }
63
- "
64
-
65
- @@repl = "
66
- id
67
- url
68
- title
69
- description
70
- size
71
- imageUrl
72
- isPrivate
73
- isAlwaysOn
74
- lang {
75
- #{@@language}
76
- }
77
- user {
78
- #{@@user}
79
- }
80
- origin {
81
- url
82
- }
83
- "
84
-
85
- @@comment = "
86
- id
87
- body
88
- timeCreated
89
- url
90
- isAnswer
91
- voteCount
92
- canVote
93
- hasVoted
94
- user {
95
- #{@@user}
96
- }
97
- post {
98
- id
99
- }
100
- "
101
-
102
- @@repl_comment = "
103
- id
104
- body
105
- timeCreated
106
- user {
107
- #{@@user}
108
- }
109
- repl {
110
- #{@@repl}
111
- }
112
- "
113
-
114
- @@post = "
115
- id
116
- title
117
- body
118
- preview(removeMarkdown: true, length: 150)
119
- url
120
- commentCount
121
- isHidden
122
- isPinned
123
- isLocked
124
- isAnnouncement
125
- timeCreated
126
- isAnswered
127
- isAnswerable
128
- voteCount
129
- canVote
130
- hasVoted
131
- user {
132
- #{@@user}
133
- }
134
- repl {
135
- #{@@repl}
136
- }
137
- board {
138
- #{@@board}
139
- }
140
- answer {
141
- #{@@comment}
142
- }
143
- "
144
- end
145
-
146
-
147
- class Queries < Fields
148
- def Queries.get_user
149
- "query userByUsername($username: String!) {
150
- user: userByUsername(username: $username) {
151
- #{@@user}
152
- }
153
- }"
154
- end
155
-
156
- def Queries.get_user_by_id
157
- "query user($user_id: Int!) {
158
- user: user(id: $user_id) {
159
- #{@@user}
160
- }
161
- }"
162
- end
163
-
164
- def Queries.get_user_posts
165
- "query user($username: String!, $after: String, $order: String, $count: Int) {
166
- user: userByUsername(username: $username) {
167
- posts(after: $after, order: $order, count: $count) {
168
- items {
169
- #{@@post}
170
- }
171
- }
172
- }
173
- }"
174
- end
175
-
176
- def Queries.get_user_comments
177
- "query user($username: String!, $after: String, $order: String, $count: Int) {
178
- user: userByUsername(username: $username) {
179
- comments(after: $after, order: $order, count: $count) {
180
- items {
181
- #{@@comment}
182
- }
183
- }
184
- }
185
- }"
186
- end
187
-
188
- def Queries.get_user_repls
189
- "query user($username: String!, $count: Int, $order: String, $direction: String, $before: String, $after: String, $pinnedReplsFirst: Boolean, $showUnnamed: Boolean) {
190
- user: userByUsername(username: $username) {
191
- publicRepls(count: $count, order: $order, direction: $direction, before: $before, after: $after, pinnedReplsFirst: $pinnedReplsFirst, showUnnamed: $showUnnamed) {
192
- items {
193
- #{@@repl}
194
- }
195
- }
196
- }
197
- }"
198
- end
199
-
200
- def Queries.get_post
201
- "query post($id: Int!) {
202
- post(id: $id) {
203
- #{@@post}
204
- }
205
- }"
206
- end
207
-
208
- def Queries.get_posts_comments
209
- "query post($postId: Int!, $order: String, $count: Int, $after: String) {
210
- post(id: $postId) {
211
- comments(order: $order, count: $count, after: $after) {
212
- items {
213
- #{@@comment}
214
- }
215
- }
216
- }
217
- }"
218
- end
219
-
220
- def Queries.get_posts_upvoters
221
- "query post($id: Int!, $count: Int) {
222
- post(id: $id) {
223
- votes(count: $count) {
224
- items {
225
- user {
226
- #{@@user}
227
- }
228
- }
229
- }
230
- }
231
- }"
232
- end
233
-
234
- def Queries.get_comment
235
- "query comment ($id: Int!) {
236
- comment(id: $id) {
237
- #{@@comment}
238
- }
239
- }"
240
- end
241
-
242
- def Queries.get_comments_comments
243
- "query comment ($id: Int!) {
244
- comment(id: $id) {
245
- comments {
246
- #{@@comment}
247
- }
248
- }
249
- }"
250
- end
251
-
252
- def Queries.get_parent_comment
253
- "query comment ($id: Int!) {
254
- comment(id: $id) {
255
- parentComment {
256
- #{@@comment}
257
- }
258
- }
259
- }"
260
- end
261
-
262
- def Queries.get_repl
263
- "query ReplView($url: String!) {
264
- repl(url: $url) {
265
- ... on Repl {
266
- #{@@repl}
267
- }
268
- }
269
- }"
270
- end
271
-
272
- def Queries.get_repl_forks
273
- "query ReplViewForks($url: String!, $count: Int!, $after: String) {
274
- repl(url: $url) {
275
- ... on Repl {
276
- publicForks(count: $count, after: $after) {
277
- items {
278
- #{@@repl}
279
- }
280
- }
281
- }
282
- }
283
- }"
284
- end
285
-
286
- def Queries.get_repl_comments
287
- "query ReplViewComments($url: String!, $count: Int, $after: String) {
288
- repl(url: $url) {
289
- ... on Repl {
290
- comments(count: $count, after: $after) {
291
- items {
292
- #{@@repl_comment}
293
- replies {
294
- #{@@repl_comment}
295
- }
296
- }
297
- }
298
- }
299
- }
300
- }"
301
- end
302
-
303
- def Queries.get_repl_comment
304
- "query ReplViewComment($id: Int!) {
305
- replComment(id: $id) {
306
- ... on ReplComment {
307
- #{@@repl_comment}
308
- }
309
- }
310
- }"
311
- end
312
-
313
-
314
- def Queries.get_board
315
- "query boardBySlug($slug: String!) {
316
- board: boardBySlug(slug: $slug) {
317
- #{@@board}
318
- }
319
- }"
320
- end
321
-
322
- def Queries.get_posts
323
- "query PostsFeed($order: String, $after: String, $searchQuery: String, $languages: [String!], $count: Int, $boardSlugs: [String!], $pinAnnouncements: Boolean, $pinPinned: Boolean) {
324
- posts(order: $order, after: $after, searchQuery: $searchQuery, languages: $languages, count: $count, boardSlugs: $boardSlugs, pinAnnouncements: $pinAnnouncements, pinPinned: $pinPinned) {
325
- items {
326
- #{@@post}
327
- }
328
- }
329
- }"
330
- end
331
-
332
- def Queries.get_leaderboard
333
- "query LeaderboardQuery($count: Int, $after: String, $since: KarmaSince) {
334
- leaderboard(count: $count, after: $after, since: $since) {
335
- items {
336
- #{@@user}
337
- karmaSince: karma(since: $since)
338
- }
339
- }
340
- }"
341
- end
342
- end
343
-
344
-
345
- class Mutations < Fields
346
- def Mutations.create_post
347
- "mutation createPost($input: CreatePostInput!) {
348
- createPost(input: $input) {
349
- post {
350
- #{@@post}
351
- }
352
- }
353
- }"
354
- end
355
-
356
- def Mutations.edit_post
357
- "mutation updatePost($input: UpdatePostInput!) {
358
- updatePost(input: $input) {
359
- post {
360
- #{@@post}
361
- }
362
- }
363
- }
364
- "
365
- end
366
-
367
- def Mutations.delete_post
368
- "mutation deletePost($id: Int!) {
369
- deletePost(id: $id) {
370
- id
371
- }
372
- }"
373
- end
374
-
375
- def Mutations.create_comment
376
- "mutation createComment($input: CreateCommentInput!) {
377
- createComment(input: $input) {
378
- comment {
379
- #{@@comment}
380
- }
381
- }
382
- }"
383
- end
384
-
385
- def Mutations.edit_comment
386
- "mutation updateComment($input: UpdateCommentInput!) {
387
- updateComment(input: $input) {
388
- comment {
389
- #{@@comment}
390
- }
391
- }
392
- }"
393
- end
394
-
395
- def Mutations.delete_comment
396
- "mutation deleteComment($id: Int!) {
397
- deleteComment(id: $id) {
398
- id
399
- }
400
- }"
401
- end
402
-
403
- def Mutations.create_repl_comment
404
- "mutation ReplViewCreateReplComment($input: CreateReplCommentInput!) {
405
- createReplComment(input: $input) {
406
- ... on ReplComment {
407
- #{@@repl_comment}
408
- }
409
- }
410
- }"
411
- end
412
-
413
- def Mutations.reply_repl_comment
414
- "mutation ReplViewCreateReplCommentReply($input: CreateReplCommentReplyInput!) {
415
- createReplCommentReply(input: $input) {
416
- ... on ReplComment {
417
- #{@@repl_comment}
418
- }
419
- }
420
- }"
421
- end
422
-
423
- def Mutations.edit_repl_comment
424
- "mutation ReplViewCommentsUpdateReplComment($input: UpdateReplCommentInput!) {
425
- updateReplComment(input: $input) {
426
- ... on ReplComment {
427
- #{@@repl_comment}
428
- }
429
- }
430
- }"
431
- end
432
-
433
- def Mutations.delete_repl_comment
434
- "mutation ReplViewCommentsDeleteReplComment($id: Int!) {
435
- deleteReplComment(id: $id) {
436
- ... on ReplComment {
437
- id
438
- }
439
- }
440
- }"
441
- end
442
-
443
- def Mutations.report_post
444
- "mutation createBoardReport($id: Int!, $reason: String!) {
445
- createBoardReport(postId: $id, reason: $reason) {
446
- id
447
- }
448
- }"
449
- end
450
-
451
- def Mutations.report_comment
452
- "mutation createBoardReport($id: Int!, $reason: String!) {
453
- createBoardReport(commentId: $id, reason: $reason) {
454
- id
455
- }
456
- }"
457
- end
458
- end