@carddb/core 0.1.4 → 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.d.cts CHANGED
@@ -16,8 +16,16 @@ interface Cache {
16
16
  clear?(): void | Promise<void>;
17
17
  }
18
18
  interface CardDBConfig {
19
- /** API key for authentication (increases rate limits) */
19
+ /** API key for authentication. Prefer publishableKey or secretKey when credential intent matters. */
20
20
  apiKey?: string;
21
+ /** Browser-safe publishable API key for public reads and OAuth-enabled user flows. */
22
+ publishableKey?: string;
23
+ /** Server-side secret API key for app-owned deck workflows. Never expose this in browsers. */
24
+ secretKey?: string;
25
+ /** OAuth bearer token for user-authorized requests. */
26
+ accessToken?: string;
27
+ /** Client environment used by API-created resources when supported by the backend. */
28
+ environment?: 'TEST' | 'LIVE';
21
29
  /** GraphQL endpoint URL (defaults to production) */
22
30
  endpoint?: string;
23
31
  /** Request timeout in milliseconds */
@@ -120,6 +128,7 @@ interface Dataset {
120
128
  name: string;
121
129
  description: string | null;
122
130
  purpose: 'DATA' | 'RULES';
131
+ tcgplayerProductIdFieldKey: string | null;
123
132
  visibility: string;
124
133
  isArchived: boolean;
125
134
  publisher: PublisherRef | null;
@@ -140,14 +149,86 @@ interface DatasetRecord {
140
149
  datasetId: string;
141
150
  data: Record<string, unknown>;
142
151
  dataset: DatasetRef | null;
152
+ pricing?: TCGPlayerPricing | null;
143
153
  resolvedLinks?: ResolvedLink[];
144
154
  createdAt: string;
145
155
  updatedAt: string;
146
156
  }
157
+ interface TCGPlayerPricing {
158
+ productId: string;
159
+ prices: TCGPlayerPrice[];
160
+ }
161
+ interface TCGPlayerPrice {
162
+ subTypeName: string;
163
+ lowPrice: number | null;
164
+ midPrice: number | null;
165
+ highPrice: number | null;
166
+ marketPrice: number | null;
167
+ directLowPrice: number | null;
168
+ }
147
169
  type DeckVisibility = 'PRIVATE' | 'UNLISTED' | 'PUBLIC';
170
+ type DeckOwnerType = 'ACCOUNT' | 'API_APPLICATION';
171
+ type DeckEnvironment = 'TEST' | 'LIVE';
172
+ type DeckAccessMode = 'PUBLIC' | 'OWNER_ONLY' | 'AUTHORIZED_TOKEN';
173
+ type DeckDiscoverability = 'LISTED' | 'UNLISTED';
174
+ type DeckState = 'DRAFT' | 'PUBLISHED' | 'ARCHIVED' | 'DELETED';
175
+ type DeckTokenReadMode = 'PUBLIC' | 'PREVIEW' | 'EMBED' | 'FULL';
176
+ type DeckAccessTokenSigningAlgorithm = 'ED25519';
177
+ type DeckImportFormat = 'SIMPLE_TEXT' | 'CONFIGURED';
178
+ type DeckExportFormat = 'SIMPLE_TEXT';
148
179
  type DeckCollaboratorRole = 'VIEWER' | 'EDITOR';
180
+ type DeckAppAccessRetention = 'RETAIN' | 'REVOKE';
181
+ type DeckAPIApplicationAccessRole = 'VIEWER' | 'EDITOR' | 'OWNER';
182
+ type DeckAPIApplicationAccessGrantSource = 'APP_CREATED' | 'USER_SELECTED' | 'CLAIM_RETAINED' | 'TRANSFER_RETAINED';
183
+ type DeckValidationSeverity = 'BLOCKER' | 'WARNING';
184
+ interface ViewerDecksFilterInput {
185
+ environment?: DeckEnvironment;
186
+ gameId?: string;
187
+ rulesetId?: string;
188
+ state?: DeckState;
189
+ accessMode?: DeckAccessMode;
190
+ discoverability?: DeckDiscoverability;
191
+ createdByApiApplicationId?: string;
192
+ externalSubjectRef?: string;
193
+ updatedAfter?: string;
194
+ updatedBefore?: string;
195
+ publishedAfter?: string;
196
+ publishedBefore?: string;
197
+ includeArchived?: boolean;
198
+ }
199
+ interface AppDecksFilterInput {
200
+ environment?: DeckEnvironment;
201
+ gameId?: string;
202
+ rulesetId?: string;
203
+ state?: DeckState;
204
+ accessMode?: DeckAccessMode;
205
+ discoverability?: DeckDiscoverability;
206
+ externalSubjectRef?: string;
207
+ updatedAfter?: string;
208
+ updatedBefore?: string;
209
+ publishedAfter?: string;
210
+ publishedBefore?: string;
211
+ includeArchived?: boolean;
212
+ }
213
+ interface PublicDecksFilterInput {
214
+ environment?: DeckEnvironment;
215
+ gameId?: string;
216
+ rulesetId?: string;
217
+ accessMode?: DeckAccessMode;
218
+ discoverability?: DeckDiscoverability;
219
+ updatedAfter?: string;
220
+ updatedBefore?: string;
221
+ publishedAfter?: string;
222
+ publishedBefore?: string;
223
+ }
149
224
  interface Deck {
150
225
  id: string;
226
+ ownerType: DeckOwnerType;
227
+ ownerAccountId: string | null;
228
+ ownerApiApplicationId: string | null;
229
+ environment: DeckEnvironment;
230
+ createdByAccountId: string | null;
231
+ createdByApiApplicationId: string | null;
151
232
  accountId: string;
152
233
  apiApplicationId: string | null;
153
234
  gameId: string;
@@ -158,12 +239,26 @@ interface Deck {
158
239
  description: string | null;
159
240
  formatKey: string | null;
160
241
  visibility: DeckVisibility;
242
+ accessMode: DeckAccessMode;
243
+ discoverability: DeckDiscoverability;
244
+ state: DeckState;
245
+ archivedAt: string | null;
246
+ deletedAt: string | null;
247
+ unpublishedAt: string | null;
248
+ externalRefApiApplicationId: string | null;
161
249
  externalRef: string | null;
250
+ externalSubjectRef: string | null;
251
+ rulesetId: string | null;
162
252
  sourceUrl: string | null;
163
253
  metadata: Record<string, unknown>;
164
254
  entries: DeckEntry[];
255
+ sectionDefinitions: DeckSectionDefinition[];
165
256
  latestPublishedVersion: DeckVersion | null;
166
257
  publishedAt: string | null;
258
+ draftRevision: number;
259
+ draftUpdatedAt: string;
260
+ draftUpdatedByAccountId: string | null;
261
+ draftUpdatedByApiApplicationId: string | null;
167
262
  hasUnpublishedChanges: boolean;
168
263
  createdAt: string;
169
264
  updatedAt: string;
@@ -184,6 +279,14 @@ interface DeckVersion {
184
279
  entries: DeckEntry[];
185
280
  publishNote: string | null;
186
281
  computedDiff: Record<string, unknown>;
282
+ rulesetId: string | null;
283
+ rulesetVersionId: string | null;
284
+ cardDatasetId: string | null;
285
+ cardDatasetVersionId: string | null;
286
+ validatedAt: string | null;
287
+ validationSummary: Record<string, unknown>;
288
+ validatedAgainst: DeckValidatedAgainst | null;
289
+ sectionDefinitions: DeckSectionDefinition[];
187
290
  publishedByAccountId: string | null;
188
291
  publishedByApiApplicationId: string | null;
189
292
  createdAt: string;
@@ -198,6 +301,36 @@ interface DeckCollaborator {
198
301
  createdAt: string;
199
302
  updatedAt: string;
200
303
  }
304
+ interface DeckOwnershipTransferPayload {
305
+ deck: Deck;
306
+ retainedAppAccess: boolean;
307
+ }
308
+ interface DeckCopyPayload {
309
+ deck: Deck;
310
+ copiedFromDeckId: string;
311
+ retainedAppAccess: boolean;
312
+ }
313
+ interface DeckAccessApplication {
314
+ id: string;
315
+ name: string;
316
+ description: string | null;
317
+ revokedAt: string | null;
318
+ }
319
+ interface DeckAPIApplicationAccess {
320
+ id: string;
321
+ deckId: string;
322
+ deck: Deck;
323
+ apiApplicationId: string;
324
+ apiApplication: DeckAccessApplication;
325
+ role: DeckAPIApplicationAccessRole;
326
+ grantSource: DeckAPIApplicationAccessGrantSource;
327
+ externalRef: string | null;
328
+ createdByAccountId: string | null;
329
+ createdByApiApplicationId: string | null;
330
+ revokedAt: string | null;
331
+ createdAt: string;
332
+ updatedAt: string;
333
+ }
201
334
  interface DeckPreviewToken {
202
335
  id: string;
203
336
  deckId: string;
@@ -212,6 +345,56 @@ interface DeckPreviewTokenCreatePayload {
212
345
  token: string;
213
346
  previewToken: DeckPreviewToken;
214
347
  }
348
+ interface DeckEmbedToken {
349
+ id: string;
350
+ deckId: string;
351
+ apiApplicationId: string | null;
352
+ label: string | null;
353
+ readMode: DeckTokenReadMode;
354
+ allowedOrigins: string[];
355
+ externalSubject: string | null;
356
+ expiresAt: string | null;
357
+ revokedAt: string | null;
358
+ lastUsedAt: string | null;
359
+ createdAt: string;
360
+ updatedAt: string;
361
+ }
362
+ interface DeckEmbedTokenCreatePayload {
363
+ token: string;
364
+ embedToken: DeckEmbedToken;
365
+ }
366
+ interface DeckAccessTokenIssuer {
367
+ id: string;
368
+ deckId: string;
369
+ apiApplicationId: string;
370
+ label: string | null;
371
+ readModes: DeckTokenReadMode[];
372
+ maxTokenLifetimeSeconds: number;
373
+ directSigningAlg: DeckAccessTokenSigningAlgorithm | null;
374
+ directSigningKeyId: string | null;
375
+ directSigningPublicKey: string | null;
376
+ directSigningKeyRevokedAt: string | null;
377
+ revokedAt: string | null;
378
+ createdAt: string;
379
+ updatedAt: string;
380
+ }
381
+ interface DeckAccessToken {
382
+ id: string;
383
+ deckId: string;
384
+ apiApplicationId: string;
385
+ issuerId: string;
386
+ readMode: DeckTokenReadMode;
387
+ externalSubject: string | null;
388
+ expiresAt: string;
389
+ revokedAt: string | null;
390
+ lastUsedAt: string | null;
391
+ createdAt: string;
392
+ updatedAt: string;
393
+ }
394
+ interface DeckAccessTokenExchangePayload {
395
+ token: string;
396
+ accessToken: DeckAccessToken;
397
+ }
215
398
  interface DeckEntry {
216
399
  id: string;
217
400
  datasetId: string;
@@ -221,6 +404,7 @@ interface DeckEntry {
221
404
  section: string;
222
405
  sortOrder: number;
223
406
  annotations: Record<string, unknown>;
407
+ display: Record<string, unknown>;
224
408
  record: DatasetRecord | null;
225
409
  }
226
410
  interface DeckEntryInput {
@@ -238,29 +422,363 @@ interface DeckCreateInput {
238
422
  description?: string;
239
423
  formatKey?: string;
240
424
  visibility?: DeckVisibility;
425
+ accessMode?: DeckAccessMode;
426
+ discoverability?: DeckDiscoverability;
241
427
  externalRef?: string;
428
+ externalSubjectRef?: string;
429
+ rulesetId?: string;
430
+ sourceUrl?: string;
431
+ metadata?: Record<string, unknown>;
432
+ entries: DeckEntryInput[];
433
+ }
434
+ interface DeckUpsertByExternalRefInput {
435
+ externalRef: string;
436
+ idempotencyKey?: string;
437
+ expectedDraftRevision?: number;
438
+ publisherSlug: string;
439
+ gameKey: string;
440
+ title: string;
441
+ description?: string;
442
+ formatKey?: string;
443
+ visibility?: DeckVisibility;
444
+ accessMode?: DeckAccessMode;
445
+ discoverability?: DeckDiscoverability;
446
+ externalSubjectRef?: string;
447
+ rulesetId?: string;
242
448
  sourceUrl?: string;
243
449
  metadata?: Record<string, unknown>;
244
450
  entries: DeckEntryInput[];
245
451
  }
452
+ interface DeckUpsertByExternalRefPayload {
453
+ deck: Deck;
454
+ created: boolean;
455
+ idempotentReplay: boolean;
456
+ }
246
457
  interface DeckUpdateInput {
458
+ expectedDraftRevision: number;
247
459
  title?: string;
248
460
  description?: string;
249
461
  formatKey?: string;
250
462
  visibility?: DeckVisibility;
463
+ accessMode?: DeckAccessMode;
464
+ discoverability?: DeckDiscoverability;
251
465
  externalRef?: string;
466
+ externalSubjectRef?: string;
467
+ rulesetId?: string;
252
468
  sourceUrl?: string;
253
469
  metadata?: Record<string, unknown>;
254
- entries?: DeckEntryInput[];
255
470
  }
256
471
  interface DeckPublishInput {
472
+ expectedDraftRevision: number;
257
473
  note?: string;
474
+ rulesetVersionId?: string;
475
+ cardDatasetVersionId?: string;
476
+ }
477
+ interface DeckEntryAddInput extends DeckEntryInput {
478
+ deckId: string;
479
+ expectedDraftRevision: number;
480
+ }
481
+ interface DeckEntryUpdateInput {
482
+ expectedDraftRevision: number;
483
+ datasetKey?: string;
484
+ identifier?: string;
485
+ quantity?: number;
486
+ section?: string;
487
+ sortOrder?: number;
488
+ annotations?: Record<string, unknown>;
489
+ }
490
+ interface DeckEntryReorderItemInput {
491
+ id: string;
492
+ section?: string;
493
+ sortOrder: number;
494
+ }
495
+ interface DeckEntryReorderInput {
496
+ expectedDraftRevision: number;
497
+ entries: DeckEntryReorderItemInput[];
498
+ }
499
+ interface DeckEntriesReplaceInput {
500
+ expectedDraftRevision: number;
501
+ entries: DeckEntryInput[];
502
+ }
503
+ interface DeckEntryMutationPayload {
504
+ deck: Deck;
505
+ entry: DeckEntry | null;
506
+ }
507
+ interface DeckEntryReorderPayload {
508
+ deck: Deck;
509
+ entries: DeckEntry[];
510
+ }
511
+ interface DeckEntriesReplacePayload {
512
+ deck: Deck;
513
+ entries: DeckEntry[];
514
+ }
515
+ interface DeckPublishPayload {
516
+ deck: Deck;
517
+ version: DeckVersion | null;
518
+ validation: DeckValidation;
519
+ blockers: DeckValidationIssue[];
520
+ warnings: DeckValidationIssue[];
521
+ }
522
+ interface DeckValidateInput {
523
+ rulesetVersionId?: string;
524
+ cardDatasetVersionId?: string;
525
+ }
526
+ interface DeckRemoveInvalidEntriesInput extends DeckValidateInput {
527
+ expectedDraftRevision: number;
528
+ }
529
+ interface DeckClaimInput {
530
+ idempotencyKey?: string;
531
+ expectedDraftRevision: number;
532
+ appAccess: DeckAppAccessRetention;
533
+ }
534
+ interface DeckTransferOwnershipInput {
535
+ idempotencyKey?: string;
536
+ targetAccountId: string;
537
+ expectedDraftRevision: number;
538
+ appAccess: DeckAppAccessRetention;
539
+ }
540
+ interface DeckCopyInput {
541
+ idempotencyKey?: string;
542
+ title?: string;
543
+ expectedDraftRevision: number;
544
+ appAccess: DeckAppAccessRetention;
545
+ }
546
+ interface DeckValidatedAgainst {
547
+ rulesetId: string | null;
548
+ rulesetVersionId: string | null;
549
+ rulesetVersionLabel: string | null;
550
+ cardDatasetId: string | null;
551
+ cardDatasetVersionId: string | null;
552
+ validatedAt: string;
553
+ validationResultSummary: Record<string, unknown>;
554
+ }
555
+ interface DeckValidationAffectedEntry {
556
+ entryId: string;
557
+ datasetId: string;
558
+ recordId: string | null;
559
+ identifier: string;
560
+ section: string;
561
+ quantity: number;
562
+ }
563
+ interface DeckValidationIssue {
564
+ code: string;
565
+ severity: DeckValidationSeverity;
566
+ message: string;
567
+ entryIds: string[];
568
+ section: string | null;
569
+ datasetId: string | null;
570
+ identifier: string | null;
571
+ metadata: Record<string, unknown>;
572
+ }
573
+ interface DeckValidation {
574
+ deckId: string;
575
+ valid: boolean;
576
+ blockers: DeckValidationIssue[];
577
+ warnings: DeckValidationIssue[];
578
+ affectedEntries: DeckValidationAffectedEntry[];
579
+ validatedAgainst: DeckValidatedAgainst;
580
+ checkedAt: string;
581
+ }
582
+ interface DeckDiff {
583
+ deckId: string;
584
+ fromVersionId: string | null;
585
+ toVersionId: string | null;
586
+ toDraftRevision: number | null;
587
+ hasChanges: boolean;
588
+ diff: Record<string, unknown>;
589
+ }
590
+ interface DeckSectionDefinition {
591
+ key: string;
592
+ label: string;
593
+ description: string | null;
594
+ order: number;
595
+ default: boolean;
596
+ aliases: string[];
597
+ minCards: number | null;
598
+ maxCards: number | null;
599
+ excludedFromDeckSize: boolean;
600
+ legalCardTypes: string[];
601
+ metadata: Record<string, unknown>;
258
602
  }
259
603
  interface DeckPreviewTokenCreateInput {
260
604
  deckId: string;
261
605
  label?: string;
262
606
  expiresAt?: string;
263
607
  }
608
+ interface DeckEmbedTokenCreateInput {
609
+ deckId: string;
610
+ label?: string;
611
+ readMode?: DeckTokenReadMode;
612
+ allowedOrigins?: string[];
613
+ externalSubject?: string;
614
+ expiresAt?: string;
615
+ }
616
+ interface DeckAccessTokenIssuerCreateInput {
617
+ deckId: string;
618
+ apiApplicationId?: string;
619
+ label?: string;
620
+ readModes?: DeckTokenReadMode[];
621
+ maxTokenLifetimeSeconds?: number;
622
+ directSigningKey?: DeckAccessTokenIssuerSigningKeyInput;
623
+ }
624
+ interface DeckAccessTokenIssuerSigningKeyInput {
625
+ algorithm: DeckAccessTokenSigningAlgorithm;
626
+ keyId: string;
627
+ publicKey: string;
628
+ }
629
+ interface DeckAccessTokenExchangeInput {
630
+ deckId: string;
631
+ readMode: DeckTokenReadMode;
632
+ externalSubject?: string;
633
+ expiresAt?: string;
634
+ }
635
+ interface DeckAPIApplicationAccessGrantInput {
636
+ deckId: string;
637
+ apiApplicationId: string;
638
+ role: DeckAPIApplicationAccessRole;
639
+ }
640
+ interface DeckImportInput {
641
+ deckId: string;
642
+ format?: DeckImportFormat;
643
+ importFormatId?: string;
644
+ importFormatKey?: string;
645
+ autoDetect?: boolean;
646
+ datasetKey?: string;
647
+ text: string;
648
+ defaultSection?: string;
649
+ replace?: boolean;
650
+ dryRun?: boolean;
651
+ expectedDraftRevision?: number;
652
+ }
653
+ interface DeckImportEntry {
654
+ lineNumber: number;
655
+ raw: string;
656
+ datasetKey: string;
657
+ datasetId: string;
658
+ recordId: string;
659
+ identifier: string;
660
+ quantity: number;
661
+ section: string;
662
+ sortOrder: number;
663
+ display: Record<string, unknown>;
664
+ record: DatasetRecord | null;
665
+ }
666
+ interface DeckImportIssue {
667
+ lineNumber: number;
668
+ raw: string;
669
+ code: string;
670
+ message: string;
671
+ }
672
+ interface DeckImportUnmatchedEntry {
673
+ lineNumber: number;
674
+ raw: string;
675
+ datasetKey: string;
676
+ identifier: string;
677
+ quantity: number;
678
+ section: string;
679
+ code: string;
680
+ message: string;
681
+ }
682
+ interface DeckImportCandidate {
683
+ recordId: string;
684
+ identifier: string;
685
+ display: Record<string, unknown>;
686
+ }
687
+ interface DeckImportAmbiguousEntry {
688
+ lineNumber: number;
689
+ raw: string;
690
+ datasetKey: string;
691
+ identifier: string;
692
+ quantity: number;
693
+ section: string;
694
+ candidates: DeckImportCandidate[];
695
+ }
696
+ interface DeckImportFormatDefinition {
697
+ id: string;
698
+ gameId: string;
699
+ key: string;
700
+ name: string;
701
+ description: string | null;
702
+ enabled: boolean;
703
+ priority: number;
704
+ datasetKey: string;
705
+ config: Record<string, unknown>;
706
+ archivedAt: string | null;
707
+ isArchived: boolean;
708
+ createdAt: string;
709
+ updatedAt: string;
710
+ }
711
+ type DeckImportFormatDefinitionConnection = Connection<DeckImportFormatDefinition>;
712
+ interface DeckImportFormatDetection {
713
+ formatId: string | null;
714
+ key: string;
715
+ name: string;
716
+ confidence: number;
717
+ reason: string;
718
+ }
719
+ interface DeckImportFormatTestPayload {
720
+ detection: DeckImportFormatDetection;
721
+ entries: DeckImportEntry[];
722
+ parseErrors: DeckImportIssue[];
723
+ unmatched: DeckImportUnmatchedEntry[];
724
+ ambiguous: DeckImportAmbiguousEntry[];
725
+ }
726
+ interface DeckImportFormatCreateInput {
727
+ gameId: string;
728
+ key: string;
729
+ name: string;
730
+ description?: string;
731
+ enabled?: boolean;
732
+ priority?: number;
733
+ datasetKey?: string;
734
+ config: Record<string, unknown>;
735
+ }
736
+ interface DeckImportFormatUpdateInput {
737
+ name?: string;
738
+ description?: string;
739
+ enabled?: boolean;
740
+ priority?: number;
741
+ datasetKey?: string;
742
+ config?: Record<string, unknown>;
743
+ }
744
+ interface DeckImportFormatTestInput {
745
+ gameId: string;
746
+ formatId?: string;
747
+ formatKey?: string;
748
+ datasetKey?: string;
749
+ defaultSection?: string;
750
+ config?: Record<string, unknown>;
751
+ text: string;
752
+ }
753
+ interface DeckImportPayload {
754
+ deck: Deck | null;
755
+ applied: boolean;
756
+ dryRun: boolean;
757
+ replace: boolean;
758
+ format: DeckImportFormat;
759
+ importFormat: DeckImportFormatDefinition | null;
760
+ detection: DeckImportFormatDetection;
761
+ entries: DeckImportEntry[];
762
+ parseErrors: DeckImportIssue[];
763
+ unmatched: DeckImportUnmatchedEntry[];
764
+ ambiguous: DeckImportAmbiguousEntry[];
765
+ validation: DeckValidation | null;
766
+ }
767
+ interface DeckHydrateEntriesInput {
768
+ deckId: string;
769
+ entries: DeckEntryInput[];
770
+ }
771
+ interface DeckHydrateEntriesPayload {
772
+ entries: DeckImportEntry[];
773
+ unmatched: DeckImportUnmatchedEntry[];
774
+ ambiguous: DeckImportAmbiguousEntry[];
775
+ }
776
+ interface DeckExportPayload {
777
+ deckId: string;
778
+ format: DeckExportFormat;
779
+ text: string;
780
+ entryCount: number;
781
+ }
264
782
  interface HydrateDeckEntryInput {
265
783
  identifier: string;
266
784
  quantity: number;
@@ -649,6 +1167,9 @@ declare function resolveFilter(input: FilterInput | undefined): FilterCondition
649
1167
  * GraphQL query builder for CardDB API
650
1168
  */
651
1169
 
1170
+ interface RecordFieldOptions {
1171
+ includePricing?: boolean;
1172
+ }
652
1173
  interface SearchPublishersParams {
653
1174
  search?: string;
654
1175
  first?: number;
@@ -679,15 +1200,45 @@ interface SearchRecordsParams {
679
1200
  first?: number;
680
1201
  after?: string;
681
1202
  validateSchema?: boolean;
1203
+ includePricing?: boolean;
682
1204
  }
683
1205
  interface ListDecksParams {
684
1206
  first?: number;
685
1207
  after?: string;
1208
+ includeArchived?: boolean;
686
1209
  }
687
1210
  interface ListDeckVersionsParams {
688
1211
  first?: number;
689
1212
  after?: string;
690
1213
  }
1214
+ interface DeckSectionDefinitionsParams {
1215
+ publisherSlug?: string;
1216
+ gameKey?: string;
1217
+ gameId?: string;
1218
+ rulesetKey?: string;
1219
+ rulesetVersionId?: string;
1220
+ }
1221
+ interface ViewerDecksParams {
1222
+ filter?: ViewerDecksFilterInput;
1223
+ first?: number;
1224
+ after?: string;
1225
+ }
1226
+ interface AppDecksParams {
1227
+ filter?: AppDecksFilterInput;
1228
+ first?: number;
1229
+ after?: string;
1230
+ }
1231
+ interface PublicDecksParams {
1232
+ filter?: PublicDecksFilterInput;
1233
+ first?: number;
1234
+ after?: string;
1235
+ }
1236
+ interface ListDeckImportFormatsParams {
1237
+ gameId: string;
1238
+ includeArchived?: boolean;
1239
+ first?: number;
1240
+ after?: string;
1241
+ }
691
1242
  declare const QueryBuilder: {
692
1243
  searchPublishers(params?: SearchPublishersParams): {
693
1244
  query: string;
@@ -732,34 +1283,55 @@ declare const QueryBuilder: {
732
1283
  query: string;
733
1284
  variables: Record<string, unknown>;
734
1285
  };
735
- fetchRecordById(): {
1286
+ fetchRecordById(params?: RecordFieldOptions): {
736
1287
  query: string;
737
1288
  };
738
- fetchRecordByIdentifier(): {
1289
+ fetchRecordByIdentifier(params?: RecordFieldOptions): {
739
1290
  query: string;
740
1291
  };
741
- fetchRecordsByIdentifier(): {
1292
+ fetchRecordsByIdentifier(params?: RecordFieldOptions): {
742
1293
  query: string;
743
1294
  };
744
- fetchRecords(): {
1295
+ fetchRecords(params?: RecordFieldOptions): {
745
1296
  query: string;
746
1297
  };
747
1298
  listMyDecks(params?: ListDecksParams): {
748
1299
  query: string;
749
1300
  variables: Record<string, unknown>;
750
1301
  };
1302
+ viewerDecks(params?: ViewerDecksParams): {
1303
+ query: string;
1304
+ variables: Record<string, unknown>;
1305
+ };
1306
+ appDecks(params?: AppDecksParams): {
1307
+ query: string;
1308
+ variables: Record<string, unknown>;
1309
+ };
1310
+ publicDecks(params?: PublicDecksParams): {
1311
+ query: string;
1312
+ variables: Record<string, unknown>;
1313
+ };
751
1314
  fetchDeckById(): {
752
1315
  query: string;
753
1316
  };
1317
+ deckById(): {
1318
+ query: string;
1319
+ };
754
1320
  myDeck(): {
755
1321
  query: string;
756
1322
  };
757
1323
  fetchDeckBySlug(): {
758
1324
  query: string;
759
1325
  };
1326
+ deckBySlug(): {
1327
+ query: string;
1328
+ };
760
1329
  fetchDeckByExternalRef(): {
761
1330
  query: string;
762
1331
  };
1332
+ deckByExternalRef(): {
1333
+ query: string;
1334
+ };
763
1335
  deckVersion(): {
764
1336
  query: string;
765
1337
  };
@@ -770,9 +1342,56 @@ declare const QueryBuilder: {
770
1342
  deckPreview(): {
771
1343
  query: string;
772
1344
  };
1345
+ deckEmbed(): {
1346
+ query: string;
1347
+ };
1348
+ deckAccess(): {
1349
+ query: string;
1350
+ };
1351
+ deckDraftDiff(): {
1352
+ query: string;
1353
+ };
1354
+ deckVersionDiff(): {
1355
+ query: string;
1356
+ };
1357
+ deckHydrateEntries(): {
1358
+ query: string;
1359
+ };
1360
+ deckExport(): {
1361
+ query: string;
1362
+ };
1363
+ deckValidate(): {
1364
+ query: string;
1365
+ };
1366
+ deckSectionDefinitions(params?: DeckSectionDefinitionsParams): {
1367
+ query: string;
1368
+ variables: Record<string, unknown>;
1369
+ };
773
1370
  deckCollaborators(): {
774
1371
  query: string;
775
1372
  };
1373
+ deckEmbedTokens(): {
1374
+ query: string;
1375
+ };
1376
+ deckAccessTokenIssuers(): {
1377
+ query: string;
1378
+ };
1379
+ deckApiApplicationAccesses(): {
1380
+ query: string;
1381
+ };
1382
+ myDeckApiApplicationAccesses(): {
1383
+ query: string;
1384
+ };
1385
+ deckImportFormats(params: ListDeckImportFormatsParams): {
1386
+ query: string;
1387
+ variables: Record<string, unknown>;
1388
+ };
1389
+ deckImportFormat(): {
1390
+ query: string;
1391
+ };
1392
+ deckImportFormatTest(): {
1393
+ query: string;
1394
+ };
776
1395
  deckPreviewTokens(): {
777
1396
  query: string;
778
1397
  };
@@ -785,9 +1404,63 @@ declare const QueryBuilder: {
785
1404
  deleteDeck(): {
786
1405
  query: string;
787
1406
  };
1407
+ archiveDeck(): {
1408
+ query: string;
1409
+ };
1410
+ restoreDeck(): {
1411
+ query: string;
1412
+ };
1413
+ unpublishDeck(): {
1414
+ query: string;
1415
+ };
1416
+ addDeckEntry(): {
1417
+ query: string;
1418
+ };
1419
+ updateDeckEntry(): {
1420
+ query: string;
1421
+ };
1422
+ removeDeckEntry(): {
1423
+ query: string;
1424
+ };
1425
+ reorderDeckEntries(): {
1426
+ query: string;
1427
+ };
1428
+ replaceDeckEntries(): {
1429
+ query: string;
1430
+ };
1431
+ importDeck(): {
1432
+ query: string;
1433
+ };
1434
+ createDeckImportFormat(): {
1435
+ query: string;
1436
+ };
1437
+ updateDeckImportFormat(): {
1438
+ query: string;
1439
+ };
1440
+ archiveDeckImportFormat(): {
1441
+ query: string;
1442
+ };
1443
+ unarchiveDeckImportFormat(): {
1444
+ query: string;
1445
+ };
1446
+ upsertDeckByExternalRef(): {
1447
+ query: string;
1448
+ };
1449
+ claimDeck(): {
1450
+ query: string;
1451
+ };
1452
+ transferDeckOwnership(): {
1453
+ query: string;
1454
+ };
1455
+ copyDeck(): {
1456
+ query: string;
1457
+ };
788
1458
  publishDeck(): {
789
1459
  query: string;
790
1460
  };
1461
+ removeInvalidDeckEntries(): {
1462
+ query: string;
1463
+ };
791
1464
  upsertDeckCollaborator(): {
792
1465
  query: string;
793
1466
  };
@@ -800,11 +1473,63 @@ declare const QueryBuilder: {
800
1473
  revokeDeckPreviewToken(): {
801
1474
  query: string;
802
1475
  };
1476
+ createDeckEmbedToken(): {
1477
+ query: string;
1478
+ };
1479
+ revokeDeckEmbedToken(): {
1480
+ query: string;
1481
+ };
1482
+ createDeckAccessTokenIssuer(): {
1483
+ query: string;
1484
+ };
1485
+ revokeDeckAccessTokenIssuer(): {
1486
+ query: string;
1487
+ };
1488
+ revokeDeckAccessTokenIssuerSigningKey(): {
1489
+ query: string;
1490
+ };
1491
+ exchangeDeckAccessToken(): {
1492
+ query: string;
1493
+ };
1494
+ grantDeckApiApplicationAccess(): {
1495
+ query: string;
1496
+ };
1497
+ revokeDeckApiApplicationAccess(): {
1498
+ query: string;
1499
+ };
1500
+ revokeDeckAccessToken(): {
1501
+ query: string;
1502
+ };
803
1503
  deckCreateVariables(input: DeckCreateInput): Record<string, unknown>;
804
1504
  deckUpdateVariables(id: string, input: DeckUpdateInput): Record<string, unknown>;
805
- deckPublishVariables(id: string, input?: DeckPublishInput): Record<string, unknown>;
1505
+ deckEntryAddVariables(input: DeckEntryAddInput): Record<string, unknown>;
1506
+ deckEntryUpdateVariables(id: string, input: DeckEntryUpdateInput): Record<string, unknown>;
1507
+ deckEntryRemoveVariables(id: string, expectedDraftRevision: number): Record<string, unknown>;
1508
+ deckEntryReorderVariables(deckId: string, input: DeckEntryReorderInput): Record<string, unknown>;
1509
+ deckEntriesReplaceVariables(deckId: string, input: DeckEntriesReplaceInput): Record<string, unknown>;
1510
+ deckImportVariables(input: DeckImportInput): Record<string, unknown>;
1511
+ deckImportFormatCreateVariables(input: DeckImportFormatCreateInput): Record<string, unknown>;
1512
+ deckImportFormatUpdateVariables(id: string, input: DeckImportFormatUpdateInput): Record<string, unknown>;
1513
+ deckImportFormatTestVariables(input: DeckImportFormatTestInput): Record<string, unknown>;
1514
+ deckUpsertByExternalRefVariables(input: DeckUpsertByExternalRefInput): Record<string, unknown>;
1515
+ deckClaimVariables(id: string, input: DeckClaimInput): Record<string, unknown>;
1516
+ deckTransferOwnershipVariables(id: string, input: DeckTransferOwnershipInput): Record<string, unknown>;
1517
+ deckCopyVariables(id: string, input: DeckCopyInput): Record<string, unknown>;
1518
+ deckPublishVariables(id: string, input: DeckPublishInput): Record<string, unknown>;
1519
+ deckValidateVariables(id: string, input?: DeckValidateInput): Record<string, unknown>;
1520
+ deckRemoveInvalidEntriesVariables(id: string, input: DeckRemoveInvalidEntriesInput): Record<string, unknown>;
1521
+ deckHydrateEntriesVariables(input: DeckHydrateEntriesInput): Record<string, unknown>;
1522
+ deckExportVariables(id: string, format: DeckExportFormat): Record<string, unknown>;
1523
+ deckVersionDiffVariables(fromVersionId: string, toVersionId: string): Record<string, unknown>;
806
1524
  deckCollaboratorVariables(deckId: string, accountId: string, role?: DeckCollaboratorRole): Record<string, unknown>;
807
1525
  deckPreviewTokenCreateVariables(input: DeckPreviewTokenCreateInput): Record<string, unknown>;
1526
+ deckEmbedTokenCreateVariables(input: DeckEmbedTokenCreateInput): Record<string, unknown>;
1527
+ deckAccessTokenIssuerCreateVariables(input: DeckAccessTokenIssuerCreateInput): Record<string, unknown>;
1528
+ deckAccessTokenExchangeVariables(input: DeckAccessTokenExchangeInput): Record<string, unknown>;
1529
+ deckApiApplicationAccessesVariables(deckId: string, includeRevoked?: boolean): Record<string, unknown>;
1530
+ myDeckApiApplicationAccessesVariables(applicationId?: string): Record<string, unknown>;
1531
+ deckApiApplicationAccessGrantVariables(input: DeckAPIApplicationAccessGrantInput): Record<string, unknown>;
1532
+ deckApiApplicationAccessRevokeVariables(deckId: string, apiApplicationId: string): Record<string, unknown>;
808
1533
  fetchMe(): {
809
1534
  query: string;
810
1535
  };
@@ -940,4 +1665,4 @@ declare class Collection<T> implements AsyncIterable<T> {
940
1665
  each(): AsyncIterable<T>;
941
1666
  }
942
1667
 
943
- export { type APIAccount, type APIApplication, type APIKeyInfo, AuthenticationError, type Cache, type CardDBConfig, CardDBError, Collection, type Connection, ConnectionError, type Dataset, type DatasetRecord, type DatasetRef, type DatasetSchema, type Deck, type DeckCollaborator, type DeckCollaboratorRole, type DeckCreateInput, type DeckEntry, type DeckEntryInput, type DeckPreviewToken, type DeckPreviewTokenCreateInput, type DeckPreviewTokenCreatePayload, type DeckPublishInput, type DeckUpdateInput, type DeckVersion, type DeckVersionConnection, type DeckVisibility, type Edge, type FieldInfo, type FieldType, type FileInfo, FilterBuilder, type FilterBuilderInterface, type FilterCondition, type FilterInput, type FilterOperatorValue, type FilterValue, type Game, type GameRef, GraphQLError, type GraphQLErrorInfo, type HydrateDeckEntryInput, type HydratedDeckEntry, type LinkFieldInfo, LinkResolutionError, type LinkResolutionFailure, type ListDeckVersionsParams, type ListDecksParams, type LogLevel, type Logger, type NextPageLoader, NotFoundError, type PageInfo, type Publisher, type PublisherRef, type PublisherStatus, QueryBuilder, RateLimitError, type RateLimitInfo, type ResolvedLink, type ResourceType, RestrictedError, type SearchDatasetsParams, type SearchGamesParams, type SearchPublishersParams, type SearchRecordsParams, ServerError, TimeoutError, ValidationError, contains, eq, gt, gte, ilike, isNotNull, isNull, like, lt, lte, neq, notWithin, resolveFilter, within };
1668
+ export { type APIAccount, type APIApplication, type APIKeyInfo, type AppDecksFilterInput, type AppDecksParams, AuthenticationError, type Cache, type CardDBConfig, CardDBError, Collection, type Connection, ConnectionError, type Dataset, type DatasetRecord, type DatasetRef, type DatasetSchema, type Deck, type DeckAPIApplicationAccess, type DeckAPIApplicationAccessGrantInput, type DeckAPIApplicationAccessGrantSource, type DeckAPIApplicationAccessRole, type DeckAccessApplication, type DeckAccessMode, type DeckAccessToken, type DeckAccessTokenExchangeInput, type DeckAccessTokenExchangePayload, type DeckAccessTokenIssuer, type DeckAccessTokenIssuerCreateInput, type DeckAccessTokenIssuerSigningKeyInput, type DeckAccessTokenSigningAlgorithm, type DeckAppAccessRetention, type DeckClaimInput, type DeckCollaborator, type DeckCollaboratorRole, type DeckCopyInput, type DeckCopyPayload, type DeckCreateInput, type DeckDiff, type DeckDiscoverability, type DeckEmbedToken, type DeckEmbedTokenCreateInput, type DeckEmbedTokenCreatePayload, type DeckEntriesReplaceInput, type DeckEntriesReplacePayload, type DeckEntry, type DeckEntryAddInput, type DeckEntryInput, type DeckEntryMutationPayload, type DeckEntryReorderInput, type DeckEntryReorderItemInput, type DeckEntryReorderPayload, type DeckEntryUpdateInput, type DeckEnvironment, type DeckExportFormat, type DeckExportPayload, type DeckHydrateEntriesInput, type DeckHydrateEntriesPayload, type DeckImportAmbiguousEntry, type DeckImportCandidate, type DeckImportEntry, type DeckImportFormat, type DeckImportFormatCreateInput, type DeckImportFormatDefinition, type DeckImportFormatDefinitionConnection, type DeckImportFormatDetection, type DeckImportFormatTestInput, type DeckImportFormatTestPayload, type DeckImportFormatUpdateInput, type DeckImportInput, type DeckImportIssue, type DeckImportPayload, type DeckImportUnmatchedEntry, type DeckOwnerType, type DeckOwnershipTransferPayload, type DeckPreviewToken, type DeckPreviewTokenCreateInput, type DeckPreviewTokenCreatePayload, type DeckPublishInput, type DeckPublishPayload, type DeckRemoveInvalidEntriesInput, type DeckSectionDefinition, type DeckSectionDefinitionsParams, type DeckState, type DeckTokenReadMode, type DeckTransferOwnershipInput, type DeckUpdateInput, type DeckUpsertByExternalRefInput, type DeckUpsertByExternalRefPayload, type DeckValidateInput, type DeckValidatedAgainst, type DeckValidation, type DeckValidationAffectedEntry, type DeckValidationIssue, type DeckValidationSeverity, type DeckVersion, type DeckVersionConnection, type DeckVisibility, type Edge, type FieldInfo, type FieldType, type FileInfo, FilterBuilder, type FilterBuilderInterface, type FilterCondition, type FilterInput, type FilterOperatorValue, type FilterValue, type Game, type GameRef, GraphQLError, type GraphQLErrorInfo, type HydrateDeckEntryInput, type HydratedDeckEntry, type LinkFieldInfo, LinkResolutionError, type LinkResolutionFailure, type ListDeckImportFormatsParams, type ListDeckVersionsParams, type ListDecksParams, type LogLevel, type Logger, type NextPageLoader, NotFoundError, type PageInfo, type PublicDecksFilterInput, type PublicDecksParams, type Publisher, type PublisherRef, type PublisherStatus, QueryBuilder, RateLimitError, type RateLimitInfo, type ResolvedLink, type ResourceType, RestrictedError, type SearchDatasetsParams, type SearchGamesParams, type SearchPublishersParams, type SearchRecordsParams, ServerError, type TCGPlayerPrice, type TCGPlayerPricing, TimeoutError, ValidationError, type ViewerDecksFilterInput, type ViewerDecksParams, contains, eq, gt, gte, ilike, isNotNull, isNull, like, lt, lte, neq, notWithin, resolveFilter, within };