@carddb/core 0.1.5 → 0.2.5

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.cjs CHANGED
@@ -303,6 +303,27 @@ function resolveFilter(input) {
303
303
  }
304
304
 
305
305
  // src/query-builder.ts
306
+ var FILE_FIELDS = `
307
+ id
308
+ createdAt
309
+ updatedAt
310
+ key
311
+ filename
312
+ contentType
313
+ size
314
+ status
315
+ isPublic
316
+ entityType
317
+ entityId
318
+ url
319
+ `;
320
+ var PRESIGNED_UPLOAD_FIELDS = `
321
+ file {
322
+ ${FILE_FIELDS}
323
+ }
324
+ uploadUrl
325
+ expiresAt
326
+ `;
306
327
  var PUBLISHER_FIELDS = `
307
328
  id
308
329
  name
@@ -327,6 +348,8 @@ var GAME_FIELDS = `
327
348
  key
328
349
  name
329
350
  description
351
+ metafyGameUuid
352
+ metafyGameSlug
330
353
  website
331
354
  visibility
332
355
  isArchived
@@ -354,8 +377,13 @@ var DATASET_FIELDS = `
354
377
  name
355
378
  description
356
379
  purpose
380
+ activeVersionId
357
381
  tcgplayerProductIdFieldKey
358
382
  visibility
383
+ posX
384
+ posY
385
+ sortOrder
386
+ archivedAt
359
387
  isArchived
360
388
  createdAt
361
389
  updatedAt
@@ -385,10 +413,28 @@ function fieldInfoFields(depth) {
385
413
  filterable
386
414
  searchable
387
415
  isIdentifier
416
+ sortOrder
388
417
  itemType
418
+ linkDatasetId
419
+ linkDatasetKey
420
+ linkDatasetName
421
+ linkFieldKey
422
+ linkAlias
423
+ linkDirection
389
424
  displayFormat
390
425
  semanticType
426
+ placeholder
427
+ isHidden
428
+ isComputed
429
+ isSystemField
430
+ defaultValue
391
431
  allowedValues
432
+ minLength
433
+ maxLength
434
+ minValue
435
+ maxValue
436
+ pattern
437
+ isUnique
392
438
  ${nestedFields}
393
439
  `;
394
440
  }
@@ -405,9 +451,48 @@ var SCHEMA_FIELDS = `
405
451
  targetDatasetKey
406
452
  targetDatasetName
407
453
  targetDatasetId
454
+ targetFieldKey
455
+ linkAlias
456
+ linkDirection
457
+ isArray
408
458
  }
409
459
  }
410
460
  `;
461
+ var OBJECT_FIELD_FIELDS = `
462
+ id
463
+ objectTypeId
464
+ key
465
+ label
466
+ dataType
467
+ isRequired
468
+ isFilterable
469
+ isSearchable
470
+ isIdentifier
471
+ sortOrder
472
+ description
473
+ placeholder
474
+ displayFormat
475
+ semanticType
476
+ isHidden
477
+ isComputed
478
+ isSystemField
479
+ defaultValue
480
+ allowedValues
481
+ minLength
482
+ maxLength
483
+ minValue
484
+ maxValue
485
+ pattern
486
+ isUnique
487
+ itemType
488
+ linkDatasetId
489
+ linkFieldKey
490
+ linkAlias
491
+ linkDirection
492
+ parentFieldId
493
+ createdAt
494
+ updatedAt
495
+ `;
411
496
  var TCGPLAYER_PRICING_FIELDS = `
412
497
  pricing {
413
498
  productId
@@ -439,6 +524,82 @@ function recordFields(options = {}) {
439
524
  `;
440
525
  }
441
526
  var RECORD_FIELDS = recordFields();
527
+ var DECK_SECTION_DEFINITION_FIELDS = `
528
+ key
529
+ label
530
+ description
531
+ order
532
+ default
533
+ aliases
534
+ minCards
535
+ maxCards
536
+ excludedFromDeckSize
537
+ legalCardTypes
538
+ metadata
539
+ `;
540
+ var DECK_ENTRY_FIELDS = `
541
+ id
542
+ datasetId
543
+ recordId
544
+ identifier
545
+ quantity
546
+ section
547
+ sortOrder
548
+ annotations
549
+ display
550
+ record {
551
+ ${RECORD_FIELDS}
552
+ }
553
+ `;
554
+ var DECK_VALIDATED_AGAINST_FIELDS = `
555
+ rulesetId
556
+ rulesetVersionId
557
+ rulesetVersionLabel
558
+ cardDatasetId
559
+ cardDatasetVersionId
560
+ validatedAt
561
+ validationResultSummary
562
+ `;
563
+ var DECK_VALIDATION_ISSUE_FIELDS = `
564
+ code
565
+ severity
566
+ message
567
+ entryIds
568
+ section
569
+ datasetId
570
+ identifier
571
+ metadata
572
+ `;
573
+ var DECK_VALIDATION_FIELDS = `
574
+ deckId
575
+ valid
576
+ blockers {
577
+ ${DECK_VALIDATION_ISSUE_FIELDS}
578
+ }
579
+ warnings {
580
+ ${DECK_VALIDATION_ISSUE_FIELDS}
581
+ }
582
+ affectedEntries {
583
+ entryId
584
+ datasetId
585
+ recordId
586
+ identifier
587
+ section
588
+ quantity
589
+ }
590
+ validatedAgainst {
591
+ ${DECK_VALIDATED_AGAINST_FIELDS}
592
+ }
593
+ checkedAt
594
+ `;
595
+ var DECK_DIFF_FIELDS = `
596
+ deckId
597
+ fromVersionId
598
+ toVersionId
599
+ toDraftRevision
600
+ hasChanges
601
+ diff
602
+ `;
442
603
  var DECK_VERSION_FIELDS = `
443
604
  id
444
605
  deckId
@@ -454,21 +615,23 @@ var DECK_VERSION_FIELDS = `
454
615
  metadata
455
616
  publishNote
456
617
  computedDiff
618
+ rulesetId
619
+ rulesetVersionId
620
+ cardDatasetId
621
+ cardDatasetVersionId
622
+ validatedAt
623
+ validationSummary
624
+ validatedAgainst {
625
+ ${DECK_VALIDATED_AGAINST_FIELDS}
626
+ }
627
+ sectionDefinitions {
628
+ ${DECK_SECTION_DEFINITION_FIELDS}
629
+ }
457
630
  publishedByAccountId
458
631
  publishedByApiApplicationId
459
632
  createdAt
460
633
  entries {
461
- id
462
- datasetId
463
- recordId
464
- identifier
465
- quantity
466
- section
467
- sortOrder
468
- annotations
469
- record {
470
- ${RECORD_FIELDS}
471
- }
634
+ ${DECK_ENTRY_FIELDS}
472
635
  }
473
636
  `;
474
637
  var DECK_COLLABORATOR_FIELDS = `
@@ -490,8 +653,156 @@ var DECK_PREVIEW_TOKEN_FIELDS = `
490
653
  createdAt
491
654
  updatedAt
492
655
  `;
656
+ var DECK_EMBED_TOKEN_FIELDS = `
657
+ id
658
+ deckId
659
+ apiApplicationId
660
+ label
661
+ readMode
662
+ allowedOrigins
663
+ externalSubject
664
+ expiresAt
665
+ revokedAt
666
+ lastUsedAt
667
+ createdAt
668
+ updatedAt
669
+ `;
670
+ var DECK_ACCESS_TOKEN_ISSUER_FIELDS = `
671
+ id
672
+ deckId
673
+ apiApplicationId
674
+ label
675
+ readModes
676
+ maxTokenLifetimeSeconds
677
+ directSigningAlg
678
+ directSigningKeyId
679
+ directSigningPublicKey
680
+ directSigningKeyRevokedAt
681
+ revokedAt
682
+ createdAt
683
+ updatedAt
684
+ `;
685
+ var DECK_ACCESS_TOKEN_FIELDS = `
686
+ id
687
+ deckId
688
+ apiApplicationId
689
+ issuerId
690
+ readMode
691
+ externalSubject
692
+ expiresAt
693
+ revokedAt
694
+ lastUsedAt
695
+ createdAt
696
+ updatedAt
697
+ `;
698
+ var DECK_IMPORT_ENTRY_FIELDS = `
699
+ lineNumber
700
+ raw
701
+ datasetKey
702
+ datasetId
703
+ recordId
704
+ identifier
705
+ quantity
706
+ section
707
+ sortOrder
708
+ display
709
+ record {
710
+ ${RECORD_FIELDS}
711
+ }
712
+ `;
713
+ var DECK_IMPORT_ISSUE_FIELDS = `
714
+ lineNumber
715
+ raw
716
+ code
717
+ message
718
+ `;
719
+ var DECK_IMPORT_UNMATCHED_FIELDS = `
720
+ lineNumber
721
+ raw
722
+ datasetKey
723
+ identifier
724
+ quantity
725
+ section
726
+ code
727
+ message
728
+ `;
729
+ var DECK_IMPORT_AMBIGUOUS_FIELDS = `
730
+ lineNumber
731
+ raw
732
+ datasetKey
733
+ identifier
734
+ quantity
735
+ section
736
+ candidates {
737
+ recordId
738
+ identifier
739
+ display
740
+ }
741
+ `;
742
+ var DECK_IMPORT_FORMAT_DEFINITION_FIELDS = `
743
+ id
744
+ gameId
745
+ key
746
+ name
747
+ description
748
+ enabled
749
+ priority
750
+ datasetKey
751
+ config
752
+ archivedAt
753
+ isArchived
754
+ createdAt
755
+ updatedAt
756
+ `;
757
+ var DECK_IMPORT_FORMAT_DETECTION_FIELDS = `
758
+ formatId
759
+ key
760
+ name
761
+ confidence
762
+ reason
763
+ `;
764
+ var DECK_IMPORT_FORMAT_TEST_PAYLOAD_FIELDS = `
765
+ detection {
766
+ ${DECK_IMPORT_FORMAT_DETECTION_FIELDS}
767
+ }
768
+ entries {
769
+ ${DECK_IMPORT_ENTRY_FIELDS}
770
+ }
771
+ parseErrors {
772
+ ${DECK_IMPORT_ISSUE_FIELDS}
773
+ }
774
+ unmatched {
775
+ ${DECK_IMPORT_UNMATCHED_FIELDS}
776
+ }
777
+ ambiguous {
778
+ ${DECK_IMPORT_AMBIGUOUS_FIELDS}
779
+ }
780
+ `;
781
+ var DECK_HYDRATE_ENTRIES_PAYLOAD_FIELDS = `
782
+ entries {
783
+ ${DECK_IMPORT_ENTRY_FIELDS}
784
+ }
785
+ unmatched {
786
+ ${DECK_IMPORT_UNMATCHED_FIELDS}
787
+ }
788
+ ambiguous {
789
+ ${DECK_IMPORT_AMBIGUOUS_FIELDS}
790
+ }
791
+ `;
792
+ var DECK_EXPORT_PAYLOAD_FIELDS = `
793
+ deckId
794
+ format
795
+ text
796
+ entryCount
797
+ `;
493
798
  var DECK_FIELDS = `
494
799
  id
800
+ ownerType
801
+ ownerAccountId
802
+ ownerApiApplicationId
803
+ environment
804
+ createdByAccountId
805
+ createdByApiApplicationId
495
806
  accountId
496
807
  apiApplicationId
497
808
  gameId
@@ -501,13 +812,29 @@ var DECK_FIELDS = `
501
812
  description
502
813
  formatKey
503
814
  visibility
815
+ accessMode
816
+ discoverability
817
+ state
818
+ archivedAt
819
+ deletedAt
820
+ unpublishedAt
821
+ externalRefApiApplicationId
504
822
  externalRef
823
+ externalSubjectRef
824
+ rulesetId
505
825
  sourceUrl
506
826
  metadata
827
+ sectionDefinitions {
828
+ ${DECK_SECTION_DEFINITION_FIELDS}
829
+ }
507
830
  latestPublishedVersion {
508
831
  ${DECK_VERSION_FIELDS}
509
832
  }
510
833
  publishedAt
834
+ draftRevision
835
+ draftUpdatedAt
836
+ draftUpdatedByAccountId
837
+ draftUpdatedByApiApplicationId
511
838
  hasUnpublishedChanges
512
839
  createdAt
513
840
  updatedAt
@@ -515,17 +842,109 @@ var DECK_FIELDS = `
515
842
  ${GAME_FIELDS}
516
843
  }
517
844
  entries {
518
- id
519
- datasetId
520
- recordId
521
- identifier
522
- quantity
523
- section
524
- sortOrder
525
- annotations
526
- record {
527
- ${RECORD_FIELDS}
528
- }
845
+ ${DECK_ENTRY_FIELDS}
846
+ }
847
+ `;
848
+ var DECK_OWNERSHIP_TRANSFER_PAYLOAD_FIELDS = `
849
+ deck {
850
+ ${DECK_FIELDS}
851
+ }
852
+ retainedAppAccess
853
+ `;
854
+ var DECK_COPY_PAYLOAD_FIELDS = `
855
+ deck {
856
+ ${DECK_FIELDS}
857
+ }
858
+ copiedFromDeckId
859
+ retainedAppAccess
860
+ `;
861
+ var DECK_ACCESS_APPLICATION_FIELDS = `
862
+ id
863
+ name
864
+ description
865
+ revokedAt
866
+ `;
867
+ var DECK_API_APPLICATION_ACCESS_FIELDS = `
868
+ id
869
+ deckId
870
+ deck {
871
+ ${DECK_FIELDS}
872
+ }
873
+ apiApplicationId
874
+ apiApplication {
875
+ ${DECK_ACCESS_APPLICATION_FIELDS}
876
+ }
877
+ role
878
+ grantSource
879
+ externalRef
880
+ createdByAccountId
881
+ createdByApiApplicationId
882
+ revokedAt
883
+ createdAt
884
+ updatedAt
885
+ `;
886
+ var DECK_PUBLISH_PAYLOAD_FIELDS = `
887
+ deck {
888
+ ${DECK_FIELDS}
889
+ }
890
+ version {
891
+ ${DECK_VERSION_FIELDS}
892
+ }
893
+ validation {
894
+ ${DECK_VALIDATION_FIELDS}
895
+ }
896
+ blockers {
897
+ ${DECK_VALIDATION_ISSUE_FIELDS}
898
+ }
899
+ warnings {
900
+ ${DECK_VALIDATION_ISSUE_FIELDS}
901
+ }
902
+ `;
903
+ var DECK_ENTRY_MUTATION_PAYLOAD_FIELDS = `
904
+ deck {
905
+ ${DECK_FIELDS}
906
+ }
907
+ entry {
908
+ ${DECK_ENTRY_FIELDS}
909
+ }
910
+ `;
911
+ var DECK_ENTRY_REORDER_PAYLOAD_FIELDS = `
912
+ deck {
913
+ ${DECK_FIELDS}
914
+ }
915
+ entries {
916
+ ${DECK_ENTRY_FIELDS}
917
+ }
918
+ `;
919
+ var DECK_ENTRIES_REPLACE_PAYLOAD_FIELDS = DECK_ENTRY_REORDER_PAYLOAD_FIELDS;
920
+ var DECK_IMPORT_PAYLOAD_FIELDS = `
921
+ deck {
922
+ ${DECK_FIELDS}
923
+ }
924
+ applied
925
+ dryRun
926
+ replace
927
+ format
928
+ importFormat {
929
+ ${DECK_IMPORT_FORMAT_DEFINITION_FIELDS}
930
+ }
931
+ detection {
932
+ ${DECK_IMPORT_FORMAT_DETECTION_FIELDS}
933
+ }
934
+ entries {
935
+ ${DECK_IMPORT_ENTRY_FIELDS}
936
+ }
937
+ parseErrors {
938
+ ${DECK_IMPORT_ISSUE_FIELDS}
939
+ }
940
+ unmatched {
941
+ ${DECK_IMPORT_UNMATCHED_FIELDS}
942
+ }
943
+ ambiguous {
944
+ ${DECK_IMPORT_AMBIGUOUS_FIELDS}
945
+ }
946
+ validation {
947
+ ${DECK_VALIDATION_FIELDS}
529
948
  }
530
949
  `;
531
950
  var RESOLVED_LINKS_FIELDS = `
@@ -540,37 +959,336 @@ var RESOLVED_LINKS_FIELDS = `
540
959
  }
541
960
  }
542
961
  `;
543
- function connectionFields(nodeFields) {
544
- return `
545
- totalCount
546
- pageInfo {
547
- hasNextPage
548
- hasPreviousPage
549
- startCursor
550
- endCursor
962
+ var BULK_RECORD_ERROR_FIELDS = `
963
+ datasetKey
964
+ index
965
+ errors {
966
+ field
967
+ message
968
+ details
969
+ }
970
+ `;
971
+ var IMPORT_STATS_FIELDS = `
972
+ total
973
+ inserted
974
+ updated
975
+ skipped
976
+ failed
977
+ `;
978
+ var BULK_IMPORT_RESULT_FIELDS = `
979
+ inserted {
980
+ ${RECORD_FIELDS}
981
+ }
982
+ updated {
983
+ ${RECORD_FIELDS}
984
+ }
985
+ skipped
986
+ errors {
987
+ ${BULK_RECORD_ERROR_FIELDS}
988
+ }
989
+ createdFields {
990
+ ${OBJECT_FIELD_FIELDS}
991
+ }
992
+ stats {
993
+ ${IMPORT_STATS_FIELDS}
994
+ }
995
+ `;
996
+ var IMPORT_JOB_ASSET_FIELDS = `
997
+ fileId
998
+ filename
999
+ file {
1000
+ ${FILE_FIELDS}
1001
+ }
1002
+ `;
1003
+ var IMPORT_JOB_FIELDS = `
1004
+ id
1005
+ publisherId
1006
+ publisher {
1007
+ ${PUBLISHER_FIELDS}
1008
+ }
1009
+ datasetId
1010
+ dataset {
1011
+ ${DATASET_FIELDS}
1012
+ ${SCHEMA_FIELDS}
1013
+ }
1014
+ accountId
1015
+ status
1016
+ mode
1017
+ onConflict
1018
+ format
1019
+ fileId
1020
+ progress
1021
+ totalRecords
1022
+ processedRecords
1023
+ insertedCount
1024
+ updatedCount
1025
+ skippedCount
1026
+ failedCount
1027
+ createdFields {
1028
+ ${OBJECT_FIELD_FIELDS}
1029
+ }
1030
+ errors {
1031
+ ${BULK_RECORD_ERROR_FIELDS}
1032
+ }
1033
+ errorMessage
1034
+ assets {
1035
+ ${IMPORT_JOB_ASSET_FIELDS}
1036
+ }
1037
+ startedAt
1038
+ completedAt
1039
+ createdAt
1040
+ updatedAt
1041
+ lastCheckpointIndex
1042
+ isResumed
1043
+ imagesPending
1044
+ imagesCompleted
1045
+ imagesFailed
1046
+ `;
1047
+ var IMPORT_JOB_LOG_FIELDS = `
1048
+ id
1049
+ importJobId
1050
+ level
1051
+ message
1052
+ datasetKey
1053
+ recordIndex
1054
+ fieldKey
1055
+ details
1056
+ createdAt
1057
+ `;
1058
+ var DATASET_RECORDS_UPSERT_PAYLOAD_FIELDS = `
1059
+ job {
1060
+ ${IMPORT_JOB_FIELDS}
1061
+ }
1062
+ dryRunResult {
1063
+ ${BULK_IMPORT_RESULT_FIELDS}
1064
+ }
1065
+ `;
1066
+ var DELETE_JOB_RESULT_FIELDS = `
1067
+ target
1068
+ recordId
1069
+ identifier
1070
+ status
1071
+ message
1072
+ `;
1073
+ var DATASET_RECORD_DELETE_JOB_FIELDS = `
1074
+ id
1075
+ publisherId
1076
+ publisher {
1077
+ ${PUBLISHER_FIELDS}
1078
+ }
1079
+ datasetId
1080
+ dataset {
1081
+ ${DATASET_FIELDS}
1082
+ }
1083
+ accountId
1084
+ status
1085
+ targetType
1086
+ dryRun
1087
+ targets
1088
+ progress
1089
+ totalTargets
1090
+ processedTargets
1091
+ matchedCount
1092
+ deletedCount
1093
+ missingCount
1094
+ blockedCount
1095
+ failedCount
1096
+ results {
1097
+ ${DELETE_JOB_RESULT_FIELDS}
1098
+ }
1099
+ errorMessage
1100
+ startedAt
1101
+ completedAt
1102
+ createdAt
1103
+ updatedAt
1104
+ `;
1105
+ var FIELD_MAPPING_FIELDS = `
1106
+ sourceField
1107
+ targetField
1108
+ targetFieldLabel
1109
+ inferredType
1110
+ inferredItemType
1111
+ inferredChildren {
1112
+ key
1113
+ label
1114
+ type
1115
+ required
1116
+ itemType
1117
+ children {
1118
+ key
1119
+ label
1120
+ type
1121
+ required
1122
+ itemType
551
1123
  }
552
- edges {
553
- cursor
554
- node {
555
- ${nodeFields}
556
- }
1124
+ }
1125
+ inferredLinkDataset
1126
+ inferredLinkFieldKey
1127
+ inferredLinkDirection
1128
+ targetFieldType
1129
+ sampleValues
1130
+ status
1131
+ `;
1132
+ var IMPORT_WARNING_FIELDS = `
1133
+ datasetKey
1134
+ field
1135
+ message
1136
+ severity
1137
+ `;
1138
+ var DATASET_IMPORT_PREVIEW_FIELDS = `
1139
+ datasetKey
1140
+ datasetName
1141
+ datasetId
1142
+ exists
1143
+ recordCount
1144
+ fieldMappings {
1145
+ ${FIELD_MAPPING_FIELDS}
1146
+ }
1147
+ warnings {
1148
+ ${IMPORT_WARNING_FIELDS}
1149
+ }
1150
+ canProceed
1151
+ sampleRecords
1152
+ availableDatasets {
1153
+ ${DATASET_FIELDS}
1154
+ ${SCHEMA_FIELDS}
1155
+ }
1156
+ `;
1157
+ var GAME_IMPORT_PREVIEW_FIELDS = `
1158
+ datasets {
1159
+ datasetKey
1160
+ datasetName
1161
+ datasetId
1162
+ exists
1163
+ recordCount
1164
+ fieldMappings {
1165
+ ${FIELD_MAPPING_FIELDS}
557
1166
  }
558
- `;
559
- }
560
- var QueryBuilder = {
561
- // Publishers
562
- searchPublishers(params = {}) {
563
- const variables = {};
564
- const args = [];
565
- const defs = [];
566
- if (params.search !== void 0) {
567
- defs.push("$search: String");
568
- args.push("search: $search");
569
- variables["search"] = params.search;
1167
+ warnings {
1168
+ ${IMPORT_WARNING_FIELDS}
570
1169
  }
571
- if (params.first !== void 0) {
572
- defs.push("$first: Int");
573
- args.push("first: $first");
1170
+ sampleRecords
1171
+ }
1172
+ importOrder
1173
+ warnings {
1174
+ ${IMPORT_WARNING_FIELDS}
1175
+ }
1176
+ canProceed
1177
+ `;
1178
+ var GAME_IMPORT_DATASET_STATUS_FIELDS = `
1179
+ datasetKey
1180
+ datasetId
1181
+ datasetName
1182
+ status
1183
+ recordCount
1184
+ insertedCount
1185
+ updatedCount
1186
+ skippedCount
1187
+ failedCount
1188
+ errorMessage
1189
+ `;
1190
+ var GAME_IMPORT_JOB_FIELDS = `
1191
+ id
1192
+ publisherId
1193
+ publisher {
1194
+ ${PUBLISHER_FIELDS}
1195
+ }
1196
+ gameId
1197
+ game {
1198
+ ${GAME_FIELDS}
1199
+ }
1200
+ accountId
1201
+ status
1202
+ mode
1203
+ onConflict
1204
+ fileId
1205
+ assets {
1206
+ ${IMPORT_JOB_ASSET_FIELDS}
1207
+ }
1208
+ totalDatasets
1209
+ completedDatasets
1210
+ progress
1211
+ importOrder
1212
+ datasetStatuses {
1213
+ ${GAME_IMPORT_DATASET_STATUS_FIELDS}
1214
+ }
1215
+ errorMessage
1216
+ startedAt
1217
+ completedAt
1218
+ createdAt
1219
+ updatedAt
1220
+ completedDatasetKeys
1221
+ currentDatasetKey
1222
+ lastCheckpointIndex
1223
+ isResumed
1224
+ imagesPending
1225
+ imagesCompleted
1226
+ imagesFailed
1227
+ phase
1228
+ linkBuildingDataset
1229
+ linkBuildingTotalDatasets
1230
+ linkBuildingCompletedDatasets
1231
+ linkBuildingProcessedRecords
1232
+ linkBuildingTotalRecords
1233
+ `;
1234
+ var EXPORT_JOB_FIELDS = `
1235
+ id
1236
+ publisherId
1237
+ publisher {
1238
+ ${PUBLISHER_FIELDS}
1239
+ }
1240
+ datasetId
1241
+ dataset {
1242
+ ${DATASET_FIELDS}
1243
+ }
1244
+ accountId
1245
+ status
1246
+ format
1247
+ filter
1248
+ totalRecords
1249
+ processedRecords
1250
+ progress
1251
+ fileId
1252
+ downloadUrl
1253
+ downloadExpiresAt
1254
+ errorMessage
1255
+ startedAt
1256
+ completedAt
1257
+ createdAt
1258
+ updatedAt
1259
+ lastCheckpointIndex
1260
+ `;
1261
+ function connectionFields(nodeFields) {
1262
+ return `
1263
+ totalCount
1264
+ pageInfo {
1265
+ hasNextPage
1266
+ hasPreviousPage
1267
+ startCursor
1268
+ endCursor
1269
+ }
1270
+ edges {
1271
+ cursor
1272
+ node {
1273
+ ${nodeFields}
1274
+ }
1275
+ }
1276
+ `;
1277
+ }
1278
+ var QueryBuilder = {
1279
+ // Publishers
1280
+ searchPublishers(params = {}) {
1281
+ const variables = {};
1282
+ const args = [];
1283
+ const defs = [];
1284
+ if (params.search !== void 0) {
1285
+ defs.push("$search: String");
1286
+ args.push("search: $search");
1287
+ variables["search"] = params.search;
1288
+ }
1289
+ if (params.first !== void 0) {
1290
+ defs.push("$first: Int");
1291
+ args.push("first: $first");
574
1292
  variables["first"] = params.first;
575
1293
  }
576
1294
  if (params.after !== void 0) {
@@ -695,6 +1413,98 @@ var QueryBuilder = {
695
1413
  `
696
1414
  };
697
1415
  },
1416
+ listGames(params) {
1417
+ const variables = { publisherId: params.publisherId };
1418
+ const args = ["publisherId: $publisherId"];
1419
+ const defs = ["$publisherId: UUID!"];
1420
+ if (params.first !== void 0) {
1421
+ defs.push("$first: Int");
1422
+ args.push("first: $first");
1423
+ variables["first"] = params.first;
1424
+ }
1425
+ if (params.after !== void 0) {
1426
+ defs.push("$after: String");
1427
+ args.push("after: $after");
1428
+ variables["after"] = params.after;
1429
+ }
1430
+ if (params.includeArchived !== void 0) {
1431
+ defs.push("$includeArchived: Boolean");
1432
+ args.push("includeArchived: $includeArchived");
1433
+ variables["includeArchived"] = params.includeArchived;
1434
+ }
1435
+ return {
1436
+ query: `
1437
+ query Games(${defs.join(", ")}) {
1438
+ games(${args.join(", ")}) {
1439
+ ${connectionFields(GAME_FIELDS)}
1440
+ }
1441
+ }
1442
+ `,
1443
+ variables
1444
+ };
1445
+ },
1446
+ game(params) {
1447
+ const variables = {};
1448
+ const args = [];
1449
+ const defs = [];
1450
+ if (params.id !== void 0) {
1451
+ defs.push("$id: UUID");
1452
+ args.push("id: $id");
1453
+ variables["id"] = params.id;
1454
+ }
1455
+ if (params.publisherId !== void 0) {
1456
+ defs.push("$publisherId: UUID");
1457
+ args.push("publisherId: $publisherId");
1458
+ variables["publisherId"] = params.publisherId;
1459
+ }
1460
+ if (params.publisherSlug !== void 0) {
1461
+ defs.push("$publisherSlug: String");
1462
+ args.push("publisherSlug: $publisherSlug");
1463
+ variables["publisherSlug"] = params.publisherSlug;
1464
+ }
1465
+ if (params.gameKey !== void 0) {
1466
+ defs.push("$gameKey: String");
1467
+ args.push("gameKey: $gameKey");
1468
+ variables["gameKey"] = params.gameKey;
1469
+ }
1470
+ if (params.gameSlug !== void 0) {
1471
+ defs.push("$gameSlug: String");
1472
+ args.push("gameSlug: $gameSlug");
1473
+ variables["gameSlug"] = params.gameSlug;
1474
+ }
1475
+ return {
1476
+ query: `
1477
+ query Game(${defs.join(", ")}) {
1478
+ game(${args.join(", ")}) {
1479
+ ${GAME_FIELDS}
1480
+ }
1481
+ }
1482
+ `,
1483
+ variables
1484
+ };
1485
+ },
1486
+ createGame() {
1487
+ return {
1488
+ query: `
1489
+ mutation GameCreate($input: GameCreateInput!) {
1490
+ gameCreate(input: $input) {
1491
+ ${GAME_FIELDS}
1492
+ }
1493
+ }
1494
+ `
1495
+ };
1496
+ },
1497
+ updateGame() {
1498
+ return {
1499
+ query: `
1500
+ mutation GameUpdate($id: UUID!, $input: GameUpdateInput!) {
1501
+ gameUpdate(id: $id, input: $input) {
1502
+ ${GAME_FIELDS}
1503
+ }
1504
+ }
1505
+ `
1506
+ };
1507
+ },
698
1508
  // Datasets
699
1509
  searchDatasets(params = {}) {
700
1510
  const variables = {};
@@ -778,6 +1588,83 @@ var QueryBuilder = {
778
1588
  `
779
1589
  };
780
1590
  },
1591
+ listDatasets(params) {
1592
+ const variables = { publisherId: params.publisherId };
1593
+ const args = ["publisherId: $publisherId"];
1594
+ const defs = ["$publisherId: UUID!"];
1595
+ if (params.gameId !== void 0) {
1596
+ defs.push("$gameId: UUID");
1597
+ args.push("gameId: $gameId");
1598
+ variables["gameId"] = params.gameId;
1599
+ }
1600
+ if (params.first !== void 0) {
1601
+ defs.push("$first: Int");
1602
+ args.push("first: $first");
1603
+ variables["first"] = params.first;
1604
+ }
1605
+ if (params.after !== void 0) {
1606
+ defs.push("$after: String");
1607
+ args.push("after: $after");
1608
+ variables["after"] = params.after;
1609
+ }
1610
+ if (params.includeArchived !== void 0) {
1611
+ defs.push("$includeArchived: Boolean");
1612
+ args.push("includeArchived: $includeArchived");
1613
+ variables["includeArchived"] = params.includeArchived;
1614
+ }
1615
+ if (params.purpose !== void 0) {
1616
+ defs.push("$purpose: DatasetPurpose");
1617
+ args.push("purpose: $purpose");
1618
+ variables["purpose"] = params.purpose;
1619
+ }
1620
+ return {
1621
+ query: `
1622
+ query Datasets(${defs.join(", ")}) {
1623
+ datasets(${args.join(", ")}) {
1624
+ ${connectionFields(`${DATASET_FIELDS}
1625
+ ${SCHEMA_FIELDS}`)}
1626
+ }
1627
+ }
1628
+ `,
1629
+ variables
1630
+ };
1631
+ },
1632
+ dataset(params) {
1633
+ const variables = {};
1634
+ const args = [];
1635
+ const defs = [];
1636
+ if (params.id !== void 0) {
1637
+ defs.push("$id: UUID");
1638
+ args.push("id: $id");
1639
+ variables["id"] = params.id;
1640
+ }
1641
+ if (params.publisherId !== void 0) {
1642
+ defs.push("$publisherId: UUID");
1643
+ args.push("publisherId: $publisherId");
1644
+ variables["publisherId"] = params.publisherId;
1645
+ }
1646
+ if (params.gameId !== void 0) {
1647
+ defs.push("$gameId: UUID");
1648
+ args.push("gameId: $gameId");
1649
+ variables["gameId"] = params.gameId;
1650
+ }
1651
+ if (params.datasetKey !== void 0) {
1652
+ defs.push("$datasetKey: String");
1653
+ args.push("datasetKey: $datasetKey");
1654
+ variables["datasetKey"] = params.datasetKey;
1655
+ }
1656
+ return {
1657
+ query: `
1658
+ query Dataset(${defs.join(", ")}) {
1659
+ dataset(${args.join(", ")}) {
1660
+ ${DATASET_FIELDS}
1661
+ ${SCHEMA_FIELDS}
1662
+ }
1663
+ }
1664
+ `,
1665
+ variables
1666
+ };
1667
+ },
781
1668
  // Records
782
1669
  searchRecords(params) {
783
1670
  const variables = {
@@ -885,11 +1772,20 @@ ${RESOLVED_LINKS_FIELDS}` : selectedRecordFields;
885
1772
  `
886
1773
  };
887
1774
  },
888
- // Decks
889
- listMyDecks(params = {}) {
890
- const variables = {};
891
- const args = [];
892
- const defs = [];
1775
+ listDatasetRecords(params) {
1776
+ const variables = { datasetId: params.datasetId };
1777
+ const args = ["datasetId: $datasetId"];
1778
+ const defs = ["$datasetId: UUID!"];
1779
+ if (params.filter !== void 0) {
1780
+ defs.push("$filter: JSON");
1781
+ args.push("filter: $filter");
1782
+ variables["filter"] = params.filter;
1783
+ }
1784
+ if (params.orderBy !== void 0) {
1785
+ defs.push("$orderBy: DatasetRecordOrderByInput");
1786
+ args.push("orderBy: $orderBy");
1787
+ variables["orderBy"] = params.orderBy;
1788
+ }
893
1789
  if (params.first !== void 0) {
894
1790
  defs.push("$first: Int");
895
1791
  args.push("first: $first");
@@ -900,159 +1796,1257 @@ ${RESOLVED_LINKS_FIELDS}` : selectedRecordFields;
900
1796
  args.push("after: $after");
901
1797
  variables["after"] = params.after;
902
1798
  }
903
- const defStr = defs.length > 0 ? `(${defs.join(", ")})` : "";
904
- const argStr = args.length > 0 ? `(${args.join(", ")})` : "";
1799
+ if (params.last !== void 0) {
1800
+ defs.push("$last: Int");
1801
+ args.push("last: $last");
1802
+ variables["last"] = params.last;
1803
+ }
1804
+ if (params.before !== void 0) {
1805
+ defs.push("$before: String");
1806
+ args.push("before: $before");
1807
+ variables["before"] = params.before;
1808
+ }
1809
+ if (params.validateSchema !== void 0) {
1810
+ defs.push("$validateSchema: Boolean");
1811
+ args.push("validateSchema: $validateSchema");
1812
+ variables["validateSchema"] = params.validateSchema;
1813
+ }
905
1814
  return {
906
1815
  query: `
907
- query MyDecks${defStr} {
908
- myDecks${argStr} {
909
- ${connectionFields(DECK_FIELDS)}
1816
+ query DatasetRecords(${defs.join(", ")}) {
1817
+ datasetRecords(${args.join(", ")}) {
1818
+ ${connectionFields(RECORD_FIELDS)}
910
1819
  }
911
1820
  }
912
1821
  `,
913
1822
  variables
914
1823
  };
915
1824
  },
916
- fetchDeckById() {
1825
+ datasetRecord(params) {
1826
+ const variables = {};
1827
+ const args = [];
1828
+ const defs = [];
1829
+ if (params.id !== void 0) {
1830
+ defs.push("$id: UUID");
1831
+ args.push("id: $id");
1832
+ variables["id"] = params.id;
1833
+ }
1834
+ if (params.datasetId !== void 0) {
1835
+ defs.push("$datasetId: UUID");
1836
+ args.push("datasetId: $datasetId");
1837
+ variables["datasetId"] = params.datasetId;
1838
+ }
1839
+ if (params.identifier !== void 0) {
1840
+ defs.push("$identifier: String");
1841
+ args.push("identifier: $identifier");
1842
+ variables["identifier"] = params.identifier;
1843
+ }
1844
+ if (params.publisherSlug !== void 0) {
1845
+ defs.push("$publisherSlug: String");
1846
+ args.push("publisherSlug: $publisherSlug");
1847
+ variables["publisherSlug"] = params.publisherSlug;
1848
+ }
1849
+ if (params.gameKey !== void 0) {
1850
+ defs.push("$gameKey: String");
1851
+ args.push("gameKey: $gameKey");
1852
+ variables["gameKey"] = params.gameKey;
1853
+ }
1854
+ if (params.datasetKey !== void 0) {
1855
+ defs.push("$datasetKey: String");
1856
+ args.push("datasetKey: $datasetKey");
1857
+ variables["datasetKey"] = params.datasetKey;
1858
+ }
1859
+ if (params.recordId !== void 0) {
1860
+ defs.push("$recordId: UUID");
1861
+ args.push("recordId: $recordId");
1862
+ variables["recordId"] = params.recordId;
1863
+ }
1864
+ if (params.resolveLinks !== void 0) {
1865
+ defs.push("$resolveLinks: [String!]");
1866
+ args.push("resolveLinks: $resolveLinks");
1867
+ variables["resolveLinks"] = params.resolveLinks;
1868
+ }
1869
+ if (params.validateSchema !== void 0) {
1870
+ defs.push("$validateSchema: Boolean");
1871
+ args.push("validateSchema: $validateSchema");
1872
+ variables["validateSchema"] = params.validateSchema;
1873
+ }
1874
+ const includeResolvedLinks = params.resolveLinks && params.resolveLinks.length > 0;
1875
+ const selectedRecordFields = recordFields({ includePricing: params.includePricing });
1876
+ const fields = includeResolvedLinks ? `${selectedRecordFields}
1877
+ ${RESOLVED_LINKS_FIELDS}` : selectedRecordFields;
917
1878
  return {
918
1879
  query: `
919
- query FetchDeck($id: UUID!) {
920
- fetchDeck(id: $id) {
921
- ${DECK_FIELDS}
1880
+ query DatasetRecord(${defs.join(", ")}) {
1881
+ datasetRecord(${args.join(", ")}) {
1882
+ ${fields}
922
1883
  }
923
1884
  }
924
- `
1885
+ `,
1886
+ variables
925
1887
  };
926
1888
  },
927
- myDeck() {
1889
+ upsertDatasetRecords() {
928
1890
  return {
929
1891
  query: `
930
- query MyDeck($id: UUID!) {
931
- myDeck(id: $id) {
932
- ${DECK_FIELDS}
1892
+ mutation DatasetRecordsUpsert($input: DatasetRecordsUpsertInput!) {
1893
+ datasetRecordsUpsert(input: $input) {
1894
+ ${DATASET_RECORDS_UPSERT_PAYLOAD_FIELDS}
933
1895
  }
934
1896
  }
935
1897
  `
936
1898
  };
937
1899
  },
938
- fetchDeckBySlug() {
1900
+ deleteDatasetRecords() {
939
1901
  return {
940
1902
  query: `
941
- query FetchDeckBySlug($publisherSlug: String!, $gameKey: String!, $slug: String!) {
942
- fetchDeckBySlug(publisherSlug: $publisherSlug, gameKey: $gameKey, slug: $slug) {
943
- ${DECK_FIELDS}
1903
+ mutation DatasetRecordsDelete($input: DatasetRecordsDeleteInput!) {
1904
+ datasetRecordsDelete(input: $input) {
1905
+ ${DATASET_RECORD_DELETE_JOB_FIELDS}
944
1906
  }
945
1907
  }
946
1908
  `
947
1909
  };
948
1910
  },
949
- fetchDeckByExternalRef() {
1911
+ datasetRecordDeleteJob() {
950
1912
  return {
951
1913
  query: `
952
- query FetchDeckByExternalRef($externalRef: String!) {
953
- fetchDeckByExternalRef(externalRef: $externalRef) {
954
- ${DECK_FIELDS}
1914
+ query DatasetRecordDeleteJob($id: UUID!) {
1915
+ datasetRecordDeleteJob(id: $id) {
1916
+ ${DATASET_RECORD_DELETE_JOB_FIELDS}
955
1917
  }
956
1918
  }
957
1919
  `
958
1920
  };
959
1921
  },
960
- deckVersion() {
1922
+ datasetRecordDeleteJobs(params) {
1923
+ const variables = { publisherId: params.publisherId };
1924
+ const args = ["publisherId: $publisherId"];
1925
+ const defs = ["$publisherId: UUID!"];
1926
+ if (params.datasetId !== void 0) {
1927
+ defs.push("$datasetId: UUID");
1928
+ args.push("datasetId: $datasetId");
1929
+ variables["datasetId"] = params.datasetId;
1930
+ }
1931
+ if (params.status !== void 0) {
1932
+ defs.push("$status: DatasetRecordDeleteJobStatus");
1933
+ args.push("status: $status");
1934
+ variables["status"] = params.status;
1935
+ }
1936
+ if (params.first !== void 0) {
1937
+ defs.push("$first: Int");
1938
+ args.push("first: $first");
1939
+ variables["first"] = params.first;
1940
+ }
1941
+ if (params.after !== void 0) {
1942
+ defs.push("$after: String");
1943
+ args.push("after: $after");
1944
+ variables["after"] = params.after;
1945
+ }
961
1946
  return {
962
1947
  query: `
963
- query DeckVersion($id: UUID!) {
964
- deckVersion(id: $id) {
965
- ${DECK_VERSION_FIELDS}
1948
+ query DatasetRecordDeleteJobs(${defs.join(", ")}) {
1949
+ datasetRecordDeleteJobs(${args.join(", ")}) {
1950
+ ${connectionFields(DATASET_RECORD_DELETE_JOB_FIELDS)}
1951
+ }
1952
+ }
1953
+ `,
1954
+ variables
1955
+ };
1956
+ },
1957
+ datasetImportPreview() {
1958
+ return {
1959
+ query: `
1960
+ query DatasetImportPreview($input: DatasetImportPreviewInput!) {
1961
+ datasetImportPreview(input: $input) {
1962
+ ${DATASET_IMPORT_PREVIEW_FIELDS}
1963
+ }
1964
+ }
1965
+ `
1966
+ };
1967
+ },
1968
+ datasetImportValidate() {
1969
+ return {
1970
+ query: `
1971
+ query DatasetImportValidate($input: DatasetImportValidateInput!) {
1972
+ datasetImportValidate(input: $input) {
1973
+ ${BULK_IMPORT_RESULT_FIELDS}
1974
+ }
1975
+ }
1976
+ `
1977
+ };
1978
+ },
1979
+ datasetImportFromFile() {
1980
+ return {
1981
+ query: `
1982
+ mutation DatasetImportFromFile($input: DatasetImportFromFileInput!) {
1983
+ datasetImportFromFile(input: $input) {
1984
+ ${IMPORT_JOB_FIELDS}
1985
+ }
1986
+ }
1987
+ `
1988
+ };
1989
+ },
1990
+ datasetImportFromPayload() {
1991
+ return {
1992
+ query: `
1993
+ mutation DatasetImportFromPayload($input: DatasetImportFromPayloadInput!) {
1994
+ datasetImportFromPayload(input: $input) {
1995
+ ${IMPORT_JOB_FIELDS}
1996
+ }
1997
+ }
1998
+ `
1999
+ };
2000
+ },
2001
+ datasetImportFromUrl() {
2002
+ return {
2003
+ query: `
2004
+ mutation DatasetImportFromUrl($input: DatasetImportFromUrlInput!) {
2005
+ datasetImportFromUrl(input: $input) {
2006
+ ${IMPORT_JOB_FIELDS}
2007
+ }
2008
+ }
2009
+ `
2010
+ };
2011
+ },
2012
+ importJob() {
2013
+ return {
2014
+ query: `
2015
+ query ImportJob($id: UUID!) {
2016
+ importJob(id: $id) {
2017
+ ${IMPORT_JOB_FIELDS}
2018
+ }
2019
+ }
2020
+ `
2021
+ };
2022
+ },
2023
+ importJobs(params) {
2024
+ const variables = { publisherId: params.publisherId };
2025
+ const args = ["publisherId: $publisherId"];
2026
+ const defs = ["$publisherId: UUID!"];
2027
+ if (params.datasetId !== void 0) {
2028
+ defs.push("$datasetId: UUID");
2029
+ args.push("datasetId: $datasetId");
2030
+ variables["datasetId"] = params.datasetId;
2031
+ }
2032
+ if (params.status !== void 0) {
2033
+ defs.push("$status: ImportJobStatus");
2034
+ args.push("status: $status");
2035
+ variables["status"] = params.status;
2036
+ }
2037
+ if (params.first !== void 0) {
2038
+ defs.push("$first: Int");
2039
+ args.push("first: $first");
2040
+ variables["first"] = params.first;
2041
+ }
2042
+ if (params.after !== void 0) {
2043
+ defs.push("$after: String");
2044
+ args.push("after: $after");
2045
+ variables["after"] = params.after;
2046
+ }
2047
+ return {
2048
+ query: `
2049
+ query ImportJobs(${defs.join(", ")}) {
2050
+ importJobs(${args.join(", ")}) {
2051
+ ${connectionFields(IMPORT_JOB_FIELDS)}
2052
+ }
2053
+ }
2054
+ `,
2055
+ variables
2056
+ };
2057
+ },
2058
+ importJobCancel() {
2059
+ return {
2060
+ query: `
2061
+ mutation ImportJobCancel($id: UUID!) {
2062
+ importJobCancel(id: $id) {
2063
+ ${IMPORT_JOB_FIELDS}
2064
+ }
2065
+ }
2066
+ `
2067
+ };
2068
+ },
2069
+ importJobLogs(params) {
2070
+ const variables = { importJobId: params.importJobId };
2071
+ const args = ["id: $importJobId"];
2072
+ const logArgs = [];
2073
+ const defs = ["$importJobId: UUID!"];
2074
+ if (params.level !== void 0) {
2075
+ defs.push("$level: ImportLogLevel");
2076
+ logArgs.push("level: $level");
2077
+ variables["level"] = params.level;
2078
+ }
2079
+ if (params.datasetKey !== void 0) {
2080
+ defs.push("$datasetKey: String");
2081
+ logArgs.push("datasetKey: $datasetKey");
2082
+ variables["datasetKey"] = params.datasetKey;
2083
+ }
2084
+ if (params.first !== void 0) {
2085
+ defs.push("$first: Int");
2086
+ logArgs.push("first: $first");
2087
+ variables["first"] = params.first;
2088
+ }
2089
+ if (params.after !== void 0) {
2090
+ defs.push("$after: String");
2091
+ logArgs.push("after: $after");
2092
+ variables["after"] = params.after;
2093
+ }
2094
+ const logArgStr = logArgs.length > 0 ? `(${logArgs.join(", ")})` : "";
2095
+ return {
2096
+ query: `
2097
+ query ImportJobLogs(${defs.join(", ")}) {
2098
+ importJob(${args.join(", ")}) {
2099
+ logs${logArgStr} {
2100
+ ${connectionFields(IMPORT_JOB_LOG_FIELDS)}
2101
+ }
2102
+ }
2103
+ }
2104
+ `,
2105
+ variables
2106
+ };
2107
+ },
2108
+ gameImportPreview() {
2109
+ return {
2110
+ query: `
2111
+ query GameImportPreview($input: GameImportPreviewInput!) {
2112
+ gameImportPreview(input: $input) {
2113
+ ${GAME_IMPORT_PREVIEW_FIELDS}
2114
+ }
2115
+ }
2116
+ `
2117
+ };
2118
+ },
2119
+ gameImportFromFile() {
2120
+ return {
2121
+ query: `
2122
+ mutation GameImportFromFile($input: GameImportFromFileInput!) {
2123
+ gameImportFromFile(input: $input) {
2124
+ ${GAME_IMPORT_JOB_FIELDS}
2125
+ }
2126
+ }
2127
+ `
2128
+ };
2129
+ },
2130
+ gameImportFromPayload() {
2131
+ return {
2132
+ query: `
2133
+ mutation GameImportFromPayload($input: GameImportFromPayloadInput!) {
2134
+ gameImportFromPayload(input: $input) {
2135
+ ${GAME_IMPORT_JOB_FIELDS}
2136
+ }
2137
+ }
2138
+ `
2139
+ };
2140
+ },
2141
+ gameImportFromUrl() {
2142
+ return {
2143
+ query: `
2144
+ mutation GameImportFromUrl($input: GameImportFromUrlInput!) {
2145
+ gameImportFromUrl(input: $input) {
2146
+ ${GAME_IMPORT_JOB_FIELDS}
2147
+ }
2148
+ }
2149
+ `
2150
+ };
2151
+ },
2152
+ gameImportJob() {
2153
+ return {
2154
+ query: `
2155
+ query GameImportJob($id: UUID!) {
2156
+ gameImportJob(id: $id) {
2157
+ ${GAME_IMPORT_JOB_FIELDS}
2158
+ }
2159
+ }
2160
+ `
2161
+ };
2162
+ },
2163
+ gameImportJobs(params) {
2164
+ const variables = { gameId: params.gameId };
2165
+ const args = ["gameId: $gameId"];
2166
+ const defs = ["$gameId: UUID!"];
2167
+ if (params.status !== void 0) {
2168
+ defs.push("$status: ImportJobStatus");
2169
+ args.push("status: $status");
2170
+ variables["status"] = params.status;
2171
+ }
2172
+ if (params.first !== void 0) {
2173
+ defs.push("$first: Int");
2174
+ args.push("first: $first");
2175
+ variables["first"] = params.first;
2176
+ }
2177
+ if (params.after !== void 0) {
2178
+ defs.push("$after: String");
2179
+ args.push("after: $after");
2180
+ variables["after"] = params.after;
2181
+ }
2182
+ return {
2183
+ query: `
2184
+ query GameImportJobs(${defs.join(", ")}) {
2185
+ gameImportJobs(${args.join(", ")}) {
2186
+ ${connectionFields(GAME_IMPORT_JOB_FIELDS)}
2187
+ }
2188
+ }
2189
+ `,
2190
+ variables
2191
+ };
2192
+ },
2193
+ gameImportJobCancel() {
2194
+ return {
2195
+ query: `
2196
+ mutation GameImportJobCancel($id: UUID!) {
2197
+ gameImportJobCancel(id: $id) {
2198
+ ${GAME_IMPORT_JOB_FIELDS}
2199
+ }
2200
+ }
2201
+ `
2202
+ };
2203
+ },
2204
+ file() {
2205
+ return {
2206
+ query: `
2207
+ query File($id: UUID!) {
2208
+ file(id: $id) {
2209
+ ${FILE_FIELDS}
2210
+ }
2211
+ }
2212
+ `
2213
+ };
2214
+ },
2215
+ fileUploadRequest() {
2216
+ return {
2217
+ query: `
2218
+ mutation FileUploadRequest($input: FileUploadInput!) {
2219
+ fileUploadRequest(input: $input) {
2220
+ ${PRESIGNED_UPLOAD_FIELDS}
2221
+ }
2222
+ }
2223
+ `
2224
+ };
2225
+ },
2226
+ fileUploadConfirm() {
2227
+ return {
2228
+ query: `
2229
+ mutation FileUploadConfirm($id: UUID!) {
2230
+ fileUploadConfirm(id: $id) {
2231
+ ${FILE_FIELDS}
2232
+ }
2233
+ }
2234
+ `
2235
+ };
2236
+ },
2237
+ fileDelete() {
2238
+ return {
2239
+ query: `
2240
+ mutation FileDelete($id: UUID!) {
2241
+ fileDelete(id: $id)
2242
+ }
2243
+ `
2244
+ };
2245
+ },
2246
+ exportJob() {
2247
+ return {
2248
+ query: `
2249
+ query ExportJob($id: UUID!) {
2250
+ exportJob(id: $id) {
2251
+ ${EXPORT_JOB_FIELDS}
2252
+ }
2253
+ }
2254
+ `
2255
+ };
2256
+ },
2257
+ exportJobs(params) {
2258
+ const variables = { publisherId: params.publisherId };
2259
+ const args = ["publisherId: $publisherId"];
2260
+ const defs = ["$publisherId: UUID!"];
2261
+ if (params.gameId !== void 0) {
2262
+ defs.push("$gameId: UUID");
2263
+ args.push("gameId: $gameId");
2264
+ variables["gameId"] = params.gameId;
2265
+ }
2266
+ if (params.datasetId !== void 0) {
2267
+ defs.push("$datasetId: UUID");
2268
+ args.push("datasetId: $datasetId");
2269
+ variables["datasetId"] = params.datasetId;
2270
+ }
2271
+ if (params.status !== void 0) {
2272
+ defs.push("$status: ExportJobStatus");
2273
+ args.push("status: $status");
2274
+ variables["status"] = params.status;
2275
+ }
2276
+ if (params.first !== void 0) {
2277
+ defs.push("$first: Int");
2278
+ args.push("first: $first");
2279
+ variables["first"] = params.first;
2280
+ }
2281
+ if (params.after !== void 0) {
2282
+ defs.push("$after: String");
2283
+ args.push("after: $after");
2284
+ variables["after"] = params.after;
2285
+ }
2286
+ return {
2287
+ query: `
2288
+ query ExportJobs(${defs.join(", ")}) {
2289
+ exportJobs(${args.join(", ")}) {
2290
+ ${connectionFields(EXPORT_JOB_FIELDS)}
2291
+ }
2292
+ }
2293
+ `,
2294
+ variables
2295
+ };
2296
+ },
2297
+ datasetExport() {
2298
+ return {
2299
+ query: `
2300
+ mutation DatasetExport($input: DatasetExportInput!) {
2301
+ datasetExport(input: $input) {
2302
+ ${EXPORT_JOB_FIELDS}
2303
+ }
2304
+ }
2305
+ `
2306
+ };
2307
+ },
2308
+ exportJobCancel() {
2309
+ return {
2310
+ query: `
2311
+ mutation ExportJobCancel($id: UUID!) {
2312
+ exportJobCancel(id: $id) {
2313
+ ${EXPORT_JOB_FIELDS}
2314
+ }
2315
+ }
2316
+ `
2317
+ };
2318
+ },
2319
+ exportJobRefreshUrl() {
2320
+ return {
2321
+ query: `
2322
+ mutation ExportJobRefreshUrl($id: UUID!) {
2323
+ exportJobRefreshUrl(id: $id) {
2324
+ ${EXPORT_JOB_FIELDS}
2325
+ }
2326
+ }
2327
+ `
2328
+ };
2329
+ },
2330
+ // Decks
2331
+ listMyDecks(params = {}) {
2332
+ const variables = {};
2333
+ const args = [];
2334
+ const defs = [];
2335
+ if (params.first !== void 0) {
2336
+ defs.push("$first: Int");
2337
+ args.push("first: $first");
2338
+ variables["first"] = params.first;
2339
+ }
2340
+ if (params.after !== void 0) {
2341
+ defs.push("$after: String");
2342
+ args.push("after: $after");
2343
+ variables["after"] = params.after;
2344
+ }
2345
+ if (params.includeArchived !== void 0) {
2346
+ defs.push("$includeArchived: Boolean");
2347
+ args.push("includeArchived: $includeArchived");
2348
+ variables["includeArchived"] = params.includeArchived;
2349
+ }
2350
+ const defStr = defs.length > 0 ? `(${defs.join(", ")})` : "";
2351
+ const argStr = args.length > 0 ? `(${args.join(", ")})` : "";
2352
+ return {
2353
+ query: `
2354
+ query MyDecks${defStr} {
2355
+ myDecks${argStr} {
2356
+ ${connectionFields(DECK_FIELDS)}
2357
+ }
2358
+ }
2359
+ `,
2360
+ variables
2361
+ };
2362
+ },
2363
+ viewerDecks(params = {}) {
2364
+ const variables = {};
2365
+ const args = [];
2366
+ const defs = [];
2367
+ if (params.filter !== void 0) {
2368
+ defs.push("$filter: ViewerDecksFilterInput");
2369
+ args.push("filter: $filter");
2370
+ variables["filter"] = params.filter;
2371
+ }
2372
+ if (params.first !== void 0) {
2373
+ defs.push("$first: Int");
2374
+ args.push("first: $first");
2375
+ variables["first"] = params.first;
2376
+ }
2377
+ if (params.after !== void 0) {
2378
+ defs.push("$after: String");
2379
+ args.push("after: $after");
2380
+ variables["after"] = params.after;
2381
+ }
2382
+ const defStr = defs.length > 0 ? `(${defs.join(", ")})` : "";
2383
+ const argStr = args.length > 0 ? `(${args.join(", ")})` : "";
2384
+ return {
2385
+ query: `
2386
+ query ViewerDecks${defStr} {
2387
+ viewerDecks${argStr} {
2388
+ ${connectionFields(DECK_FIELDS)}
2389
+ }
2390
+ }
2391
+ `,
2392
+ variables
2393
+ };
2394
+ },
2395
+ appDecks(params = {}) {
2396
+ const variables = {};
2397
+ const args = [];
2398
+ const defs = [];
2399
+ if (params.filter !== void 0) {
2400
+ defs.push("$filter: AppDecksFilterInput");
2401
+ args.push("filter: $filter");
2402
+ variables["filter"] = params.filter;
2403
+ }
2404
+ if (params.first !== void 0) {
2405
+ defs.push("$first: Int");
2406
+ args.push("first: $first");
2407
+ variables["first"] = params.first;
2408
+ }
2409
+ if (params.after !== void 0) {
2410
+ defs.push("$after: String");
2411
+ args.push("after: $after");
2412
+ variables["after"] = params.after;
2413
+ }
2414
+ const defStr = defs.length > 0 ? `(${defs.join(", ")})` : "";
2415
+ const argStr = args.length > 0 ? `(${args.join(", ")})` : "";
2416
+ return {
2417
+ query: `
2418
+ query AppDecks${defStr} {
2419
+ appDecks${argStr} {
2420
+ ${connectionFields(DECK_FIELDS)}
2421
+ }
2422
+ }
2423
+ `,
2424
+ variables
2425
+ };
2426
+ },
2427
+ publicDecks(params = {}) {
2428
+ const variables = {};
2429
+ const args = [];
2430
+ const defs = [];
2431
+ if (params.filter !== void 0) {
2432
+ defs.push("$filter: PublicDecksFilterInput");
2433
+ args.push("filter: $filter");
2434
+ variables["filter"] = params.filter;
2435
+ }
2436
+ if (params.first !== void 0) {
2437
+ defs.push("$first: Int");
2438
+ args.push("first: $first");
2439
+ variables["first"] = params.first;
2440
+ }
2441
+ if (params.after !== void 0) {
2442
+ defs.push("$after: String");
2443
+ args.push("after: $after");
2444
+ variables["after"] = params.after;
2445
+ }
2446
+ const defStr = defs.length > 0 ? `(${defs.join(", ")})` : "";
2447
+ const argStr = args.length > 0 ? `(${args.join(", ")})` : "";
2448
+ return {
2449
+ query: `
2450
+ query PublicDecks${defStr} {
2451
+ publicDecks${argStr} {
2452
+ ${connectionFields(DECK_FIELDS)}
2453
+ }
2454
+ }
2455
+ `,
2456
+ variables
2457
+ };
2458
+ },
2459
+ fetchDeckById() {
2460
+ return {
2461
+ query: `
2462
+ query FetchDeck($id: UUID!) {
2463
+ fetchDeck(id: $id) {
2464
+ ${DECK_FIELDS}
2465
+ }
2466
+ }
2467
+ `
2468
+ };
2469
+ },
2470
+ deckById() {
2471
+ return {
2472
+ query: `
2473
+ query Deck($id: UUID!) {
2474
+ deck(id: $id) {
2475
+ ${DECK_FIELDS}
2476
+ }
2477
+ }
2478
+ `
2479
+ };
2480
+ },
2481
+ myDeck() {
2482
+ return {
2483
+ query: `
2484
+ query MyDeck($id: UUID!) {
2485
+ myDeck(id: $id) {
2486
+ ${DECK_FIELDS}
2487
+ }
2488
+ }
2489
+ `
2490
+ };
2491
+ },
2492
+ fetchDeckBySlug() {
2493
+ return {
2494
+ query: `
2495
+ query FetchDeckBySlug($publisherSlug: String!, $gameKey: String!, $slug: String!) {
2496
+ fetchDeckBySlug(publisherSlug: $publisherSlug, gameKey: $gameKey, slug: $slug) {
2497
+ ${DECK_FIELDS}
2498
+ }
2499
+ }
2500
+ `
2501
+ };
2502
+ },
2503
+ deckBySlug() {
2504
+ return {
2505
+ query: `
2506
+ query DeckBySlug($publisherSlug: String!, $gameKey: String!, $slug: String!) {
2507
+ deckBySlug(publisherSlug: $publisherSlug, gameKey: $gameKey, slug: $slug) {
2508
+ ${DECK_FIELDS}
2509
+ }
2510
+ }
2511
+ `
2512
+ };
2513
+ },
2514
+ fetchDeckByExternalRef() {
2515
+ return {
2516
+ query: `
2517
+ query FetchDeckByExternalRef($externalRef: String!) {
2518
+ fetchDeckByExternalRef(externalRef: $externalRef) {
2519
+ ${DECK_FIELDS}
2520
+ }
2521
+ }
2522
+ `
2523
+ };
2524
+ },
2525
+ deckByExternalRef() {
2526
+ return {
2527
+ query: `
2528
+ query DeckByExternalRef($externalRef: String!) {
2529
+ deckByExternalRef(externalRef: $externalRef) {
2530
+ ${DECK_FIELDS}
2531
+ }
2532
+ }
2533
+ `
2534
+ };
2535
+ },
2536
+ deckVersion() {
2537
+ return {
2538
+ query: `
2539
+ query DeckVersion($id: UUID!) {
2540
+ deckVersion(id: $id) {
2541
+ ${DECK_VERSION_FIELDS}
2542
+ }
2543
+ }
2544
+ `
2545
+ };
2546
+ },
2547
+ deckVersions(params = {}) {
2548
+ const variables = {};
2549
+ const args = ["deckId: $deckId"];
2550
+ const defs = ["$deckId: UUID!"];
2551
+ if (params.first !== void 0) {
2552
+ defs.push("$first: Int");
2553
+ args.push("first: $first");
2554
+ variables["first"] = params.first;
2555
+ }
2556
+ if (params.after !== void 0) {
2557
+ defs.push("$after: String");
2558
+ args.push("after: $after");
2559
+ variables["after"] = params.after;
2560
+ }
2561
+ return {
2562
+ query: `
2563
+ query DeckVersions(${defs.join(", ")}) {
2564
+ deckVersions(${args.join(", ")}) {
2565
+ ${connectionFields(DECK_VERSION_FIELDS)}
2566
+ }
2567
+ }
2568
+ `,
2569
+ variables
2570
+ };
2571
+ },
2572
+ deckPreview() {
2573
+ return {
2574
+ query: `
2575
+ query DeckPreview($token: String!) {
2576
+ deckPreview(token: $token) {
2577
+ ${DECK_FIELDS}
2578
+ }
2579
+ }
2580
+ `
2581
+ };
2582
+ },
2583
+ deckEmbed() {
2584
+ return {
2585
+ query: `
2586
+ query DeckEmbed($token: String!) {
2587
+ deckEmbed(token: $token) {
2588
+ ${DECK_FIELDS}
2589
+ }
2590
+ }
2591
+ `
2592
+ };
2593
+ },
2594
+ deckAccess() {
2595
+ return {
2596
+ query: `
2597
+ query DeckAccess($token: String!) {
2598
+ deckAccess(token: $token) {
2599
+ ${DECK_FIELDS}
2600
+ }
2601
+ }
2602
+ `
2603
+ };
2604
+ },
2605
+ deckDraftDiff() {
2606
+ return {
2607
+ query: `
2608
+ query DeckDraftDiff($id: UUID!) {
2609
+ deckDraftDiff(id: $id) {
2610
+ ${DECK_DIFF_FIELDS}
2611
+ }
2612
+ }
2613
+ `
2614
+ };
2615
+ },
2616
+ deckVersionDiff() {
2617
+ return {
2618
+ query: `
2619
+ query DeckVersionDiff($fromVersionId: UUID!, $toVersionId: UUID!) {
2620
+ deckVersionDiff(fromVersionId: $fromVersionId, toVersionId: $toVersionId) {
2621
+ ${DECK_DIFF_FIELDS}
2622
+ }
2623
+ }
2624
+ `
2625
+ };
2626
+ },
2627
+ deckHydrateEntries() {
2628
+ return {
2629
+ query: `
2630
+ query DeckHydrateEntries($input: DeckHydrateEntriesInput!) {
2631
+ deckHydrateEntries(input: $input) {
2632
+ ${DECK_HYDRATE_ENTRIES_PAYLOAD_FIELDS}
2633
+ }
2634
+ }
2635
+ `
2636
+ };
2637
+ },
2638
+ deckExport() {
2639
+ return {
2640
+ query: `
2641
+ query DeckExport($id: UUID!, $format: DeckExportFormat!) {
2642
+ deckExport(id: $id, format: $format) {
2643
+ ${DECK_EXPORT_PAYLOAD_FIELDS}
2644
+ }
2645
+ }
2646
+ `
2647
+ };
2648
+ },
2649
+ deckValidate() {
2650
+ return {
2651
+ query: `
2652
+ query DeckValidate($id: UUID!, $input: DeckValidateInput) {
2653
+ deckValidate(id: $id, input: $input) {
2654
+ ${DECK_VALIDATION_FIELDS}
2655
+ }
2656
+ }
2657
+ `
2658
+ };
2659
+ },
2660
+ deckSectionDefinitions(params = {}) {
2661
+ const variables = {};
2662
+ const args = [];
2663
+ const defs = [];
2664
+ if (params.publisherSlug !== void 0) {
2665
+ defs.push("$publisherSlug: String");
2666
+ args.push("publisherSlug: $publisherSlug");
2667
+ variables["publisherSlug"] = params.publisherSlug;
2668
+ }
2669
+ if (params.gameKey !== void 0) {
2670
+ defs.push("$gameKey: String");
2671
+ args.push("gameKey: $gameKey");
2672
+ variables["gameKey"] = params.gameKey;
2673
+ }
2674
+ if (params.gameId !== void 0) {
2675
+ defs.push("$gameId: UUID");
2676
+ args.push("gameId: $gameId");
2677
+ variables["gameId"] = params.gameId;
2678
+ }
2679
+ if (params.rulesetKey !== void 0) {
2680
+ defs.push("$rulesetKey: String");
2681
+ args.push("rulesetKey: $rulesetKey");
2682
+ variables["rulesetKey"] = params.rulesetKey;
2683
+ }
2684
+ if (params.rulesetVersionId !== void 0) {
2685
+ defs.push("$rulesetVersionId: UUID");
2686
+ args.push("rulesetVersionId: $rulesetVersionId");
2687
+ variables["rulesetVersionId"] = params.rulesetVersionId;
2688
+ }
2689
+ const defStr = defs.length > 0 ? `(${defs.join(", ")})` : "";
2690
+ const argStr = args.length > 0 ? `(${args.join(", ")})` : "";
2691
+ return {
2692
+ query: `
2693
+ query DeckSectionDefinitions${defStr} {
2694
+ deckSectionDefinitions${argStr} {
2695
+ ${DECK_SECTION_DEFINITION_FIELDS}
2696
+ }
2697
+ }
2698
+ `,
2699
+ variables
2700
+ };
2701
+ },
2702
+ deckCollaborators() {
2703
+ return {
2704
+ query: `
2705
+ query DeckCollaborators($deckId: UUID!) {
2706
+ deckCollaborators(deckId: $deckId) {
2707
+ ${DECK_COLLABORATOR_FIELDS}
2708
+ }
2709
+ }
2710
+ `
2711
+ };
2712
+ },
2713
+ deckEmbedTokens() {
2714
+ return {
2715
+ query: `
2716
+ query DeckEmbedTokens($deckId: UUID!) {
2717
+ deckEmbedTokens(deckId: $deckId) {
2718
+ ${DECK_EMBED_TOKEN_FIELDS}
2719
+ }
2720
+ }
2721
+ `
2722
+ };
2723
+ },
2724
+ deckAccessTokenIssuers() {
2725
+ return {
2726
+ query: `
2727
+ query DeckAccessTokenIssuers($deckId: UUID!) {
2728
+ deckAccessTokenIssuers(deckId: $deckId) {
2729
+ ${DECK_ACCESS_TOKEN_ISSUER_FIELDS}
2730
+ }
2731
+ }
2732
+ `
2733
+ };
2734
+ },
2735
+ deckApiApplicationAccesses() {
2736
+ return {
2737
+ query: `
2738
+ query DeckApiApplicationAccesses($deckId: UUID!, $includeRevoked: Boolean) {
2739
+ deckApiApplicationAccesses(deckId: $deckId, includeRevoked: $includeRevoked) {
2740
+ ${DECK_API_APPLICATION_ACCESS_FIELDS}
2741
+ }
2742
+ }
2743
+ `
2744
+ };
2745
+ },
2746
+ myDeckApiApplicationAccesses() {
2747
+ return {
2748
+ query: `
2749
+ query MyDeckApiApplicationAccesses($applicationId: UUID) {
2750
+ myDeckApiApplicationAccesses(applicationId: $applicationId) {
2751
+ ${DECK_API_APPLICATION_ACCESS_FIELDS}
2752
+ }
2753
+ }
2754
+ `
2755
+ };
2756
+ },
2757
+ deckImportFormats(params) {
2758
+ const variables = {};
2759
+ const args = [];
2760
+ const defs = [];
2761
+ if (params.publisherId !== void 0) {
2762
+ defs.push("$publisherId: UUID");
2763
+ args.push("publisherId: $publisherId");
2764
+ variables["publisherId"] = params.publisherId;
2765
+ }
2766
+ if (params.gameId !== void 0) {
2767
+ defs.push("$gameId: UUID");
2768
+ args.push("gameId: $gameId");
2769
+ variables["gameId"] = params.gameId;
2770
+ }
2771
+ if (params.includeArchived !== void 0) {
2772
+ defs.push("$includeArchived: Boolean");
2773
+ args.push("includeArchived: $includeArchived");
2774
+ variables["includeArchived"] = params.includeArchived;
2775
+ }
2776
+ if (params.first !== void 0) {
2777
+ defs.push("$first: Int");
2778
+ args.push("first: $first");
2779
+ variables["first"] = params.first;
2780
+ }
2781
+ if (params.after !== void 0) {
2782
+ defs.push("$after: String");
2783
+ args.push("after: $after");
2784
+ variables["after"] = params.after;
2785
+ }
2786
+ const defStr = defs.length > 0 ? `(${defs.join(", ")})` : "";
2787
+ const argStr = args.length > 0 ? `(${args.join(", ")})` : "";
2788
+ return {
2789
+ query: `
2790
+ query DeckImportFormats${defStr} {
2791
+ deckImportFormats${argStr} {
2792
+ ${connectionFields(DECK_IMPORT_FORMAT_DEFINITION_FIELDS)}
2793
+ }
2794
+ }
2795
+ `,
2796
+ variables
2797
+ };
2798
+ },
2799
+ deckImportFormat() {
2800
+ return {
2801
+ query: `
2802
+ query DeckImportFormat($id: UUID, $gameId: UUID, $key: String) {
2803
+ deckImportFormat(id: $id, gameId: $gameId, key: $key) {
2804
+ ${DECK_IMPORT_FORMAT_DEFINITION_FIELDS}
2805
+ }
2806
+ }
2807
+ `
2808
+ };
2809
+ },
2810
+ deckImportFormatTest() {
2811
+ return {
2812
+ query: `
2813
+ query DeckImportFormatTest($input: DeckImportFormatTestInput!) {
2814
+ deckImportFormatTest(input: $input) {
2815
+ ${DECK_IMPORT_FORMAT_TEST_PAYLOAD_FIELDS}
2816
+ }
2817
+ }
2818
+ `
2819
+ };
2820
+ },
2821
+ deckPreviewTokens() {
2822
+ return {
2823
+ query: `
2824
+ query DeckPreviewTokens($deckId: UUID!) {
2825
+ deckPreviewTokens(deckId: $deckId) {
2826
+ ${DECK_PREVIEW_TOKEN_FIELDS}
2827
+ }
2828
+ }
2829
+ `
2830
+ };
2831
+ },
2832
+ createDeck() {
2833
+ return {
2834
+ query: `
2835
+ mutation DeckCreate($input: DeckCreateInput!) {
2836
+ deckCreate(input: $input) {
2837
+ ${DECK_FIELDS}
2838
+ }
2839
+ }
2840
+ `
2841
+ };
2842
+ },
2843
+ updateDeck() {
2844
+ return {
2845
+ query: `
2846
+ mutation DeckUpdate($id: UUID!, $input: DeckUpdateInput!) {
2847
+ deckUpdate(id: $id, input: $input) {
2848
+ ${DECK_FIELDS}
2849
+ }
2850
+ }
2851
+ `
2852
+ };
2853
+ },
2854
+ deleteDeck() {
2855
+ return {
2856
+ query: `
2857
+ mutation DeckDelete($id: UUID!) {
2858
+ deckDelete(id: $id)
2859
+ }
2860
+ `
2861
+ };
2862
+ },
2863
+ archiveDeck() {
2864
+ return {
2865
+ query: `
2866
+ mutation DeckArchive($id: UUID!) {
2867
+ deckArchive(id: $id) {
2868
+ ${DECK_FIELDS}
966
2869
  }
967
2870
  }
968
2871
  `
969
2872
  };
970
2873
  },
971
- deckVersions(params = {}) {
972
- const variables = {};
973
- const args = ["deckId: $deckId"];
974
- const defs = ["$deckId: UUID!"];
975
- if (params.first !== void 0) {
976
- defs.push("$first: Int");
977
- args.push("first: $first");
978
- variables["first"] = params.first;
979
- }
980
- if (params.after !== void 0) {
981
- defs.push("$after: String");
982
- args.push("after: $after");
983
- variables["after"] = params.after;
984
- }
2874
+ restoreDeck() {
985
2875
  return {
986
2876
  query: `
987
- query DeckVersions(${defs.join(", ")}) {
988
- deckVersions(${args.join(", ")}) {
989
- ${connectionFields(DECK_VERSION_FIELDS)}
2877
+ mutation DeckRestore($id: UUID!) {
2878
+ deckRestore(id: $id) {
2879
+ ${DECK_FIELDS}
990
2880
  }
991
2881
  }
992
- `,
993
- variables
2882
+ `
994
2883
  };
995
2884
  },
996
- deckPreview() {
2885
+ unpublishDeck() {
997
2886
  return {
998
2887
  query: `
999
- query DeckPreview($token: String!) {
1000
- deckPreview(token: $token) {
2888
+ mutation DeckUnpublish($id: UUID!) {
2889
+ deckUnpublish(id: $id) {
1001
2890
  ${DECK_FIELDS}
1002
2891
  }
1003
2892
  }
1004
2893
  `
1005
2894
  };
1006
2895
  },
1007
- deckCollaborators() {
2896
+ addDeckEntry() {
1008
2897
  return {
1009
2898
  query: `
1010
- query DeckCollaborators($deckId: UUID!) {
1011
- deckCollaborators(deckId: $deckId) {
1012
- ${DECK_COLLABORATOR_FIELDS}
2899
+ mutation DeckEntryAdd($input: DeckEntryAddInput!) {
2900
+ deckEntryAdd(input: $input) {
2901
+ ${DECK_ENTRY_MUTATION_PAYLOAD_FIELDS}
1013
2902
  }
1014
2903
  }
1015
2904
  `
1016
2905
  };
1017
2906
  },
1018
- deckPreviewTokens() {
2907
+ updateDeckEntry() {
1019
2908
  return {
1020
2909
  query: `
1021
- query DeckPreviewTokens($deckId: UUID!) {
1022
- deckPreviewTokens(deckId: $deckId) {
1023
- ${DECK_PREVIEW_TOKEN_FIELDS}
2910
+ mutation DeckEntryUpdate($id: UUID!, $input: DeckEntryUpdateInput!) {
2911
+ deckEntryUpdate(id: $id, input: $input) {
2912
+ ${DECK_ENTRY_MUTATION_PAYLOAD_FIELDS}
1024
2913
  }
1025
2914
  }
1026
2915
  `
1027
2916
  };
1028
2917
  },
1029
- createDeck() {
2918
+ removeDeckEntry() {
1030
2919
  return {
1031
2920
  query: `
1032
- mutation DeckCreate($input: DeckCreateInput!) {
1033
- deckCreate(input: $input) {
1034
- ${DECK_FIELDS}
2921
+ mutation DeckEntryRemove($id: UUID!, $expectedDraftRevision: Int!) {
2922
+ deckEntryRemove(id: $id, expectedDraftRevision: $expectedDraftRevision) {
2923
+ ${DECK_ENTRY_MUTATION_PAYLOAD_FIELDS}
1035
2924
  }
1036
2925
  }
1037
2926
  `
1038
2927
  };
1039
2928
  },
1040
- updateDeck() {
2929
+ reorderDeckEntries() {
1041
2930
  return {
1042
2931
  query: `
1043
- mutation DeckUpdate($id: UUID!, $input: DeckUpdateInput!) {
1044
- deckUpdate(id: $id, input: $input) {
1045
- ${DECK_FIELDS}
2932
+ mutation DeckEntryReorder($deckId: UUID!, $input: DeckEntryReorderInput!) {
2933
+ deckEntryReorder(deckId: $deckId, input: $input) {
2934
+ ${DECK_ENTRY_REORDER_PAYLOAD_FIELDS}
1046
2935
  }
1047
2936
  }
1048
2937
  `
1049
2938
  };
1050
2939
  },
1051
- deleteDeck() {
2940
+ replaceDeckEntries() {
1052
2941
  return {
1053
2942
  query: `
1054
- mutation DeckDelete($id: UUID!) {
1055
- deckDelete(id: $id)
2943
+ mutation DeckEntriesReplace($deckId: UUID!, $input: DeckEntriesReplaceInput!) {
2944
+ deckEntriesReplace(deckId: $deckId, input: $input) {
2945
+ ${DECK_ENTRIES_REPLACE_PAYLOAD_FIELDS}
2946
+ }
2947
+ }
2948
+ `
2949
+ };
2950
+ },
2951
+ importDeck() {
2952
+ return {
2953
+ query: `
2954
+ mutation DeckImport($input: DeckImportInput!) {
2955
+ deckImport(input: $input) {
2956
+ ${DECK_IMPORT_PAYLOAD_FIELDS}
2957
+ }
2958
+ }
2959
+ `
2960
+ };
2961
+ },
2962
+ createDeckImportFormat() {
2963
+ return {
2964
+ query: `
2965
+ mutation DeckImportFormatCreate($input: DeckImportFormatCreateInput!) {
2966
+ deckImportFormatCreate(input: $input) {
2967
+ ${DECK_IMPORT_FORMAT_DEFINITION_FIELDS}
2968
+ }
2969
+ }
2970
+ `
2971
+ };
2972
+ },
2973
+ updateDeckImportFormat() {
2974
+ return {
2975
+ query: `
2976
+ mutation DeckImportFormatUpdate($id: UUID!, $input: DeckImportFormatUpdateInput!) {
2977
+ deckImportFormatUpdate(id: $id, input: $input) {
2978
+ ${DECK_IMPORT_FORMAT_DEFINITION_FIELDS}
2979
+ }
2980
+ }
2981
+ `
2982
+ };
2983
+ },
2984
+ archiveDeckImportFormat() {
2985
+ return {
2986
+ query: `
2987
+ mutation DeckImportFormatArchive($id: UUID!) {
2988
+ deckImportFormatArchive(id: $id) {
2989
+ ${DECK_IMPORT_FORMAT_DEFINITION_FIELDS}
2990
+ }
2991
+ }
2992
+ `
2993
+ };
2994
+ },
2995
+ unarchiveDeckImportFormat() {
2996
+ return {
2997
+ query: `
2998
+ mutation DeckImportFormatUnarchive($id: UUID!) {
2999
+ deckImportFormatUnarchive(id: $id) {
3000
+ ${DECK_IMPORT_FORMAT_DEFINITION_FIELDS}
3001
+ }
3002
+ }
3003
+ `
3004
+ };
3005
+ },
3006
+ upsertDeckByExternalRef() {
3007
+ return {
3008
+ query: `
3009
+ mutation DeckUpsertByExternalRef($input: DeckUpsertByExternalRefInput!) {
3010
+ deckUpsertByExternalRef(input: $input) {
3011
+ deck {
3012
+ ${DECK_FIELDS}
3013
+ }
3014
+ created
3015
+ idempotentReplay
3016
+ }
3017
+ }
3018
+ `
3019
+ };
3020
+ },
3021
+ claimDeck() {
3022
+ return {
3023
+ query: `
3024
+ mutation DeckClaim($id: UUID!, $input: DeckClaimInput!) {
3025
+ deckClaim(id: $id, input: $input) {
3026
+ ${DECK_OWNERSHIP_TRANSFER_PAYLOAD_FIELDS}
3027
+ }
3028
+ }
3029
+ `
3030
+ };
3031
+ },
3032
+ transferDeckOwnership() {
3033
+ return {
3034
+ query: `
3035
+ mutation DeckTransferOwnership($id: UUID!, $input: DeckTransferOwnershipInput!) {
3036
+ deckTransferOwnership(id: $id, input: $input) {
3037
+ ${DECK_OWNERSHIP_TRANSFER_PAYLOAD_FIELDS}
3038
+ }
3039
+ }
3040
+ `
3041
+ };
3042
+ },
3043
+ copyDeck() {
3044
+ return {
3045
+ query: `
3046
+ mutation DeckCopy($id: UUID!, $input: DeckCopyInput!) {
3047
+ deckCopy(id: $id, input: $input) {
3048
+ ${DECK_COPY_PAYLOAD_FIELDS}
3049
+ }
1056
3050
  }
1057
3051
  `
1058
3052
  };
@@ -1062,7 +3056,18 @@ ${RESOLVED_LINKS_FIELDS}` : selectedRecordFields;
1062
3056
  query: `
1063
3057
  mutation DeckPublish($id: UUID!, $input: DeckPublishInput!) {
1064
3058
  deckPublish(id: $id, input: $input) {
1065
- ${DECK_VERSION_FIELDS}
3059
+ ${DECK_PUBLISH_PAYLOAD_FIELDS}
3060
+ }
3061
+ }
3062
+ `
3063
+ };
3064
+ },
3065
+ removeInvalidDeckEntries() {
3066
+ return {
3067
+ query: `
3068
+ mutation DeckRemoveInvalidEntries($id: UUID!, $input: DeckRemoveInvalidEntriesInput!) {
3069
+ deckRemoveInvalidEntries(id: $id, input: $input) {
3070
+ ${DECK_FIELDS}
1066
3071
  }
1067
3072
  }
1068
3073
  `
@@ -1111,21 +3116,238 @@ ${RESOLVED_LINKS_FIELDS}` : selectedRecordFields;
1111
3116
  `
1112
3117
  };
1113
3118
  },
3119
+ createDeckEmbedToken() {
3120
+ return {
3121
+ query: `
3122
+ mutation DeckEmbedTokenCreate($input: DeckEmbedTokenCreateInput!) {
3123
+ deckEmbedTokenCreate(input: $input) {
3124
+ token
3125
+ embedToken {
3126
+ ${DECK_EMBED_TOKEN_FIELDS}
3127
+ }
3128
+ }
3129
+ }
3130
+ `
3131
+ };
3132
+ },
3133
+ revokeDeckEmbedToken() {
3134
+ return {
3135
+ query: `
3136
+ mutation DeckEmbedTokenRevoke($id: UUID!) {
3137
+ deckEmbedTokenRevoke(id: $id)
3138
+ }
3139
+ `
3140
+ };
3141
+ },
3142
+ createDeckAccessTokenIssuer() {
3143
+ return {
3144
+ query: `
3145
+ mutation DeckAccessTokenIssuerCreate($input: DeckAccessTokenIssuerCreateInput!) {
3146
+ deckAccessTokenIssuerCreate(input: $input) {
3147
+ ${DECK_ACCESS_TOKEN_ISSUER_FIELDS}
3148
+ }
3149
+ }
3150
+ `
3151
+ };
3152
+ },
3153
+ revokeDeckAccessTokenIssuer() {
3154
+ return {
3155
+ query: `
3156
+ mutation DeckAccessTokenIssuerRevoke($id: UUID!) {
3157
+ deckAccessTokenIssuerRevoke(id: $id)
3158
+ }
3159
+ `
3160
+ };
3161
+ },
3162
+ revokeDeckAccessTokenIssuerSigningKey() {
3163
+ return {
3164
+ query: `
3165
+ mutation DeckAccessTokenIssuerSigningKeyRevoke($id: UUID!) {
3166
+ deckAccessTokenIssuerSigningKeyRevoke(id: $id) {
3167
+ ${DECK_ACCESS_TOKEN_ISSUER_FIELDS}
3168
+ }
3169
+ }
3170
+ `
3171
+ };
3172
+ },
3173
+ exchangeDeckAccessToken() {
3174
+ return {
3175
+ query: `
3176
+ mutation DeckAccessTokenExchange($input: DeckAccessTokenExchangeInput!) {
3177
+ deckAccessTokenExchange(input: $input) {
3178
+ token
3179
+ accessToken {
3180
+ ${DECK_ACCESS_TOKEN_FIELDS}
3181
+ }
3182
+ }
3183
+ }
3184
+ `
3185
+ };
3186
+ },
3187
+ grantDeckApiApplicationAccess() {
3188
+ return {
3189
+ query: `
3190
+ mutation DeckApiApplicationAccessGrant($input: DeckAPIApplicationAccessGrantInput!) {
3191
+ deckApiApplicationAccessGrant(input: $input) {
3192
+ ${DECK_API_APPLICATION_ACCESS_FIELDS}
3193
+ }
3194
+ }
3195
+ `
3196
+ };
3197
+ },
3198
+ revokeDeckApiApplicationAccess() {
3199
+ return {
3200
+ query: `
3201
+ mutation DeckApiApplicationAccessRevoke($deckId: UUID!, $apiApplicationId: UUID!) {
3202
+ deckApiApplicationAccessRevoke(deckId: $deckId, apiApplicationId: $apiApplicationId)
3203
+ }
3204
+ `
3205
+ };
3206
+ },
3207
+ revokeDeckAccessToken() {
3208
+ return {
3209
+ query: `
3210
+ mutation DeckAccessTokenRevoke($id: UUID!) {
3211
+ deckAccessTokenRevoke(id: $id)
3212
+ }
3213
+ `
3214
+ };
3215
+ },
1114
3216
  deckCreateVariables(input) {
1115
3217
  return { input };
1116
3218
  },
1117
3219
  deckUpdateVariables(id, input) {
1118
3220
  return { id, input };
1119
3221
  },
1120
- deckPublishVariables(id, input = {}) {
3222
+ deckEntryAddVariables(input) {
3223
+ return { input };
3224
+ },
3225
+ deckEntryUpdateVariables(id, input) {
3226
+ return { id, input };
3227
+ },
3228
+ deckEntryRemoveVariables(id, expectedDraftRevision) {
3229
+ return { id, expectedDraftRevision };
3230
+ },
3231
+ deckEntryReorderVariables(deckId, input) {
3232
+ return { deckId, input };
3233
+ },
3234
+ deckEntriesReplaceVariables(deckId, input) {
3235
+ return { deckId, input };
3236
+ },
3237
+ deckImportVariables(input) {
3238
+ return { input };
3239
+ },
3240
+ deckImportFormatCreateVariables(input) {
3241
+ return { input };
3242
+ },
3243
+ deckImportFormatUpdateVariables(id, input) {
3244
+ return { id, input };
3245
+ },
3246
+ deckImportFormatTestVariables(input) {
3247
+ return { input };
3248
+ },
3249
+ deckUpsertByExternalRefVariables(input) {
3250
+ return { input };
3251
+ },
3252
+ deckClaimVariables(id, input) {
3253
+ return { id, input };
3254
+ },
3255
+ deckTransferOwnershipVariables(id, input) {
3256
+ return { id, input };
3257
+ },
3258
+ deckCopyVariables(id, input) {
3259
+ return { id, input };
3260
+ },
3261
+ deckPublishVariables(id, input) {
1121
3262
  return { id, input };
1122
3263
  },
3264
+ deckValidateVariables(id, input) {
3265
+ return input === void 0 ? { id } : { id, input };
3266
+ },
3267
+ deckRemoveInvalidEntriesVariables(id, input) {
3268
+ return { id, input };
3269
+ },
3270
+ deckHydrateEntriesVariables(input) {
3271
+ return { input };
3272
+ },
3273
+ deckExportVariables(id, format) {
3274
+ return { id, format };
3275
+ },
3276
+ deckVersionDiffVariables(fromVersionId, toVersionId) {
3277
+ return { fromVersionId, toVersionId };
3278
+ },
1123
3279
  deckCollaboratorVariables(deckId, accountId, role) {
1124
3280
  return role === void 0 ? { deckId, accountId } : { deckId, accountId, role };
1125
3281
  },
1126
3282
  deckPreviewTokenCreateVariables(input) {
1127
3283
  return { input };
1128
3284
  },
3285
+ deckEmbedTokenCreateVariables(input) {
3286
+ return { input };
3287
+ },
3288
+ deckAccessTokenIssuerCreateVariables(input) {
3289
+ return { input };
3290
+ },
3291
+ deckAccessTokenExchangeVariables(input) {
3292
+ return { input };
3293
+ },
3294
+ deckApiApplicationAccessesVariables(deckId, includeRevoked) {
3295
+ return includeRevoked === void 0 ? { deckId } : { deckId, includeRevoked };
3296
+ },
3297
+ myDeckApiApplicationAccessesVariables(applicationId) {
3298
+ return applicationId === void 0 ? {} : { applicationId };
3299
+ },
3300
+ deckApiApplicationAccessGrantVariables(input) {
3301
+ return { input };
3302
+ },
3303
+ deckApiApplicationAccessRevokeVariables(deckId, apiApplicationId) {
3304
+ return { deckId, apiApplicationId };
3305
+ },
3306
+ gameCreateVariables(input) {
3307
+ return { input };
3308
+ },
3309
+ gameUpdateVariables(id, input) {
3310
+ return { id, input };
3311
+ },
3312
+ datasetImportPreviewVariables(input) {
3313
+ return { input };
3314
+ },
3315
+ datasetImportValidateVariables(input) {
3316
+ return { input };
3317
+ },
3318
+ datasetImportFromFileVariables(input) {
3319
+ return { input };
3320
+ },
3321
+ datasetImportFromPayloadVariables(input) {
3322
+ return { input };
3323
+ },
3324
+ datasetImportFromUrlVariables(input) {
3325
+ return { input };
3326
+ },
3327
+ gameImportPreviewVariables(input) {
3328
+ return { input };
3329
+ },
3330
+ gameImportFromFileVariables(input) {
3331
+ return { input };
3332
+ },
3333
+ gameImportFromPayloadVariables(input) {
3334
+ return { input };
3335
+ },
3336
+ gameImportFromUrlVariables(input) {
3337
+ return { input };
3338
+ },
3339
+ datasetRecordsUpsertVariables(input) {
3340
+ return { input };
3341
+ },
3342
+ datasetRecordsDeleteVariables(input) {
3343
+ return { input };
3344
+ },
3345
+ fileUploadRequestVariables(input) {
3346
+ return { input };
3347
+ },
3348
+ datasetExportVariables(input) {
3349
+ return { input };
3350
+ },
1129
3351
  // API Key Info
1130
3352
  fetchMe() {
1131
3353
  return {