@carddb/core 0.1.5 → 0.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.
package/dist/index.js CHANGED
@@ -386,6 +386,82 @@ function recordFields(options = {}) {
386
386
  `;
387
387
  }
388
388
  var RECORD_FIELDS = recordFields();
389
+ var DECK_SECTION_DEFINITION_FIELDS = `
390
+ key
391
+ label
392
+ description
393
+ order
394
+ default
395
+ aliases
396
+ minCards
397
+ maxCards
398
+ excludedFromDeckSize
399
+ legalCardTypes
400
+ metadata
401
+ `;
402
+ var DECK_ENTRY_FIELDS = `
403
+ id
404
+ datasetId
405
+ recordId
406
+ identifier
407
+ quantity
408
+ section
409
+ sortOrder
410
+ annotations
411
+ display
412
+ record {
413
+ ${RECORD_FIELDS}
414
+ }
415
+ `;
416
+ var DECK_VALIDATED_AGAINST_FIELDS = `
417
+ rulesetId
418
+ rulesetVersionId
419
+ rulesetVersionLabel
420
+ cardDatasetId
421
+ cardDatasetVersionId
422
+ validatedAt
423
+ validationResultSummary
424
+ `;
425
+ var DECK_VALIDATION_ISSUE_FIELDS = `
426
+ code
427
+ severity
428
+ message
429
+ entryIds
430
+ section
431
+ datasetId
432
+ identifier
433
+ metadata
434
+ `;
435
+ var DECK_VALIDATION_FIELDS = `
436
+ deckId
437
+ valid
438
+ blockers {
439
+ ${DECK_VALIDATION_ISSUE_FIELDS}
440
+ }
441
+ warnings {
442
+ ${DECK_VALIDATION_ISSUE_FIELDS}
443
+ }
444
+ affectedEntries {
445
+ entryId
446
+ datasetId
447
+ recordId
448
+ identifier
449
+ section
450
+ quantity
451
+ }
452
+ validatedAgainst {
453
+ ${DECK_VALIDATED_AGAINST_FIELDS}
454
+ }
455
+ checkedAt
456
+ `;
457
+ var DECK_DIFF_FIELDS = `
458
+ deckId
459
+ fromVersionId
460
+ toVersionId
461
+ toDraftRevision
462
+ hasChanges
463
+ diff
464
+ `;
389
465
  var DECK_VERSION_FIELDS = `
390
466
  id
391
467
  deckId
@@ -401,21 +477,23 @@ var DECK_VERSION_FIELDS = `
401
477
  metadata
402
478
  publishNote
403
479
  computedDiff
480
+ rulesetId
481
+ rulesetVersionId
482
+ cardDatasetId
483
+ cardDatasetVersionId
484
+ validatedAt
485
+ validationSummary
486
+ validatedAgainst {
487
+ ${DECK_VALIDATED_AGAINST_FIELDS}
488
+ }
489
+ sectionDefinitions {
490
+ ${DECK_SECTION_DEFINITION_FIELDS}
491
+ }
404
492
  publishedByAccountId
405
493
  publishedByApiApplicationId
406
494
  createdAt
407
495
  entries {
408
- id
409
- datasetId
410
- recordId
411
- identifier
412
- quantity
413
- section
414
- sortOrder
415
- annotations
416
- record {
417
- ${RECORD_FIELDS}
418
- }
496
+ ${DECK_ENTRY_FIELDS}
419
497
  }
420
498
  `;
421
499
  var DECK_COLLABORATOR_FIELDS = `
@@ -437,8 +515,156 @@ var DECK_PREVIEW_TOKEN_FIELDS = `
437
515
  createdAt
438
516
  updatedAt
439
517
  `;
518
+ var DECK_EMBED_TOKEN_FIELDS = `
519
+ id
520
+ deckId
521
+ apiApplicationId
522
+ label
523
+ readMode
524
+ allowedOrigins
525
+ externalSubject
526
+ expiresAt
527
+ revokedAt
528
+ lastUsedAt
529
+ createdAt
530
+ updatedAt
531
+ `;
532
+ var DECK_ACCESS_TOKEN_ISSUER_FIELDS = `
533
+ id
534
+ deckId
535
+ apiApplicationId
536
+ label
537
+ readModes
538
+ maxTokenLifetimeSeconds
539
+ directSigningAlg
540
+ directSigningKeyId
541
+ directSigningPublicKey
542
+ directSigningKeyRevokedAt
543
+ revokedAt
544
+ createdAt
545
+ updatedAt
546
+ `;
547
+ var DECK_ACCESS_TOKEN_FIELDS = `
548
+ id
549
+ deckId
550
+ apiApplicationId
551
+ issuerId
552
+ readMode
553
+ externalSubject
554
+ expiresAt
555
+ revokedAt
556
+ lastUsedAt
557
+ createdAt
558
+ updatedAt
559
+ `;
560
+ var DECK_IMPORT_ENTRY_FIELDS = `
561
+ lineNumber
562
+ raw
563
+ datasetKey
564
+ datasetId
565
+ recordId
566
+ identifier
567
+ quantity
568
+ section
569
+ sortOrder
570
+ display
571
+ record {
572
+ ${RECORD_FIELDS}
573
+ }
574
+ `;
575
+ var DECK_IMPORT_ISSUE_FIELDS = `
576
+ lineNumber
577
+ raw
578
+ code
579
+ message
580
+ `;
581
+ var DECK_IMPORT_UNMATCHED_FIELDS = `
582
+ lineNumber
583
+ raw
584
+ datasetKey
585
+ identifier
586
+ quantity
587
+ section
588
+ code
589
+ message
590
+ `;
591
+ var DECK_IMPORT_AMBIGUOUS_FIELDS = `
592
+ lineNumber
593
+ raw
594
+ datasetKey
595
+ identifier
596
+ quantity
597
+ section
598
+ candidates {
599
+ recordId
600
+ identifier
601
+ display
602
+ }
603
+ `;
604
+ var DECK_IMPORT_FORMAT_DEFINITION_FIELDS = `
605
+ id
606
+ gameId
607
+ key
608
+ name
609
+ description
610
+ enabled
611
+ priority
612
+ datasetKey
613
+ config
614
+ archivedAt
615
+ isArchived
616
+ createdAt
617
+ updatedAt
618
+ `;
619
+ var DECK_IMPORT_FORMAT_DETECTION_FIELDS = `
620
+ formatId
621
+ key
622
+ name
623
+ confidence
624
+ reason
625
+ `;
626
+ var DECK_IMPORT_FORMAT_TEST_PAYLOAD_FIELDS = `
627
+ detection {
628
+ ${DECK_IMPORT_FORMAT_DETECTION_FIELDS}
629
+ }
630
+ entries {
631
+ ${DECK_IMPORT_ENTRY_FIELDS}
632
+ }
633
+ parseErrors {
634
+ ${DECK_IMPORT_ISSUE_FIELDS}
635
+ }
636
+ unmatched {
637
+ ${DECK_IMPORT_UNMATCHED_FIELDS}
638
+ }
639
+ ambiguous {
640
+ ${DECK_IMPORT_AMBIGUOUS_FIELDS}
641
+ }
642
+ `;
643
+ var DECK_HYDRATE_ENTRIES_PAYLOAD_FIELDS = `
644
+ entries {
645
+ ${DECK_IMPORT_ENTRY_FIELDS}
646
+ }
647
+ unmatched {
648
+ ${DECK_IMPORT_UNMATCHED_FIELDS}
649
+ }
650
+ ambiguous {
651
+ ${DECK_IMPORT_AMBIGUOUS_FIELDS}
652
+ }
653
+ `;
654
+ var DECK_EXPORT_PAYLOAD_FIELDS = `
655
+ deckId
656
+ format
657
+ text
658
+ entryCount
659
+ `;
440
660
  var DECK_FIELDS = `
441
661
  id
662
+ ownerType
663
+ ownerAccountId
664
+ ownerApiApplicationId
665
+ environment
666
+ createdByAccountId
667
+ createdByApiApplicationId
442
668
  accountId
443
669
  apiApplicationId
444
670
  gameId
@@ -448,13 +674,29 @@ var DECK_FIELDS = `
448
674
  description
449
675
  formatKey
450
676
  visibility
677
+ accessMode
678
+ discoverability
679
+ state
680
+ archivedAt
681
+ deletedAt
682
+ unpublishedAt
683
+ externalRefApiApplicationId
451
684
  externalRef
685
+ externalSubjectRef
686
+ rulesetId
452
687
  sourceUrl
453
688
  metadata
689
+ sectionDefinitions {
690
+ ${DECK_SECTION_DEFINITION_FIELDS}
691
+ }
454
692
  latestPublishedVersion {
455
693
  ${DECK_VERSION_FIELDS}
456
694
  }
457
695
  publishedAt
696
+ draftRevision
697
+ draftUpdatedAt
698
+ draftUpdatedByAccountId
699
+ draftUpdatedByApiApplicationId
458
700
  hasUnpublishedChanges
459
701
  createdAt
460
702
  updatedAt
@@ -462,17 +704,109 @@ var DECK_FIELDS = `
462
704
  ${GAME_FIELDS}
463
705
  }
464
706
  entries {
465
- id
466
- datasetId
467
- recordId
468
- identifier
469
- quantity
470
- section
471
- sortOrder
472
- annotations
473
- record {
474
- ${RECORD_FIELDS}
475
- }
707
+ ${DECK_ENTRY_FIELDS}
708
+ }
709
+ `;
710
+ var DECK_OWNERSHIP_TRANSFER_PAYLOAD_FIELDS = `
711
+ deck {
712
+ ${DECK_FIELDS}
713
+ }
714
+ retainedAppAccess
715
+ `;
716
+ var DECK_COPY_PAYLOAD_FIELDS = `
717
+ deck {
718
+ ${DECK_FIELDS}
719
+ }
720
+ copiedFromDeckId
721
+ retainedAppAccess
722
+ `;
723
+ var DECK_ACCESS_APPLICATION_FIELDS = `
724
+ id
725
+ name
726
+ description
727
+ revokedAt
728
+ `;
729
+ var DECK_API_APPLICATION_ACCESS_FIELDS = `
730
+ id
731
+ deckId
732
+ deck {
733
+ ${DECK_FIELDS}
734
+ }
735
+ apiApplicationId
736
+ apiApplication {
737
+ ${DECK_ACCESS_APPLICATION_FIELDS}
738
+ }
739
+ role
740
+ grantSource
741
+ externalRef
742
+ createdByAccountId
743
+ createdByApiApplicationId
744
+ revokedAt
745
+ createdAt
746
+ updatedAt
747
+ `;
748
+ var DECK_PUBLISH_PAYLOAD_FIELDS = `
749
+ deck {
750
+ ${DECK_FIELDS}
751
+ }
752
+ version {
753
+ ${DECK_VERSION_FIELDS}
754
+ }
755
+ validation {
756
+ ${DECK_VALIDATION_FIELDS}
757
+ }
758
+ blockers {
759
+ ${DECK_VALIDATION_ISSUE_FIELDS}
760
+ }
761
+ warnings {
762
+ ${DECK_VALIDATION_ISSUE_FIELDS}
763
+ }
764
+ `;
765
+ var DECK_ENTRY_MUTATION_PAYLOAD_FIELDS = `
766
+ deck {
767
+ ${DECK_FIELDS}
768
+ }
769
+ entry {
770
+ ${DECK_ENTRY_FIELDS}
771
+ }
772
+ `;
773
+ var DECK_ENTRY_REORDER_PAYLOAD_FIELDS = `
774
+ deck {
775
+ ${DECK_FIELDS}
776
+ }
777
+ entries {
778
+ ${DECK_ENTRY_FIELDS}
779
+ }
780
+ `;
781
+ var DECK_ENTRIES_REPLACE_PAYLOAD_FIELDS = DECK_ENTRY_REORDER_PAYLOAD_FIELDS;
782
+ var DECK_IMPORT_PAYLOAD_FIELDS = `
783
+ deck {
784
+ ${DECK_FIELDS}
785
+ }
786
+ applied
787
+ dryRun
788
+ replace
789
+ format
790
+ importFormat {
791
+ ${DECK_IMPORT_FORMAT_DEFINITION_FIELDS}
792
+ }
793
+ detection {
794
+ ${DECK_IMPORT_FORMAT_DETECTION_FIELDS}
795
+ }
796
+ entries {
797
+ ${DECK_IMPORT_ENTRY_FIELDS}
798
+ }
799
+ parseErrors {
800
+ ${DECK_IMPORT_ISSUE_FIELDS}
801
+ }
802
+ unmatched {
803
+ ${DECK_IMPORT_UNMATCHED_FIELDS}
804
+ }
805
+ ambiguous {
806
+ ${DECK_IMPORT_AMBIGUOUS_FIELDS}
807
+ }
808
+ validation {
809
+ ${DECK_VALIDATION_FIELDS}
476
810
  }
477
811
  `;
478
812
  var RESOLVED_LINKS_FIELDS = `
@@ -847,6 +1181,11 @@ ${RESOLVED_LINKS_FIELDS}` : selectedRecordFields;
847
1181
  args.push("after: $after");
848
1182
  variables["after"] = params.after;
849
1183
  }
1184
+ if (params.includeArchived !== void 0) {
1185
+ defs.push("$includeArchived: Boolean");
1186
+ args.push("includeArchived: $includeArchived");
1187
+ variables["includeArchived"] = params.includeArchived;
1188
+ }
850
1189
  const defStr = defs.length > 0 ? `(${defs.join(", ")})` : "";
851
1190
  const argStr = args.length > 0 ? `(${args.join(", ")})` : "";
852
1191
  return {
@@ -860,6 +1199,102 @@ ${RESOLVED_LINKS_FIELDS}` : selectedRecordFields;
860
1199
  variables
861
1200
  };
862
1201
  },
1202
+ viewerDecks(params = {}) {
1203
+ const variables = {};
1204
+ const args = [];
1205
+ const defs = [];
1206
+ if (params.filter !== void 0) {
1207
+ defs.push("$filter: ViewerDecksFilterInput");
1208
+ args.push("filter: $filter");
1209
+ variables["filter"] = params.filter;
1210
+ }
1211
+ if (params.first !== void 0) {
1212
+ defs.push("$first: Int");
1213
+ args.push("first: $first");
1214
+ variables["first"] = params.first;
1215
+ }
1216
+ if (params.after !== void 0) {
1217
+ defs.push("$after: String");
1218
+ args.push("after: $after");
1219
+ variables["after"] = params.after;
1220
+ }
1221
+ const defStr = defs.length > 0 ? `(${defs.join(", ")})` : "";
1222
+ const argStr = args.length > 0 ? `(${args.join(", ")})` : "";
1223
+ return {
1224
+ query: `
1225
+ query ViewerDecks${defStr} {
1226
+ viewerDecks${argStr} {
1227
+ ${connectionFields(DECK_FIELDS)}
1228
+ }
1229
+ }
1230
+ `,
1231
+ variables
1232
+ };
1233
+ },
1234
+ appDecks(params = {}) {
1235
+ const variables = {};
1236
+ const args = [];
1237
+ const defs = [];
1238
+ if (params.filter !== void 0) {
1239
+ defs.push("$filter: AppDecksFilterInput");
1240
+ args.push("filter: $filter");
1241
+ variables["filter"] = params.filter;
1242
+ }
1243
+ if (params.first !== void 0) {
1244
+ defs.push("$first: Int");
1245
+ args.push("first: $first");
1246
+ variables["first"] = params.first;
1247
+ }
1248
+ if (params.after !== void 0) {
1249
+ defs.push("$after: String");
1250
+ args.push("after: $after");
1251
+ variables["after"] = params.after;
1252
+ }
1253
+ const defStr = defs.length > 0 ? `(${defs.join(", ")})` : "";
1254
+ const argStr = args.length > 0 ? `(${args.join(", ")})` : "";
1255
+ return {
1256
+ query: `
1257
+ query AppDecks${defStr} {
1258
+ appDecks${argStr} {
1259
+ ${connectionFields(DECK_FIELDS)}
1260
+ }
1261
+ }
1262
+ `,
1263
+ variables
1264
+ };
1265
+ },
1266
+ publicDecks(params = {}) {
1267
+ const variables = {};
1268
+ const args = [];
1269
+ const defs = [];
1270
+ if (params.filter !== void 0) {
1271
+ defs.push("$filter: PublicDecksFilterInput");
1272
+ args.push("filter: $filter");
1273
+ variables["filter"] = params.filter;
1274
+ }
1275
+ if (params.first !== void 0) {
1276
+ defs.push("$first: Int");
1277
+ args.push("first: $first");
1278
+ variables["first"] = params.first;
1279
+ }
1280
+ if (params.after !== void 0) {
1281
+ defs.push("$after: String");
1282
+ args.push("after: $after");
1283
+ variables["after"] = params.after;
1284
+ }
1285
+ const defStr = defs.length > 0 ? `(${defs.join(", ")})` : "";
1286
+ const argStr = args.length > 0 ? `(${args.join(", ")})` : "";
1287
+ return {
1288
+ query: `
1289
+ query PublicDecks${defStr} {
1290
+ publicDecks${argStr} {
1291
+ ${connectionFields(DECK_FIELDS)}
1292
+ }
1293
+ }
1294
+ `,
1295
+ variables
1296
+ };
1297
+ },
863
1298
  fetchDeckById() {
864
1299
  return {
865
1300
  query: `
@@ -871,6 +1306,17 @@ ${RESOLVED_LINKS_FIELDS}` : selectedRecordFields;
871
1306
  `
872
1307
  };
873
1308
  },
1309
+ deckById() {
1310
+ return {
1311
+ query: `
1312
+ query Deck($id: UUID!) {
1313
+ deck(id: $id) {
1314
+ ${DECK_FIELDS}
1315
+ }
1316
+ }
1317
+ `
1318
+ };
1319
+ },
874
1320
  myDeck() {
875
1321
  return {
876
1322
  query: `
@@ -893,6 +1339,17 @@ ${RESOLVED_LINKS_FIELDS}` : selectedRecordFields;
893
1339
  `
894
1340
  };
895
1341
  },
1342
+ deckBySlug() {
1343
+ return {
1344
+ query: `
1345
+ query DeckBySlug($publisherSlug: String!, $gameKey: String!, $slug: String!) {
1346
+ deckBySlug(publisherSlug: $publisherSlug, gameKey: $gameKey, slug: $slug) {
1347
+ ${DECK_FIELDS}
1348
+ }
1349
+ }
1350
+ `
1351
+ };
1352
+ },
896
1353
  fetchDeckByExternalRef() {
897
1354
  return {
898
1355
  query: `
@@ -904,10 +1361,21 @@ ${RESOLVED_LINKS_FIELDS}` : selectedRecordFields;
904
1361
  `
905
1362
  };
906
1363
  },
907
- deckVersion() {
1364
+ deckByExternalRef() {
908
1365
  return {
909
1366
  query: `
910
- query DeckVersion($id: UUID!) {
1367
+ query DeckByExternalRef($externalRef: String!) {
1368
+ deckByExternalRef(externalRef: $externalRef) {
1369
+ ${DECK_FIELDS}
1370
+ }
1371
+ }
1372
+ `
1373
+ };
1374
+ },
1375
+ deckVersion() {
1376
+ return {
1377
+ query: `
1378
+ query DeckVersion($id: UUID!) {
911
1379
  deckVersion(id: $id) {
912
1380
  ${DECK_VERSION_FIELDS}
913
1381
  }
@@ -951,6 +1419,125 @@ ${RESOLVED_LINKS_FIELDS}` : selectedRecordFields;
951
1419
  `
952
1420
  };
953
1421
  },
1422
+ deckEmbed() {
1423
+ return {
1424
+ query: `
1425
+ query DeckEmbed($token: String!) {
1426
+ deckEmbed(token: $token) {
1427
+ ${DECK_FIELDS}
1428
+ }
1429
+ }
1430
+ `
1431
+ };
1432
+ },
1433
+ deckAccess() {
1434
+ return {
1435
+ query: `
1436
+ query DeckAccess($token: String!) {
1437
+ deckAccess(token: $token) {
1438
+ ${DECK_FIELDS}
1439
+ }
1440
+ }
1441
+ `
1442
+ };
1443
+ },
1444
+ deckDraftDiff() {
1445
+ return {
1446
+ query: `
1447
+ query DeckDraftDiff($id: UUID!) {
1448
+ deckDraftDiff(id: $id) {
1449
+ ${DECK_DIFF_FIELDS}
1450
+ }
1451
+ }
1452
+ `
1453
+ };
1454
+ },
1455
+ deckVersionDiff() {
1456
+ return {
1457
+ query: `
1458
+ query DeckVersionDiff($fromVersionId: UUID!, $toVersionId: UUID!) {
1459
+ deckVersionDiff(fromVersionId: $fromVersionId, toVersionId: $toVersionId) {
1460
+ ${DECK_DIFF_FIELDS}
1461
+ }
1462
+ }
1463
+ `
1464
+ };
1465
+ },
1466
+ deckHydrateEntries() {
1467
+ return {
1468
+ query: `
1469
+ query DeckHydrateEntries($input: DeckHydrateEntriesInput!) {
1470
+ deckHydrateEntries(input: $input) {
1471
+ ${DECK_HYDRATE_ENTRIES_PAYLOAD_FIELDS}
1472
+ }
1473
+ }
1474
+ `
1475
+ };
1476
+ },
1477
+ deckExport() {
1478
+ return {
1479
+ query: `
1480
+ query DeckExport($id: UUID!, $format: DeckExportFormat!) {
1481
+ deckExport(id: $id, format: $format) {
1482
+ ${DECK_EXPORT_PAYLOAD_FIELDS}
1483
+ }
1484
+ }
1485
+ `
1486
+ };
1487
+ },
1488
+ deckValidate() {
1489
+ return {
1490
+ query: `
1491
+ query DeckValidate($id: UUID!, $input: DeckValidateInput) {
1492
+ deckValidate(id: $id, input: $input) {
1493
+ ${DECK_VALIDATION_FIELDS}
1494
+ }
1495
+ }
1496
+ `
1497
+ };
1498
+ },
1499
+ deckSectionDefinitions(params = {}) {
1500
+ const variables = {};
1501
+ const args = [];
1502
+ const defs = [];
1503
+ if (params.publisherSlug !== void 0) {
1504
+ defs.push("$publisherSlug: String");
1505
+ args.push("publisherSlug: $publisherSlug");
1506
+ variables["publisherSlug"] = params.publisherSlug;
1507
+ }
1508
+ if (params.gameKey !== void 0) {
1509
+ defs.push("$gameKey: String");
1510
+ args.push("gameKey: $gameKey");
1511
+ variables["gameKey"] = params.gameKey;
1512
+ }
1513
+ if (params.gameId !== void 0) {
1514
+ defs.push("$gameId: UUID");
1515
+ args.push("gameId: $gameId");
1516
+ variables["gameId"] = params.gameId;
1517
+ }
1518
+ if (params.rulesetKey !== void 0) {
1519
+ defs.push("$rulesetKey: String");
1520
+ args.push("rulesetKey: $rulesetKey");
1521
+ variables["rulesetKey"] = params.rulesetKey;
1522
+ }
1523
+ if (params.rulesetVersionId !== void 0) {
1524
+ defs.push("$rulesetVersionId: UUID");
1525
+ args.push("rulesetVersionId: $rulesetVersionId");
1526
+ variables["rulesetVersionId"] = params.rulesetVersionId;
1527
+ }
1528
+ const defStr = defs.length > 0 ? `(${defs.join(", ")})` : "";
1529
+ const argStr = args.length > 0 ? `(${args.join(", ")})` : "";
1530
+ return {
1531
+ query: `
1532
+ query DeckSectionDefinitions${defStr} {
1533
+ deckSectionDefinitions${argStr} {
1534
+ ${DECK_SECTION_DEFINITION_FIELDS}
1535
+ }
1536
+ }
1537
+ `,
1538
+ variables
1539
+ };
1540
+ },
954
1541
  deckCollaborators() {
955
1542
  return {
956
1543
  query: `
@@ -962,6 +1549,102 @@ ${RESOLVED_LINKS_FIELDS}` : selectedRecordFields;
962
1549
  `
963
1550
  };
964
1551
  },
1552
+ deckEmbedTokens() {
1553
+ return {
1554
+ query: `
1555
+ query DeckEmbedTokens($deckId: UUID!) {
1556
+ deckEmbedTokens(deckId: $deckId) {
1557
+ ${DECK_EMBED_TOKEN_FIELDS}
1558
+ }
1559
+ }
1560
+ `
1561
+ };
1562
+ },
1563
+ deckAccessTokenIssuers() {
1564
+ return {
1565
+ query: `
1566
+ query DeckAccessTokenIssuers($deckId: UUID!) {
1567
+ deckAccessTokenIssuers(deckId: $deckId) {
1568
+ ${DECK_ACCESS_TOKEN_ISSUER_FIELDS}
1569
+ }
1570
+ }
1571
+ `
1572
+ };
1573
+ },
1574
+ deckApiApplicationAccesses() {
1575
+ return {
1576
+ query: `
1577
+ query DeckApiApplicationAccesses($deckId: UUID!, $includeRevoked: Boolean) {
1578
+ deckApiApplicationAccesses(deckId: $deckId, includeRevoked: $includeRevoked) {
1579
+ ${DECK_API_APPLICATION_ACCESS_FIELDS}
1580
+ }
1581
+ }
1582
+ `
1583
+ };
1584
+ },
1585
+ myDeckApiApplicationAccesses() {
1586
+ return {
1587
+ query: `
1588
+ query MyDeckApiApplicationAccesses($applicationId: UUID) {
1589
+ myDeckApiApplicationAccesses(applicationId: $applicationId) {
1590
+ ${DECK_API_APPLICATION_ACCESS_FIELDS}
1591
+ }
1592
+ }
1593
+ `
1594
+ };
1595
+ },
1596
+ deckImportFormats(params) {
1597
+ const variables = { gameId: params.gameId };
1598
+ const args = ["gameId: $gameId"];
1599
+ const defs = ["$gameId: UUID!"];
1600
+ if (params.includeArchived !== void 0) {
1601
+ defs.push("$includeArchived: Boolean");
1602
+ args.push("includeArchived: $includeArchived");
1603
+ variables["includeArchived"] = params.includeArchived;
1604
+ }
1605
+ if (params.first !== void 0) {
1606
+ defs.push("$first: Int");
1607
+ args.push("first: $first");
1608
+ variables["first"] = params.first;
1609
+ }
1610
+ if (params.after !== void 0) {
1611
+ defs.push("$after: String");
1612
+ args.push("after: $after");
1613
+ variables["after"] = params.after;
1614
+ }
1615
+ return {
1616
+ query: `
1617
+ query DeckImportFormats(${defs.join(", ")}) {
1618
+ deckImportFormats(${args.join(", ")}) {
1619
+ ${connectionFields(DECK_IMPORT_FORMAT_DEFINITION_FIELDS)}
1620
+ }
1621
+ }
1622
+ `,
1623
+ variables
1624
+ };
1625
+ },
1626
+ deckImportFormat() {
1627
+ return {
1628
+ query: `
1629
+ query DeckImportFormat($id: UUID!) {
1630
+ deckImportFormat(id: $id) {
1631
+ ${DECK_IMPORT_FORMAT_DEFINITION_FIELDS}
1632
+ }
1633
+ }
1634
+ `
1635
+ };
1636
+ },
1637
+ deckImportFormatTest() {
1638
+ return {
1639
+ query: `
1640
+ query DeckImportFormatTest($input: DeckImportFormatTestInput!) {
1641
+ deckImportFormatTest(input: $input) {
1642
+ ${DECK_IMPORT_FORMAT_TEST_PAYLOAD_FIELDS}
1643
+ }
1644
+ }
1645
+ `
1646
+ };
1647
+ },
965
1648
  deckPreviewTokens() {
966
1649
  return {
967
1650
  query: `
@@ -1004,12 +1687,214 @@ ${RESOLVED_LINKS_FIELDS}` : selectedRecordFields;
1004
1687
  `
1005
1688
  };
1006
1689
  },
1690
+ archiveDeck() {
1691
+ return {
1692
+ query: `
1693
+ mutation DeckArchive($id: UUID!) {
1694
+ deckArchive(id: $id) {
1695
+ ${DECK_FIELDS}
1696
+ }
1697
+ }
1698
+ `
1699
+ };
1700
+ },
1701
+ restoreDeck() {
1702
+ return {
1703
+ query: `
1704
+ mutation DeckRestore($id: UUID!) {
1705
+ deckRestore(id: $id) {
1706
+ ${DECK_FIELDS}
1707
+ }
1708
+ }
1709
+ `
1710
+ };
1711
+ },
1712
+ unpublishDeck() {
1713
+ return {
1714
+ query: `
1715
+ mutation DeckUnpublish($id: UUID!) {
1716
+ deckUnpublish(id: $id) {
1717
+ ${DECK_FIELDS}
1718
+ }
1719
+ }
1720
+ `
1721
+ };
1722
+ },
1723
+ addDeckEntry() {
1724
+ return {
1725
+ query: `
1726
+ mutation DeckEntryAdd($input: DeckEntryAddInput!) {
1727
+ deckEntryAdd(input: $input) {
1728
+ ${DECK_ENTRY_MUTATION_PAYLOAD_FIELDS}
1729
+ }
1730
+ }
1731
+ `
1732
+ };
1733
+ },
1734
+ updateDeckEntry() {
1735
+ return {
1736
+ query: `
1737
+ mutation DeckEntryUpdate($id: UUID!, $input: DeckEntryUpdateInput!) {
1738
+ deckEntryUpdate(id: $id, input: $input) {
1739
+ ${DECK_ENTRY_MUTATION_PAYLOAD_FIELDS}
1740
+ }
1741
+ }
1742
+ `
1743
+ };
1744
+ },
1745
+ removeDeckEntry() {
1746
+ return {
1747
+ query: `
1748
+ mutation DeckEntryRemove($id: UUID!, $expectedDraftRevision: Int!) {
1749
+ deckEntryRemove(id: $id, expectedDraftRevision: $expectedDraftRevision) {
1750
+ ${DECK_ENTRY_MUTATION_PAYLOAD_FIELDS}
1751
+ }
1752
+ }
1753
+ `
1754
+ };
1755
+ },
1756
+ reorderDeckEntries() {
1757
+ return {
1758
+ query: `
1759
+ mutation DeckEntryReorder($deckId: UUID!, $input: DeckEntryReorderInput!) {
1760
+ deckEntryReorder(deckId: $deckId, input: $input) {
1761
+ ${DECK_ENTRY_REORDER_PAYLOAD_FIELDS}
1762
+ }
1763
+ }
1764
+ `
1765
+ };
1766
+ },
1767
+ replaceDeckEntries() {
1768
+ return {
1769
+ query: `
1770
+ mutation DeckEntriesReplace($deckId: UUID!, $input: DeckEntriesReplaceInput!) {
1771
+ deckEntriesReplace(deckId: $deckId, input: $input) {
1772
+ ${DECK_ENTRIES_REPLACE_PAYLOAD_FIELDS}
1773
+ }
1774
+ }
1775
+ `
1776
+ };
1777
+ },
1778
+ importDeck() {
1779
+ return {
1780
+ query: `
1781
+ mutation DeckImport($input: DeckImportInput!) {
1782
+ deckImport(input: $input) {
1783
+ ${DECK_IMPORT_PAYLOAD_FIELDS}
1784
+ }
1785
+ }
1786
+ `
1787
+ };
1788
+ },
1789
+ createDeckImportFormat() {
1790
+ return {
1791
+ query: `
1792
+ mutation DeckImportFormatCreate($input: DeckImportFormatCreateInput!) {
1793
+ deckImportFormatCreate(input: $input) {
1794
+ ${DECK_IMPORT_FORMAT_DEFINITION_FIELDS}
1795
+ }
1796
+ }
1797
+ `
1798
+ };
1799
+ },
1800
+ updateDeckImportFormat() {
1801
+ return {
1802
+ query: `
1803
+ mutation DeckImportFormatUpdate($id: UUID!, $input: DeckImportFormatUpdateInput!) {
1804
+ deckImportFormatUpdate(id: $id, input: $input) {
1805
+ ${DECK_IMPORT_FORMAT_DEFINITION_FIELDS}
1806
+ }
1807
+ }
1808
+ `
1809
+ };
1810
+ },
1811
+ archiveDeckImportFormat() {
1812
+ return {
1813
+ query: `
1814
+ mutation DeckImportFormatArchive($id: UUID!) {
1815
+ deckImportFormatArchive(id: $id) {
1816
+ ${DECK_IMPORT_FORMAT_DEFINITION_FIELDS}
1817
+ }
1818
+ }
1819
+ `
1820
+ };
1821
+ },
1822
+ unarchiveDeckImportFormat() {
1823
+ return {
1824
+ query: `
1825
+ mutation DeckImportFormatUnarchive($id: UUID!) {
1826
+ deckImportFormatUnarchive(id: $id) {
1827
+ ${DECK_IMPORT_FORMAT_DEFINITION_FIELDS}
1828
+ }
1829
+ }
1830
+ `
1831
+ };
1832
+ },
1833
+ upsertDeckByExternalRef() {
1834
+ return {
1835
+ query: `
1836
+ mutation DeckUpsertByExternalRef($input: DeckUpsertByExternalRefInput!) {
1837
+ deckUpsertByExternalRef(input: $input) {
1838
+ deck {
1839
+ ${DECK_FIELDS}
1840
+ }
1841
+ created
1842
+ idempotentReplay
1843
+ }
1844
+ }
1845
+ `
1846
+ };
1847
+ },
1848
+ claimDeck() {
1849
+ return {
1850
+ query: `
1851
+ mutation DeckClaim($id: UUID!, $input: DeckClaimInput!) {
1852
+ deckClaim(id: $id, input: $input) {
1853
+ ${DECK_OWNERSHIP_TRANSFER_PAYLOAD_FIELDS}
1854
+ }
1855
+ }
1856
+ `
1857
+ };
1858
+ },
1859
+ transferDeckOwnership() {
1860
+ return {
1861
+ query: `
1862
+ mutation DeckTransferOwnership($id: UUID!, $input: DeckTransferOwnershipInput!) {
1863
+ deckTransferOwnership(id: $id, input: $input) {
1864
+ ${DECK_OWNERSHIP_TRANSFER_PAYLOAD_FIELDS}
1865
+ }
1866
+ }
1867
+ `
1868
+ };
1869
+ },
1870
+ copyDeck() {
1871
+ return {
1872
+ query: `
1873
+ mutation DeckCopy($id: UUID!, $input: DeckCopyInput!) {
1874
+ deckCopy(id: $id, input: $input) {
1875
+ ${DECK_COPY_PAYLOAD_FIELDS}
1876
+ }
1877
+ }
1878
+ `
1879
+ };
1880
+ },
1007
1881
  publishDeck() {
1008
1882
  return {
1009
1883
  query: `
1010
1884
  mutation DeckPublish($id: UUID!, $input: DeckPublishInput!) {
1011
1885
  deckPublish(id: $id, input: $input) {
1012
- ${DECK_VERSION_FIELDS}
1886
+ ${DECK_PUBLISH_PAYLOAD_FIELDS}
1887
+ }
1888
+ }
1889
+ `
1890
+ };
1891
+ },
1892
+ removeInvalidDeckEntries() {
1893
+ return {
1894
+ query: `
1895
+ mutation DeckRemoveInvalidEntries($id: UUID!, $input: DeckRemoveInvalidEntriesInput!) {
1896
+ deckRemoveInvalidEntries(id: $id, input: $input) {
1897
+ ${DECK_FIELDS}
1013
1898
  }
1014
1899
  }
1015
1900
  `
@@ -1058,21 +1943,193 @@ ${RESOLVED_LINKS_FIELDS}` : selectedRecordFields;
1058
1943
  `
1059
1944
  };
1060
1945
  },
1946
+ createDeckEmbedToken() {
1947
+ return {
1948
+ query: `
1949
+ mutation DeckEmbedTokenCreate($input: DeckEmbedTokenCreateInput!) {
1950
+ deckEmbedTokenCreate(input: $input) {
1951
+ token
1952
+ embedToken {
1953
+ ${DECK_EMBED_TOKEN_FIELDS}
1954
+ }
1955
+ }
1956
+ }
1957
+ `
1958
+ };
1959
+ },
1960
+ revokeDeckEmbedToken() {
1961
+ return {
1962
+ query: `
1963
+ mutation DeckEmbedTokenRevoke($id: UUID!) {
1964
+ deckEmbedTokenRevoke(id: $id)
1965
+ }
1966
+ `
1967
+ };
1968
+ },
1969
+ createDeckAccessTokenIssuer() {
1970
+ return {
1971
+ query: `
1972
+ mutation DeckAccessTokenIssuerCreate($input: DeckAccessTokenIssuerCreateInput!) {
1973
+ deckAccessTokenIssuerCreate(input: $input) {
1974
+ ${DECK_ACCESS_TOKEN_ISSUER_FIELDS}
1975
+ }
1976
+ }
1977
+ `
1978
+ };
1979
+ },
1980
+ revokeDeckAccessTokenIssuer() {
1981
+ return {
1982
+ query: `
1983
+ mutation DeckAccessTokenIssuerRevoke($id: UUID!) {
1984
+ deckAccessTokenIssuerRevoke(id: $id)
1985
+ }
1986
+ `
1987
+ };
1988
+ },
1989
+ revokeDeckAccessTokenIssuerSigningKey() {
1990
+ return {
1991
+ query: `
1992
+ mutation DeckAccessTokenIssuerSigningKeyRevoke($id: UUID!) {
1993
+ deckAccessTokenIssuerSigningKeyRevoke(id: $id) {
1994
+ ${DECK_ACCESS_TOKEN_ISSUER_FIELDS}
1995
+ }
1996
+ }
1997
+ `
1998
+ };
1999
+ },
2000
+ exchangeDeckAccessToken() {
2001
+ return {
2002
+ query: `
2003
+ mutation DeckAccessTokenExchange($input: DeckAccessTokenExchangeInput!) {
2004
+ deckAccessTokenExchange(input: $input) {
2005
+ token
2006
+ accessToken {
2007
+ ${DECK_ACCESS_TOKEN_FIELDS}
2008
+ }
2009
+ }
2010
+ }
2011
+ `
2012
+ };
2013
+ },
2014
+ grantDeckApiApplicationAccess() {
2015
+ return {
2016
+ query: `
2017
+ mutation DeckApiApplicationAccessGrant($input: DeckAPIApplicationAccessGrantInput!) {
2018
+ deckApiApplicationAccessGrant(input: $input) {
2019
+ ${DECK_API_APPLICATION_ACCESS_FIELDS}
2020
+ }
2021
+ }
2022
+ `
2023
+ };
2024
+ },
2025
+ revokeDeckApiApplicationAccess() {
2026
+ return {
2027
+ query: `
2028
+ mutation DeckApiApplicationAccessRevoke($deckId: UUID!, $apiApplicationId: UUID!) {
2029
+ deckApiApplicationAccessRevoke(deckId: $deckId, apiApplicationId: $apiApplicationId)
2030
+ }
2031
+ `
2032
+ };
2033
+ },
2034
+ revokeDeckAccessToken() {
2035
+ return {
2036
+ query: `
2037
+ mutation DeckAccessTokenRevoke($id: UUID!) {
2038
+ deckAccessTokenRevoke(id: $id)
2039
+ }
2040
+ `
2041
+ };
2042
+ },
1061
2043
  deckCreateVariables(input) {
1062
2044
  return { input };
1063
2045
  },
1064
2046
  deckUpdateVariables(id, input) {
1065
2047
  return { id, input };
1066
2048
  },
1067
- deckPublishVariables(id, input = {}) {
2049
+ deckEntryAddVariables(input) {
2050
+ return { input };
2051
+ },
2052
+ deckEntryUpdateVariables(id, input) {
2053
+ return { id, input };
2054
+ },
2055
+ deckEntryRemoveVariables(id, expectedDraftRevision) {
2056
+ return { id, expectedDraftRevision };
2057
+ },
2058
+ deckEntryReorderVariables(deckId, input) {
2059
+ return { deckId, input };
2060
+ },
2061
+ deckEntriesReplaceVariables(deckId, input) {
2062
+ return { deckId, input };
2063
+ },
2064
+ deckImportVariables(input) {
2065
+ return { input };
2066
+ },
2067
+ deckImportFormatCreateVariables(input) {
2068
+ return { input };
2069
+ },
2070
+ deckImportFormatUpdateVariables(id, input) {
2071
+ return { id, input };
2072
+ },
2073
+ deckImportFormatTestVariables(input) {
2074
+ return { input };
2075
+ },
2076
+ deckUpsertByExternalRefVariables(input) {
2077
+ return { input };
2078
+ },
2079
+ deckClaimVariables(id, input) {
2080
+ return { id, input };
2081
+ },
2082
+ deckTransferOwnershipVariables(id, input) {
2083
+ return { id, input };
2084
+ },
2085
+ deckCopyVariables(id, input) {
2086
+ return { id, input };
2087
+ },
2088
+ deckPublishVariables(id, input) {
1068
2089
  return { id, input };
1069
2090
  },
2091
+ deckValidateVariables(id, input) {
2092
+ return input === void 0 ? { id } : { id, input };
2093
+ },
2094
+ deckRemoveInvalidEntriesVariables(id, input) {
2095
+ return { id, input };
2096
+ },
2097
+ deckHydrateEntriesVariables(input) {
2098
+ return { input };
2099
+ },
2100
+ deckExportVariables(id, format) {
2101
+ return { id, format };
2102
+ },
2103
+ deckVersionDiffVariables(fromVersionId, toVersionId) {
2104
+ return { fromVersionId, toVersionId };
2105
+ },
1070
2106
  deckCollaboratorVariables(deckId, accountId, role) {
1071
2107
  return role === void 0 ? { deckId, accountId } : { deckId, accountId, role };
1072
2108
  },
1073
2109
  deckPreviewTokenCreateVariables(input) {
1074
2110
  return { input };
1075
2111
  },
2112
+ deckEmbedTokenCreateVariables(input) {
2113
+ return { input };
2114
+ },
2115
+ deckAccessTokenIssuerCreateVariables(input) {
2116
+ return { input };
2117
+ },
2118
+ deckAccessTokenExchangeVariables(input) {
2119
+ return { input };
2120
+ },
2121
+ deckApiApplicationAccessesVariables(deckId, includeRevoked) {
2122
+ return includeRevoked === void 0 ? { deckId } : { deckId, includeRevoked };
2123
+ },
2124
+ myDeckApiApplicationAccessesVariables(applicationId) {
2125
+ return applicationId === void 0 ? {} : { applicationId };
2126
+ },
2127
+ deckApiApplicationAccessGrantVariables(input) {
2128
+ return { input };
2129
+ },
2130
+ deckApiApplicationAccessRevokeVariables(deckId, apiApplicationId) {
2131
+ return { deckId, apiApplicationId };
2132
+ },
1076
2133
  // API Key Info
1077
2134
  fetchMe() {
1078
2135
  return {