repltalk 2.0.5 → 4.0.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.5
4
+ version: 4.0.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-25 00:00:00.000000000 Z
11
+ date: 2021-05-08 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,459 +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
- timeCreated
71
- size
72
- imageUrl
73
- isPrivate
74
- isAlwaysOn
75
- lang {
76
- #{@@language}
77
- }
78
- user {
79
- #{@@user}
80
- }
81
- origin {
82
- url
83
- }
84
- "
85
-
86
- @@comment = "
87
- id
88
- body
89
- timeCreated
90
- url
91
- isAnswer
92
- voteCount
93
- canVote
94
- hasVoted
95
- user {
96
- #{@@user}
97
- }
98
- post {
99
- id
100
- }
101
- "
102
-
103
- @@repl_comment = "
104
- id
105
- body
106
- timeCreated
107
- user {
108
- #{@@user}
109
- }
110
- repl {
111
- #{@@repl}
112
- }
113
- "
114
-
115
- @@post = "
116
- id
117
- title
118
- body
119
- preview(removeMarkdown: true, length: 150)
120
- url
121
- commentCount
122
- isHidden
123
- isPinned
124
- isLocked
125
- isAnnouncement
126
- timeCreated
127
- isAnswered
128
- isAnswerable
129
- voteCount
130
- canVote
131
- hasVoted
132
- user {
133
- #{@@user}
134
- }
135
- repl {
136
- #{@@repl}
137
- }
138
- board {
139
- #{@@board}
140
- }
141
- answer {
142
- #{@@comment}
143
- }
144
- "
145
- end
146
-
147
-
148
- class Queries < Fields
149
- def Queries.get_user
150
- "query userByUsername($username: String!) {
151
- user: userByUsername(username: $username) {
152
- #{@@user}
153
- }
154
- }"
155
- end
156
-
157
- def Queries.get_user_by_id
158
- "query user($user_id: Int!) {
159
- user: user(id: $user_id) {
160
- #{@@user}
161
- }
162
- }"
163
- end
164
-
165
- def Queries.get_user_posts
166
- "query user($username: String!, $after: String, $order: String, $count: Int) {
167
- user: userByUsername(username: $username) {
168
- posts(after: $after, order: $order, count: $count) {
169
- items {
170
- #{@@post}
171
- }
172
- }
173
- }
174
- }"
175
- end
176
-
177
- def Queries.get_user_comments
178
- "query user($username: String!, $after: String, $order: String, $count: Int) {
179
- user: userByUsername(username: $username) {
180
- comments(after: $after, order: $order, count: $count) {
181
- items {
182
- #{@@comment}
183
- }
184
- }
185
- }
186
- }"
187
- end
188
-
189
- def Queries.get_user_repls
190
- "query user($username: String!, $count: Int, $order: String, $direction: String, $before: String, $after: String, $pinnedReplsFirst: Boolean, $showUnnamed: Boolean) {
191
- user: userByUsername(username: $username) {
192
- publicRepls(count: $count, order: $order, direction: $direction, before: $before, after: $after, pinnedReplsFirst: $pinnedReplsFirst, showUnnamed: $showUnnamed) {
193
- items {
194
- #{@@repl}
195
- }
196
- }
197
- }
198
- }"
199
- end
200
-
201
- def Queries.get_post
202
- "query post($id: Int!) {
203
- post(id: $id) {
204
- #{@@post}
205
- }
206
- }"
207
- end
208
-
209
- def Queries.get_posts_comments
210
- "query post($postId: Int!, $order: String, $count: Int, $after: String) {
211
- post(id: $postId) {
212
- comments(order: $order, count: $count, after: $after) {
213
- items {
214
- #{@@comment}
215
- }
216
- }
217
- }
218
- }"
219
- end
220
-
221
- def Queries.get_posts_upvoters
222
- "query post($id: Int!, $count: Int) {
223
- post(id: $id) {
224
- votes(count: $count) {
225
- items {
226
- user {
227
- #{@@user}
228
- }
229
- }
230
- }
231
- }
232
- }"
233
- end
234
-
235
- def Queries.get_comment
236
- "query comment ($id: Int!) {
237
- comment(id: $id) {
238
- #{@@comment}
239
- }
240
- }"
241
- end
242
-
243
- def Queries.get_comments_comments
244
- "query comment ($id: Int!) {
245
- comment(id: $id) {
246
- comments {
247
- #{@@comment}
248
- }
249
- }
250
- }"
251
- end
252
-
253
- def Queries.get_parent_comment
254
- "query comment ($id: Int!) {
255
- comment(id: $id) {
256
- parentComment {
257
- #{@@comment}
258
- }
259
- }
260
- }"
261
- end
262
-
263
- def Queries.get_repl
264
- "query ReplView($url: String!) {
265
- repl(url: $url) {
266
- ... on Repl {
267
- #{@@repl}
268
- }
269
- }
270
- }"
271
- end
272
-
273
- def Queries.get_repl_forks
274
- "query ReplViewForks($url: String!, $count: Int!, $after: String) {
275
- repl(url: $url) {
276
- ... on Repl {
277
- publicForks(count: $count, after: $after) {
278
- items {
279
- #{@@repl}
280
- }
281
- }
282
- }
283
- }
284
- }"
285
- end
286
-
287
- def Queries.get_repl_comments
288
- "query ReplViewComments($url: String!, $count: Int, $after: String) {
289
- repl(url: $url) {
290
- ... on Repl {
291
- comments(count: $count, after: $after) {
292
- items {
293
- #{@@repl_comment}
294
- replies {
295
- #{@@repl_comment}
296
- }
297
- }
298
- }
299
- }
300
- }
301
- }"
302
- end
303
-
304
- def Queries.get_repl_comment
305
- "query ReplViewComment($id: Int!) {
306
- replComment(id: $id) {
307
- ... on ReplComment {
308
- #{@@repl_comment}
309
- }
310
- }
311
- }"
312
- end
313
-
314
-
315
- def Queries.get_board
316
- "query boardBySlug($slug: String!) {
317
- board: boardBySlug(slug: $slug) {
318
- #{@@board}
319
- }
320
- }"
321
- end
322
-
323
- def Queries.get_posts
324
- "query PostsFeed($order: String, $after: String, $searchQuery: String, $languages: [String!], $count: Int, $boardSlugs: [String!], $pinAnnouncements: Boolean, $pinPinned: Boolean) {
325
- posts(order: $order, after: $after, searchQuery: $searchQuery, languages: $languages, count: $count, boardSlugs: $boardSlugs, pinAnnouncements: $pinAnnouncements, pinPinned: $pinPinned) {
326
- items {
327
- #{@@post}
328
- }
329
- }
330
- }"
331
- end
332
-
333
- def Queries.get_leaderboard
334
- "query LeaderboardQuery($count: Int, $after: String, $since: KarmaSince) {
335
- leaderboard(count: $count, after: $after, since: $since) {
336
- items {
337
- #{@@user}
338
- karmaSince: karma(since: $since)
339
- }
340
- }
341
- }"
342
- end
343
- end
344
-
345
-
346
- class Mutations < Fields
347
- def Mutations.create_post
348
- "mutation createPost($input: CreatePostInput!) {
349
- createPost(input: $input) {
350
- post {
351
- #{@@post}
352
- }
353
- }
354
- }"
355
- end
356
-
357
- def Mutations.edit_post
358
- "mutation updatePost($input: UpdatePostInput!) {
359
- updatePost(input: $input) {
360
- post {
361
- #{@@post}
362
- }
363
- }
364
- }
365
- "
366
- end
367
-
368
- def Mutations.delete_post
369
- "mutation deletePost($id: Int!) {
370
- deletePost(id: $id) {
371
- id
372
- }
373
- }"
374
- end
375
-
376
- def Mutations.create_comment
377
- "mutation createComment($input: CreateCommentInput!) {
378
- createComment(input: $input) {
379
- comment {
380
- #{@@comment}
381
- }
382
- }
383
- }"
384
- end
385
-
386
- def Mutations.edit_comment
387
- "mutation updateComment($input: UpdateCommentInput!) {
388
- updateComment(input: $input) {
389
- comment {
390
- #{@@comment}
391
- }
392
- }
393
- }"
394
- end
395
-
396
- def Mutations.delete_comment
397
- "mutation deleteComment($id: Int!) {
398
- deleteComment(id: $id) {
399
- id
400
- }
401
- }"
402
- end
403
-
404
- def Mutations.create_repl_comment
405
- "mutation ReplViewCreateReplComment($input: CreateReplCommentInput!) {
406
- createReplComment(input: $input) {
407
- ... on ReplComment {
408
- #{@@repl_comment}
409
- }
410
- }
411
- }"
412
- end
413
-
414
- def Mutations.reply_repl_comment
415
- "mutation ReplViewCreateReplCommentReply($input: CreateReplCommentReplyInput!) {
416
- createReplCommentReply(input: $input) {
417
- ... on ReplComment {
418
- #{@@repl_comment}
419
- }
420
- }
421
- }"
422
- end
423
-
424
- def Mutations.edit_repl_comment
425
- "mutation ReplViewCommentsUpdateReplComment($input: UpdateReplCommentInput!) {
426
- updateReplComment(input: $input) {
427
- ... on ReplComment {
428
- #{@@repl_comment}
429
- }
430
- }
431
- }"
432
- end
433
-
434
- def Mutations.delete_repl_comment
435
- "mutation ReplViewCommentsDeleteReplComment($id: Int!) {
436
- deleteReplComment(id: $id) {
437
- ... on ReplComment {
438
- id
439
- }
440
- }
441
- }"
442
- end
443
-
444
- def Mutations.report_post
445
- "mutation createBoardReport($id: Int!, $reason: String!) {
446
- createBoardReport(postId: $id, reason: $reason) {
447
- id
448
- }
449
- }"
450
- end
451
-
452
- def Mutations.report_comment
453
- "mutation createBoardReport($id: Int!, $reason: String!) {
454
- createBoardReport(commentId: $id, reason: $reason) {
455
- id
456
- }
457
- }"
458
- end
459
- end