@carddb/client 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.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _carddb_core from '@carddb/core';
2
- import { Logger, LogLevel, Cache, ResourceType, CardDBConfig, RateLimitInfo, GraphQLErrorInfo, Collection, Publisher, Game, Dataset, Deck, DeckVersion, DeckCollaborator, DeckPreviewToken, DeckCreateInput, DeckUpdateInput, DeckPublishInput, DeckCollaboratorRole, DeckPreviewTokenCreateInput, DeckPreviewTokenCreatePayload, HydrateDeckEntryInput, HydratedDeckEntry, FilterInput, DatasetRecord, APIKeyInfo } from '@carddb/core';
2
+ import { Logger, LogLevel, Cache, ResourceType, CardDBConfig, RateLimitInfo, GraphQLErrorInfo, Collection, Publisher, Game, GameCreateInput, GameUpdateInput, Dataset, DatasetSchema, Deck, ViewerDecksFilterInput, AppDecksFilterInput, PublicDecksFilterInput, DeckVersion, DeckDiff, DeckValidateInput, DeckValidation, DeckHydrateEntriesInput, DeckHydrateEntriesPayload, DeckExportFormat, DeckExportPayload, DeckSectionDefinition, DeckCollaborator, DeckPreviewToken, DeckEmbedToken, DeckAccessTokenIssuer, DeckAPIApplicationAccess, DeckCreateInput, DeckUpdateInput, DeckUpsertByExternalRefInput, DeckUpsertByExternalRefPayload, DeckClaimInput, DeckOwnershipTransferPayload, DeckTransferOwnershipInput, DeckCopyInput, DeckCopyPayload, DeckEntryAddInput, DeckEntryMutationPayload, DeckEntryUpdateInput, DeckEntryReorderInput, DeckEntryReorderPayload, DeckEntriesReplaceInput, DeckEntriesReplacePayload, DeckImportInput, DeckImportPayload, DeckImportFormatDefinition, DeckImportFormatTestInput, DeckImportFormatTestPayload, DeckImportFormatCreateInput, DeckImportFormatUpdateInput, DeckPublishInput, DeckPublishPayload, DeckRemoveInvalidEntriesInput, DeckCollaboratorRole, DeckPreviewTokenCreateInput, DeckPreviewTokenCreatePayload, DeckEmbedTokenCreateInput, DeckEmbedTokenCreatePayload, DeckAccessTokenIssuerCreateInput, DeckAPIApplicationAccessGrantInput, DeckAccessTokenExchangeInput, DeckAccessTokenExchangePayload, HydrateDeckEntryInput, HydratedDeckEntry, FilterInput, DatasetRecord, DatasetRecordsUpsertInput, DatasetRecordsUpsertPayload, DatasetRecordsDeleteInput, DatasetRecordDeleteJob, DatasetRecordDeleteJobStatus, DatasetImportPreviewInput, DatasetImportPreviewResult, DatasetImportValidateInput, BulkImportResult, DatasetImportRunInput, ImportJob, ImportJobStatus, ImportLogLevel, ImportJobLog, GameImportPreviewInput, GameImportPreview, GameImportRunInput, GameImportJob, DatasetExportInput, ExportJob, ExportJobStatus, File, FileUploadInput, PresignedUpload, APIKeyInfo } from '@carddb/core';
3
3
  export * from '@carddb/core';
4
4
 
5
5
  /**
@@ -16,6 +16,11 @@ declare const DEFAULT_RETRY_BASE_DELAY = 1000;
16
16
  declare const DEFAULT_RETRY_MAX_DELAY = 30000;
17
17
  declare class Configuration {
18
18
  apiKey?: string;
19
+ publishableKey?: string;
20
+ secretKey?: string;
21
+ accessToken?: string;
22
+ private legacyApiKey?;
23
+ environment?: 'TEST' | 'LIVE';
19
24
  endpoint: string;
20
25
  timeout: number;
21
26
  openTimeout: number;
@@ -65,6 +70,18 @@ declare class Configuration {
65
70
  * Validate both publisher and game access
66
71
  */
67
72
  validateAccess(publisherSlug?: string, gameKey?: string): void;
73
+ /**
74
+ * Secret-key-only helpers are for server runtimes and trusted backend workflows.
75
+ */
76
+ requireSecretCredential(operation: string): void;
77
+ /**
78
+ * API key sent on requests when no OAuth bearer token is configured.
79
+ */
80
+ requestApiKey(): string | undefined;
81
+ /**
82
+ * Explicit legacy apiKey supplied by the caller, excluding publishable/secret aliases.
83
+ */
84
+ configApiKey(): string | undefined;
68
85
  /**
69
86
  * Check if a log level should be logged
70
87
  */
@@ -215,8 +232,52 @@ interface GetGameOptions {
215
232
  /** Whether to use cache (defaults to client config) */
216
233
  cache?: boolean;
217
234
  }
235
+ interface ListGamesOptions extends GetGameOptions {
236
+ /** Maximum number of results per page */
237
+ first?: number;
238
+ /** Cursor for pagination */
239
+ after?: string;
240
+ /** Include archived games */
241
+ includeArchived?: boolean;
242
+ }
243
+ interface GetGameByKeyOptions extends GetGameOptions {
244
+ /** Publisher ID for authenticated publisher-management lookup */
245
+ publisherId?: string;
246
+ /** Publisher slug for authenticated publisher-management lookup */
247
+ publisherSlug?: string;
248
+ /** Stable game key */
249
+ gameKey: string;
250
+ }
251
+ interface GetGameBySlugOptions extends GetGameOptions {
252
+ /** Publisher ID for authenticated publisher-management lookup */
253
+ publisherId?: string;
254
+ /** Publisher slug for authenticated publisher-management lookup */
255
+ publisherSlug?: string;
256
+ /** Stable game slug, currently backed by metafyGameSlug */
257
+ gameSlug: string;
258
+ }
218
259
  declare class GamesResource extends BaseResource {
219
260
  constructor(connection: Connection, config: Configuration);
261
+ /**
262
+ * List games for a publisher-management context.
263
+ */
264
+ list(publisherId: string, options?: ListGamesOptions): Promise<Collection<Game>>;
265
+ /**
266
+ * Get a publisher-managed game by stable key.
267
+ */
268
+ getByKey(options: GetGameByKeyOptions): Promise<Game | null>;
269
+ /**
270
+ * Get a publisher-managed game by slug.
271
+ */
272
+ getBySlug(options: GetGameBySlugOptions): Promise<Game | null>;
273
+ /**
274
+ * Create a publisher-managed game. Requires a server-side secret credential.
275
+ */
276
+ create(input: GameCreateInput): Promise<Game>;
277
+ /**
278
+ * Update a publisher-managed game. Requires a server-side secret credential.
279
+ */
280
+ update(id: string, input: GameUpdateInput): Promise<Game>;
220
281
  /**
221
282
  * Search for games
222
283
  *
@@ -275,8 +336,40 @@ interface GetDatasetOptions {
275
336
  /** Whether to use cache (defaults to client config) */
276
337
  cache?: boolean;
277
338
  }
339
+ interface ListDatasetsOptions extends GetDatasetOptions {
340
+ /** Game ID to filter datasets */
341
+ gameId?: string;
342
+ /** Include archived datasets */
343
+ includeArchived?: boolean;
344
+ /** Dataset purpose to filter by */
345
+ purpose?: 'DATA' | 'RULES';
346
+ /** Maximum number of results per page */
347
+ first?: number;
348
+ /** Cursor for pagination */
349
+ after?: string;
350
+ }
351
+ interface GetDatasetByKeyOptions extends GetDatasetOptions {
352
+ /** Optional publisher ID ownership check */
353
+ publisherId?: string;
354
+ /** Game ID for stable dataset-key lookup */
355
+ gameId: string;
356
+ /** Stable dataset key */
357
+ datasetKey: string;
358
+ }
278
359
  declare class DatasetsResource extends BaseResource {
279
360
  constructor(connection: Connection, config: Configuration);
361
+ /**
362
+ * List datasets for a publisher-management context.
363
+ */
364
+ list(publisherId: string, options?: ListDatasetsOptions): Promise<Collection<Dataset>>;
365
+ /**
366
+ * Get a dataset by game ID and stable dataset key.
367
+ */
368
+ getByKey(options: GetDatasetByKeyOptions): Promise<Dataset | null>;
369
+ /**
370
+ * Fetch only the schema portion for a dataset.
371
+ */
372
+ getSchema(idOrOptions: string | GetDatasetByKeyOptions): Promise<DatasetSchema | null>;
280
373
  /**
281
374
  * Search for datasets
282
375
  *
@@ -323,9 +416,20 @@ interface ListDecksOptions {
323
416
  first?: number;
324
417
  /** Cursor for pagination */
325
418
  after?: string;
419
+ /** Include archived decks in owner lists */
420
+ includeArchived?: boolean;
326
421
  /** Whether to use cache (defaults to client config) */
327
422
  cache?: boolean;
328
423
  }
424
+ interface ListViewerDecksOptions extends ListDecksOptions {
425
+ filter?: ViewerDecksFilterInput;
426
+ }
427
+ interface ListAppDecksOptions extends ListDecksOptions {
428
+ filter?: AppDecksFilterInput;
429
+ }
430
+ interface ListPublicDecksOptions extends Omit<ListDecksOptions, 'includeArchived'> {
431
+ filter?: PublicDecksFilterInput;
432
+ }
329
433
  interface FetchDeckOptions {
330
434
  /** Whether to use cache (defaults to client config) */
331
435
  cache?: boolean;
@@ -335,6 +439,22 @@ type FetchDeckBySlugOptions = FetchDeckOptions;
335
439
  type ListDeckVersionsOptions = ListDecksOptions;
336
440
  type ListDeckCollaboratorsOptions = FetchDeckOptions;
337
441
  type ListDeckPreviewTokensOptions = FetchDeckOptions;
442
+ type ListDeckEmbedTokensOptions = FetchDeckOptions;
443
+ type ListDeckAccessTokenIssuersOptions = FetchDeckOptions;
444
+ interface ListDeckApiApplicationAccessesOptions extends FetchDeckOptions {
445
+ includeRevoked?: boolean;
446
+ }
447
+ interface ListMyDeckApiApplicationAccessesOptions extends FetchDeckOptions {
448
+ applicationId?: string;
449
+ }
450
+ type ListDeckImportFormatsOptions = ListDecksOptions;
451
+ interface DeckSectionDefinitionsOptions extends FetchDeckOptions {
452
+ publisherSlug?: string;
453
+ gameKey?: string;
454
+ gameId?: string;
455
+ rulesetKey?: string;
456
+ rulesetVersionId?: string;
457
+ }
338
458
  interface HydrateDeckEntriesOptions {
339
459
  /** Publisher slug (uses default if configured) */
340
460
  publisherSlug?: string;
@@ -355,6 +475,10 @@ declare class DecksResource extends BaseResource {
355
475
  * Fetch a hosted deck by CardDB UUID.
356
476
  */
357
477
  fetch(id: string, options?: FetchDeckOptions): Promise<Deck | null>;
478
+ /**
479
+ * Fetch a deck by UUID using the ownership-aware `deck` API.
480
+ */
481
+ get(id: string, options?: FetchDeckOptions): Promise<Deck | null>;
358
482
  /**
359
483
  * Fetch one deck owned by the current account or API application.
360
484
  */
@@ -363,14 +487,34 @@ declare class DecksResource extends BaseResource {
363
487
  * Fetch a hosted deck by canonical or historical slug.
364
488
  */
365
489
  fetchBySlug(publisherSlug: string, gameKey: string, slug: string, options?: FetchDeckBySlugOptions): Promise<Deck | null>;
490
+ /**
491
+ * Fetch by slug using the ownership-aware `deckBySlug` API.
492
+ */
493
+ getBySlug(publisherSlug: string, gameKey: string, slug: string, options?: FetchDeckBySlugOptions): Promise<Deck | null>;
366
494
  /**
367
495
  * Fetch a hosted deck by external reference for the current API application.
368
496
  */
369
497
  fetchByExternalRef(externalRef: string, options?: FetchDeckByExternalRefOptions): Promise<Deck | null>;
498
+ /**
499
+ * Fetch by external reference using the ownership-aware `deckByExternalRef` API.
500
+ */
501
+ getByExternalRef(externalRef: string, options?: FetchDeckByExternalRefOptions): Promise<Deck | null>;
370
502
  /**
371
503
  * List decks owned by the current account or API application.
372
504
  */
373
505
  listMine(options?: ListDecksOptions): Promise<Collection<Deck>>;
506
+ /**
507
+ * List decks owned by the current account or OAuth grant.
508
+ */
509
+ listViewer(options?: ListViewerDecksOptions): Promise<Collection<Deck>>;
510
+ /**
511
+ * List app-owned decks for the current secret-key API application.
512
+ */
513
+ listApp(options?: ListAppDecksOptions): Promise<Collection<Deck>>;
514
+ /**
515
+ * List published live decks eligible for public discovery.
516
+ */
517
+ listPublic(options?: ListPublicDecksOptions): Promise<Collection<Deck>>;
374
518
  /**
375
519
  * Fetch one immutable published deck version.
376
520
  */
@@ -383,6 +527,38 @@ declare class DecksResource extends BaseResource {
383
527
  * Fetch current draft data using a revocable preview token.
384
528
  */
385
529
  preview(token: string, options?: FetchDeckOptions): Promise<Deck | null>;
530
+ /**
531
+ * Fetch published embed data using a revocable embed token.
532
+ */
533
+ embed(token: string, options?: FetchDeckOptions): Promise<Deck | null>;
534
+ /**
535
+ * Fetch token-authorized published data using an exchanged access token.
536
+ */
537
+ access(token: string, options?: FetchDeckOptions): Promise<Deck | null>;
538
+ /**
539
+ * Compare the current draft against the latest published version.
540
+ */
541
+ draftDiff(id: string, options?: FetchDeckOptions): Promise<DeckDiff>;
542
+ /**
543
+ * Compare any two readable immutable deck versions from the same deck.
544
+ */
545
+ versionDiff(fromVersionId: string, toVersionId: string, options?: FetchDeckOptions): Promise<DeckDiff>;
546
+ /**
547
+ * Validate a draft against current or explicitly requested immutable rules/data.
548
+ */
549
+ validate(id: string, input?: DeckValidateInput, options?: FetchDeckOptions): Promise<DeckValidation>;
550
+ /**
551
+ * Hydrate unpersisted deck entries against a stored deck's game without mutating the deck.
552
+ */
553
+ hydrateDeckEntries(input: DeckHydrateEntriesInput, options?: FetchDeckOptions): Promise<DeckHydrateEntriesPayload>;
554
+ /**
555
+ * Export a readable deck representation in a deterministic text format.
556
+ */
557
+ exportDeck(id: string, format?: DeckExportFormat, options?: FetchDeckOptions): Promise<DeckExportPayload>;
558
+ /**
559
+ * Resolve current or historical ruleset section definitions.
560
+ */
561
+ sectionDefinitions(options?: DeckSectionDefinitionsOptions): Promise<DeckSectionDefinition[]>;
386
562
  /**
387
563
  * List collaborators for a deck.
388
564
  */
@@ -391,6 +567,22 @@ declare class DecksResource extends BaseResource {
391
567
  * List draft preview tokens for a deck.
392
568
  */
393
569
  listPreviewTokens(deckId: string, options?: ListDeckPreviewTokensOptions): Promise<DeckPreviewToken[]>;
570
+ /**
571
+ * List published embed tokens for a deck.
572
+ */
573
+ listEmbedTokens(deckId: string, options?: ListDeckEmbedTokensOptions): Promise<DeckEmbedToken[]>;
574
+ /**
575
+ * List trusted access token issuers for a deck.
576
+ */
577
+ listAccessTokenIssuers(deckId: string, options?: ListDeckAccessTokenIssuersOptions): Promise<DeckAccessTokenIssuer[]>;
578
+ /**
579
+ * List API applications with explicit access to one owned deck.
580
+ */
581
+ listApiApplicationAccesses(deckId: string, options?: ListDeckApiApplicationAccessesOptions): Promise<DeckAPIApplicationAccess[]>;
582
+ /**
583
+ * List selected-deck grants for the current account.
584
+ */
585
+ listMyApiApplicationAccesses(options?: ListMyDeckApiApplicationAccessesOptions): Promise<DeckAPIApplicationAccess[]>;
394
586
  /**
395
587
  * Create a hosted deck.
396
588
  */
@@ -399,14 +591,102 @@ declare class DecksResource extends BaseResource {
399
591
  * Update a hosted deck.
400
592
  */
401
593
  update(id: string, input: DeckUpdateInput): Promise<Deck>;
594
+ /**
595
+ * Update deck-level metadata without mutating entries.
596
+ */
597
+ updateMetadata(id: string, input: DeckUpdateInput): Promise<Deck>;
598
+ /**
599
+ * Create or replace a draft by API-application external reference.
600
+ */
601
+ upsertByExternalRef(input: DeckUpsertByExternalRefInput): Promise<DeckUpsertByExternalRefPayload>;
602
+ /**
603
+ * Claim an app-owned deck into the consenting OAuth user's account.
604
+ */
605
+ claim(id: string, input: DeckClaimInput): Promise<DeckOwnershipTransferPayload>;
606
+ /**
607
+ * Transfer a deck to another account.
608
+ */
609
+ transferOwnership(id: string, input: DeckTransferOwnershipInput): Promise<DeckOwnershipTransferPayload>;
610
+ /**
611
+ * Copy a deck into the current principal's ownership namespace.
612
+ */
613
+ copy(id: string, input: DeckCopyInput): Promise<DeckCopyPayload>;
614
+ /**
615
+ * Add one entry to a deck draft.
616
+ */
617
+ addEntry(input: DeckEntryAddInput): Promise<DeckEntryMutationPayload>;
618
+ /**
619
+ * Update one stable deck entry.
620
+ */
621
+ updateEntry(id: string, input: DeckEntryUpdateInput): Promise<DeckEntryMutationPayload>;
622
+ /**
623
+ * Remove one stable deck entry.
624
+ */
625
+ removeEntry(id: string, expectedDraftRevision: number): Promise<DeckEntryMutationPayload>;
626
+ /**
627
+ * Reorder deck entries within or across sections.
628
+ */
629
+ reorderEntries(deckId: string, input: DeckEntryReorderInput): Promise<DeckEntryReorderPayload>;
630
+ /**
631
+ * Explicitly replace all deck entries for import or repair flows.
632
+ */
633
+ replaceEntries(deckId: string, input: DeckEntriesReplaceInput): Promise<DeckEntriesReplacePayload>;
634
+ /**
635
+ * Import a decklist into an existing deck or dry-run resolution.
636
+ */
637
+ importDeck(input: DeckImportInput): Promise<DeckImportPayload>;
638
+ /**
639
+ * List publisher-managed configured import formats for a game.
640
+ */
641
+ listImportFormats(gameId: string, options?: ListDeckImportFormatsOptions): Promise<Collection<DeckImportFormatDefinition>>;
642
+ /**
643
+ * Fetch one configured import format by UUID.
644
+ */
645
+ fetchImportFormat(id: string, options?: FetchDeckOptions): Promise<DeckImportFormatDefinition | null>;
646
+ /**
647
+ * Preview configured import-format parsing and record resolution.
648
+ */
649
+ testImportFormat(input: DeckImportFormatTestInput): Promise<DeckImportFormatTestPayload>;
650
+ /**
651
+ * Create a publisher-managed configured import format.
652
+ */
653
+ createImportFormat(input: DeckImportFormatCreateInput): Promise<DeckImportFormatDefinition>;
654
+ /**
655
+ * Update a publisher-managed configured import format.
656
+ */
657
+ updateImportFormat(id: string, input: DeckImportFormatUpdateInput): Promise<DeckImportFormatDefinition>;
658
+ /**
659
+ * Archive a configured import format.
660
+ */
661
+ archiveImportFormat(id: string): Promise<DeckImportFormatDefinition>;
662
+ /**
663
+ * Restore an archived configured import format.
664
+ */
665
+ unarchiveImportFormat(id: string): Promise<DeckImportFormatDefinition>;
402
666
  /**
403
667
  * Delete a hosted deck.
404
668
  */
405
669
  delete(id: string): Promise<boolean>;
670
+ /**
671
+ * Recoverably hide a deck from normal owner and public lists.
672
+ */
673
+ archive(id: string): Promise<Deck>;
674
+ /**
675
+ * Restore an archived deck to draft or published state.
676
+ */
677
+ restore(id: string): Promise<Deck>;
678
+ /**
679
+ * Remove the current public published pointer while keeping version history.
680
+ */
681
+ unpublish(id: string): Promise<Deck>;
406
682
  /**
407
683
  * Publish the current draft as an immutable deck version.
408
684
  */
409
- publish(id: string, input?: DeckPublishInput): Promise<DeckVersion>;
685
+ publish(id: string, input: DeckPublishInput): Promise<DeckPublishPayload>;
686
+ /**
687
+ * Remove draft entries that fail card-reference validation.
688
+ */
689
+ removeInvalidEntries(id: string, input: DeckRemoveInvalidEntriesInput): Promise<Deck>;
410
690
  /**
411
691
  * Create or update a deck collaborator.
412
692
  */
@@ -423,6 +703,42 @@ declare class DecksResource extends BaseResource {
423
703
  * Revoke a draft preview token.
424
704
  */
425
705
  revokePreviewToken(id: string): Promise<boolean>;
706
+ /**
707
+ * Create a revocable published embed token.
708
+ */
709
+ createEmbedToken(input: DeckEmbedTokenCreateInput): Promise<DeckEmbedTokenCreatePayload>;
710
+ /**
711
+ * Revoke a published embed token.
712
+ */
713
+ revokeEmbedToken(id: string): Promise<boolean>;
714
+ /**
715
+ * Trust the current API application to exchange short-lived deck access tokens.
716
+ */
717
+ createAccessTokenIssuer(input: DeckAccessTokenIssuerCreateInput): Promise<DeckAccessTokenIssuer>;
718
+ /**
719
+ * Revoke a trusted deck access token issuer.
720
+ */
721
+ revokeAccessTokenIssuer(id: string): Promise<boolean>;
722
+ /**
723
+ * Revoke only the direct signing key for a trusted deck access token issuer.
724
+ */
725
+ revokeAccessTokenIssuerSigningKey(id: string): Promise<DeckAccessTokenIssuer>;
726
+ /**
727
+ * Grant or update one OAuth app's selected-deck access.
728
+ */
729
+ grantApiApplicationAccess(input: DeckAPIApplicationAccessGrantInput): Promise<DeckAPIApplicationAccess>;
730
+ /**
731
+ * Revoke one OAuth app's selected-deck access.
732
+ */
733
+ revokeApiApplicationAccess(deckId: string, apiApplicationId: string): Promise<boolean>;
734
+ /**
735
+ * Exchange the current trusted API application credential for a deck access token.
736
+ */
737
+ exchangeAccessToken(input: DeckAccessTokenExchangeInput): Promise<DeckAccessTokenExchangePayload>;
738
+ /**
739
+ * Revoke an exchanged deck access token.
740
+ */
741
+ revokeAccessToken(id: string): Promise<boolean>;
426
742
  /**
427
743
  * Hydrate third-party-owned deck entries without storing them in CardDB.
428
744
  */
@@ -513,8 +829,83 @@ interface GetRecordsByIdentifierOptions {
513
829
  /** Whether to use cache (defaults to client config) */
514
830
  cache?: boolean;
515
831
  }
832
+ interface ListRecordsOptions {
833
+ /** Dataset ID to list records from */
834
+ datasetId: string;
835
+ /** Filter conditions - can be an object or a builder function */
836
+ filter?: FilterInput;
837
+ /** Sort field and direction */
838
+ orderBy?: {
839
+ field: string;
840
+ direction?: 'ASC' | 'DESC';
841
+ };
842
+ /** Maximum number of results per page */
843
+ first?: number;
844
+ /** Cursor for forward pagination */
845
+ after?: string;
846
+ /** Maximum number of results for backward pagination */
847
+ last?: number;
848
+ /** Cursor for backward pagination */
849
+ before?: string;
850
+ /** Validate and sanitize against schema */
851
+ validateSchema?: boolean;
852
+ /** Whether to use cache (defaults to client config) */
853
+ cache?: boolean;
854
+ }
855
+ interface GetRecordByDatasetIdentifierOptions extends GetRecordOptions {
856
+ /** Dataset ID to search */
857
+ datasetId: string;
858
+ /** Identifier value to look up */
859
+ identifier: string;
860
+ }
861
+ interface ListRecordDeleteJobsOptions {
862
+ /** Dataset ID to filter jobs */
863
+ datasetId?: string;
864
+ /** Job status to filter by */
865
+ status?: DatasetRecordDeleteJobStatus;
866
+ /** Maximum number of results per page */
867
+ first?: number;
868
+ /** Cursor for pagination */
869
+ after?: string;
870
+ /** Whether to use cache (defaults to client config) */
871
+ cache?: boolean;
872
+ }
873
+ interface WaitForRecordDeleteJobOptions {
874
+ /** Polling interval in milliseconds */
875
+ intervalMs?: number;
876
+ /** Max time to wait in milliseconds */
877
+ timeoutMs?: number;
878
+ }
516
879
  declare class RecordsResource extends BaseResource {
517
880
  constructor(connection: Connection, config: Configuration);
881
+ /**
882
+ * List records in a publisher-accessible dataset by dataset ID.
883
+ */
884
+ list(options: ListRecordsOptions): Promise<Collection<DatasetRecord>>;
885
+ /**
886
+ * Get a publisher-accessible record by dataset ID and identifier value.
887
+ */
888
+ getByDatasetIdentifier(options: GetRecordByDatasetIdentifierOptions): Promise<DatasetRecord | null>;
889
+ /**
890
+ * Start an import-backed batch upsert, or return a dry-run result. Requires a secret credential.
891
+ */
892
+ upsertBatch(input: DatasetRecordsUpsertInput): Promise<DatasetRecordsUpsertPayload>;
893
+ /**
894
+ * Create a dry-run or destructive bulk delete/reconciliation job. Requires a secret credential.
895
+ */
896
+ deleteBatch(input: DatasetRecordsDeleteInput): Promise<DatasetRecordDeleteJob>;
897
+ /**
898
+ * Get one bulk delete/reconciliation job.
899
+ */
900
+ getDeleteJob(id: string, options?: GetRecordOptions): Promise<DatasetRecordDeleteJob | null>;
901
+ /**
902
+ * List bulk delete/reconciliation jobs for a publisher.
903
+ */
904
+ listDeleteJobs(publisherId: string, options?: ListRecordDeleteJobsOptions): Promise<Collection<DatasetRecordDeleteJob>>;
905
+ /**
906
+ * Poll a delete job until it reaches a terminal state.
907
+ */
908
+ waitForDeleteJob(id: string, options?: WaitForRecordDeleteJobOptions): Promise<DatasetRecordDeleteJob>;
518
909
  /**
519
910
  * Search for records in a dataset with filtering, search, and pagination
520
911
  *
@@ -693,6 +1084,262 @@ declare class RulesResource extends BaseResource {
693
1084
  private searchRuleRecords;
694
1085
  }
695
1086
 
1087
+ /**
1088
+ * Publisher-managed import format resource for CardDB API
1089
+ */
1090
+
1091
+ interface ListImportFormatsOptions {
1092
+ /** Publisher ID for publisher-scoped listing */
1093
+ publisherId?: string;
1094
+ /** Game ID for game-scoped listing */
1095
+ gameId?: string;
1096
+ /** Include archived definitions */
1097
+ includeArchived?: boolean;
1098
+ /** Maximum number of results per page */
1099
+ first?: number;
1100
+ /** Cursor for pagination */
1101
+ after?: string;
1102
+ /** Whether to use cache (defaults to client config) */
1103
+ cache?: boolean;
1104
+ }
1105
+ interface GetImportFormatOptions {
1106
+ /** Whether to use cache (defaults to client config) */
1107
+ cache?: boolean;
1108
+ }
1109
+ interface GetImportFormatByKeyOptions extends GetImportFormatOptions {
1110
+ /** Game ID for stable format-key lookup */
1111
+ gameId: string;
1112
+ /** Stable import format key */
1113
+ key: string;
1114
+ }
1115
+ declare class ImportFormatsResource extends BaseResource {
1116
+ constructor(connection: Connection, config: Configuration);
1117
+ /**
1118
+ * List publisher-managed import formats by publisher or game scope.
1119
+ */
1120
+ list(options: ListImportFormatsOptions): Promise<Collection<DeckImportFormatDefinition>>;
1121
+ /**
1122
+ * Get one import format by UUID.
1123
+ */
1124
+ get(id: string, options?: GetImportFormatOptions): Promise<DeckImportFormatDefinition | null>;
1125
+ /**
1126
+ * Get one import format by game ID and stable key.
1127
+ */
1128
+ getByKey(options: GetImportFormatByKeyOptions): Promise<DeckImportFormatDefinition | null>;
1129
+ /**
1130
+ * Preview parsing and record resolution for a configured import format.
1131
+ */
1132
+ test(input: DeckImportFormatTestInput): Promise<DeckImportFormatTestPayload>;
1133
+ /**
1134
+ * Create an import format. Requires a server-side secret credential.
1135
+ */
1136
+ create(input: DeckImportFormatCreateInput): Promise<DeckImportFormatDefinition>;
1137
+ /**
1138
+ * Update an import format. Requires a server-side secret credential.
1139
+ */
1140
+ update(id: string, input: DeckImportFormatUpdateInput): Promise<DeckImportFormatDefinition>;
1141
+ /**
1142
+ * Archive an import format. Requires a server-side secret credential.
1143
+ */
1144
+ archive(id: string): Promise<DeckImportFormatDefinition>;
1145
+ /**
1146
+ * Restore an archived import format. Requires a server-side secret credential.
1147
+ */
1148
+ unarchive(id: string): Promise<DeckImportFormatDefinition>;
1149
+ }
1150
+
1151
+ /**
1152
+ * Publisher import jobs resource for CardDB API
1153
+ */
1154
+
1155
+ interface ListImportJobsOptions {
1156
+ /** Dataset ID to filter by */
1157
+ datasetId?: string;
1158
+ /** Job status to filter by */
1159
+ status?: ImportJobStatus;
1160
+ /** Maximum number of results per page */
1161
+ first?: number;
1162
+ /** Cursor for pagination */
1163
+ after?: string;
1164
+ /** Whether to use cache (defaults to client config) */
1165
+ cache?: boolean;
1166
+ }
1167
+ interface ListGameImportJobsOptions {
1168
+ /** Job status to filter by */
1169
+ status?: ImportJobStatus;
1170
+ /** Maximum number of results per page */
1171
+ first?: number;
1172
+ /** Cursor for pagination */
1173
+ after?: string;
1174
+ /** Whether to use cache (defaults to client config) */
1175
+ cache?: boolean;
1176
+ }
1177
+ interface ListImportJobLogsOptions {
1178
+ /** Log level to filter by */
1179
+ level?: ImportLogLevel;
1180
+ /** Dataset key to filter by */
1181
+ datasetKey?: string;
1182
+ /** Maximum number of results per page */
1183
+ first?: number;
1184
+ /** Cursor for pagination */
1185
+ after?: string;
1186
+ /** Whether to use cache (defaults to client config) */
1187
+ cache?: boolean;
1188
+ }
1189
+ interface WaitForImportJobOptions {
1190
+ /** Polling interval in milliseconds */
1191
+ intervalMs?: number;
1192
+ /** Max time to wait in milliseconds */
1193
+ timeoutMs?: number;
1194
+ }
1195
+ declare class ImportsResource extends BaseResource {
1196
+ constructor(connection: Connection, config: Configuration);
1197
+ /**
1198
+ * Preview a single-dataset import source without writing records or schema.
1199
+ */
1200
+ preview(input: DatasetImportPreviewInput): Promise<DatasetImportPreviewResult>;
1201
+ /**
1202
+ * Validate a single-dataset import source with dry-run enforced.
1203
+ */
1204
+ validate(input: DatasetImportValidateInput): Promise<BulkImportResult>;
1205
+ /**
1206
+ * Start an async single-dataset import from `fileId`, `data`, or `sourceUrl`.
1207
+ */
1208
+ run(input: DatasetImportRunInput): Promise<ImportJob>;
1209
+ /**
1210
+ * Fetch one single-dataset import job.
1211
+ */
1212
+ getJob(id: string, options?: {
1213
+ cache?: boolean;
1214
+ }): Promise<ImportJob | null>;
1215
+ /**
1216
+ * List single-dataset import jobs for a publisher.
1217
+ */
1218
+ listJobs(publisherId: string, options?: ListImportJobsOptions): Promise<Collection<ImportJob>>;
1219
+ /**
1220
+ * Cancel a pending or processing single-dataset import job.
1221
+ */
1222
+ cancelJob(id: string): Promise<ImportJob>;
1223
+ /**
1224
+ * List structured logs for one single-dataset import job.
1225
+ */
1226
+ listJobLogs(importJobId: string, options?: ListImportJobLogsOptions): Promise<Collection<ImportJobLog>>;
1227
+ /**
1228
+ * Poll a single-dataset import job until completion or failure.
1229
+ */
1230
+ waitForJob(id: string, options?: WaitForImportJobOptions): Promise<ImportJob>;
1231
+ /**
1232
+ * Preview an advanced game-level import source without writing records or schema.
1233
+ */
1234
+ previewGame(input: GameImportPreviewInput): Promise<GameImportPreview>;
1235
+ /**
1236
+ * Start an async advanced game-level import from `fileId`, `data`, or `sourceUrl`.
1237
+ */
1238
+ runGame(input: GameImportRunInput): Promise<GameImportJob>;
1239
+ /**
1240
+ * Fetch one advanced game-level import job.
1241
+ */
1242
+ getGameJob(id: string, options?: {
1243
+ cache?: boolean;
1244
+ }): Promise<GameImportJob | null>;
1245
+ /**
1246
+ * List advanced game-level import jobs.
1247
+ */
1248
+ listGameJobs(gameId: string, options?: ListGameImportJobsOptions): Promise<Collection<GameImportJob>>;
1249
+ /**
1250
+ * Cancel a pending or processing advanced game-level import job.
1251
+ */
1252
+ cancelGameJob(id: string): Promise<GameImportJob>;
1253
+ /**
1254
+ * Poll an advanced game-level import job until completion or failure.
1255
+ */
1256
+ waitForGameJob(id: string, options?: WaitForImportJobOptions): Promise<GameImportJob>;
1257
+ }
1258
+
1259
+ /**
1260
+ * Publisher dataset export jobs resource for CardDB API
1261
+ */
1262
+
1263
+ interface ListExportJobsOptions {
1264
+ /** Game ID to filter by */
1265
+ gameId?: string;
1266
+ /** Dataset ID to filter by */
1267
+ datasetId?: string;
1268
+ /** Job status to filter by */
1269
+ status?: ExportJobStatus;
1270
+ /** Maximum number of results per page */
1271
+ first?: number;
1272
+ /** Cursor for pagination */
1273
+ after?: string;
1274
+ /** Whether to use cache (defaults to client config) */
1275
+ cache?: boolean;
1276
+ }
1277
+ interface WaitForExportJobOptions {
1278
+ /** Polling interval in milliseconds */
1279
+ intervalMs?: number;
1280
+ /** Max time to wait in milliseconds */
1281
+ timeoutMs?: number;
1282
+ }
1283
+ declare class ExportsResource extends BaseResource {
1284
+ constructor(connection: Connection, config: Configuration);
1285
+ /**
1286
+ * Start an async dataset export. Requires a server-side secret credential.
1287
+ */
1288
+ run(input: DatasetExportInput): Promise<ExportJob>;
1289
+ /** Alias for `run`. */
1290
+ create(input: DatasetExportInput): Promise<ExportJob>;
1291
+ /**
1292
+ * Fetch one export job.
1293
+ */
1294
+ getJob(id: string, options?: {
1295
+ cache?: boolean;
1296
+ }): Promise<ExportJob | null>;
1297
+ /**
1298
+ * List export jobs for a publisher, optionally filtered by game, dataset, or status.
1299
+ */
1300
+ listJobs(publisherId: string, options?: ListExportJobsOptions): Promise<Collection<ExportJob>>;
1301
+ /**
1302
+ * Refresh the signed download URL for a completed export job.
1303
+ */
1304
+ refreshUrl(id: string): Promise<ExportJob>;
1305
+ /**
1306
+ * Cancel a pending or processing export job. Requires a server-side secret credential.
1307
+ */
1308
+ cancel(id: string): Promise<ExportJob>;
1309
+ /**
1310
+ * Poll an export job until completion or failure.
1311
+ */
1312
+ waitForJob(id: string, options?: WaitForExportJobOptions): Promise<ExportJob>;
1313
+ }
1314
+
1315
+ /**
1316
+ * File upload helper resource for CardDB API
1317
+ */
1318
+
1319
+ interface GetFileOptions {
1320
+ /** Whether to use cache (defaults to client config) */
1321
+ cache?: boolean;
1322
+ }
1323
+ declare class FilesResource extends BaseResource {
1324
+ constructor(connection: Connection, config: Configuration);
1325
+ /**
1326
+ * Get one file by ID.
1327
+ */
1328
+ get(id: string, options?: GetFileOptions): Promise<File | null>;
1329
+ /**
1330
+ * Request a presigned URL for direct upload. Requires a server-side secret credential.
1331
+ */
1332
+ requestUpload(input: FileUploadInput): Promise<PresignedUpload>;
1333
+ /**
1334
+ * Confirm that a presigned upload completed.
1335
+ */
1336
+ confirmUpload(id: string): Promise<File>;
1337
+ /**
1338
+ * Delete a file. Requires a server-side secret credential.
1339
+ */
1340
+ delete(id: string): Promise<boolean>;
1341
+ }
1342
+
696
1343
  /**
697
1344
  * CardDB API Client
698
1345
  *
@@ -756,6 +1403,14 @@ declare class CardDBClient {
756
1403
  readonly decks: DecksResource;
757
1404
  /** Rules resource for game rules and deck formats */
758
1405
  readonly rules: RulesResource;
1406
+ /** Publisher-managed import format resource */
1407
+ readonly importFormats: ImportFormatsResource;
1408
+ /** Publisher import job resource */
1409
+ readonly imports: ImportsResource;
1410
+ /** Publisher dataset export job resource */
1411
+ readonly exports: ExportsResource;
1412
+ /** File upload helper resource */
1413
+ readonly files: FilesResource;
759
1414
  /**
760
1415
  * Create a new CardDB client
761
1416
  *
@@ -837,4 +1492,4 @@ declare function readCache<T>(cache: Cache, key: string): Promise<T | null>;
837
1492
  */
838
1493
  declare function writeCache<T>(cache: Cache, key: string, value: T, ttl: number): Promise<void>;
839
1494
 
840
- export { BaseResource, CardDBClient, Configuration, Connection, DEFAULT_CACHE_TTL, DEFAULT_ENDPOINT, DEFAULT_MAX_NETWORK_RETRIES, DEFAULT_MAX_RETRIES, DEFAULT_OPEN_TIMEOUT, DEFAULT_RETRY_BASE_DELAY, DEFAULT_RETRY_MAX_DELAY, DEFAULT_TIMEOUT, DatasetsResource, DecksResource, type FetchDeckByExternalRefOptions, type FetchDeckBySlugOptions, type FetchDeckOptions, GamesResource, type GetDatasetOptions, type GetGameOptions, type GetPublisherOptions, type GetRecordByIdentifierOptions, type GetRecordOptions, type GetRecordsByIdentifierOptions, type GraphQLResponse, type HydrateDeckEntriesOptions, type ListDeckCollaboratorsOptions, type ListDeckPreviewTokensOptions, type ListDeckVersionsOptions, type ListDecksOptions, type ListFormatsOptions, type ListRuleDatasetsOptions, type ListRulesOptions, PublishersResource, RecordsResource, RulesResource, type SearchDatasetsOptions, type SearchGamesOptions, type SearchPublishersOptions, type SearchRecordsOptions, cacheKey, getRateLimitInfo, getSDKVersion, getUserAgent, readCache, writeCache };
1495
+ export { BaseResource, CardDBClient, Configuration, Connection, DEFAULT_CACHE_TTL, DEFAULT_ENDPOINT, DEFAULT_MAX_NETWORK_RETRIES, DEFAULT_MAX_RETRIES, DEFAULT_OPEN_TIMEOUT, DEFAULT_RETRY_BASE_DELAY, DEFAULT_RETRY_MAX_DELAY, DEFAULT_TIMEOUT, DatasetsResource, type DeckSectionDefinitionsOptions, DecksResource, ExportsResource, type FetchDeckByExternalRefOptions, type FetchDeckBySlugOptions, type FetchDeckOptions, FilesResource, GamesResource, type GetDatasetByKeyOptions, type GetDatasetOptions, type GetFileOptions, type GetGameByKeyOptions, type GetGameBySlugOptions, type GetGameOptions, type GetImportFormatByKeyOptions, type GetImportFormatOptions, type GetPublisherOptions, type GetRecordByDatasetIdentifierOptions, type GetRecordByIdentifierOptions, type GetRecordOptions, type GetRecordsByIdentifierOptions, type GraphQLResponse, type HydrateDeckEntriesOptions, ImportFormatsResource, ImportsResource, type ListAppDecksOptions, type ListDatasetsOptions, type ListDeckAccessTokenIssuersOptions, type ListDeckApiApplicationAccessesOptions, type ListDeckCollaboratorsOptions, type ListDeckEmbedTokensOptions, type ListDeckImportFormatsOptions, type ListDeckPreviewTokensOptions, type ListDeckVersionsOptions, type ListDecksOptions, type ListExportJobsOptions, type ListFormatsOptions, type ListGameImportJobsOptions, type ListGamesOptions, type ListImportFormatsOptions, type ListImportJobLogsOptions, type ListImportJobsOptions, type ListMyDeckApiApplicationAccessesOptions, type ListPublicDecksOptions, type ListRecordDeleteJobsOptions, type ListRecordsOptions, type ListRuleDatasetsOptions, type ListRulesOptions, type ListViewerDecksOptions, PublishersResource, RecordsResource, RulesResource, type SearchDatasetsOptions, type SearchGamesOptions, type SearchPublishersOptions, type SearchRecordsOptions, type WaitForExportJobOptions, type WaitForImportJobOptions, type WaitForRecordDeleteJobOptions, cacheKey, getRateLimitInfo, getSDKVersion, getUserAgent, readCache, writeCache };