@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.d.cts CHANGED
@@ -2,7 +2,7 @@
2
2
  * Core types for CardDB JavaScript clients
3
3
  */
4
4
  type LogLevel = 'debug' | 'info' | 'warn' | 'error';
5
- type ResourceType = 'publishers' | 'games' | 'datasets' | 'records' | 'decks';
5
+ type ResourceType = 'publishers' | 'games' | 'datasets' | 'records' | 'decks' | 'importFormats' | 'imports' | 'exports' | 'files';
6
6
  interface Logger {
7
7
  debug(message: string, ...args: unknown[]): void;
8
8
  info(message: string, ...args: unknown[]): void;
@@ -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 */
@@ -74,6 +82,36 @@ interface FileInfo {
74
82
  id: string;
75
83
  url: string;
76
84
  }
85
+ type FileStatus = 'PENDING' | 'UPLOADED' | 'DELETED';
86
+ interface FileUploadInput {
87
+ filename: string;
88
+ contentType: string;
89
+ size: number;
90
+ isPublic: boolean;
91
+ entityType?: string;
92
+ entityId?: string;
93
+ publisherId?: string;
94
+ datasetId?: string;
95
+ }
96
+ interface File {
97
+ id: string;
98
+ createdAt: string;
99
+ updatedAt: string;
100
+ key: string;
101
+ filename: string;
102
+ contentType: string;
103
+ size: number;
104
+ status: FileStatus;
105
+ isPublic: boolean;
106
+ entityType: string | null;
107
+ entityId: string | null;
108
+ url: string;
109
+ }
110
+ interface PresignedUpload {
111
+ file: File;
112
+ uploadUrl: string;
113
+ expiresAt: string;
114
+ }
77
115
  type PublisherStatus = 'ACTIVE' | 'DEACTIVATED';
78
116
  interface Publisher {
79
117
  id: string;
@@ -98,8 +136,10 @@ interface Game {
98
136
  key: string;
99
137
  name: string;
100
138
  description: string | null;
139
+ metafyGameUuid?: string | null;
140
+ metafyGameSlug?: string | null;
101
141
  website: string | null;
102
- visibility: string;
142
+ visibility: GameVisibility;
103
143
  isArchived: boolean;
104
144
  publisher: PublisherRef | null;
105
145
  logoFile: FileInfo | null;
@@ -107,6 +147,29 @@ interface Game {
107
147
  createdAt: string;
108
148
  updatedAt: string;
109
149
  }
150
+ type GameVisibility = 'PRIVATE' | 'PUBLIC';
151
+ interface GameCreateInput {
152
+ publisherId: string;
153
+ key: string;
154
+ name: string;
155
+ description?: string;
156
+ metafyGameUuid?: string;
157
+ metafyGameSlug?: string;
158
+ logoFileId?: string;
159
+ coverFileId?: string;
160
+ website?: string;
161
+ visibility?: GameVisibility;
162
+ }
163
+ interface GameUpdateInput {
164
+ name?: string;
165
+ description?: string;
166
+ metafyGameUuid?: string;
167
+ metafyGameSlug?: string;
168
+ logoFileId?: string;
169
+ coverFileId?: string;
170
+ website?: string;
171
+ visibility?: GameVisibility;
172
+ }
110
173
  interface GameRef {
111
174
  id: string;
112
175
  key: string;
@@ -119,9 +182,14 @@ interface Dataset {
119
182
  key: string;
120
183
  name: string;
121
184
  description: string | null;
122
- purpose: 'DATA' | 'RULES';
185
+ purpose: DatasetPurpose;
186
+ activeVersionId?: string | null;
123
187
  tcgplayerProductIdFieldKey: string | null;
124
- visibility: string;
188
+ visibility: DatasetVisibility;
189
+ posX?: number;
190
+ posY?: number;
191
+ sortOrder?: number;
192
+ archivedAt?: string | null;
125
193
  isArchived: boolean;
126
194
  publisher: PublisherRef | null;
127
195
  game: GameRef | null;
@@ -129,6 +197,8 @@ interface Dataset {
129
197
  createdAt: string;
130
198
  updatedAt: string;
131
199
  }
200
+ type DatasetPurpose = 'DATA' | 'RULES';
201
+ type DatasetVisibility = 'PRIVATE' | 'PUBLIC';
132
202
  interface DatasetRef {
133
203
  id: string;
134
204
  key: string;
@@ -146,6 +216,390 @@ interface DatasetRecord {
146
216
  createdAt: string;
147
217
  updatedAt: string;
148
218
  }
219
+ type ImportFormat = 'JSON' | 'CSV';
220
+ type ImportMode = 'STRICT' | 'CREATE';
221
+ type OnConflict = 'ERROR' | 'SKIP' | 'UPDATE';
222
+ type ImportJobStatus = 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED';
223
+ type ImportLogLevel = 'DEBUG' | 'INFO' | 'WARN' | 'ERROR';
224
+ type BulkInsertMode = 'FAIL_FAST' | 'COLLECT_ERRORS';
225
+ interface ImportOptions {
226
+ mode?: ImportMode;
227
+ onConflict?: OnConflict;
228
+ dryRun?: boolean;
229
+ validateLinks?: boolean;
230
+ }
231
+ interface CsvOptions {
232
+ delimiter?: string;
233
+ hasHeader?: boolean;
234
+ headerMapping?: Record<string, unknown>;
235
+ }
236
+ interface FieldMappingOverrideInput {
237
+ sourceField: string;
238
+ skip?: boolean;
239
+ targetType?: FieldType;
240
+ linkDatasetId?: string;
241
+ linkFieldKey?: string;
242
+ linkDirection?: string;
243
+ itemType?: string;
244
+ }
245
+ interface ImportJobAssetInput {
246
+ fileId: string;
247
+ filename: string;
248
+ }
249
+ interface ImportJobAsset {
250
+ fileId: string;
251
+ filename: string;
252
+ file: File;
253
+ }
254
+ interface ImportValidationError {
255
+ field: string;
256
+ message: string;
257
+ details?: Record<string, unknown> | null;
258
+ }
259
+ interface BulkRecordError {
260
+ datasetKey: string | null;
261
+ index: number;
262
+ errors: ImportValidationError[];
263
+ }
264
+ interface ImportStats {
265
+ total: number;
266
+ inserted: number;
267
+ updated: number;
268
+ skipped: number;
269
+ failed: number;
270
+ }
271
+ interface BulkImportResult {
272
+ inserted: DatasetRecord[];
273
+ updated: DatasetRecord[];
274
+ skipped: number;
275
+ errors: BulkRecordError[];
276
+ createdFields: ObjectField[];
277
+ stats: ImportStats;
278
+ }
279
+ interface BulkCreateResult {
280
+ inserted: DatasetRecord[];
281
+ errors: BulkRecordError[];
282
+ }
283
+ interface ImportJob {
284
+ id: string;
285
+ publisherId: string;
286
+ publisher: Publisher;
287
+ datasetId: string;
288
+ dataset: Dataset;
289
+ accountId: string;
290
+ status: ImportJobStatus;
291
+ mode: ImportMode;
292
+ onConflict: OnConflict;
293
+ format: ImportFormat;
294
+ fileId: string | null;
295
+ progress: number;
296
+ totalRecords: number | null;
297
+ processedRecords: number;
298
+ insertedCount: number;
299
+ updatedCount: number;
300
+ skippedCount: number;
301
+ failedCount: number;
302
+ createdFields: ObjectField[];
303
+ errors: BulkRecordError[];
304
+ errorMessage: string | null;
305
+ assets: ImportJobAsset[];
306
+ startedAt: string | null;
307
+ completedAt: string | null;
308
+ createdAt: string;
309
+ updatedAt: string;
310
+ lastCheckpointIndex: number;
311
+ isResumed: boolean;
312
+ imagesPending: number;
313
+ imagesCompleted: number;
314
+ imagesFailed: number;
315
+ }
316
+ type ImportJobConnection = Connection<ImportJob>;
317
+ interface ImportJobLog {
318
+ id: string;
319
+ importJobId: string;
320
+ level: ImportLogLevel;
321
+ message: string;
322
+ datasetKey: string | null;
323
+ recordIndex: number | null;
324
+ fieldKey: string | null;
325
+ details: Record<string, unknown> | null;
326
+ createdAt: string;
327
+ }
328
+ type ImportJobLogConnection = Connection<ImportJobLog>;
329
+ interface DatasetImportFromFileInput {
330
+ publisherId: string;
331
+ datasetKey: string;
332
+ fileId: string;
333
+ format: ImportFormat;
334
+ options: ImportOptions;
335
+ csvOptions?: CsvOptions;
336
+ fieldOverrides?: FieldMappingOverrideInput[];
337
+ assets?: ImportJobAssetInput[];
338
+ }
339
+ interface DatasetImportFromPayloadInput {
340
+ publisherId: string;
341
+ datasetKey: string;
342
+ data: Record<string, unknown> | unknown[];
343
+ options: ImportOptions;
344
+ assets?: ImportJobAssetInput[];
345
+ }
346
+ interface DatasetImportFromUrlInput {
347
+ publisherId: string;
348
+ datasetKey: string;
349
+ sourceUrl: string;
350
+ format: ImportFormat;
351
+ options: ImportOptions;
352
+ csvOptions?: CsvOptions;
353
+ fieldOverrides?: FieldMappingOverrideInput[];
354
+ assets?: ImportJobAssetInput[];
355
+ }
356
+ type DatasetImportRunInput = DatasetImportFromFileInput | DatasetImportFromPayloadInput | DatasetImportFromUrlInput;
357
+ interface DatasetImportPreviewInput {
358
+ publisherId: string;
359
+ datasetKey: string;
360
+ fileId?: string;
361
+ data?: Record<string, unknown> | unknown[];
362
+ sourceUrl?: string;
363
+ format?: ImportFormat;
364
+ }
365
+ interface DatasetImportValidateInput extends DatasetImportPreviewInput {
366
+ options: ImportOptions;
367
+ }
368
+ type FieldMappingStatus = 'MATCHED' | 'NOT_IN_SCHEMA' | 'TYPE_MISMATCH' | 'WILL_CREATE' | 'NEW';
369
+ interface InferredChildField {
370
+ key: string;
371
+ label: string;
372
+ type: FieldType;
373
+ required: boolean;
374
+ itemType: string | null;
375
+ children: InferredChildField[] | null;
376
+ }
377
+ interface FieldMapping {
378
+ sourceField: string;
379
+ targetField: string | null;
380
+ targetFieldLabel: string | null;
381
+ inferredType: FieldType | null;
382
+ inferredItemType: string | null;
383
+ inferredChildren: InferredChildField[] | null;
384
+ inferredLinkDataset: string | null;
385
+ inferredLinkFieldKey: string | null;
386
+ inferredLinkDirection: string | null;
387
+ targetFieldType: FieldType | null;
388
+ sampleValues: string[];
389
+ status: FieldMappingStatus;
390
+ }
391
+ type ImportWarningSeverity = 'INFO' | 'WARNING' | 'ERROR';
392
+ interface ImportWarning {
393
+ datasetKey: string | null;
394
+ field: string | null;
395
+ message: string;
396
+ severity: ImportWarningSeverity;
397
+ }
398
+ interface DatasetImportPreviewResult {
399
+ datasetKey: string;
400
+ datasetName: string | null;
401
+ datasetId: string | null;
402
+ exists: boolean;
403
+ recordCount: number;
404
+ fieldMappings: FieldMapping[];
405
+ warnings: ImportWarning[];
406
+ canProceed: boolean;
407
+ sampleRecords: Record<string, unknown>[];
408
+ availableDatasets: Dataset[];
409
+ }
410
+ interface GameImportPreviewInput {
411
+ gameId: string;
412
+ fileId?: string;
413
+ data?: Record<string, unknown> | unknown[];
414
+ sourceUrl?: string;
415
+ }
416
+ interface DatasetImportPreview {
417
+ datasetKey: string;
418
+ datasetName: string | null;
419
+ datasetId: string | null;
420
+ exists: boolean;
421
+ recordCount: number;
422
+ fieldMappings: FieldMapping[];
423
+ warnings: ImportWarning[];
424
+ sampleRecords: Record<string, unknown>[];
425
+ }
426
+ interface GameImportPreview {
427
+ datasets: DatasetImportPreview[];
428
+ importOrder: string[];
429
+ warnings: ImportWarning[];
430
+ canProceed: boolean;
431
+ }
432
+ interface GameImportFromFileInput {
433
+ gameId: string;
434
+ fileId: string;
435
+ options: ImportOptions;
436
+ skipDatasets?: string[];
437
+ datasetOverrides?: Record<string, unknown>;
438
+ assets?: ImportJobAssetInput[];
439
+ }
440
+ interface GameImportFromPayloadInput {
441
+ gameId: string;
442
+ data: Record<string, unknown> | unknown[];
443
+ options: ImportOptions;
444
+ skipDatasets?: string[];
445
+ datasetOverrides?: Record<string, unknown>;
446
+ assets?: ImportJobAssetInput[];
447
+ }
448
+ interface GameImportFromUrlInput {
449
+ gameId: string;
450
+ sourceUrl: string;
451
+ options: ImportOptions;
452
+ skipDatasets?: string[];
453
+ datasetOverrides?: Record<string, unknown>;
454
+ assets?: ImportJobAssetInput[];
455
+ }
456
+ type GameImportRunInput = GameImportFromFileInput | GameImportFromPayloadInput | GameImportFromUrlInput;
457
+ interface GameImportDatasetStatus {
458
+ datasetKey: string;
459
+ datasetId: string | null;
460
+ datasetName: string | null;
461
+ status: ImportJobStatus;
462
+ recordCount: number | null;
463
+ insertedCount: number;
464
+ updatedCount: number;
465
+ skippedCount: number;
466
+ failedCount: number;
467
+ errorMessage: string | null;
468
+ }
469
+ interface GameImportJob {
470
+ id: string;
471
+ publisherId: string;
472
+ publisher: Publisher;
473
+ gameId: string;
474
+ game: Game;
475
+ accountId: string;
476
+ status: ImportJobStatus;
477
+ mode: ImportMode;
478
+ onConflict: OnConflict;
479
+ fileId: string | null;
480
+ assets: ImportJobAsset[];
481
+ totalDatasets: number;
482
+ completedDatasets: number;
483
+ progress: number;
484
+ importOrder: string[];
485
+ datasetStatuses: GameImportDatasetStatus[];
486
+ errorMessage: string | null;
487
+ startedAt: string | null;
488
+ completedAt: string | null;
489
+ createdAt: string;
490
+ updatedAt: string;
491
+ completedDatasetKeys: string[];
492
+ currentDatasetKey: string | null;
493
+ lastCheckpointIndex: number;
494
+ isResumed: boolean;
495
+ imagesPending: number;
496
+ imagesCompleted: number;
497
+ imagesFailed: number;
498
+ phase: string | null;
499
+ linkBuildingDataset: string | null;
500
+ linkBuildingTotalDatasets: number;
501
+ linkBuildingCompletedDatasets: number;
502
+ linkBuildingProcessedRecords: number;
503
+ linkBuildingTotalRecords: number;
504
+ }
505
+ type GameImportJobConnection = Connection<GameImportJob>;
506
+ interface DatasetRecordsUpsertInput {
507
+ datasetId?: string;
508
+ publisherId?: string;
509
+ gameId?: string;
510
+ datasetKey?: string;
511
+ records?: Record<string, unknown>[];
512
+ fileId?: string;
513
+ sourceUrl?: string;
514
+ format?: ImportFormat;
515
+ options?: ImportOptions;
516
+ assets?: ImportJobAssetInput[];
517
+ }
518
+ interface DatasetRecordsUpsertPayload {
519
+ job: ImportJob | null;
520
+ dryRunResult: BulkImportResult | null;
521
+ }
522
+ type DatasetRecordDeleteJobStatus = 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED';
523
+ type DatasetRecordDeleteTargetType = 'RECORD_ID' | 'IDENTIFIER' | 'RECONCILE_MISSING_IDENTIFIER';
524
+ type DatasetRecordDeleteResultStatus = 'MATCHED' | 'MISSING' | 'DELETED' | 'BLOCKED' | 'ERROR';
525
+ interface DatasetRecordsDeleteInput {
526
+ datasetId?: string;
527
+ publisherId?: string;
528
+ gameId?: string;
529
+ datasetKey?: string;
530
+ recordIds?: string[];
531
+ identifiers?: string[];
532
+ reconcileIdentifiers?: string[];
533
+ dryRun?: boolean;
534
+ }
535
+ interface DatasetRecordDeleteJobResult {
536
+ target: string;
537
+ recordId: string | null;
538
+ identifier: string | null;
539
+ status: DatasetRecordDeleteResultStatus;
540
+ message: string | null;
541
+ }
542
+ interface DatasetRecordDeleteJob {
543
+ id: string;
544
+ publisherId: string;
545
+ publisher: Publisher;
546
+ datasetId: string;
547
+ dataset: Dataset;
548
+ accountId: string;
549
+ status: DatasetRecordDeleteJobStatus;
550
+ targetType: DatasetRecordDeleteTargetType;
551
+ dryRun: boolean;
552
+ targets: string[];
553
+ progress: number;
554
+ totalTargets: number;
555
+ processedTargets: number;
556
+ matchedCount: number;
557
+ deletedCount: number;
558
+ missingCount: number;
559
+ blockedCount: number;
560
+ failedCount: number;
561
+ results: DatasetRecordDeleteJobResult[];
562
+ errorMessage: string | null;
563
+ startedAt: string | null;
564
+ completedAt: string | null;
565
+ createdAt: string;
566
+ updatedAt: string;
567
+ }
568
+ type DatasetRecordDeleteJobConnection = Connection<DatasetRecordDeleteJob>;
569
+ type ExportFormat = 'JSON' | 'CSV';
570
+ type ExportJobStatus = 'PENDING' | 'PROCESSING' | 'COMPLETED' | 'FAILED';
571
+ interface DatasetExportInput {
572
+ datasetId?: string;
573
+ publisherId?: string;
574
+ gameId?: string;
575
+ datasetKey?: string;
576
+ format?: ExportFormat;
577
+ filter?: FilterCondition;
578
+ }
579
+ interface ExportJob {
580
+ id: string;
581
+ publisherId: string;
582
+ publisher: Publisher;
583
+ datasetId: string;
584
+ dataset: Dataset;
585
+ accountId: string;
586
+ status: ExportJobStatus;
587
+ format: ExportFormat;
588
+ filter: FilterCondition | null;
589
+ totalRecords: number | null;
590
+ processedRecords: number;
591
+ progress: number;
592
+ fileId: string | null;
593
+ downloadUrl: string | null;
594
+ downloadExpiresAt: string | null;
595
+ errorMessage: string | null;
596
+ startedAt: string | null;
597
+ completedAt: string | null;
598
+ createdAt: string;
599
+ updatedAt: string;
600
+ lastCheckpointIndex: number;
601
+ }
602
+ type ExportJobConnection = Connection<ExportJob>;
149
603
  interface TCGPlayerPricing {
150
604
  productId: string;
151
605
  prices: TCGPlayerPrice[];
@@ -159,9 +613,68 @@ interface TCGPlayerPrice {
159
613
  directLowPrice: number | null;
160
614
  }
161
615
  type DeckVisibility = 'PRIVATE' | 'UNLISTED' | 'PUBLIC';
616
+ type DeckOwnerType = 'ACCOUNT' | 'API_APPLICATION';
617
+ type DeckEnvironment = 'TEST' | 'LIVE';
618
+ type DeckAccessMode = 'PUBLIC' | 'OWNER_ONLY' | 'AUTHORIZED_TOKEN';
619
+ type DeckDiscoverability = 'LISTED' | 'UNLISTED';
620
+ type DeckState = 'DRAFT' | 'PUBLISHED' | 'ARCHIVED' | 'DELETED';
621
+ type DeckTokenReadMode = 'PUBLIC' | 'PREVIEW' | 'EMBED' | 'FULL';
622
+ type DeckAccessTokenSigningAlgorithm = 'ED25519';
623
+ type DeckImportFormat = 'SIMPLE_TEXT' | 'CONFIGURED';
624
+ type DeckExportFormat = 'SIMPLE_TEXT';
162
625
  type DeckCollaboratorRole = 'VIEWER' | 'EDITOR';
626
+ type DeckAppAccessRetention = 'RETAIN' | 'REVOKE';
627
+ type DeckAPIApplicationAccessRole = 'VIEWER' | 'EDITOR' | 'OWNER';
628
+ type DeckAPIApplicationAccessGrantSource = 'APP_CREATED' | 'USER_SELECTED' | 'CLAIM_RETAINED' | 'TRANSFER_RETAINED';
629
+ type DeckValidationSeverity = 'BLOCKER' | 'WARNING';
630
+ interface ViewerDecksFilterInput {
631
+ environment?: DeckEnvironment;
632
+ gameId?: string;
633
+ rulesetId?: string;
634
+ state?: DeckState;
635
+ accessMode?: DeckAccessMode;
636
+ discoverability?: DeckDiscoverability;
637
+ createdByApiApplicationId?: string;
638
+ externalSubjectRef?: string;
639
+ updatedAfter?: string;
640
+ updatedBefore?: string;
641
+ publishedAfter?: string;
642
+ publishedBefore?: string;
643
+ includeArchived?: boolean;
644
+ }
645
+ interface AppDecksFilterInput {
646
+ environment?: DeckEnvironment;
647
+ gameId?: string;
648
+ rulesetId?: string;
649
+ state?: DeckState;
650
+ accessMode?: DeckAccessMode;
651
+ discoverability?: DeckDiscoverability;
652
+ externalSubjectRef?: string;
653
+ updatedAfter?: string;
654
+ updatedBefore?: string;
655
+ publishedAfter?: string;
656
+ publishedBefore?: string;
657
+ includeArchived?: boolean;
658
+ }
659
+ interface PublicDecksFilterInput {
660
+ environment?: DeckEnvironment;
661
+ gameId?: string;
662
+ rulesetId?: string;
663
+ accessMode?: DeckAccessMode;
664
+ discoverability?: DeckDiscoverability;
665
+ updatedAfter?: string;
666
+ updatedBefore?: string;
667
+ publishedAfter?: string;
668
+ publishedBefore?: string;
669
+ }
163
670
  interface Deck {
164
671
  id: string;
672
+ ownerType: DeckOwnerType;
673
+ ownerAccountId: string | null;
674
+ ownerApiApplicationId: string | null;
675
+ environment: DeckEnvironment;
676
+ createdByAccountId: string | null;
677
+ createdByApiApplicationId: string | null;
165
678
  accountId: string;
166
679
  apiApplicationId: string | null;
167
680
  gameId: string;
@@ -172,12 +685,26 @@ interface Deck {
172
685
  description: string | null;
173
686
  formatKey: string | null;
174
687
  visibility: DeckVisibility;
688
+ accessMode: DeckAccessMode;
689
+ discoverability: DeckDiscoverability;
690
+ state: DeckState;
691
+ archivedAt: string | null;
692
+ deletedAt: string | null;
693
+ unpublishedAt: string | null;
694
+ externalRefApiApplicationId: string | null;
175
695
  externalRef: string | null;
696
+ externalSubjectRef: string | null;
697
+ rulesetId: string | null;
176
698
  sourceUrl: string | null;
177
699
  metadata: Record<string, unknown>;
178
700
  entries: DeckEntry[];
701
+ sectionDefinitions: DeckSectionDefinition[];
179
702
  latestPublishedVersion: DeckVersion | null;
180
703
  publishedAt: string | null;
704
+ draftRevision: number;
705
+ draftUpdatedAt: string;
706
+ draftUpdatedByAccountId: string | null;
707
+ draftUpdatedByApiApplicationId: string | null;
181
708
  hasUnpublishedChanges: boolean;
182
709
  createdAt: string;
183
710
  updatedAt: string;
@@ -198,6 +725,14 @@ interface DeckVersion {
198
725
  entries: DeckEntry[];
199
726
  publishNote: string | null;
200
727
  computedDiff: Record<string, unknown>;
728
+ rulesetId: string | null;
729
+ rulesetVersionId: string | null;
730
+ cardDatasetId: string | null;
731
+ cardDatasetVersionId: string | null;
732
+ validatedAt: string | null;
733
+ validationSummary: Record<string, unknown>;
734
+ validatedAgainst: DeckValidatedAgainst | null;
735
+ sectionDefinitions: DeckSectionDefinition[];
201
736
  publishedByAccountId: string | null;
202
737
  publishedByApiApplicationId: string | null;
203
738
  createdAt: string;
@@ -212,6 +747,36 @@ interface DeckCollaborator {
212
747
  createdAt: string;
213
748
  updatedAt: string;
214
749
  }
750
+ interface DeckOwnershipTransferPayload {
751
+ deck: Deck;
752
+ retainedAppAccess: boolean;
753
+ }
754
+ interface DeckCopyPayload {
755
+ deck: Deck;
756
+ copiedFromDeckId: string;
757
+ retainedAppAccess: boolean;
758
+ }
759
+ interface DeckAccessApplication {
760
+ id: string;
761
+ name: string;
762
+ description: string | null;
763
+ revokedAt: string | null;
764
+ }
765
+ interface DeckAPIApplicationAccess {
766
+ id: string;
767
+ deckId: string;
768
+ deck: Deck;
769
+ apiApplicationId: string;
770
+ apiApplication: DeckAccessApplication;
771
+ role: DeckAPIApplicationAccessRole;
772
+ grantSource: DeckAPIApplicationAccessGrantSource;
773
+ externalRef: string | null;
774
+ createdByAccountId: string | null;
775
+ createdByApiApplicationId: string | null;
776
+ revokedAt: string | null;
777
+ createdAt: string;
778
+ updatedAt: string;
779
+ }
215
780
  interface DeckPreviewToken {
216
781
  id: string;
217
782
  deckId: string;
@@ -226,6 +791,56 @@ interface DeckPreviewTokenCreatePayload {
226
791
  token: string;
227
792
  previewToken: DeckPreviewToken;
228
793
  }
794
+ interface DeckEmbedToken {
795
+ id: string;
796
+ deckId: string;
797
+ apiApplicationId: string | null;
798
+ label: string | null;
799
+ readMode: DeckTokenReadMode;
800
+ allowedOrigins: string[];
801
+ externalSubject: string | null;
802
+ expiresAt: string | null;
803
+ revokedAt: string | null;
804
+ lastUsedAt: string | null;
805
+ createdAt: string;
806
+ updatedAt: string;
807
+ }
808
+ interface DeckEmbedTokenCreatePayload {
809
+ token: string;
810
+ embedToken: DeckEmbedToken;
811
+ }
812
+ interface DeckAccessTokenIssuer {
813
+ id: string;
814
+ deckId: string;
815
+ apiApplicationId: string;
816
+ label: string | null;
817
+ readModes: DeckTokenReadMode[];
818
+ maxTokenLifetimeSeconds: number;
819
+ directSigningAlg: DeckAccessTokenSigningAlgorithm | null;
820
+ directSigningKeyId: string | null;
821
+ directSigningPublicKey: string | null;
822
+ directSigningKeyRevokedAt: string | null;
823
+ revokedAt: string | null;
824
+ createdAt: string;
825
+ updatedAt: string;
826
+ }
827
+ interface DeckAccessToken {
828
+ id: string;
829
+ deckId: string;
830
+ apiApplicationId: string;
831
+ issuerId: string;
832
+ readMode: DeckTokenReadMode;
833
+ externalSubject: string | null;
834
+ expiresAt: string;
835
+ revokedAt: string | null;
836
+ lastUsedAt: string | null;
837
+ createdAt: string;
838
+ updatedAt: string;
839
+ }
840
+ interface DeckAccessTokenExchangePayload {
841
+ token: string;
842
+ accessToken: DeckAccessToken;
843
+ }
229
844
  interface DeckEntry {
230
845
  id: string;
231
846
  datasetId: string;
@@ -235,6 +850,7 @@ interface DeckEntry {
235
850
  section: string;
236
851
  sortOrder: number;
237
852
  annotations: Record<string, unknown>;
853
+ display: Record<string, unknown>;
238
854
  record: DatasetRecord | null;
239
855
  }
240
856
  interface DeckEntryInput {
@@ -252,29 +868,363 @@ interface DeckCreateInput {
252
868
  description?: string;
253
869
  formatKey?: string;
254
870
  visibility?: DeckVisibility;
871
+ accessMode?: DeckAccessMode;
872
+ discoverability?: DeckDiscoverability;
255
873
  externalRef?: string;
874
+ externalSubjectRef?: string;
875
+ rulesetId?: string;
256
876
  sourceUrl?: string;
257
877
  metadata?: Record<string, unknown>;
258
878
  entries: DeckEntryInput[];
259
879
  }
880
+ interface DeckUpsertByExternalRefInput {
881
+ externalRef: string;
882
+ idempotencyKey?: string;
883
+ expectedDraftRevision?: number;
884
+ publisherSlug: string;
885
+ gameKey: string;
886
+ title: string;
887
+ description?: string;
888
+ formatKey?: string;
889
+ visibility?: DeckVisibility;
890
+ accessMode?: DeckAccessMode;
891
+ discoverability?: DeckDiscoverability;
892
+ externalSubjectRef?: string;
893
+ rulesetId?: string;
894
+ sourceUrl?: string;
895
+ metadata?: Record<string, unknown>;
896
+ entries: DeckEntryInput[];
897
+ }
898
+ interface DeckUpsertByExternalRefPayload {
899
+ deck: Deck;
900
+ created: boolean;
901
+ idempotentReplay: boolean;
902
+ }
260
903
  interface DeckUpdateInput {
904
+ expectedDraftRevision: number;
261
905
  title?: string;
262
906
  description?: string;
263
907
  formatKey?: string;
264
908
  visibility?: DeckVisibility;
909
+ accessMode?: DeckAccessMode;
910
+ discoverability?: DeckDiscoverability;
265
911
  externalRef?: string;
912
+ externalSubjectRef?: string;
913
+ rulesetId?: string;
266
914
  sourceUrl?: string;
267
915
  metadata?: Record<string, unknown>;
268
- entries?: DeckEntryInput[];
269
916
  }
270
917
  interface DeckPublishInput {
918
+ expectedDraftRevision: number;
271
919
  note?: string;
920
+ rulesetVersionId?: string;
921
+ cardDatasetVersionId?: string;
922
+ }
923
+ interface DeckEntryAddInput extends DeckEntryInput {
924
+ deckId: string;
925
+ expectedDraftRevision: number;
926
+ }
927
+ interface DeckEntryUpdateInput {
928
+ expectedDraftRevision: number;
929
+ datasetKey?: string;
930
+ identifier?: string;
931
+ quantity?: number;
932
+ section?: string;
933
+ sortOrder?: number;
934
+ annotations?: Record<string, unknown>;
935
+ }
936
+ interface DeckEntryReorderItemInput {
937
+ id: string;
938
+ section?: string;
939
+ sortOrder: number;
940
+ }
941
+ interface DeckEntryReorderInput {
942
+ expectedDraftRevision: number;
943
+ entries: DeckEntryReorderItemInput[];
944
+ }
945
+ interface DeckEntriesReplaceInput {
946
+ expectedDraftRevision: number;
947
+ entries: DeckEntryInput[];
948
+ }
949
+ interface DeckEntryMutationPayload {
950
+ deck: Deck;
951
+ entry: DeckEntry | null;
952
+ }
953
+ interface DeckEntryReorderPayload {
954
+ deck: Deck;
955
+ entries: DeckEntry[];
956
+ }
957
+ interface DeckEntriesReplacePayload {
958
+ deck: Deck;
959
+ entries: DeckEntry[];
960
+ }
961
+ interface DeckPublishPayload {
962
+ deck: Deck;
963
+ version: DeckVersion | null;
964
+ validation: DeckValidation;
965
+ blockers: DeckValidationIssue[];
966
+ warnings: DeckValidationIssue[];
967
+ }
968
+ interface DeckValidateInput {
969
+ rulesetVersionId?: string;
970
+ cardDatasetVersionId?: string;
971
+ }
972
+ interface DeckRemoveInvalidEntriesInput extends DeckValidateInput {
973
+ expectedDraftRevision: number;
974
+ }
975
+ interface DeckClaimInput {
976
+ idempotencyKey?: string;
977
+ expectedDraftRevision: number;
978
+ appAccess: DeckAppAccessRetention;
979
+ }
980
+ interface DeckTransferOwnershipInput {
981
+ idempotencyKey?: string;
982
+ targetAccountId: string;
983
+ expectedDraftRevision: number;
984
+ appAccess: DeckAppAccessRetention;
985
+ }
986
+ interface DeckCopyInput {
987
+ idempotencyKey?: string;
988
+ title?: string;
989
+ expectedDraftRevision: number;
990
+ appAccess: DeckAppAccessRetention;
991
+ }
992
+ interface DeckValidatedAgainst {
993
+ rulesetId: string | null;
994
+ rulesetVersionId: string | null;
995
+ rulesetVersionLabel: string | null;
996
+ cardDatasetId: string | null;
997
+ cardDatasetVersionId: string | null;
998
+ validatedAt: string;
999
+ validationResultSummary: Record<string, unknown>;
1000
+ }
1001
+ interface DeckValidationAffectedEntry {
1002
+ entryId: string;
1003
+ datasetId: string;
1004
+ recordId: string | null;
1005
+ identifier: string;
1006
+ section: string;
1007
+ quantity: number;
1008
+ }
1009
+ interface DeckValidationIssue {
1010
+ code: string;
1011
+ severity: DeckValidationSeverity;
1012
+ message: string;
1013
+ entryIds: string[];
1014
+ section: string | null;
1015
+ datasetId: string | null;
1016
+ identifier: string | null;
1017
+ metadata: Record<string, unknown>;
1018
+ }
1019
+ interface DeckValidation {
1020
+ deckId: string;
1021
+ valid: boolean;
1022
+ blockers: DeckValidationIssue[];
1023
+ warnings: DeckValidationIssue[];
1024
+ affectedEntries: DeckValidationAffectedEntry[];
1025
+ validatedAgainst: DeckValidatedAgainst;
1026
+ checkedAt: string;
1027
+ }
1028
+ interface DeckDiff {
1029
+ deckId: string;
1030
+ fromVersionId: string | null;
1031
+ toVersionId: string | null;
1032
+ toDraftRevision: number | null;
1033
+ hasChanges: boolean;
1034
+ diff: Record<string, unknown>;
1035
+ }
1036
+ interface DeckSectionDefinition {
1037
+ key: string;
1038
+ label: string;
1039
+ description: string | null;
1040
+ order: number;
1041
+ default: boolean;
1042
+ aliases: string[];
1043
+ minCards: number | null;
1044
+ maxCards: number | null;
1045
+ excludedFromDeckSize: boolean;
1046
+ legalCardTypes: string[];
1047
+ metadata: Record<string, unknown>;
272
1048
  }
273
1049
  interface DeckPreviewTokenCreateInput {
274
1050
  deckId: string;
275
1051
  label?: string;
276
1052
  expiresAt?: string;
277
1053
  }
1054
+ interface DeckEmbedTokenCreateInput {
1055
+ deckId: string;
1056
+ label?: string;
1057
+ readMode?: DeckTokenReadMode;
1058
+ allowedOrigins?: string[];
1059
+ externalSubject?: string;
1060
+ expiresAt?: string;
1061
+ }
1062
+ interface DeckAccessTokenIssuerCreateInput {
1063
+ deckId: string;
1064
+ apiApplicationId?: string;
1065
+ label?: string;
1066
+ readModes?: DeckTokenReadMode[];
1067
+ maxTokenLifetimeSeconds?: number;
1068
+ directSigningKey?: DeckAccessTokenIssuerSigningKeyInput;
1069
+ }
1070
+ interface DeckAccessTokenIssuerSigningKeyInput {
1071
+ algorithm: DeckAccessTokenSigningAlgorithm;
1072
+ keyId: string;
1073
+ publicKey: string;
1074
+ }
1075
+ interface DeckAccessTokenExchangeInput {
1076
+ deckId: string;
1077
+ readMode: DeckTokenReadMode;
1078
+ externalSubject?: string;
1079
+ expiresAt?: string;
1080
+ }
1081
+ interface DeckAPIApplicationAccessGrantInput {
1082
+ deckId: string;
1083
+ apiApplicationId: string;
1084
+ role: DeckAPIApplicationAccessRole;
1085
+ }
1086
+ interface DeckImportInput {
1087
+ deckId: string;
1088
+ format?: DeckImportFormat;
1089
+ importFormatId?: string;
1090
+ importFormatKey?: string;
1091
+ autoDetect?: boolean;
1092
+ datasetKey?: string;
1093
+ text: string;
1094
+ defaultSection?: string;
1095
+ replace?: boolean;
1096
+ dryRun?: boolean;
1097
+ expectedDraftRevision?: number;
1098
+ }
1099
+ interface DeckImportEntry {
1100
+ lineNumber: number;
1101
+ raw: string;
1102
+ datasetKey: string;
1103
+ datasetId: string;
1104
+ recordId: string;
1105
+ identifier: string;
1106
+ quantity: number;
1107
+ section: string;
1108
+ sortOrder: number;
1109
+ display: Record<string, unknown>;
1110
+ record: DatasetRecord | null;
1111
+ }
1112
+ interface DeckImportIssue {
1113
+ lineNumber: number;
1114
+ raw: string;
1115
+ code: string;
1116
+ message: string;
1117
+ }
1118
+ interface DeckImportUnmatchedEntry {
1119
+ lineNumber: number;
1120
+ raw: string;
1121
+ datasetKey: string;
1122
+ identifier: string;
1123
+ quantity: number;
1124
+ section: string;
1125
+ code: string;
1126
+ message: string;
1127
+ }
1128
+ interface DeckImportCandidate {
1129
+ recordId: string;
1130
+ identifier: string;
1131
+ display: Record<string, unknown>;
1132
+ }
1133
+ interface DeckImportAmbiguousEntry {
1134
+ lineNumber: number;
1135
+ raw: string;
1136
+ datasetKey: string;
1137
+ identifier: string;
1138
+ quantity: number;
1139
+ section: string;
1140
+ candidates: DeckImportCandidate[];
1141
+ }
1142
+ interface DeckImportFormatDefinition {
1143
+ id: string;
1144
+ gameId: string;
1145
+ key: string;
1146
+ name: string;
1147
+ description: string | null;
1148
+ enabled: boolean;
1149
+ priority: number;
1150
+ datasetKey: string;
1151
+ config: Record<string, unknown>;
1152
+ archivedAt: string | null;
1153
+ isArchived: boolean;
1154
+ createdAt: string;
1155
+ updatedAt: string;
1156
+ }
1157
+ type DeckImportFormatDefinitionConnection = Connection<DeckImportFormatDefinition>;
1158
+ interface DeckImportFormatDetection {
1159
+ formatId: string | null;
1160
+ key: string;
1161
+ name: string;
1162
+ confidence: number;
1163
+ reason: string;
1164
+ }
1165
+ interface DeckImportFormatTestPayload {
1166
+ detection: DeckImportFormatDetection;
1167
+ entries: DeckImportEntry[];
1168
+ parseErrors: DeckImportIssue[];
1169
+ unmatched: DeckImportUnmatchedEntry[];
1170
+ ambiguous: DeckImportAmbiguousEntry[];
1171
+ }
1172
+ interface DeckImportFormatCreateInput {
1173
+ gameId: string;
1174
+ key: string;
1175
+ name: string;
1176
+ description?: string;
1177
+ enabled?: boolean;
1178
+ priority?: number;
1179
+ datasetKey?: string;
1180
+ config: Record<string, unknown>;
1181
+ }
1182
+ interface DeckImportFormatUpdateInput {
1183
+ name?: string;
1184
+ description?: string;
1185
+ enabled?: boolean;
1186
+ priority?: number;
1187
+ datasetKey?: string;
1188
+ config?: Record<string, unknown>;
1189
+ }
1190
+ interface DeckImportFormatTestInput {
1191
+ gameId: string;
1192
+ formatId?: string;
1193
+ formatKey?: string;
1194
+ datasetKey?: string;
1195
+ defaultSection?: string;
1196
+ config?: Record<string, unknown>;
1197
+ text: string;
1198
+ }
1199
+ interface DeckImportPayload {
1200
+ deck: Deck | null;
1201
+ applied: boolean;
1202
+ dryRun: boolean;
1203
+ replace: boolean;
1204
+ format: DeckImportFormat;
1205
+ importFormat: DeckImportFormatDefinition | null;
1206
+ detection: DeckImportFormatDetection;
1207
+ entries: DeckImportEntry[];
1208
+ parseErrors: DeckImportIssue[];
1209
+ unmatched: DeckImportUnmatchedEntry[];
1210
+ ambiguous: DeckImportAmbiguousEntry[];
1211
+ validation: DeckValidation | null;
1212
+ }
1213
+ interface DeckHydrateEntriesInput {
1214
+ deckId: string;
1215
+ entries: DeckEntryInput[];
1216
+ }
1217
+ interface DeckHydrateEntriesPayload {
1218
+ entries: DeckImportEntry[];
1219
+ unmatched: DeckImportUnmatchedEntry[];
1220
+ ambiguous: DeckImportAmbiguousEntry[];
1221
+ }
1222
+ interface DeckExportPayload {
1223
+ deckId: string;
1224
+ format: DeckExportFormat;
1225
+ text: string;
1226
+ entryCount: number;
1227
+ }
278
1228
  interface HydrateDeckEntryInput {
279
1229
  identifier: string;
280
1230
  quantity: number;
@@ -296,7 +1246,42 @@ interface ResolvedLink {
296
1246
  values: string[];
297
1247
  records: (ResolvedRecord | null)[];
298
1248
  }
299
- type FieldType = 'STRING' | 'INTEGER' | 'FLOAT' | 'BOOLEAN' | 'DATE' | 'DATETIME' | 'URL' | 'IMAGE' | 'LINK' | 'ARRAY' | 'HASH';
1249
+ type FieldType = 'STRING' | 'INT' | 'INTEGER' | 'FLOAT' | 'BOOL' | 'BOOLEAN' | 'UUID' | 'DATE' | 'DATETIME' | 'URL' | 'FILE' | 'IMAGE' | 'LINK' | 'ARRAY' | 'HASH';
1250
+ interface ObjectField {
1251
+ id: string;
1252
+ objectTypeId: string;
1253
+ key: string;
1254
+ label: string;
1255
+ dataType: FieldType;
1256
+ isRequired: boolean;
1257
+ isFilterable: boolean;
1258
+ isSearchable: boolean;
1259
+ isIdentifier: boolean;
1260
+ sortOrder: number;
1261
+ description: string | null;
1262
+ placeholder: string | null;
1263
+ displayFormat: string | null;
1264
+ semanticType: string | null;
1265
+ isHidden: boolean;
1266
+ isComputed: boolean;
1267
+ isSystemField: boolean;
1268
+ defaultValue: unknown;
1269
+ allowedValues: unknown;
1270
+ minLength: number | null;
1271
+ maxLength: number | null;
1272
+ minValue: number | null;
1273
+ maxValue: number | null;
1274
+ pattern: string | null;
1275
+ isUnique: boolean;
1276
+ itemType: string | null;
1277
+ linkDatasetId: string | null;
1278
+ linkFieldKey: string | null;
1279
+ linkAlias: string | null;
1280
+ linkDirection: string | null;
1281
+ parentFieldId: string | null;
1282
+ createdAt: string;
1283
+ updatedAt: string;
1284
+ }
300
1285
  interface FieldInfo {
301
1286
  key: string;
302
1287
  label: string | null;
@@ -306,10 +1291,28 @@ interface FieldInfo {
306
1291
  filterable: boolean;
307
1292
  searchable: boolean;
308
1293
  isIdentifier: boolean;
309
- itemType: FieldType | null;
1294
+ sortOrder: number;
1295
+ itemType: string | null;
1296
+ linkDatasetId: string | null;
1297
+ linkDatasetKey: string | null;
1298
+ linkDatasetName: string | null;
1299
+ linkFieldKey: string | null;
1300
+ linkAlias: string | null;
1301
+ linkDirection: string | null;
310
1302
  displayFormat: string | null;
311
1303
  semanticType: string | null;
312
- allowedValues: string[] | null;
1304
+ placeholder: string | null;
1305
+ isHidden: boolean;
1306
+ isComputed: boolean;
1307
+ isSystemField: boolean;
1308
+ defaultValue: unknown;
1309
+ allowedValues: unknown;
1310
+ minLength: number | null;
1311
+ maxLength: number | null;
1312
+ minValue: number | null;
1313
+ maxValue: number | null;
1314
+ pattern: string | null;
1315
+ isUnique: boolean;
313
1316
  nestedFields: FieldInfo[] | null;
314
1317
  }
315
1318
  interface LinkFieldInfo {
@@ -318,6 +1321,10 @@ interface LinkFieldInfo {
318
1321
  targetDatasetKey: string;
319
1322
  targetDatasetName: string | null;
320
1323
  targetDatasetId: string;
1324
+ targetFieldKey: string | null;
1325
+ linkAlias: string | null;
1326
+ linkDirection: string | null;
1327
+ isArray: boolean;
321
1328
  }
322
1329
  interface DatasetSchema {
323
1330
  fields: FieldInfo[];
@@ -698,14 +1705,124 @@ interface SearchRecordsParams {
698
1705
  validateSchema?: boolean;
699
1706
  includePricing?: boolean;
700
1707
  }
1708
+ interface ListGamesParams {
1709
+ publisherId: string;
1710
+ first?: number;
1711
+ after?: string;
1712
+ includeArchived?: boolean;
1713
+ }
1714
+ interface GameLookupParams {
1715
+ id?: string;
1716
+ publisherId?: string;
1717
+ publisherSlug?: string;
1718
+ gameKey?: string;
1719
+ gameSlug?: string;
1720
+ }
1721
+ interface ListDatasetsParams {
1722
+ publisherId: string;
1723
+ gameId?: string;
1724
+ first?: number;
1725
+ after?: string;
1726
+ includeArchived?: boolean;
1727
+ purpose?: 'DATA' | 'RULES';
1728
+ }
1729
+ interface DatasetLookupParams {
1730
+ id?: string;
1731
+ publisherId?: string;
1732
+ gameId?: string;
1733
+ datasetKey?: string;
1734
+ }
1735
+ interface ListDatasetRecordsParams {
1736
+ datasetId: string;
1737
+ filter?: FilterCondition;
1738
+ orderBy?: {
1739
+ field: string;
1740
+ direction?: 'ASC' | 'DESC';
1741
+ };
1742
+ first?: number;
1743
+ after?: string;
1744
+ last?: number;
1745
+ before?: string;
1746
+ validateSchema?: boolean;
1747
+ }
1748
+ interface DatasetRecordLookupParams {
1749
+ id?: string;
1750
+ datasetId?: string;
1751
+ identifier?: string;
1752
+ publisherSlug?: string;
1753
+ gameKey?: string;
1754
+ datasetKey?: string;
1755
+ recordId?: string;
1756
+ resolveLinks?: string[];
1757
+ validateSchema?: boolean;
1758
+ includePricing?: boolean;
1759
+ }
1760
+ interface ListImportJobsParams {
1761
+ publisherId: string;
1762
+ datasetId?: string;
1763
+ status?: ImportJobStatus;
1764
+ first?: number;
1765
+ after?: string;
1766
+ }
1767
+ interface ListGameImportJobsParams {
1768
+ gameId: string;
1769
+ status?: ImportJobStatus;
1770
+ first?: number;
1771
+ after?: string;
1772
+ }
1773
+ interface ListDatasetRecordDeleteJobsParams {
1774
+ publisherId: string;
1775
+ datasetId?: string;
1776
+ status?: DatasetRecordDeleteJobStatus;
1777
+ first?: number;
1778
+ after?: string;
1779
+ }
1780
+ interface ListExportJobsParams {
1781
+ publisherId: string;
1782
+ gameId?: string;
1783
+ datasetId?: string;
1784
+ status?: ExportJobStatus;
1785
+ first?: number;
1786
+ after?: string;
1787
+ }
701
1788
  interface ListDecksParams {
702
1789
  first?: number;
703
1790
  after?: string;
1791
+ includeArchived?: boolean;
704
1792
  }
705
1793
  interface ListDeckVersionsParams {
706
1794
  first?: number;
707
1795
  after?: string;
708
1796
  }
1797
+ interface DeckSectionDefinitionsParams {
1798
+ publisherSlug?: string;
1799
+ gameKey?: string;
1800
+ gameId?: string;
1801
+ rulesetKey?: string;
1802
+ rulesetVersionId?: string;
1803
+ }
1804
+ interface ViewerDecksParams {
1805
+ filter?: ViewerDecksFilterInput;
1806
+ first?: number;
1807
+ after?: string;
1808
+ }
1809
+ interface AppDecksParams {
1810
+ filter?: AppDecksFilterInput;
1811
+ first?: number;
1812
+ after?: string;
1813
+ }
1814
+ interface PublicDecksParams {
1815
+ filter?: PublicDecksFilterInput;
1816
+ first?: number;
1817
+ after?: string;
1818
+ }
1819
+ interface ListDeckImportFormatsParams {
1820
+ publisherId?: string;
1821
+ gameId?: string;
1822
+ includeArchived?: boolean;
1823
+ first?: number;
1824
+ after?: string;
1825
+ }
709
1826
  declare const QueryBuilder: {
710
1827
  searchPublishers(params?: SearchPublishersParams): {
711
1828
  query: string;
@@ -733,6 +1850,20 @@ declare const QueryBuilder: {
733
1850
  fetchGames(): {
734
1851
  query: string;
735
1852
  };
1853
+ listGames(params: ListGamesParams): {
1854
+ query: string;
1855
+ variables: Record<string, unknown>;
1856
+ };
1857
+ game(params: GameLookupParams): {
1858
+ query: string;
1859
+ variables: Record<string, unknown>;
1860
+ };
1861
+ createGame(): {
1862
+ query: string;
1863
+ };
1864
+ updateGame(): {
1865
+ query: string;
1866
+ };
736
1867
  searchDatasets(params?: SearchDatasetsParams): {
737
1868
  query: string;
738
1869
  variables: Record<string, unknown>;
@@ -746,6 +1877,14 @@ declare const QueryBuilder: {
746
1877
  fetchDatasets(): {
747
1878
  query: string;
748
1879
  };
1880
+ listDatasets(params: ListDatasetsParams): {
1881
+ query: string;
1882
+ variables: Record<string, unknown>;
1883
+ };
1884
+ dataset(params: DatasetLookupParams): {
1885
+ query: string;
1886
+ variables: Record<string, unknown>;
1887
+ };
749
1888
  searchRecords(params: SearchRecordsParams): {
750
1889
  query: string;
751
1890
  variables: Record<string, unknown>;
@@ -762,22 +1901,149 @@ declare const QueryBuilder: {
762
1901
  fetchRecords(params?: RecordFieldOptions): {
763
1902
  query: string;
764
1903
  };
1904
+ listDatasetRecords(params: ListDatasetRecordsParams): {
1905
+ query: string;
1906
+ variables: Record<string, unknown>;
1907
+ };
1908
+ datasetRecord(params: DatasetRecordLookupParams): {
1909
+ query: string;
1910
+ variables: Record<string, unknown>;
1911
+ };
1912
+ upsertDatasetRecords(): {
1913
+ query: string;
1914
+ };
1915
+ deleteDatasetRecords(): {
1916
+ query: string;
1917
+ };
1918
+ datasetRecordDeleteJob(): {
1919
+ query: string;
1920
+ };
1921
+ datasetRecordDeleteJobs(params: ListDatasetRecordDeleteJobsParams): {
1922
+ query: string;
1923
+ variables: Record<string, unknown>;
1924
+ };
1925
+ datasetImportPreview(): {
1926
+ query: string;
1927
+ };
1928
+ datasetImportValidate(): {
1929
+ query: string;
1930
+ };
1931
+ datasetImportFromFile(): {
1932
+ query: string;
1933
+ };
1934
+ datasetImportFromPayload(): {
1935
+ query: string;
1936
+ };
1937
+ datasetImportFromUrl(): {
1938
+ query: string;
1939
+ };
1940
+ importJob(): {
1941
+ query: string;
1942
+ };
1943
+ importJobs(params: ListImportJobsParams): {
1944
+ query: string;
1945
+ variables: Record<string, unknown>;
1946
+ };
1947
+ importJobCancel(): {
1948
+ query: string;
1949
+ };
1950
+ importJobLogs(params: {
1951
+ importJobId: string;
1952
+ level?: string;
1953
+ datasetKey?: string;
1954
+ first?: number;
1955
+ after?: string;
1956
+ }): {
1957
+ query: string;
1958
+ variables: Record<string, unknown>;
1959
+ };
1960
+ gameImportPreview(): {
1961
+ query: string;
1962
+ };
1963
+ gameImportFromFile(): {
1964
+ query: string;
1965
+ };
1966
+ gameImportFromPayload(): {
1967
+ query: string;
1968
+ };
1969
+ gameImportFromUrl(): {
1970
+ query: string;
1971
+ };
1972
+ gameImportJob(): {
1973
+ query: string;
1974
+ };
1975
+ gameImportJobs(params: ListGameImportJobsParams): {
1976
+ query: string;
1977
+ variables: Record<string, unknown>;
1978
+ };
1979
+ gameImportJobCancel(): {
1980
+ query: string;
1981
+ };
1982
+ file(): {
1983
+ query: string;
1984
+ };
1985
+ fileUploadRequest(): {
1986
+ query: string;
1987
+ };
1988
+ fileUploadConfirm(): {
1989
+ query: string;
1990
+ };
1991
+ fileDelete(): {
1992
+ query: string;
1993
+ };
1994
+ exportJob(): {
1995
+ query: string;
1996
+ };
1997
+ exportJobs(params: ListExportJobsParams): {
1998
+ query: string;
1999
+ variables: Record<string, unknown>;
2000
+ };
2001
+ datasetExport(): {
2002
+ query: string;
2003
+ };
2004
+ exportJobCancel(): {
2005
+ query: string;
2006
+ };
2007
+ exportJobRefreshUrl(): {
2008
+ query: string;
2009
+ };
765
2010
  listMyDecks(params?: ListDecksParams): {
766
2011
  query: string;
767
2012
  variables: Record<string, unknown>;
768
2013
  };
2014
+ viewerDecks(params?: ViewerDecksParams): {
2015
+ query: string;
2016
+ variables: Record<string, unknown>;
2017
+ };
2018
+ appDecks(params?: AppDecksParams): {
2019
+ query: string;
2020
+ variables: Record<string, unknown>;
2021
+ };
2022
+ publicDecks(params?: PublicDecksParams): {
2023
+ query: string;
2024
+ variables: Record<string, unknown>;
2025
+ };
769
2026
  fetchDeckById(): {
770
2027
  query: string;
771
2028
  };
2029
+ deckById(): {
2030
+ query: string;
2031
+ };
772
2032
  myDeck(): {
773
2033
  query: string;
774
2034
  };
775
2035
  fetchDeckBySlug(): {
776
2036
  query: string;
777
2037
  };
2038
+ deckBySlug(): {
2039
+ query: string;
2040
+ };
778
2041
  fetchDeckByExternalRef(): {
779
2042
  query: string;
780
2043
  };
2044
+ deckByExternalRef(): {
2045
+ query: string;
2046
+ };
781
2047
  deckVersion(): {
782
2048
  query: string;
783
2049
  };
@@ -788,9 +2054,56 @@ declare const QueryBuilder: {
788
2054
  deckPreview(): {
789
2055
  query: string;
790
2056
  };
2057
+ deckEmbed(): {
2058
+ query: string;
2059
+ };
2060
+ deckAccess(): {
2061
+ query: string;
2062
+ };
2063
+ deckDraftDiff(): {
2064
+ query: string;
2065
+ };
2066
+ deckVersionDiff(): {
2067
+ query: string;
2068
+ };
2069
+ deckHydrateEntries(): {
2070
+ query: string;
2071
+ };
2072
+ deckExport(): {
2073
+ query: string;
2074
+ };
2075
+ deckValidate(): {
2076
+ query: string;
2077
+ };
2078
+ deckSectionDefinitions(params?: DeckSectionDefinitionsParams): {
2079
+ query: string;
2080
+ variables: Record<string, unknown>;
2081
+ };
791
2082
  deckCollaborators(): {
792
2083
  query: string;
793
2084
  };
2085
+ deckEmbedTokens(): {
2086
+ query: string;
2087
+ };
2088
+ deckAccessTokenIssuers(): {
2089
+ query: string;
2090
+ };
2091
+ deckApiApplicationAccesses(): {
2092
+ query: string;
2093
+ };
2094
+ myDeckApiApplicationAccesses(): {
2095
+ query: string;
2096
+ };
2097
+ deckImportFormats(params: ListDeckImportFormatsParams): {
2098
+ query: string;
2099
+ variables: Record<string, unknown>;
2100
+ };
2101
+ deckImportFormat(): {
2102
+ query: string;
2103
+ };
2104
+ deckImportFormatTest(): {
2105
+ query: string;
2106
+ };
794
2107
  deckPreviewTokens(): {
795
2108
  query: string;
796
2109
  };
@@ -803,9 +2116,63 @@ declare const QueryBuilder: {
803
2116
  deleteDeck(): {
804
2117
  query: string;
805
2118
  };
2119
+ archiveDeck(): {
2120
+ query: string;
2121
+ };
2122
+ restoreDeck(): {
2123
+ query: string;
2124
+ };
2125
+ unpublishDeck(): {
2126
+ query: string;
2127
+ };
2128
+ addDeckEntry(): {
2129
+ query: string;
2130
+ };
2131
+ updateDeckEntry(): {
2132
+ query: string;
2133
+ };
2134
+ removeDeckEntry(): {
2135
+ query: string;
2136
+ };
2137
+ reorderDeckEntries(): {
2138
+ query: string;
2139
+ };
2140
+ replaceDeckEntries(): {
2141
+ query: string;
2142
+ };
2143
+ importDeck(): {
2144
+ query: string;
2145
+ };
2146
+ createDeckImportFormat(): {
2147
+ query: string;
2148
+ };
2149
+ updateDeckImportFormat(): {
2150
+ query: string;
2151
+ };
2152
+ archiveDeckImportFormat(): {
2153
+ query: string;
2154
+ };
2155
+ unarchiveDeckImportFormat(): {
2156
+ query: string;
2157
+ };
2158
+ upsertDeckByExternalRef(): {
2159
+ query: string;
2160
+ };
2161
+ claimDeck(): {
2162
+ query: string;
2163
+ };
2164
+ transferDeckOwnership(): {
2165
+ query: string;
2166
+ };
2167
+ copyDeck(): {
2168
+ query: string;
2169
+ };
806
2170
  publishDeck(): {
807
2171
  query: string;
808
2172
  };
2173
+ removeInvalidDeckEntries(): {
2174
+ query: string;
2175
+ };
809
2176
  upsertDeckCollaborator(): {
810
2177
  query: string;
811
2178
  };
@@ -818,11 +2185,78 @@ declare const QueryBuilder: {
818
2185
  revokeDeckPreviewToken(): {
819
2186
  query: string;
820
2187
  };
2188
+ createDeckEmbedToken(): {
2189
+ query: string;
2190
+ };
2191
+ revokeDeckEmbedToken(): {
2192
+ query: string;
2193
+ };
2194
+ createDeckAccessTokenIssuer(): {
2195
+ query: string;
2196
+ };
2197
+ revokeDeckAccessTokenIssuer(): {
2198
+ query: string;
2199
+ };
2200
+ revokeDeckAccessTokenIssuerSigningKey(): {
2201
+ query: string;
2202
+ };
2203
+ exchangeDeckAccessToken(): {
2204
+ query: string;
2205
+ };
2206
+ grantDeckApiApplicationAccess(): {
2207
+ query: string;
2208
+ };
2209
+ revokeDeckApiApplicationAccess(): {
2210
+ query: string;
2211
+ };
2212
+ revokeDeckAccessToken(): {
2213
+ query: string;
2214
+ };
821
2215
  deckCreateVariables(input: DeckCreateInput): Record<string, unknown>;
822
2216
  deckUpdateVariables(id: string, input: DeckUpdateInput): Record<string, unknown>;
823
- deckPublishVariables(id: string, input?: DeckPublishInput): Record<string, unknown>;
2217
+ deckEntryAddVariables(input: DeckEntryAddInput): Record<string, unknown>;
2218
+ deckEntryUpdateVariables(id: string, input: DeckEntryUpdateInput): Record<string, unknown>;
2219
+ deckEntryRemoveVariables(id: string, expectedDraftRevision: number): Record<string, unknown>;
2220
+ deckEntryReorderVariables(deckId: string, input: DeckEntryReorderInput): Record<string, unknown>;
2221
+ deckEntriesReplaceVariables(deckId: string, input: DeckEntriesReplaceInput): Record<string, unknown>;
2222
+ deckImportVariables(input: DeckImportInput): Record<string, unknown>;
2223
+ deckImportFormatCreateVariables(input: DeckImportFormatCreateInput): Record<string, unknown>;
2224
+ deckImportFormatUpdateVariables(id: string, input: DeckImportFormatUpdateInput): Record<string, unknown>;
2225
+ deckImportFormatTestVariables(input: DeckImportFormatTestInput): Record<string, unknown>;
2226
+ deckUpsertByExternalRefVariables(input: DeckUpsertByExternalRefInput): Record<string, unknown>;
2227
+ deckClaimVariables(id: string, input: DeckClaimInput): Record<string, unknown>;
2228
+ deckTransferOwnershipVariables(id: string, input: DeckTransferOwnershipInput): Record<string, unknown>;
2229
+ deckCopyVariables(id: string, input: DeckCopyInput): Record<string, unknown>;
2230
+ deckPublishVariables(id: string, input: DeckPublishInput): Record<string, unknown>;
2231
+ deckValidateVariables(id: string, input?: DeckValidateInput): Record<string, unknown>;
2232
+ deckRemoveInvalidEntriesVariables(id: string, input: DeckRemoveInvalidEntriesInput): Record<string, unknown>;
2233
+ deckHydrateEntriesVariables(input: DeckHydrateEntriesInput): Record<string, unknown>;
2234
+ deckExportVariables(id: string, format: DeckExportFormat): Record<string, unknown>;
2235
+ deckVersionDiffVariables(fromVersionId: string, toVersionId: string): Record<string, unknown>;
824
2236
  deckCollaboratorVariables(deckId: string, accountId: string, role?: DeckCollaboratorRole): Record<string, unknown>;
825
2237
  deckPreviewTokenCreateVariables(input: DeckPreviewTokenCreateInput): Record<string, unknown>;
2238
+ deckEmbedTokenCreateVariables(input: DeckEmbedTokenCreateInput): Record<string, unknown>;
2239
+ deckAccessTokenIssuerCreateVariables(input: DeckAccessTokenIssuerCreateInput): Record<string, unknown>;
2240
+ deckAccessTokenExchangeVariables(input: DeckAccessTokenExchangeInput): Record<string, unknown>;
2241
+ deckApiApplicationAccessesVariables(deckId: string, includeRevoked?: boolean): Record<string, unknown>;
2242
+ myDeckApiApplicationAccessesVariables(applicationId?: string): Record<string, unknown>;
2243
+ deckApiApplicationAccessGrantVariables(input: DeckAPIApplicationAccessGrantInput): Record<string, unknown>;
2244
+ deckApiApplicationAccessRevokeVariables(deckId: string, apiApplicationId: string): Record<string, unknown>;
2245
+ gameCreateVariables(input: GameCreateInput): Record<string, unknown>;
2246
+ gameUpdateVariables(id: string, input: GameUpdateInput): Record<string, unknown>;
2247
+ datasetImportPreviewVariables(input: DatasetImportPreviewInput): Record<string, unknown>;
2248
+ datasetImportValidateVariables(input: DatasetImportValidateInput): Record<string, unknown>;
2249
+ datasetImportFromFileVariables(input: DatasetImportFromFileInput): Record<string, unknown>;
2250
+ datasetImportFromPayloadVariables(input: DatasetImportFromPayloadInput): Record<string, unknown>;
2251
+ datasetImportFromUrlVariables(input: DatasetImportFromUrlInput): Record<string, unknown>;
2252
+ gameImportPreviewVariables(input: GameImportPreviewInput): Record<string, unknown>;
2253
+ gameImportFromFileVariables(input: GameImportFromFileInput): Record<string, unknown>;
2254
+ gameImportFromPayloadVariables(input: GameImportFromPayloadInput): Record<string, unknown>;
2255
+ gameImportFromUrlVariables(input: GameImportFromUrlInput): Record<string, unknown>;
2256
+ datasetRecordsUpsertVariables(input: DatasetRecordsUpsertInput): Record<string, unknown>;
2257
+ datasetRecordsDeleteVariables(input: DatasetRecordsDeleteInput): Record<string, unknown>;
2258
+ fileUploadRequestVariables(input: FileUploadInput): Record<string, unknown>;
2259
+ datasetExportVariables(input: DatasetExportInput): Record<string, unknown>;
826
2260
  fetchMe(): {
827
2261
  query: string;
828
2262
  };
@@ -958,4 +2392,4 @@ declare class Collection<T> implements AsyncIterable<T> {
958
2392
  each(): AsyncIterable<T>;
959
2393
  }
960
2394
 
961
- 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, type TCGPlayerPrice, type TCGPlayerPricing, TimeoutError, ValidationError, contains, eq, gt, gte, ilike, isNotNull, isNull, like, lt, lte, neq, notWithin, resolveFilter, within };
2395
+ export { type APIAccount, type APIApplication, type APIKeyInfo, type AppDecksFilterInput, type AppDecksParams, AuthenticationError, type BulkCreateResult, type BulkImportResult, type BulkInsertMode, type BulkRecordError, type Cache, type CardDBConfig, CardDBError, Collection, type Connection, ConnectionError, type CsvOptions, type Dataset, type DatasetExportInput, type DatasetImportFromFileInput, type DatasetImportFromPayloadInput, type DatasetImportFromUrlInput, type DatasetImportPreview, type DatasetImportPreviewInput, type DatasetImportPreviewResult, type DatasetImportRunInput, type DatasetImportValidateInput, type DatasetPurpose, type DatasetRecord, type DatasetRecordDeleteJob, type DatasetRecordDeleteJobConnection, type DatasetRecordDeleteJobResult, type DatasetRecordDeleteJobStatus, type DatasetRecordDeleteResultStatus, type DatasetRecordDeleteTargetType, type DatasetRecordsDeleteInput, type DatasetRecordsUpsertInput, type DatasetRecordsUpsertPayload, type DatasetRef, type DatasetSchema, type DatasetVisibility, 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 ExportFormat, type ExportJob, type ExportJobConnection, type ExportJobStatus, type FieldInfo, type FieldMapping, type FieldMappingOverrideInput, type FieldMappingStatus, type FieldType, type File, type FileInfo, type FileStatus, type FileUploadInput, FilterBuilder, type FilterBuilderInterface, type FilterCondition, type FilterInput, type FilterOperatorValue, type FilterValue, type Game, type GameCreateInput, type GameImportDatasetStatus, type GameImportFromFileInput, type GameImportFromPayloadInput, type GameImportFromUrlInput, type GameImportJob, type GameImportJobConnection, type GameImportPreview, type GameImportPreviewInput, type GameImportRunInput, type GameRef, type GameUpdateInput, type GameVisibility, GraphQLError, type GraphQLErrorInfo, type HydrateDeckEntryInput, type HydratedDeckEntry, type ImportFormat, type ImportJob, type ImportJobAsset, type ImportJobAssetInput, type ImportJobConnection, type ImportJobLog, type ImportJobLogConnection, type ImportJobStatus, type ImportLogLevel, type ImportMode, type ImportOptions, type ImportStats, type ImportValidationError, type ImportWarning, type ImportWarningSeverity, type InferredChildField, type LinkFieldInfo, LinkResolutionError, type LinkResolutionFailure, type ListDeckImportFormatsParams, type ListDeckVersionsParams, type ListDecksParams, type LogLevel, type Logger, type NextPageLoader, NotFoundError, type ObjectField, type OnConflict, type PageInfo, type PresignedUpload, 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 };