@carddb/core 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts 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;
@@ -82,6 +82,36 @@ interface FileInfo {
82
82
  id: string;
83
83
  url: string;
84
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
+ }
85
115
  type PublisherStatus = 'ACTIVE' | 'DEACTIVATED';
86
116
  interface Publisher {
87
117
  id: string;
@@ -106,8 +136,10 @@ interface Game {
106
136
  key: string;
107
137
  name: string;
108
138
  description: string | null;
139
+ metafyGameUuid?: string | null;
140
+ metafyGameSlug?: string | null;
109
141
  website: string | null;
110
- visibility: string;
142
+ visibility: GameVisibility;
111
143
  isArchived: boolean;
112
144
  publisher: PublisherRef | null;
113
145
  logoFile: FileInfo | null;
@@ -115,6 +147,29 @@ interface Game {
115
147
  createdAt: string;
116
148
  updatedAt: string;
117
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
+ }
118
173
  interface GameRef {
119
174
  id: string;
120
175
  key: string;
@@ -127,9 +182,14 @@ interface Dataset {
127
182
  key: string;
128
183
  name: string;
129
184
  description: string | null;
130
- purpose: 'DATA' | 'RULES';
185
+ purpose: DatasetPurpose;
186
+ activeVersionId?: string | null;
131
187
  tcgplayerProductIdFieldKey: string | null;
132
- visibility: string;
188
+ visibility: DatasetVisibility;
189
+ posX?: number;
190
+ posY?: number;
191
+ sortOrder?: number;
192
+ archivedAt?: string | null;
133
193
  isArchived: boolean;
134
194
  publisher: PublisherRef | null;
135
195
  game: GameRef | null;
@@ -137,6 +197,8 @@ interface Dataset {
137
197
  createdAt: string;
138
198
  updatedAt: string;
139
199
  }
200
+ type DatasetPurpose = 'DATA' | 'RULES';
201
+ type DatasetVisibility = 'PRIVATE' | 'PUBLIC';
140
202
  interface DatasetRef {
141
203
  id: string;
142
204
  key: string;
@@ -154,6 +216,390 @@ interface DatasetRecord {
154
216
  createdAt: string;
155
217
  updatedAt: string;
156
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>;
157
603
  interface TCGPlayerPricing {
158
604
  productId: string;
159
605
  prices: TCGPlayerPrice[];
@@ -173,6 +619,7 @@ type DeckAccessMode = 'PUBLIC' | 'OWNER_ONLY' | 'AUTHORIZED_TOKEN';
173
619
  type DeckDiscoverability = 'LISTED' | 'UNLISTED';
174
620
  type DeckState = 'DRAFT' | 'PUBLISHED' | 'ARCHIVED' | 'DELETED';
175
621
  type DeckTokenReadMode = 'PUBLIC' | 'PREVIEW' | 'EMBED' | 'FULL';
622
+ type DeckSessionScope = 'DECKS_READ' | 'DECKS_WRITE' | 'DECKS_PUBLISH' | 'DECKS_DELETE' | 'DECKS_EMBED' | 'DECKS_PREVIEW' | 'DECKS_COLLABORATE';
176
623
  type DeckAccessTokenSigningAlgorithm = 'ED25519';
177
624
  type DeckImportFormat = 'SIMPLE_TEXT' | 'CONFIGURED';
178
625
  type DeckExportFormat = 'SIMPLE_TEXT';
@@ -395,6 +842,24 @@ interface DeckAccessTokenExchangePayload {
395
842
  token: string;
396
843
  accessToken: DeckAccessToken;
397
844
  }
845
+ interface DeckSessionToken {
846
+ id: string;
847
+ accountId: string;
848
+ apiApplicationId: string;
849
+ gameId: string;
850
+ environment: DeckEnvironment;
851
+ externalSubject: string;
852
+ scopes: string[];
853
+ expiresAt: string;
854
+ revokedAt: string | null;
855
+ lastUsedAt: string | null;
856
+ createdAt: string;
857
+ updatedAt: string;
858
+ }
859
+ interface DeckSessionTokenExchangePayload {
860
+ token: string;
861
+ sessionToken: DeckSessionToken;
862
+ }
398
863
  interface DeckEntry {
399
864
  id: string;
400
865
  datasetId: string;
@@ -632,6 +1097,13 @@ interface DeckAccessTokenExchangeInput {
632
1097
  externalSubject?: string;
633
1098
  expiresAt?: string;
634
1099
  }
1100
+ interface DeckSessionTokenExchangeInput {
1101
+ publisherSlug: string;
1102
+ gameKey: string;
1103
+ externalSubject: string;
1104
+ scopes: DeckSessionScope[];
1105
+ expiresAt?: string;
1106
+ }
635
1107
  interface DeckAPIApplicationAccessGrantInput {
636
1108
  deckId: string;
637
1109
  apiApplicationId: string;
@@ -800,7 +1272,42 @@ interface ResolvedLink {
800
1272
  values: string[];
801
1273
  records: (ResolvedRecord | null)[];
802
1274
  }
803
- type FieldType = 'STRING' | 'INTEGER' | 'FLOAT' | 'BOOLEAN' | 'DATE' | 'DATETIME' | 'URL' | 'IMAGE' | 'LINK' | 'ARRAY' | 'HASH';
1275
+ type FieldType = 'STRING' | 'INT' | 'INTEGER' | 'FLOAT' | 'BOOL' | 'BOOLEAN' | 'UUID' | 'DATE' | 'DATETIME' | 'URL' | 'FILE' | 'IMAGE' | 'LINK' | 'ARRAY' | 'HASH';
1276
+ interface ObjectField {
1277
+ id: string;
1278
+ objectTypeId: string;
1279
+ key: string;
1280
+ label: string;
1281
+ dataType: FieldType;
1282
+ isRequired: boolean;
1283
+ isFilterable: boolean;
1284
+ isSearchable: boolean;
1285
+ isIdentifier: boolean;
1286
+ sortOrder: number;
1287
+ description: string | null;
1288
+ placeholder: string | null;
1289
+ displayFormat: string | null;
1290
+ semanticType: string | null;
1291
+ isHidden: boolean;
1292
+ isComputed: boolean;
1293
+ isSystemField: boolean;
1294
+ defaultValue: unknown;
1295
+ allowedValues: unknown;
1296
+ minLength: number | null;
1297
+ maxLength: number | null;
1298
+ minValue: number | null;
1299
+ maxValue: number | null;
1300
+ pattern: string | null;
1301
+ isUnique: boolean;
1302
+ itemType: string | null;
1303
+ linkDatasetId: string | null;
1304
+ linkFieldKey: string | null;
1305
+ linkAlias: string | null;
1306
+ linkDirection: string | null;
1307
+ parentFieldId: string | null;
1308
+ createdAt: string;
1309
+ updatedAt: string;
1310
+ }
804
1311
  interface FieldInfo {
805
1312
  key: string;
806
1313
  label: string | null;
@@ -810,10 +1317,28 @@ interface FieldInfo {
810
1317
  filterable: boolean;
811
1318
  searchable: boolean;
812
1319
  isIdentifier: boolean;
813
- itemType: FieldType | null;
1320
+ sortOrder: number;
1321
+ itemType: string | null;
1322
+ linkDatasetId: string | null;
1323
+ linkDatasetKey: string | null;
1324
+ linkDatasetName: string | null;
1325
+ linkFieldKey: string | null;
1326
+ linkAlias: string | null;
1327
+ linkDirection: string | null;
814
1328
  displayFormat: string | null;
815
1329
  semanticType: string | null;
816
- allowedValues: string[] | null;
1330
+ placeholder: string | null;
1331
+ isHidden: boolean;
1332
+ isComputed: boolean;
1333
+ isSystemField: boolean;
1334
+ defaultValue: unknown;
1335
+ allowedValues: unknown;
1336
+ minLength: number | null;
1337
+ maxLength: number | null;
1338
+ minValue: number | null;
1339
+ maxValue: number | null;
1340
+ pattern: string | null;
1341
+ isUnique: boolean;
817
1342
  nestedFields: FieldInfo[] | null;
818
1343
  }
819
1344
  interface LinkFieldInfo {
@@ -822,6 +1347,10 @@ interface LinkFieldInfo {
822
1347
  targetDatasetKey: string;
823
1348
  targetDatasetName: string | null;
824
1349
  targetDatasetId: string;
1350
+ targetFieldKey: string | null;
1351
+ linkAlias: string | null;
1352
+ linkDirection: string | null;
1353
+ isArray: boolean;
825
1354
  }
826
1355
  interface DatasetSchema {
827
1356
  fields: FieldInfo[];
@@ -1202,6 +1731,86 @@ interface SearchRecordsParams {
1202
1731
  validateSchema?: boolean;
1203
1732
  includePricing?: boolean;
1204
1733
  }
1734
+ interface ListGamesParams {
1735
+ publisherId: string;
1736
+ first?: number;
1737
+ after?: string;
1738
+ includeArchived?: boolean;
1739
+ }
1740
+ interface GameLookupParams {
1741
+ id?: string;
1742
+ publisherId?: string;
1743
+ publisherSlug?: string;
1744
+ gameKey?: string;
1745
+ gameSlug?: string;
1746
+ }
1747
+ interface ListDatasetsParams {
1748
+ publisherId: string;
1749
+ gameId?: string;
1750
+ first?: number;
1751
+ after?: string;
1752
+ includeArchived?: boolean;
1753
+ purpose?: 'DATA' | 'RULES';
1754
+ }
1755
+ interface DatasetLookupParams {
1756
+ id?: string;
1757
+ publisherId?: string;
1758
+ gameId?: string;
1759
+ datasetKey?: string;
1760
+ }
1761
+ interface ListDatasetRecordsParams {
1762
+ datasetId: string;
1763
+ filter?: FilterCondition;
1764
+ orderBy?: {
1765
+ field: string;
1766
+ direction?: 'ASC' | 'DESC';
1767
+ };
1768
+ first?: number;
1769
+ after?: string;
1770
+ last?: number;
1771
+ before?: string;
1772
+ validateSchema?: boolean;
1773
+ }
1774
+ interface DatasetRecordLookupParams {
1775
+ id?: string;
1776
+ datasetId?: string;
1777
+ identifier?: string;
1778
+ publisherSlug?: string;
1779
+ gameKey?: string;
1780
+ datasetKey?: string;
1781
+ recordId?: string;
1782
+ resolveLinks?: string[];
1783
+ validateSchema?: boolean;
1784
+ includePricing?: boolean;
1785
+ }
1786
+ interface ListImportJobsParams {
1787
+ publisherId: string;
1788
+ datasetId?: string;
1789
+ status?: ImportJobStatus;
1790
+ first?: number;
1791
+ after?: string;
1792
+ }
1793
+ interface ListGameImportJobsParams {
1794
+ gameId: string;
1795
+ status?: ImportJobStatus;
1796
+ first?: number;
1797
+ after?: string;
1798
+ }
1799
+ interface ListDatasetRecordDeleteJobsParams {
1800
+ publisherId: string;
1801
+ datasetId?: string;
1802
+ status?: DatasetRecordDeleteJobStatus;
1803
+ first?: number;
1804
+ after?: string;
1805
+ }
1806
+ interface ListExportJobsParams {
1807
+ publisherId: string;
1808
+ gameId?: string;
1809
+ datasetId?: string;
1810
+ status?: ExportJobStatus;
1811
+ first?: number;
1812
+ after?: string;
1813
+ }
1205
1814
  interface ListDecksParams {
1206
1815
  first?: number;
1207
1816
  after?: string;
@@ -1234,7 +1843,8 @@ interface PublicDecksParams {
1234
1843
  after?: string;
1235
1844
  }
1236
1845
  interface ListDeckImportFormatsParams {
1237
- gameId: string;
1846
+ publisherId?: string;
1847
+ gameId?: string;
1238
1848
  includeArchived?: boolean;
1239
1849
  first?: number;
1240
1850
  after?: string;
@@ -1266,6 +1876,20 @@ declare const QueryBuilder: {
1266
1876
  fetchGames(): {
1267
1877
  query: string;
1268
1878
  };
1879
+ listGames(params: ListGamesParams): {
1880
+ query: string;
1881
+ variables: Record<string, unknown>;
1882
+ };
1883
+ game(params: GameLookupParams): {
1884
+ query: string;
1885
+ variables: Record<string, unknown>;
1886
+ };
1887
+ createGame(): {
1888
+ query: string;
1889
+ };
1890
+ updateGame(): {
1891
+ query: string;
1892
+ };
1269
1893
  searchDatasets(params?: SearchDatasetsParams): {
1270
1894
  query: string;
1271
1895
  variables: Record<string, unknown>;
@@ -1279,6 +1903,14 @@ declare const QueryBuilder: {
1279
1903
  fetchDatasets(): {
1280
1904
  query: string;
1281
1905
  };
1906
+ listDatasets(params: ListDatasetsParams): {
1907
+ query: string;
1908
+ variables: Record<string, unknown>;
1909
+ };
1910
+ dataset(params: DatasetLookupParams): {
1911
+ query: string;
1912
+ variables: Record<string, unknown>;
1913
+ };
1282
1914
  searchRecords(params: SearchRecordsParams): {
1283
1915
  query: string;
1284
1916
  variables: Record<string, unknown>;
@@ -1295,6 +1927,112 @@ declare const QueryBuilder: {
1295
1927
  fetchRecords(params?: RecordFieldOptions): {
1296
1928
  query: string;
1297
1929
  };
1930
+ listDatasetRecords(params: ListDatasetRecordsParams): {
1931
+ query: string;
1932
+ variables: Record<string, unknown>;
1933
+ };
1934
+ datasetRecord(params: DatasetRecordLookupParams): {
1935
+ query: string;
1936
+ variables: Record<string, unknown>;
1937
+ };
1938
+ upsertDatasetRecords(): {
1939
+ query: string;
1940
+ };
1941
+ deleteDatasetRecords(): {
1942
+ query: string;
1943
+ };
1944
+ datasetRecordDeleteJob(): {
1945
+ query: string;
1946
+ };
1947
+ datasetRecordDeleteJobs(params: ListDatasetRecordDeleteJobsParams): {
1948
+ query: string;
1949
+ variables: Record<string, unknown>;
1950
+ };
1951
+ datasetImportPreview(): {
1952
+ query: string;
1953
+ };
1954
+ datasetImportValidate(): {
1955
+ query: string;
1956
+ };
1957
+ datasetImportFromFile(): {
1958
+ query: string;
1959
+ };
1960
+ datasetImportFromPayload(): {
1961
+ query: string;
1962
+ };
1963
+ datasetImportFromUrl(): {
1964
+ query: string;
1965
+ };
1966
+ importJob(): {
1967
+ query: string;
1968
+ };
1969
+ importJobs(params: ListImportJobsParams): {
1970
+ query: string;
1971
+ variables: Record<string, unknown>;
1972
+ };
1973
+ importJobCancel(): {
1974
+ query: string;
1975
+ };
1976
+ importJobLogs(params: {
1977
+ importJobId: string;
1978
+ level?: string;
1979
+ datasetKey?: string;
1980
+ first?: number;
1981
+ after?: string;
1982
+ }): {
1983
+ query: string;
1984
+ variables: Record<string, unknown>;
1985
+ };
1986
+ gameImportPreview(): {
1987
+ query: string;
1988
+ };
1989
+ gameImportFromFile(): {
1990
+ query: string;
1991
+ };
1992
+ gameImportFromPayload(): {
1993
+ query: string;
1994
+ };
1995
+ gameImportFromUrl(): {
1996
+ query: string;
1997
+ };
1998
+ gameImportJob(): {
1999
+ query: string;
2000
+ };
2001
+ gameImportJobs(params: ListGameImportJobsParams): {
2002
+ query: string;
2003
+ variables: Record<string, unknown>;
2004
+ };
2005
+ gameImportJobCancel(): {
2006
+ query: string;
2007
+ };
2008
+ file(): {
2009
+ query: string;
2010
+ };
2011
+ fileUploadRequest(): {
2012
+ query: string;
2013
+ };
2014
+ fileUploadConfirm(): {
2015
+ query: string;
2016
+ };
2017
+ fileDelete(): {
2018
+ query: string;
2019
+ };
2020
+ exportJob(): {
2021
+ query: string;
2022
+ };
2023
+ exportJobs(params: ListExportJobsParams): {
2024
+ query: string;
2025
+ variables: Record<string, unknown>;
2026
+ };
2027
+ datasetExport(): {
2028
+ query: string;
2029
+ };
2030
+ exportJobCancel(): {
2031
+ query: string;
2032
+ };
2033
+ exportJobRefreshUrl(): {
2034
+ query: string;
2035
+ };
1298
2036
  listMyDecks(params?: ListDecksParams): {
1299
2037
  query: string;
1300
2038
  variables: Record<string, unknown>;
@@ -1491,6 +2229,9 @@ declare const QueryBuilder: {
1491
2229
  exchangeDeckAccessToken(): {
1492
2230
  query: string;
1493
2231
  };
2232
+ exchangeDeckSessionToken(): {
2233
+ query: string;
2234
+ };
1494
2235
  grantDeckApiApplicationAccess(): {
1495
2236
  query: string;
1496
2237
  };
@@ -1526,10 +2267,26 @@ declare const QueryBuilder: {
1526
2267
  deckEmbedTokenCreateVariables(input: DeckEmbedTokenCreateInput): Record<string, unknown>;
1527
2268
  deckAccessTokenIssuerCreateVariables(input: DeckAccessTokenIssuerCreateInput): Record<string, unknown>;
1528
2269
  deckAccessTokenExchangeVariables(input: DeckAccessTokenExchangeInput): Record<string, unknown>;
2270
+ deckSessionTokenExchangeVariables(input: DeckSessionTokenExchangeInput): Record<string, unknown>;
1529
2271
  deckApiApplicationAccessesVariables(deckId: string, includeRevoked?: boolean): Record<string, unknown>;
1530
2272
  myDeckApiApplicationAccessesVariables(applicationId?: string): Record<string, unknown>;
1531
2273
  deckApiApplicationAccessGrantVariables(input: DeckAPIApplicationAccessGrantInput): Record<string, unknown>;
1532
2274
  deckApiApplicationAccessRevokeVariables(deckId: string, apiApplicationId: string): Record<string, unknown>;
2275
+ gameCreateVariables(input: GameCreateInput): Record<string, unknown>;
2276
+ gameUpdateVariables(id: string, input: GameUpdateInput): Record<string, unknown>;
2277
+ datasetImportPreviewVariables(input: DatasetImportPreviewInput): Record<string, unknown>;
2278
+ datasetImportValidateVariables(input: DatasetImportValidateInput): Record<string, unknown>;
2279
+ datasetImportFromFileVariables(input: DatasetImportFromFileInput): Record<string, unknown>;
2280
+ datasetImportFromPayloadVariables(input: DatasetImportFromPayloadInput): Record<string, unknown>;
2281
+ datasetImportFromUrlVariables(input: DatasetImportFromUrlInput): Record<string, unknown>;
2282
+ gameImportPreviewVariables(input: GameImportPreviewInput): Record<string, unknown>;
2283
+ gameImportFromFileVariables(input: GameImportFromFileInput): Record<string, unknown>;
2284
+ gameImportFromPayloadVariables(input: GameImportFromPayloadInput): Record<string, unknown>;
2285
+ gameImportFromUrlVariables(input: GameImportFromUrlInput): Record<string, unknown>;
2286
+ datasetRecordsUpsertVariables(input: DatasetRecordsUpsertInput): Record<string, unknown>;
2287
+ datasetRecordsDeleteVariables(input: DatasetRecordsDeleteInput): Record<string, unknown>;
2288
+ fileUploadRequestVariables(input: FileUploadInput): Record<string, unknown>;
2289
+ datasetExportVariables(input: DatasetExportInput): Record<string, unknown>;
1533
2290
  fetchMe(): {
1534
2291
  query: string;
1535
2292
  };
@@ -1665,4 +2422,4 @@ declare class Collection<T> implements AsyncIterable<T> {
1665
2422
  each(): AsyncIterable<T>;
1666
2423
  }
1667
2424
 
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 };
2425
+ 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 DeckSessionScope, type DeckSessionToken, type DeckSessionTokenExchangeInput, type DeckSessionTokenExchangePayload, 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 };