carddb 0.2.1 → 0.3.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.
- checksums.yaml +4 -4
- data/.rspec_status +109 -70
- data/CHANGELOG.md +6 -0
- data/README.md +216 -2
- data/lib/carddb/client.rb +14 -1
- data/lib/carddb/collection.rb +517 -3
- data/lib/carddb/configuration.rb +27 -1
- data/lib/carddb/connection.rb +5 -2
- data/lib/carddb/query_builder.rb +1096 -127
- data/lib/carddb/resources/decks.rb +432 -6
- data/lib/carddb/resources/records.rb +39 -15
- data/lib/carddb/version.rb +1 -1
- metadata +1 -1
data/lib/carddb/query_builder.rb
CHANGED
|
@@ -165,6 +165,7 @@ module CardDB
|
|
|
165
165
|
end
|
|
166
166
|
|
|
167
167
|
# Builds a searchRecords query
|
|
168
|
+
# rubocop:disable Metrics/ParameterLists
|
|
168
169
|
def search_records(
|
|
169
170
|
publisher_slug:,
|
|
170
171
|
game_key:,
|
|
@@ -175,7 +176,8 @@ module CardDB
|
|
|
175
176
|
resolve_links: nil,
|
|
176
177
|
first: nil,
|
|
177
178
|
after: nil,
|
|
178
|
-
validate_schema: nil
|
|
179
|
+
validate_schema: nil,
|
|
180
|
+
include_pricing: false
|
|
179
181
|
)
|
|
180
182
|
args = build_args(
|
|
181
183
|
{
|
|
@@ -196,59 +198,63 @@ module CardDB
|
|
|
196
198
|
<<~GRAPHQL
|
|
197
199
|
query SearchRecords#{args[:definition]} {
|
|
198
200
|
searchRecords#{args[:call]} {
|
|
199
|
-
#{record_connection_fields(
|
|
201
|
+
#{record_connection_fields(
|
|
202
|
+
include_resolved_links: resolve_links&.any?,
|
|
203
|
+
include_pricing: include_pricing
|
|
204
|
+
)}
|
|
200
205
|
}
|
|
201
206
|
}
|
|
202
207
|
GRAPHQL
|
|
203
208
|
end
|
|
209
|
+
# rubocop:enable Metrics/ParameterLists
|
|
204
210
|
|
|
205
211
|
# Builds a fetchRecordByIdentifier query
|
|
206
|
-
def fetch_record_by_identifier
|
|
212
|
+
def fetch_record_by_identifier(include_pricing: false)
|
|
207
213
|
<<~GRAPHQL
|
|
208
214
|
query FetchRecordByIdentifier($publisherSlug: String!, $gameKey: String!, $datasetKey: String!, $identifier: String!) {
|
|
209
215
|
fetchRecordByIdentifier(publisherSlug: $publisherSlug, gameKey: $gameKey, datasetKey: $datasetKey, identifier: $identifier) {
|
|
210
|
-
#{record_fields}
|
|
216
|
+
#{record_fields(include_pricing: include_pricing)}
|
|
211
217
|
}
|
|
212
218
|
}
|
|
213
219
|
GRAPHQL
|
|
214
220
|
end
|
|
215
221
|
|
|
216
222
|
# Builds a fetchRecordsByIdentifier query
|
|
217
|
-
def fetch_records_by_identifier
|
|
223
|
+
def fetch_records_by_identifier(include_pricing: false)
|
|
218
224
|
<<~GRAPHQL
|
|
219
225
|
query FetchRecordsByIdentifier($publisherSlug: String!, $gameKey: String!, $datasetKey: String!, $identifiers: [String!]!) {
|
|
220
226
|
fetchRecordsByIdentifier(publisherSlug: $publisherSlug, gameKey: $gameKey, datasetKey: $datasetKey, identifiers: $identifiers) {
|
|
221
|
-
#{record_fields}
|
|
227
|
+
#{record_fields(include_pricing: include_pricing)}
|
|
222
228
|
}
|
|
223
229
|
}
|
|
224
230
|
GRAPHQL
|
|
225
231
|
end
|
|
226
232
|
|
|
227
233
|
# Builds a fetchRecord query
|
|
228
|
-
def fetch_record
|
|
234
|
+
def fetch_record(include_pricing: false)
|
|
229
235
|
<<~GRAPHQL
|
|
230
236
|
query FetchRecord($id: UUID!) {
|
|
231
237
|
fetchRecord(id: $id) {
|
|
232
|
-
#{record_fields}
|
|
238
|
+
#{record_fields(include_pricing: include_pricing)}
|
|
233
239
|
}
|
|
234
240
|
}
|
|
235
241
|
GRAPHQL
|
|
236
242
|
end
|
|
237
243
|
|
|
238
244
|
# Builds a fetchRecords query
|
|
239
|
-
def fetch_records
|
|
245
|
+
def fetch_records(include_pricing: false)
|
|
240
246
|
<<~GRAPHQL
|
|
241
247
|
query FetchRecords($ids: [UUID!]!) {
|
|
242
248
|
fetchRecords(ids: $ids) {
|
|
243
|
-
#{record_fields}
|
|
249
|
+
#{record_fields(include_pricing: include_pricing)}
|
|
244
250
|
}
|
|
245
251
|
}
|
|
246
252
|
GRAPHQL
|
|
247
253
|
end
|
|
248
254
|
|
|
249
255
|
# Builds a myDecks query
|
|
250
|
-
def list_my_decks(first: nil, after: nil)
|
|
251
|
-
args = build_args({ first: first, after: after })
|
|
256
|
+
def list_my_decks(first: nil, after: nil, include_archived: nil)
|
|
257
|
+
args = build_args({ first: first, after: after, includeArchived: include_archived })
|
|
252
258
|
|
|
253
259
|
<<~GRAPHQL
|
|
254
260
|
query MyDecks#{args[:definition]} {
|
|
@@ -259,6 +265,51 @@ module CardDB
|
|
|
259
265
|
GRAPHQL
|
|
260
266
|
end
|
|
261
267
|
|
|
268
|
+
def viewer_decks(filter: nil, first: nil, after: nil)
|
|
269
|
+
args = build_args(
|
|
270
|
+
{ filter: filter, first: first, after: after },
|
|
271
|
+
type_overrides: { filter: 'ViewerDecksFilterInput' }
|
|
272
|
+
)
|
|
273
|
+
|
|
274
|
+
<<~GRAPHQL
|
|
275
|
+
query ViewerDecks#{args[:definition]} {
|
|
276
|
+
viewerDecks#{args[:call]} {
|
|
277
|
+
#{deck_connection_fields}
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
GRAPHQL
|
|
281
|
+
end
|
|
282
|
+
|
|
283
|
+
def app_decks(filter: nil, first: nil, after: nil)
|
|
284
|
+
args = build_args(
|
|
285
|
+
{ filter: filter, first: first, after: after },
|
|
286
|
+
type_overrides: { filter: 'AppDecksFilterInput' }
|
|
287
|
+
)
|
|
288
|
+
|
|
289
|
+
<<~GRAPHQL
|
|
290
|
+
query AppDecks#{args[:definition]} {
|
|
291
|
+
appDecks#{args[:call]} {
|
|
292
|
+
#{deck_connection_fields}
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
GRAPHQL
|
|
296
|
+
end
|
|
297
|
+
|
|
298
|
+
def public_decks(filter: nil, first: nil, after: nil)
|
|
299
|
+
args = build_args(
|
|
300
|
+
{ filter: filter, first: first, after: after },
|
|
301
|
+
type_overrides: { filter: 'PublicDecksFilterInput' }
|
|
302
|
+
)
|
|
303
|
+
|
|
304
|
+
<<~GRAPHQL
|
|
305
|
+
query PublicDecks#{args[:definition]} {
|
|
306
|
+
publicDecks#{args[:call]} {
|
|
307
|
+
#{deck_connection_fields}
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
GRAPHQL
|
|
311
|
+
end
|
|
312
|
+
|
|
262
313
|
# Builds a fetchDeck query
|
|
263
314
|
def fetch_deck
|
|
264
315
|
<<~GRAPHQL
|
|
@@ -270,6 +321,16 @@ module CardDB
|
|
|
270
321
|
GRAPHQL
|
|
271
322
|
end
|
|
272
323
|
|
|
324
|
+
def deck
|
|
325
|
+
<<~GRAPHQL
|
|
326
|
+
query Deck($id: UUID!) {
|
|
327
|
+
deck(id: $id) {
|
|
328
|
+
#{deck_fields}
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
GRAPHQL
|
|
332
|
+
end
|
|
333
|
+
|
|
273
334
|
# Builds a myDeck query
|
|
274
335
|
def my_deck
|
|
275
336
|
<<~GRAPHQL
|
|
@@ -292,6 +353,16 @@ module CardDB
|
|
|
292
353
|
GRAPHQL
|
|
293
354
|
end
|
|
294
355
|
|
|
356
|
+
def deck_by_slug
|
|
357
|
+
<<~GRAPHQL
|
|
358
|
+
query DeckBySlug($publisherSlug: String!, $gameKey: String!, $slug: String!) {
|
|
359
|
+
deckBySlug(publisherSlug: $publisherSlug, gameKey: $gameKey, slug: $slug) {
|
|
360
|
+
#{deck_fields}
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
GRAPHQL
|
|
364
|
+
end
|
|
365
|
+
|
|
295
366
|
# Builds a fetchDeckByExternalRef query
|
|
296
367
|
def fetch_deck_by_external_ref
|
|
297
368
|
<<~GRAPHQL
|
|
@@ -303,6 +374,16 @@ module CardDB
|
|
|
303
374
|
GRAPHQL
|
|
304
375
|
end
|
|
305
376
|
|
|
377
|
+
def deck_by_external_ref
|
|
378
|
+
<<~GRAPHQL
|
|
379
|
+
query DeckByExternalRef($externalRef: String!) {
|
|
380
|
+
deckByExternalRef(externalRef: $externalRef) {
|
|
381
|
+
#{deck_fields}
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
GRAPHQL
|
|
385
|
+
end
|
|
386
|
+
|
|
306
387
|
# Builds a deckVersion query
|
|
307
388
|
def deck_version
|
|
308
389
|
<<~GRAPHQL
|
|
@@ -338,6 +419,94 @@ module CardDB
|
|
|
338
419
|
GRAPHQL
|
|
339
420
|
end
|
|
340
421
|
|
|
422
|
+
def deck_embed
|
|
423
|
+
<<~GRAPHQL
|
|
424
|
+
query DeckEmbed($token: String!) {
|
|
425
|
+
deckEmbed(token: $token) {
|
|
426
|
+
#{deck_fields}
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
GRAPHQL
|
|
430
|
+
end
|
|
431
|
+
|
|
432
|
+
def deck_access
|
|
433
|
+
<<~GRAPHQL
|
|
434
|
+
query DeckAccess($token: String!) {
|
|
435
|
+
deckAccess(token: $token) {
|
|
436
|
+
#{deck_fields}
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
GRAPHQL
|
|
440
|
+
end
|
|
441
|
+
|
|
442
|
+
def deck_draft_diff
|
|
443
|
+
<<~GRAPHQL
|
|
444
|
+
query DeckDraftDiff($id: UUID!) {
|
|
445
|
+
deckDraftDiff(id: $id) {
|
|
446
|
+
#{deck_diff_fields}
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
GRAPHQL
|
|
450
|
+
end
|
|
451
|
+
|
|
452
|
+
def deck_version_diff
|
|
453
|
+
<<~GRAPHQL
|
|
454
|
+
query DeckVersionDiff($fromVersionId: UUID!, $toVersionId: UUID!) {
|
|
455
|
+
deckVersionDiff(fromVersionId: $fromVersionId, toVersionId: $toVersionId) {
|
|
456
|
+
#{deck_diff_fields}
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
GRAPHQL
|
|
460
|
+
end
|
|
461
|
+
|
|
462
|
+
def deck_hydrate_entries
|
|
463
|
+
<<~GRAPHQL
|
|
464
|
+
query DeckHydrateEntries($input: DeckHydrateEntriesInput!) {
|
|
465
|
+
deckHydrateEntries(input: $input) {
|
|
466
|
+
#{deck_hydrate_entries_payload_fields}
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
GRAPHQL
|
|
470
|
+
end
|
|
471
|
+
|
|
472
|
+
def deck_export
|
|
473
|
+
<<~GRAPHQL
|
|
474
|
+
query DeckExport($id: UUID!, $format: DeckExportFormat!) {
|
|
475
|
+
deckExport(id: $id, format: $format) {
|
|
476
|
+
#{deck_export_payload_fields}
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
GRAPHQL
|
|
480
|
+
end
|
|
481
|
+
|
|
482
|
+
def deck_validate
|
|
483
|
+
<<~GRAPHQL
|
|
484
|
+
query DeckValidate($id: UUID!, $input: DeckValidateInput) {
|
|
485
|
+
deckValidate(id: $id, input: $input) {
|
|
486
|
+
#{deck_validation_fields}
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
GRAPHQL
|
|
490
|
+
end
|
|
491
|
+
|
|
492
|
+
def deck_section_definitions(publisher_slug: nil, game_key: nil, game_id: nil, ruleset_key: nil, ruleset_version_id: nil)
|
|
493
|
+
args = build_args({
|
|
494
|
+
publisherSlug: publisher_slug,
|
|
495
|
+
gameKey: game_key,
|
|
496
|
+
gameId: game_id,
|
|
497
|
+
rulesetKey: ruleset_key,
|
|
498
|
+
rulesetVersionId: ruleset_version_id
|
|
499
|
+
})
|
|
500
|
+
|
|
501
|
+
<<~GRAPHQL
|
|
502
|
+
query DeckSectionDefinitions#{args[:definition]} {
|
|
503
|
+
deckSectionDefinitions#{args[:call]} {
|
|
504
|
+
#{deck_section_definition_fields}
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
GRAPHQL
|
|
508
|
+
end
|
|
509
|
+
|
|
341
510
|
# Builds a deckCollaborators query
|
|
342
511
|
def deck_collaborators
|
|
343
512
|
<<~GRAPHQL
|
|
@@ -360,6 +529,81 @@ module CardDB
|
|
|
360
529
|
GRAPHQL
|
|
361
530
|
end
|
|
362
531
|
|
|
532
|
+
def deck_embed_tokens
|
|
533
|
+
<<~GRAPHQL
|
|
534
|
+
query DeckEmbedTokens($deckId: UUID!) {
|
|
535
|
+
deckEmbedTokens(deckId: $deckId) {
|
|
536
|
+
#{deck_embed_token_fields}
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
GRAPHQL
|
|
540
|
+
end
|
|
541
|
+
|
|
542
|
+
def deck_access_token_issuers
|
|
543
|
+
<<~GRAPHQL
|
|
544
|
+
query DeckAccessTokenIssuers($deckId: UUID!) {
|
|
545
|
+
deckAccessTokenIssuers(deckId: $deckId) {
|
|
546
|
+
#{deck_access_token_issuer_fields}
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
GRAPHQL
|
|
550
|
+
end
|
|
551
|
+
|
|
552
|
+
def deck_api_application_accesses
|
|
553
|
+
<<~GRAPHQL
|
|
554
|
+
query DeckApiApplicationAccesses($deckId: UUID!, $includeRevoked: Boolean) {
|
|
555
|
+
deckApiApplicationAccesses(deckId: $deckId, includeRevoked: $includeRevoked) {
|
|
556
|
+
#{deck_api_application_access_fields}
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
GRAPHQL
|
|
560
|
+
end
|
|
561
|
+
|
|
562
|
+
def my_deck_api_application_accesses
|
|
563
|
+
<<~GRAPHQL
|
|
564
|
+
query MyDeckApiApplicationAccesses($applicationId: UUID) {
|
|
565
|
+
myDeckApiApplicationAccesses(applicationId: $applicationId) {
|
|
566
|
+
#{deck_api_application_access_fields}
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
GRAPHQL
|
|
570
|
+
end
|
|
571
|
+
|
|
572
|
+
def deck_import_formats(game_id:, include_archived: nil, first: nil, after: nil)
|
|
573
|
+
args = build_args(
|
|
574
|
+
{ gameId: game_id, includeArchived: include_archived, first: first, after: after },
|
|
575
|
+
required: [:gameId]
|
|
576
|
+
)
|
|
577
|
+
|
|
578
|
+
<<~GRAPHQL
|
|
579
|
+
query DeckImportFormats#{args[:definition]} {
|
|
580
|
+
deckImportFormats#{args[:call]} {
|
|
581
|
+
#{deck_import_format_definition_connection_fields}
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
GRAPHQL
|
|
585
|
+
end
|
|
586
|
+
|
|
587
|
+
def deck_import_format
|
|
588
|
+
<<~GRAPHQL
|
|
589
|
+
query DeckImportFormat($id: UUID!) {
|
|
590
|
+
deckImportFormat(id: $id) {
|
|
591
|
+
#{deck_import_format_definition_fields}
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
GRAPHQL
|
|
595
|
+
end
|
|
596
|
+
|
|
597
|
+
def deck_import_format_test
|
|
598
|
+
<<~GRAPHQL
|
|
599
|
+
query DeckImportFormatTest($input: DeckImportFormatTestInput!) {
|
|
600
|
+
deckImportFormatTest(input: $input) {
|
|
601
|
+
#{deck_import_format_test_payload_fields}
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
GRAPHQL
|
|
605
|
+
end
|
|
606
|
+
|
|
363
607
|
# Builds a deckCreate mutation
|
|
364
608
|
def create_deck
|
|
365
609
|
<<~GRAPHQL
|
|
@@ -382,139 +626,415 @@ module CardDB
|
|
|
382
626
|
GRAPHQL
|
|
383
627
|
end
|
|
384
628
|
|
|
385
|
-
|
|
386
|
-
def publish_deck
|
|
629
|
+
def add_deck_entry
|
|
387
630
|
<<~GRAPHQL
|
|
388
|
-
mutation
|
|
389
|
-
|
|
390
|
-
#{
|
|
631
|
+
mutation DeckEntryAdd($input: DeckEntryAddInput!) {
|
|
632
|
+
deckEntryAdd(input: $input) {
|
|
633
|
+
#{deck_entry_mutation_payload_fields}
|
|
391
634
|
}
|
|
392
635
|
}
|
|
393
636
|
GRAPHQL
|
|
394
637
|
end
|
|
395
638
|
|
|
396
|
-
|
|
397
|
-
def upsert_deck_collaborator
|
|
639
|
+
def update_deck_entry
|
|
398
640
|
<<~GRAPHQL
|
|
399
|
-
mutation
|
|
400
|
-
|
|
401
|
-
#{
|
|
641
|
+
mutation DeckEntryUpdate($id: UUID!, $input: DeckEntryUpdateInput!) {
|
|
642
|
+
deckEntryUpdate(id: $id, input: $input) {
|
|
643
|
+
#{deck_entry_mutation_payload_fields}
|
|
402
644
|
}
|
|
403
645
|
}
|
|
404
646
|
GRAPHQL
|
|
405
647
|
end
|
|
406
648
|
|
|
407
|
-
|
|
408
|
-
def remove_deck_collaborator
|
|
649
|
+
def remove_deck_entry
|
|
409
650
|
<<~GRAPHQL
|
|
410
|
-
mutation
|
|
411
|
-
|
|
651
|
+
mutation DeckEntryRemove($id: UUID!, $expectedDraftRevision: Int!) {
|
|
652
|
+
deckEntryRemove(id: $id, expectedDraftRevision: $expectedDraftRevision) {
|
|
653
|
+
#{deck_entry_mutation_payload_fields}
|
|
654
|
+
}
|
|
412
655
|
}
|
|
413
656
|
GRAPHQL
|
|
414
657
|
end
|
|
415
658
|
|
|
416
|
-
|
|
417
|
-
def create_deck_preview_token
|
|
659
|
+
def reorder_deck_entries
|
|
418
660
|
<<~GRAPHQL
|
|
419
|
-
mutation
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
previewToken {
|
|
423
|
-
#{deck_preview_token_fields}
|
|
424
|
-
}
|
|
661
|
+
mutation DeckEntryReorder($deckId: UUID!, $input: DeckEntryReorderInput!) {
|
|
662
|
+
deckEntryReorder(deckId: $deckId, input: $input) {
|
|
663
|
+
#{deck_entry_reorder_payload_fields}
|
|
425
664
|
}
|
|
426
665
|
}
|
|
427
666
|
GRAPHQL
|
|
428
667
|
end
|
|
429
668
|
|
|
430
|
-
|
|
431
|
-
def revoke_deck_preview_token
|
|
669
|
+
def replace_deck_entries
|
|
432
670
|
<<~GRAPHQL
|
|
433
|
-
mutation
|
|
434
|
-
|
|
671
|
+
mutation DeckEntriesReplace($deckId: UUID!, $input: DeckEntriesReplaceInput!) {
|
|
672
|
+
deckEntriesReplace(deckId: $deckId, input: $input) {
|
|
673
|
+
#{deck_entry_reorder_payload_fields}
|
|
674
|
+
}
|
|
435
675
|
}
|
|
436
676
|
GRAPHQL
|
|
437
677
|
end
|
|
438
678
|
|
|
439
|
-
|
|
440
|
-
def delete_deck
|
|
679
|
+
def import_deck
|
|
441
680
|
<<~GRAPHQL
|
|
442
|
-
mutation
|
|
443
|
-
|
|
681
|
+
mutation DeckImport($input: DeckImportInput!) {
|
|
682
|
+
deckImport(input: $input) {
|
|
683
|
+
#{deck_import_payload_fields}
|
|
684
|
+
}
|
|
444
685
|
}
|
|
445
686
|
GRAPHQL
|
|
446
687
|
end
|
|
447
688
|
|
|
448
|
-
|
|
449
|
-
def fetch_me
|
|
689
|
+
def create_deck_import_format
|
|
450
690
|
<<~GRAPHQL
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
id
|
|
455
|
-
name
|
|
456
|
-
description
|
|
457
|
-
environment
|
|
458
|
-
apiKeyPrefix
|
|
459
|
-
allowedOrigins
|
|
460
|
-
allowedIps
|
|
461
|
-
createdAt
|
|
462
|
-
updatedAt
|
|
463
|
-
lastUsedAt
|
|
464
|
-
}
|
|
465
|
-
account {
|
|
466
|
-
id
|
|
467
|
-
displayName
|
|
468
|
-
createdAt
|
|
469
|
-
}
|
|
691
|
+
mutation DeckImportFormatCreate($input: DeckImportFormatCreateInput!) {
|
|
692
|
+
deckImportFormatCreate(input: $input) {
|
|
693
|
+
#{deck_import_format_definition_fields}
|
|
470
694
|
}
|
|
471
695
|
}
|
|
472
696
|
GRAPHQL
|
|
473
697
|
end
|
|
474
698
|
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
type_map = {
|
|
485
|
-
publisherSlug: 'String',
|
|
486
|
-
gameKey: 'String',
|
|
487
|
-
datasetKey: 'String',
|
|
488
|
-
search: 'String',
|
|
489
|
-
orderBy: 'String',
|
|
490
|
-
filter: 'JSON',
|
|
491
|
-
resolveLinks: '[String!]',
|
|
492
|
-
first: 'Int',
|
|
493
|
-
after: 'String',
|
|
494
|
-
externalRef: 'String',
|
|
495
|
-
deckId: 'UUID!',
|
|
496
|
-
validateSchema: 'Boolean',
|
|
497
|
-
purpose: 'DatasetPurpose',
|
|
498
|
-
id: 'UUID!',
|
|
499
|
-
ids: '[UUID!]!'
|
|
500
|
-
}
|
|
699
|
+
def update_deck_import_format
|
|
700
|
+
<<~GRAPHQL
|
|
701
|
+
mutation DeckImportFormatUpdate($id: UUID!, $input: DeckImportFormatUpdateInput!) {
|
|
702
|
+
deckImportFormatUpdate(id: $id, input: $input) {
|
|
703
|
+
#{deck_import_format_definition_fields}
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
GRAPHQL
|
|
707
|
+
end
|
|
501
708
|
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
709
|
+
def archive_deck_import_format
|
|
710
|
+
<<~GRAPHQL
|
|
711
|
+
mutation DeckImportFormatArchive($id: UUID!) {
|
|
712
|
+
deckImportFormatArchive(id: $id) {
|
|
713
|
+
#{deck_import_format_definition_fields}
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
GRAPHQL
|
|
717
|
+
end
|
|
509
718
|
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
719
|
+
def unarchive_deck_import_format
|
|
720
|
+
<<~GRAPHQL
|
|
721
|
+
mutation DeckImportFormatUnarchive($id: UUID!) {
|
|
722
|
+
deckImportFormatUnarchive(id: $id) {
|
|
723
|
+
#{deck_import_format_definition_fields}
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
GRAPHQL
|
|
514
727
|
end
|
|
515
728
|
|
|
516
|
-
def
|
|
517
|
-
<<~
|
|
729
|
+
def upsert_deck_by_external_ref
|
|
730
|
+
<<~GRAPHQL
|
|
731
|
+
mutation DeckUpsertByExternalRef($input: DeckUpsertByExternalRefInput!) {
|
|
732
|
+
deckUpsertByExternalRef(input: $input) {
|
|
733
|
+
deck {
|
|
734
|
+
#{deck_fields}
|
|
735
|
+
}
|
|
736
|
+
created
|
|
737
|
+
idempotentReplay
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
GRAPHQL
|
|
741
|
+
end
|
|
742
|
+
|
|
743
|
+
def claim_deck
|
|
744
|
+
<<~GRAPHQL
|
|
745
|
+
mutation DeckClaim($id: UUID!, $input: DeckClaimInput!) {
|
|
746
|
+
deckClaim(id: $id, input: $input) {
|
|
747
|
+
#{deck_ownership_transfer_payload_fields}
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
GRAPHQL
|
|
751
|
+
end
|
|
752
|
+
|
|
753
|
+
def transfer_deck_ownership
|
|
754
|
+
<<~GRAPHQL
|
|
755
|
+
mutation DeckTransferOwnership($id: UUID!, $input: DeckTransferOwnershipInput!) {
|
|
756
|
+
deckTransferOwnership(id: $id, input: $input) {
|
|
757
|
+
#{deck_ownership_transfer_payload_fields}
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
GRAPHQL
|
|
761
|
+
end
|
|
762
|
+
|
|
763
|
+
def copy_deck
|
|
764
|
+
<<~GRAPHQL
|
|
765
|
+
mutation DeckCopy($id: UUID!, $input: DeckCopyInput!) {
|
|
766
|
+
deckCopy(id: $id, input: $input) {
|
|
767
|
+
#{deck_copy_payload_fields}
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
GRAPHQL
|
|
771
|
+
end
|
|
772
|
+
|
|
773
|
+
def archive_deck
|
|
774
|
+
<<~GRAPHQL
|
|
775
|
+
mutation DeckArchive($id: UUID!) {
|
|
776
|
+
deckArchive(id: $id) {
|
|
777
|
+
#{deck_fields}
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
GRAPHQL
|
|
781
|
+
end
|
|
782
|
+
|
|
783
|
+
def restore_deck
|
|
784
|
+
<<~GRAPHQL
|
|
785
|
+
mutation DeckRestore($id: UUID!) {
|
|
786
|
+
deckRestore(id: $id) {
|
|
787
|
+
#{deck_fields}
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
GRAPHQL
|
|
791
|
+
end
|
|
792
|
+
|
|
793
|
+
def unpublish_deck
|
|
794
|
+
<<~GRAPHQL
|
|
795
|
+
mutation DeckUnpublish($id: UUID!) {
|
|
796
|
+
deckUnpublish(id: $id) {
|
|
797
|
+
#{deck_fields}
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
GRAPHQL
|
|
801
|
+
end
|
|
802
|
+
|
|
803
|
+
# Builds a deckPublish mutation
|
|
804
|
+
def publish_deck
|
|
805
|
+
<<~GRAPHQL
|
|
806
|
+
mutation DeckPublish($id: UUID!, $input: DeckPublishInput!) {
|
|
807
|
+
deckPublish(id: $id, input: $input) {
|
|
808
|
+
#{deck_publish_payload_fields}
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
GRAPHQL
|
|
812
|
+
end
|
|
813
|
+
|
|
814
|
+
def remove_invalid_deck_entries
|
|
815
|
+
<<~GRAPHQL
|
|
816
|
+
mutation DeckRemoveInvalidEntries($id: UUID!, $input: DeckRemoveInvalidEntriesInput!) {
|
|
817
|
+
deckRemoveInvalidEntries(id: $id, input: $input) {
|
|
818
|
+
#{deck_fields}
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
GRAPHQL
|
|
822
|
+
end
|
|
823
|
+
|
|
824
|
+
# Builds a deckCollaboratorUpsert mutation
|
|
825
|
+
def upsert_deck_collaborator
|
|
826
|
+
<<~GRAPHQL
|
|
827
|
+
mutation DeckCollaboratorUpsert($deckId: UUID!, $accountId: UUID!, $role: DeckCollaboratorRole!) {
|
|
828
|
+
deckCollaboratorUpsert(deckId: $deckId, accountId: $accountId, role: $role) {
|
|
829
|
+
#{deck_collaborator_fields}
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
GRAPHQL
|
|
833
|
+
end
|
|
834
|
+
|
|
835
|
+
# Builds a deckCollaboratorRemove mutation
|
|
836
|
+
def remove_deck_collaborator
|
|
837
|
+
<<~GRAPHQL
|
|
838
|
+
mutation DeckCollaboratorRemove($deckId: UUID!, $accountId: UUID!) {
|
|
839
|
+
deckCollaboratorRemove(deckId: $deckId, accountId: $accountId)
|
|
840
|
+
}
|
|
841
|
+
GRAPHQL
|
|
842
|
+
end
|
|
843
|
+
|
|
844
|
+
# Builds a deckPreviewTokenCreate mutation
|
|
845
|
+
def create_deck_preview_token
|
|
846
|
+
<<~GRAPHQL
|
|
847
|
+
mutation DeckPreviewTokenCreate($input: DeckPreviewTokenCreateInput!) {
|
|
848
|
+
deckPreviewTokenCreate(input: $input) {
|
|
849
|
+
token
|
|
850
|
+
previewToken {
|
|
851
|
+
#{deck_preview_token_fields}
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
GRAPHQL
|
|
856
|
+
end
|
|
857
|
+
|
|
858
|
+
# Builds a deckPreviewTokenRevoke mutation
|
|
859
|
+
def revoke_deck_preview_token
|
|
860
|
+
<<~GRAPHQL
|
|
861
|
+
mutation DeckPreviewTokenRevoke($id: UUID!) {
|
|
862
|
+
deckPreviewTokenRevoke(id: $id)
|
|
863
|
+
}
|
|
864
|
+
GRAPHQL
|
|
865
|
+
end
|
|
866
|
+
|
|
867
|
+
def create_deck_embed_token
|
|
868
|
+
<<~GRAPHQL
|
|
869
|
+
mutation DeckEmbedTokenCreate($input: DeckEmbedTokenCreateInput!) {
|
|
870
|
+
deckEmbedTokenCreate(input: $input) {
|
|
871
|
+
token
|
|
872
|
+
embedToken {
|
|
873
|
+
#{deck_embed_token_fields}
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
GRAPHQL
|
|
878
|
+
end
|
|
879
|
+
|
|
880
|
+
def revoke_deck_embed_token
|
|
881
|
+
<<~GRAPHQL
|
|
882
|
+
mutation DeckEmbedTokenRevoke($id: UUID!) {
|
|
883
|
+
deckEmbedTokenRevoke(id: $id)
|
|
884
|
+
}
|
|
885
|
+
GRAPHQL
|
|
886
|
+
end
|
|
887
|
+
|
|
888
|
+
def create_deck_access_token_issuer
|
|
889
|
+
<<~GRAPHQL
|
|
890
|
+
mutation DeckAccessTokenIssuerCreate($input: DeckAccessTokenIssuerCreateInput!) {
|
|
891
|
+
deckAccessTokenIssuerCreate(input: $input) {
|
|
892
|
+
#{deck_access_token_issuer_fields}
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
GRAPHQL
|
|
896
|
+
end
|
|
897
|
+
|
|
898
|
+
def revoke_deck_access_token_issuer
|
|
899
|
+
<<~GRAPHQL
|
|
900
|
+
mutation DeckAccessTokenIssuerRevoke($id: UUID!) {
|
|
901
|
+
deckAccessTokenIssuerRevoke(id: $id)
|
|
902
|
+
}
|
|
903
|
+
GRAPHQL
|
|
904
|
+
end
|
|
905
|
+
|
|
906
|
+
def revoke_deck_access_token_issuer_signing_key
|
|
907
|
+
<<~GRAPHQL
|
|
908
|
+
mutation DeckAccessTokenIssuerSigningKeyRevoke($id: UUID!) {
|
|
909
|
+
deckAccessTokenIssuerSigningKeyRevoke(id: $id) {
|
|
910
|
+
#{deck_access_token_issuer_fields}
|
|
911
|
+
}
|
|
912
|
+
}
|
|
913
|
+
GRAPHQL
|
|
914
|
+
end
|
|
915
|
+
|
|
916
|
+
def exchange_deck_access_token
|
|
917
|
+
<<~GRAPHQL
|
|
918
|
+
mutation DeckAccessTokenExchange($input: DeckAccessTokenExchangeInput!) {
|
|
919
|
+
deckAccessTokenExchange(input: $input) {
|
|
920
|
+
token
|
|
921
|
+
accessToken {
|
|
922
|
+
#{deck_access_token_fields}
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
GRAPHQL
|
|
927
|
+
end
|
|
928
|
+
|
|
929
|
+
def revoke_deck_access_token
|
|
930
|
+
<<~GRAPHQL
|
|
931
|
+
mutation DeckAccessTokenRevoke($id: UUID!) {
|
|
932
|
+
deckAccessTokenRevoke(id: $id)
|
|
933
|
+
}
|
|
934
|
+
GRAPHQL
|
|
935
|
+
end
|
|
936
|
+
|
|
937
|
+
def grant_deck_api_application_access
|
|
938
|
+
<<~GRAPHQL
|
|
939
|
+
mutation DeckApiApplicationAccessGrant($input: DeckAPIApplicationAccessGrantInput!) {
|
|
940
|
+
deckApiApplicationAccessGrant(input: $input) {
|
|
941
|
+
#{deck_api_application_access_fields}
|
|
942
|
+
}
|
|
943
|
+
}
|
|
944
|
+
GRAPHQL
|
|
945
|
+
end
|
|
946
|
+
|
|
947
|
+
def revoke_deck_api_application_access
|
|
948
|
+
<<~GRAPHQL
|
|
949
|
+
mutation DeckApiApplicationAccessRevoke($deckId: UUID!, $apiApplicationId: UUID!) {
|
|
950
|
+
deckApiApplicationAccessRevoke(deckId: $deckId, apiApplicationId: $apiApplicationId)
|
|
951
|
+
}
|
|
952
|
+
GRAPHQL
|
|
953
|
+
end
|
|
954
|
+
|
|
955
|
+
# Builds a deckDelete mutation
|
|
956
|
+
def delete_deck
|
|
957
|
+
<<~GRAPHQL
|
|
958
|
+
mutation DeckDelete($id: UUID!) {
|
|
959
|
+
deckDelete(id: $id)
|
|
960
|
+
}
|
|
961
|
+
GRAPHQL
|
|
962
|
+
end
|
|
963
|
+
|
|
964
|
+
# Builds a fetchMe query
|
|
965
|
+
def fetch_me
|
|
966
|
+
<<~GRAPHQL
|
|
967
|
+
query FetchMe {
|
|
968
|
+
fetchMe {
|
|
969
|
+
application {
|
|
970
|
+
id
|
|
971
|
+
name
|
|
972
|
+
description
|
|
973
|
+
environment
|
|
974
|
+
apiKeyPrefix
|
|
975
|
+
allowedOrigins
|
|
976
|
+
allowedIps
|
|
977
|
+
createdAt
|
|
978
|
+
updatedAt
|
|
979
|
+
lastUsedAt
|
|
980
|
+
}
|
|
981
|
+
account {
|
|
982
|
+
id
|
|
983
|
+
displayName
|
|
984
|
+
createdAt
|
|
985
|
+
}
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
GRAPHQL
|
|
989
|
+
end
|
|
990
|
+
|
|
991
|
+
private
|
|
992
|
+
|
|
993
|
+
def build_args(params, required: [], type_overrides: {})
|
|
994
|
+
# Filter out nil values
|
|
995
|
+
params = params.compact
|
|
996
|
+
|
|
997
|
+
return { definition: '', call: '' } if params.empty?
|
|
998
|
+
|
|
999
|
+
# Map Ruby types to GraphQL types (base types, without !)
|
|
1000
|
+
type_map = {
|
|
1001
|
+
publisherSlug: 'String',
|
|
1002
|
+
gameKey: 'String',
|
|
1003
|
+
datasetKey: 'String',
|
|
1004
|
+
search: 'String',
|
|
1005
|
+
orderBy: 'String',
|
|
1006
|
+
filter: 'JSON',
|
|
1007
|
+
resolveLinks: '[String!]',
|
|
1008
|
+
first: 'Int',
|
|
1009
|
+
after: 'String',
|
|
1010
|
+
includeArchived: 'Boolean',
|
|
1011
|
+
externalRef: 'String',
|
|
1012
|
+
deckId: 'UUID!',
|
|
1013
|
+
gameId: 'UUID',
|
|
1014
|
+
rulesetKey: 'String',
|
|
1015
|
+
rulesetVersionId: 'UUID',
|
|
1016
|
+
validateSchema: 'Boolean',
|
|
1017
|
+
purpose: 'DatasetPurpose',
|
|
1018
|
+
id: 'UUID!',
|
|
1019
|
+
ids: '[UUID!]!'
|
|
1020
|
+
}
|
|
1021
|
+
|
|
1022
|
+
definitions = params.keys.map do |k|
|
|
1023
|
+
base_type = type_overrides[k] || type_map[k] || 'String'
|
|
1024
|
+
# Add ! for required fields (unless already has !)
|
|
1025
|
+
type = required.include?(k) && !base_type.end_with?('!') ? "#{base_type}!" : base_type
|
|
1026
|
+
"$#{k}: #{type}"
|
|
1027
|
+
end
|
|
1028
|
+
calls = params.keys.map { |k| "#{k}: $#{k}" }
|
|
1029
|
+
|
|
1030
|
+
{
|
|
1031
|
+
definition: "(#{definitions.join(', ')})",
|
|
1032
|
+
call: "(#{calls.join(', ')})"
|
|
1033
|
+
}
|
|
1034
|
+
end
|
|
1035
|
+
|
|
1036
|
+
def publisher_fields
|
|
1037
|
+
<<~FIELDS
|
|
518
1038
|
id
|
|
519
1039
|
name
|
|
520
1040
|
slug
|
|
@@ -607,6 +1127,7 @@ module CardDB
|
|
|
607
1127
|
name
|
|
608
1128
|
description
|
|
609
1129
|
purpose
|
|
1130
|
+
tcgplayerProductIdFieldKey
|
|
610
1131
|
visibility
|
|
611
1132
|
isArchived
|
|
612
1133
|
createdAt
|
|
@@ -687,11 +1208,14 @@ module CardDB
|
|
|
687
1208
|
FIELDS
|
|
688
1209
|
end
|
|
689
1210
|
|
|
690
|
-
def record_fields
|
|
1211
|
+
def record_fields(include_pricing: false)
|
|
1212
|
+
pricing_fields = include_pricing ? tcgplayer_pricing_fields : ''
|
|
1213
|
+
|
|
691
1214
|
<<~FIELDS
|
|
692
1215
|
id
|
|
693
1216
|
datasetId
|
|
694
1217
|
data
|
|
1218
|
+
#{pricing_fields}
|
|
695
1219
|
createdAt
|
|
696
1220
|
updatedAt
|
|
697
1221
|
dataset {
|
|
@@ -704,7 +1228,23 @@ module CardDB
|
|
|
704
1228
|
FIELDS
|
|
705
1229
|
end
|
|
706
1230
|
|
|
707
|
-
def
|
|
1231
|
+
def tcgplayer_pricing_fields
|
|
1232
|
+
<<~FIELDS
|
|
1233
|
+
pricing {
|
|
1234
|
+
productId
|
|
1235
|
+
prices {
|
|
1236
|
+
subTypeName
|
|
1237
|
+
lowPrice
|
|
1238
|
+
midPrice
|
|
1239
|
+
highPrice
|
|
1240
|
+
marketPrice
|
|
1241
|
+
directLowPrice
|
|
1242
|
+
}
|
|
1243
|
+
}
|
|
1244
|
+
FIELDS
|
|
1245
|
+
end
|
|
1246
|
+
|
|
1247
|
+
def record_connection_fields(include_resolved_links: false, include_pricing: false)
|
|
708
1248
|
resolved_links_field = if include_resolved_links
|
|
709
1249
|
<<~FIELDS
|
|
710
1250
|
resolvedLinks {
|
|
@@ -733,16 +1273,116 @@ module CardDB
|
|
|
733
1273
|
edges {
|
|
734
1274
|
cursor
|
|
735
1275
|
node {
|
|
736
|
-
#{record_fields}
|
|
1276
|
+
#{record_fields(include_pricing: include_pricing)}
|
|
737
1277
|
#{resolved_links_field}
|
|
738
1278
|
}
|
|
739
1279
|
}
|
|
740
1280
|
FIELDS
|
|
741
1281
|
end
|
|
742
1282
|
|
|
1283
|
+
def deck_section_definition_fields
|
|
1284
|
+
<<~FIELDS
|
|
1285
|
+
key
|
|
1286
|
+
label
|
|
1287
|
+
description
|
|
1288
|
+
order
|
|
1289
|
+
default
|
|
1290
|
+
aliases
|
|
1291
|
+
minCards
|
|
1292
|
+
maxCards
|
|
1293
|
+
excludedFromDeckSize
|
|
1294
|
+
legalCardTypes
|
|
1295
|
+
metadata
|
|
1296
|
+
FIELDS
|
|
1297
|
+
end
|
|
1298
|
+
|
|
1299
|
+
def deck_entry_fields
|
|
1300
|
+
<<~FIELDS
|
|
1301
|
+
id
|
|
1302
|
+
datasetId
|
|
1303
|
+
recordId
|
|
1304
|
+
identifier
|
|
1305
|
+
quantity
|
|
1306
|
+
section
|
|
1307
|
+
sortOrder
|
|
1308
|
+
annotations
|
|
1309
|
+
display
|
|
1310
|
+
record {
|
|
1311
|
+
#{record_fields}
|
|
1312
|
+
}
|
|
1313
|
+
FIELDS
|
|
1314
|
+
end
|
|
1315
|
+
|
|
1316
|
+
def deck_validated_against_fields
|
|
1317
|
+
<<~FIELDS
|
|
1318
|
+
rulesetId
|
|
1319
|
+
rulesetVersionId
|
|
1320
|
+
rulesetVersionLabel
|
|
1321
|
+
cardDatasetId
|
|
1322
|
+
cardDatasetVersionId
|
|
1323
|
+
validatedAt
|
|
1324
|
+
validationResultSummary
|
|
1325
|
+
FIELDS
|
|
1326
|
+
end
|
|
1327
|
+
|
|
1328
|
+
def deck_validation_issue_fields
|
|
1329
|
+
<<~FIELDS
|
|
1330
|
+
code
|
|
1331
|
+
severity
|
|
1332
|
+
message
|
|
1333
|
+
entryIds
|
|
1334
|
+
section
|
|
1335
|
+
datasetId
|
|
1336
|
+
identifier
|
|
1337
|
+
metadata
|
|
1338
|
+
FIELDS
|
|
1339
|
+
end
|
|
1340
|
+
|
|
1341
|
+
def deck_validation_fields
|
|
1342
|
+
<<~FIELDS
|
|
1343
|
+
deckId
|
|
1344
|
+
valid
|
|
1345
|
+
blockers {
|
|
1346
|
+
#{deck_validation_issue_fields}
|
|
1347
|
+
}
|
|
1348
|
+
warnings {
|
|
1349
|
+
#{deck_validation_issue_fields}
|
|
1350
|
+
}
|
|
1351
|
+
affectedEntries {
|
|
1352
|
+
entryId
|
|
1353
|
+
datasetId
|
|
1354
|
+
recordId
|
|
1355
|
+
identifier
|
|
1356
|
+
section
|
|
1357
|
+
quantity
|
|
1358
|
+
}
|
|
1359
|
+
validatedAgainst {
|
|
1360
|
+
#{deck_validated_against_fields}
|
|
1361
|
+
}
|
|
1362
|
+
checkedAt
|
|
1363
|
+
FIELDS
|
|
1364
|
+
end
|
|
1365
|
+
|
|
1366
|
+
def deck_diff_fields
|
|
1367
|
+
<<~FIELDS
|
|
1368
|
+
deckId
|
|
1369
|
+
fromVersionId
|
|
1370
|
+
toVersionId
|
|
1371
|
+
toDraftRevision
|
|
1372
|
+
hasChanges
|
|
1373
|
+
diff
|
|
1374
|
+
FIELDS
|
|
1375
|
+
end
|
|
1376
|
+
|
|
743
1377
|
def deck_fields
|
|
744
1378
|
<<~FIELDS
|
|
745
1379
|
id
|
|
1380
|
+
ownerType
|
|
1381
|
+
ownerAccountId
|
|
1382
|
+
ownerApiApplicationId
|
|
1383
|
+
environment
|
|
1384
|
+
createdByAccountId
|
|
1385
|
+
createdByApiApplicationId
|
|
746
1386
|
accountId
|
|
747
1387
|
apiApplicationId
|
|
748
1388
|
gameId
|
|
@@ -752,13 +1392,29 @@ module CardDB
|
|
|
752
1392
|
description
|
|
753
1393
|
formatKey
|
|
754
1394
|
visibility
|
|
1395
|
+
accessMode
|
|
1396
|
+
discoverability
|
|
1397
|
+
state
|
|
1398
|
+
archivedAt
|
|
1399
|
+
deletedAt
|
|
1400
|
+
unpublishedAt
|
|
1401
|
+
externalRefApiApplicationId
|
|
755
1402
|
externalRef
|
|
1403
|
+
externalSubjectRef
|
|
1404
|
+
rulesetId
|
|
756
1405
|
sourceUrl
|
|
757
1406
|
metadata
|
|
1407
|
+
sectionDefinitions {
|
|
1408
|
+
#{deck_section_definition_fields}
|
|
1409
|
+
}
|
|
758
1410
|
latestPublishedVersion {
|
|
759
1411
|
#{deck_version_fields}
|
|
760
1412
|
}
|
|
761
1413
|
publishedAt
|
|
1414
|
+
draftRevision
|
|
1415
|
+
draftUpdatedAt
|
|
1416
|
+
draftUpdatedByAccountId
|
|
1417
|
+
draftUpdatedByApiApplicationId
|
|
762
1418
|
hasUnpublishedChanges
|
|
763
1419
|
createdAt
|
|
764
1420
|
updatedAt
|
|
@@ -766,18 +1422,58 @@ module CardDB
|
|
|
766
1422
|
#{game_fields}
|
|
767
1423
|
}
|
|
768
1424
|
entries {
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
1425
|
+
#{deck_entry_fields}
|
|
1426
|
+
}
|
|
1427
|
+
FIELDS
|
|
1428
|
+
end
|
|
1429
|
+
|
|
1430
|
+
def deck_ownership_transfer_payload_fields
|
|
1431
|
+
<<~FIELDS
|
|
1432
|
+
deck {
|
|
1433
|
+
#{deck_fields}
|
|
1434
|
+
}
|
|
1435
|
+
retainedAppAccess
|
|
1436
|
+
FIELDS
|
|
1437
|
+
end
|
|
1438
|
+
|
|
1439
|
+
def deck_copy_payload_fields
|
|
1440
|
+
<<~FIELDS
|
|
1441
|
+
deck {
|
|
1442
|
+
#{deck_fields}
|
|
780
1443
|
}
|
|
1444
|
+
copiedFromDeckId
|
|
1445
|
+
retainedAppAccess
|
|
1446
|
+
FIELDS
|
|
1447
|
+
end
|
|
1448
|
+
|
|
1449
|
+
def deck_access_application_fields
|
|
1450
|
+
<<~FIELDS
|
|
1451
|
+
id
|
|
1452
|
+
name
|
|
1453
|
+
description
|
|
1454
|
+
revokedAt
|
|
1455
|
+
FIELDS
|
|
1456
|
+
end
|
|
1457
|
+
|
|
1458
|
+
def deck_api_application_access_fields
|
|
1459
|
+
<<~FIELDS
|
|
1460
|
+
id
|
|
1461
|
+
deckId
|
|
1462
|
+
deck {
|
|
1463
|
+
#{deck_fields}
|
|
1464
|
+
}
|
|
1465
|
+
apiApplicationId
|
|
1466
|
+
apiApplication {
|
|
1467
|
+
#{deck_access_application_fields}
|
|
1468
|
+
}
|
|
1469
|
+
role
|
|
1470
|
+
grantSource
|
|
1471
|
+
externalRef
|
|
1472
|
+
createdByAccountId
|
|
1473
|
+
createdByApiApplicationId
|
|
1474
|
+
revokedAt
|
|
1475
|
+
createdAt
|
|
1476
|
+
updatedAt
|
|
781
1477
|
FIELDS
|
|
782
1478
|
end
|
|
783
1479
|
|
|
@@ -795,23 +1491,67 @@ module CardDB
|
|
|
795
1491
|
externalRef
|
|
796
1492
|
sourceUrl
|
|
797
1493
|
metadata
|
|
1494
|
+
entries {
|
|
1495
|
+
#{deck_entry_fields}
|
|
1496
|
+
}
|
|
798
1497
|
publishNote
|
|
799
1498
|
computedDiff
|
|
1499
|
+
rulesetId
|
|
1500
|
+
rulesetVersionId
|
|
1501
|
+
cardDatasetId
|
|
1502
|
+
cardDatasetVersionId
|
|
1503
|
+
validatedAt
|
|
1504
|
+
validationSummary
|
|
1505
|
+
validatedAgainst {
|
|
1506
|
+
#{deck_validated_against_fields}
|
|
1507
|
+
}
|
|
1508
|
+
sectionDefinitions {
|
|
1509
|
+
#{deck_section_definition_fields}
|
|
1510
|
+
}
|
|
800
1511
|
publishedByAccountId
|
|
801
1512
|
publishedByApiApplicationId
|
|
802
1513
|
createdAt
|
|
1514
|
+
FIELDS
|
|
1515
|
+
end
|
|
1516
|
+
|
|
1517
|
+
def deck_publish_payload_fields
|
|
1518
|
+
<<~FIELDS
|
|
1519
|
+
deck {
|
|
1520
|
+
#{deck_fields}
|
|
1521
|
+
}
|
|
1522
|
+
version {
|
|
1523
|
+
#{deck_version_fields}
|
|
1524
|
+
}
|
|
1525
|
+
validation {
|
|
1526
|
+
#{deck_validation_fields}
|
|
1527
|
+
}
|
|
1528
|
+
blockers {
|
|
1529
|
+
#{deck_validation_issue_fields}
|
|
1530
|
+
}
|
|
1531
|
+
warnings {
|
|
1532
|
+
#{deck_validation_issue_fields}
|
|
1533
|
+
}
|
|
1534
|
+
FIELDS
|
|
1535
|
+
end
|
|
1536
|
+
|
|
1537
|
+
def deck_entry_mutation_payload_fields
|
|
1538
|
+
<<~FIELDS
|
|
1539
|
+
deck {
|
|
1540
|
+
#{deck_fields}
|
|
1541
|
+
}
|
|
1542
|
+
entry {
|
|
1543
|
+
#{deck_entry_fields}
|
|
1544
|
+
}
|
|
1545
|
+
FIELDS
|
|
1546
|
+
end
|
|
1547
|
+
|
|
1548
|
+
def deck_entry_reorder_payload_fields
|
|
1549
|
+
<<~FIELDS
|
|
1550
|
+
deck {
|
|
1551
|
+
#{deck_fields}
|
|
1552
|
+
}
|
|
803
1553
|
entries {
|
|
804
|
-
|
|
805
|
-
datasetId
|
|
806
|
-
recordId
|
|
807
|
-
identifier
|
|
808
|
-
quantity
|
|
809
|
-
section
|
|
810
|
-
sortOrder
|
|
811
|
-
annotations
|
|
812
|
-
record {
|
|
813
|
-
#{record_fields}
|
|
814
|
-
}
|
|
1554
|
+
#{deck_entry_fields}
|
|
815
1555
|
}
|
|
816
1556
|
FIELDS
|
|
817
1557
|
end
|
|
@@ -859,6 +1599,217 @@ module CardDB
|
|
|
859
1599
|
FIELDS
|
|
860
1600
|
end
|
|
861
1601
|
|
|
1602
|
+
def deck_embed_token_fields
|
|
1603
|
+
<<~FIELDS
|
|
1604
|
+
id
|
|
1605
|
+
deckId
|
|
1606
|
+
apiApplicationId
|
|
1607
|
+
label
|
|
1608
|
+
readMode
|
|
1609
|
+
allowedOrigins
|
|
1610
|
+
externalSubject
|
|
1611
|
+
expiresAt
|
|
1612
|
+
revokedAt
|
|
1613
|
+
lastUsedAt
|
|
1614
|
+
createdAt
|
|
1615
|
+
updatedAt
|
|
1616
|
+
FIELDS
|
|
1617
|
+
end
|
|
1618
|
+
|
|
1619
|
+
def deck_access_token_issuer_fields
|
|
1620
|
+
<<~FIELDS
|
|
1621
|
+
id
|
|
1622
|
+
deckId
|
|
1623
|
+
apiApplicationId
|
|
1624
|
+
label
|
|
1625
|
+
readModes
|
|
1626
|
+
maxTokenLifetimeSeconds
|
|
1627
|
+
directSigningAlg
|
|
1628
|
+
directSigningKeyId
|
|
1629
|
+
directSigningPublicKey
|
|
1630
|
+
directSigningKeyRevokedAt
|
|
1631
|
+
revokedAt
|
|
1632
|
+
createdAt
|
|
1633
|
+
updatedAt
|
|
1634
|
+
FIELDS
|
|
1635
|
+
end
|
|
1636
|
+
|
|
1637
|
+
def deck_access_token_fields
|
|
1638
|
+
<<~FIELDS
|
|
1639
|
+
id
|
|
1640
|
+
deckId
|
|
1641
|
+
apiApplicationId
|
|
1642
|
+
issuerId
|
|
1643
|
+
readMode
|
|
1644
|
+
externalSubject
|
|
1645
|
+
expiresAt
|
|
1646
|
+
revokedAt
|
|
1647
|
+
lastUsedAt
|
|
1648
|
+
createdAt
|
|
1649
|
+
updatedAt
|
|
1650
|
+
FIELDS
|
|
1651
|
+
end
|
|
1652
|
+
|
|
1653
|
+
def deck_import_entry_fields
|
|
1654
|
+
<<~FIELDS
|
|
1655
|
+
lineNumber
|
|
1656
|
+
raw
|
|
1657
|
+
datasetKey
|
|
1658
|
+
datasetId
|
|
1659
|
+
recordId
|
|
1660
|
+
identifier
|
|
1661
|
+
quantity
|
|
1662
|
+
section
|
|
1663
|
+
sortOrder
|
|
1664
|
+
display
|
|
1665
|
+
record {
|
|
1666
|
+
#{record_fields}
|
|
1667
|
+
}
|
|
1668
|
+
FIELDS
|
|
1669
|
+
end
|
|
1670
|
+
|
|
1671
|
+
def deck_import_issue_fields
|
|
1672
|
+
<<~FIELDS
|
|
1673
|
+
lineNumber
|
|
1674
|
+
raw
|
|
1675
|
+
code
|
|
1676
|
+
message
|
|
1677
|
+
FIELDS
|
|
1678
|
+
end
|
|
1679
|
+
|
|
1680
|
+
def deck_import_unmatched_fields
|
|
1681
|
+
<<~FIELDS
|
|
1682
|
+
lineNumber
|
|
1683
|
+
raw
|
|
1684
|
+
datasetKey
|
|
1685
|
+
identifier
|
|
1686
|
+
quantity
|
|
1687
|
+
section
|
|
1688
|
+
code
|
|
1689
|
+
message
|
|
1690
|
+
FIELDS
|
|
1691
|
+
end
|
|
1692
|
+
|
|
1693
|
+
def deck_import_ambiguous_fields
|
|
1694
|
+
<<~FIELDS
|
|
1695
|
+
lineNumber
|
|
1696
|
+
raw
|
|
1697
|
+
datasetKey
|
|
1698
|
+
identifier
|
|
1699
|
+
quantity
|
|
1700
|
+
section
|
|
1701
|
+
candidates {
|
|
1702
|
+
recordId
|
|
1703
|
+
identifier
|
|
1704
|
+
display
|
|
1705
|
+
}
|
|
1706
|
+
FIELDS
|
|
1707
|
+
end
|
|
1708
|
+
|
|
1709
|
+
def deck_import_format_definition_fields
|
|
1710
|
+
<<~FIELDS
|
|
1711
|
+
id
|
|
1712
|
+
gameId
|
|
1713
|
+
key
|
|
1714
|
+
name
|
|
1715
|
+
description
|
|
1716
|
+
enabled
|
|
1717
|
+
priority
|
|
1718
|
+
datasetKey
|
|
1719
|
+
config
|
|
1720
|
+
archivedAt
|
|
1721
|
+
isArchived
|
|
1722
|
+
createdAt
|
|
1723
|
+
updatedAt
|
|
1724
|
+
FIELDS
|
|
1725
|
+
end
|
|
1726
|
+
|
|
1727
|
+
def deck_import_format_detection_fields
|
|
1728
|
+
<<~FIELDS
|
|
1729
|
+
formatId
|
|
1730
|
+
key
|
|
1731
|
+
name
|
|
1732
|
+
confidence
|
|
1733
|
+
reason
|
|
1734
|
+
FIELDS
|
|
1735
|
+
end
|
|
1736
|
+
|
|
1737
|
+
def deck_import_format_test_payload_fields
|
|
1738
|
+
<<~FIELDS
|
|
1739
|
+
detection {
|
|
1740
|
+
#{deck_import_format_detection_fields}
|
|
1741
|
+
}
|
|
1742
|
+
entries {
|
|
1743
|
+
#{deck_import_entry_fields}
|
|
1744
|
+
}
|
|
1745
|
+
parseErrors {
|
|
1746
|
+
#{deck_import_issue_fields}
|
|
1747
|
+
}
|
|
1748
|
+
unmatched {
|
|
1749
|
+
#{deck_import_unmatched_fields}
|
|
1750
|
+
}
|
|
1751
|
+
ambiguous {
|
|
1752
|
+
#{deck_import_ambiguous_fields}
|
|
1753
|
+
}
|
|
1754
|
+
FIELDS
|
|
1755
|
+
end
|
|
1756
|
+
|
|
1757
|
+
def deck_hydrate_entries_payload_fields
|
|
1758
|
+
<<~FIELDS
|
|
1759
|
+
entries {
|
|
1760
|
+
#{deck_import_entry_fields}
|
|
1761
|
+
}
|
|
1762
|
+
unmatched {
|
|
1763
|
+
#{deck_import_unmatched_fields}
|
|
1764
|
+
}
|
|
1765
|
+
ambiguous {
|
|
1766
|
+
#{deck_import_ambiguous_fields}
|
|
1767
|
+
}
|
|
1768
|
+
FIELDS
|
|
1769
|
+
end
|
|
1770
|
+
|
|
1771
|
+
def deck_import_payload_fields
|
|
1772
|
+
<<~FIELDS
|
|
1773
|
+
deck {
|
|
1774
|
+
#{deck_fields}
|
|
1775
|
+
}
|
|
1776
|
+
applied
|
|
1777
|
+
dryRun
|
|
1778
|
+
replace
|
|
1779
|
+
format
|
|
1780
|
+
importFormat {
|
|
1781
|
+
#{deck_import_format_definition_fields}
|
|
1782
|
+
}
|
|
1783
|
+
detection {
|
|
1784
|
+
#{deck_import_format_detection_fields}
|
|
1785
|
+
}
|
|
1786
|
+
entries {
|
|
1787
|
+
#{deck_import_entry_fields}
|
|
1788
|
+
}
|
|
1789
|
+
parseErrors {
|
|
1790
|
+
#{deck_import_issue_fields}
|
|
1791
|
+
}
|
|
1792
|
+
unmatched {
|
|
1793
|
+
#{deck_import_unmatched_fields}
|
|
1794
|
+
}
|
|
1795
|
+
ambiguous {
|
|
1796
|
+
#{deck_import_ambiguous_fields}
|
|
1797
|
+
}
|
|
1798
|
+
validation {
|
|
1799
|
+
#{deck_validation_fields}
|
|
1800
|
+
}
|
|
1801
|
+
FIELDS
|
|
1802
|
+
end
|
|
1803
|
+
|
|
1804
|
+
def deck_export_payload_fields
|
|
1805
|
+
<<~FIELDS
|
|
1806
|
+
deckId
|
|
1807
|
+
format
|
|
1808
|
+
text
|
|
1809
|
+
entryCount
|
|
1810
|
+
FIELDS
|
|
1811
|
+
end
|
|
1812
|
+
|
|
862
1813
|
def deck_connection_fields
|
|
863
1814
|
<<~FIELDS
|
|
864
1815
|
totalCount
|
|
@@ -876,6 +1827,24 @@ module CardDB
|
|
|
876
1827
|
}
|
|
877
1828
|
FIELDS
|
|
878
1829
|
end
|
|
1830
|
+
|
|
1831
|
+
def deck_import_format_definition_connection_fields
|
|
1832
|
+
<<~FIELDS
|
|
1833
|
+
totalCount
|
|
1834
|
+
pageInfo {
|
|
1835
|
+
hasNextPage
|
|
1836
|
+
hasPreviousPage
|
|
1837
|
+
startCursor
|
|
1838
|
+
endCursor
|
|
1839
|
+
}
|
|
1840
|
+
edges {
|
|
1841
|
+
cursor
|
|
1842
|
+
node {
|
|
1843
|
+
#{deck_import_format_definition_fields}
|
|
1844
|
+
}
|
|
1845
|
+
}
|
|
1846
|
+
FIELDS
|
|
1847
|
+
end
|
|
879
1848
|
end
|
|
880
1849
|
# rubocop:enable Metrics/ClassLength
|
|
881
1850
|
end
|