@carddb/client 0.4.5 → 0.5.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.cjs +266 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +141 -2
- package/dist/index.d.ts +141 -2
- package/dist/index.js +266 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
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, GameCreateInput, GameUpdateInput, GameScanRegion, Dataset, DatasetSchema, Deck, DeckReadState, DeckPublishedVersionSelector, ViewerDecksFilterInput, AppDecksFilterInput, PublicDecksFilterInput, DeckVersion, DeckDiff, DeckValidateInput, DeckValidation, DeckHydrateEntriesInput, DeckHydrateEntriesPayload, DeckExportFormat, DeckExportPayload, DeckSectionDefinition, DeckCollaborator, 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, DeckTokenIssuerCreateInput, DeckTokenIssuer, DeckAPIApplicationAccessGrantInput, DeckTokenExchangeInput, DeckTokenExchangePayload, 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, UploadPurpose, CreateScanUploadSessionInput, ConfirmScanUploadInput, CreateScanJobInput, ScanJobPayload, ScanJob, SubmitScanFeedbackInput, ScanFeedbackPayload, ScanMetricsInput, ScanMetrics, ResolveScanTemplateInput, ScanTemplateResolution, ScanTemplatesInput, ScanTemplate, SaveScanTemplateInput, ScanTemplatePayload, PreviewScanTemplateInput, ScanTemplatePreview, APIKeyInfo } from '@carddb/core';
|
|
2
|
+
import { Logger, LogLevel, Cache, ResourceType, CardDBConfig, RateLimitInfo, GraphQLErrorInfo, Collection, Publisher, Game, GameCreateInput, GameUpdateInput, GameScanRegion, Dataset, DatasetSchema, DatasetFilterValueConnection, Deck, DeckReadState, DeckPublishedVersionSelector, ViewerDecksFilterInput, AppDecksFilterInput, PublicDecksFilterInput, DeckVersion, DeckDiff, DeckValidateInput, DeckValidation, DeckHydrateEntriesInput, DeckHydrateEntriesPayload, DeckExportFormat, DeckExportPayload, DeckSectionDefinition, DeckCollaborator, 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, DeckTokenIssuerCreateInput, DeckTokenIssuer, DeckAPIApplicationAccessGrantInput, DeckTokenExchangeInput, DeckTokenExchangePayload, HydrateDeckEntryInput, HydratedDeckEntry, FilterInput, DatasetRecord, DatasetRecordsUpsertInput, DatasetRecordsUpsertPayload, DatasetRecordsDeleteInput, DatasetRecordDeleteJob, DatasetRecordDeleteJobStatus, Ruleset, RulesetVersionStatus, RulesetVersion, DeckValidationRules, RulesetVersionDraftImportFromDatasetRecordInput, RulesetVersionDraftImportPreview, RulesetValidationImpact, RulesetCreateInput, RulesetUpdateInput, RulesetVersionDraftCreateInput, RulesetVersionDraftUpdateInput, RulesetVersionPublishInput, DatasetImportPreviewInput, DatasetImportPreviewResult, DatasetImportValidateInput, BulkImportResult, DatasetImportRunInput, ImportJob, ImportJobStatus, ImportLogLevel, ImportJobLog, GameImportPreviewInput, GameImportPreview, GameImportRunInput, GameImportJob, DatasetExportInput, ExportJob, ExportJobStatus, File, FileUploadInput, PresignedUpload, UploadPurpose, CreateScanUploadSessionInput, ConfirmScanUploadInput, CreateScanJobInput, ScanJobPayload, ScanJob, SubmitScanFeedbackInput, ScanFeedbackPayload, ScanMetricsInput, ScanMetrics, ResolveScanTemplateInput, ScanTemplateResolution, ScanTemplatesInput, ScanTemplate, SaveScanTemplateInput, ScanTemplatePayload, PreviewScanTemplateInput, ScanTemplatePreview, APIKeyInfo } from '@carddb/core';
|
|
3
3
|
export * from '@carddb/core';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -368,6 +368,16 @@ interface GetDatasetByKeyOptions extends GetDatasetOptions {
|
|
|
368
368
|
/** Stable dataset key */
|
|
369
369
|
datasetKey: string;
|
|
370
370
|
}
|
|
371
|
+
interface DatasetFilterValuesOptions extends GetDatasetOptions {
|
|
372
|
+
/** Optional case-insensitive search within values */
|
|
373
|
+
search?: string;
|
|
374
|
+
/** Include per-value record counts. More expensive than listing values only. */
|
|
375
|
+
includeCounts?: boolean;
|
|
376
|
+
/** Maximum number of values per field (default: 50, max: 500) */
|
|
377
|
+
first?: number;
|
|
378
|
+
/** Cursor for pagination. Applies to each requested field. */
|
|
379
|
+
after?: string;
|
|
380
|
+
}
|
|
371
381
|
declare class DatasetsResource extends BaseResource {
|
|
372
382
|
constructor(connection: Connection, config: Configuration);
|
|
373
383
|
/**
|
|
@@ -417,6 +427,20 @@ declare class DatasetsResource extends BaseResource {
|
|
|
417
427
|
* const datasets = await client.datasets.getMany(['id1', 'id2', 'id3'])
|
|
418
428
|
*/
|
|
419
429
|
getMany(ids: string[], options?: GetDatasetOptions): Promise<Dataset[]>;
|
|
430
|
+
/**
|
|
431
|
+
* Get distinct filter values for one or more filterable fields.
|
|
432
|
+
*
|
|
433
|
+
* @example
|
|
434
|
+
* const values = await client.datasets.filterValues('dataset-id', ['name', 'colors'], {
|
|
435
|
+
* includeCounts: true,
|
|
436
|
+
* first: 500,
|
|
437
|
+
* })
|
|
438
|
+
*/
|
|
439
|
+
filterValues(id: string, fields: string[], options?: DatasetFilterValuesOptions): Promise<DatasetFilterValueConnection[]>;
|
|
440
|
+
/**
|
|
441
|
+
* Get distinct filter values for a dataset by publisher/game/dataset keys.
|
|
442
|
+
*/
|
|
443
|
+
filterValues(publisherSlug: string, gameKey: string, datasetKey: string, fields: string[], options?: DatasetFilterValuesOptions): Promise<DatasetFilterValueConnection[]>;
|
|
420
444
|
}
|
|
421
445
|
|
|
422
446
|
/**
|
|
@@ -1080,6 +1104,119 @@ declare class RulesResource extends BaseResource {
|
|
|
1080
1104
|
private searchRuleRecords;
|
|
1081
1105
|
}
|
|
1082
1106
|
|
|
1107
|
+
/**
|
|
1108
|
+
* First-class rulesets resource for CardDB API
|
|
1109
|
+
*/
|
|
1110
|
+
|
|
1111
|
+
interface ListRulesetsOptions {
|
|
1112
|
+
/** Include archived rulesets */
|
|
1113
|
+
includeArchived?: boolean;
|
|
1114
|
+
/** Maximum number of results per page */
|
|
1115
|
+
first?: number;
|
|
1116
|
+
/** Cursor for pagination */
|
|
1117
|
+
after?: string;
|
|
1118
|
+
/** Whether to use cache (defaults to client config) */
|
|
1119
|
+
cache?: boolean;
|
|
1120
|
+
}
|
|
1121
|
+
type ListPublicRulesetsOptions = Omit<ListRulesetsOptions, 'includeArchived'>;
|
|
1122
|
+
interface GetRulesetOptions {
|
|
1123
|
+
/** Whether to use cache (defaults to client config) */
|
|
1124
|
+
cache?: boolean;
|
|
1125
|
+
}
|
|
1126
|
+
interface GetRulesetByKeyOptions extends GetRulesetOptions {
|
|
1127
|
+
/** Game ID for stable ruleset-key lookup */
|
|
1128
|
+
gameId: string;
|
|
1129
|
+
/** Stable ruleset key */
|
|
1130
|
+
key: string;
|
|
1131
|
+
}
|
|
1132
|
+
interface ListRulesetVersionsOptions extends GetRulesetOptions {
|
|
1133
|
+
/** Optional status filter */
|
|
1134
|
+
status?: RulesetVersionStatus;
|
|
1135
|
+
/** Maximum number of results per page */
|
|
1136
|
+
first?: number;
|
|
1137
|
+
/** Cursor for pagination */
|
|
1138
|
+
after?: string;
|
|
1139
|
+
}
|
|
1140
|
+
interface RulesetValidationRulesOptions extends GetRulesetOptions {
|
|
1141
|
+
/** Optional immutable ruleset version override */
|
|
1142
|
+
rulesetVersionId?: string;
|
|
1143
|
+
}
|
|
1144
|
+
interface RulesetValidationImpactOptions extends GetRulesetOptions {
|
|
1145
|
+
/** Maximum number of affected decks to include */
|
|
1146
|
+
first?: number;
|
|
1147
|
+
}
|
|
1148
|
+
declare class RulesetsResource extends BaseResource {
|
|
1149
|
+
constructor(connection: Connection, config: Configuration);
|
|
1150
|
+
/**
|
|
1151
|
+
* List first-class rulesets for a game.
|
|
1152
|
+
*/
|
|
1153
|
+
list(gameId: string, options?: ListRulesetsOptions): Promise<Collection<Ruleset>>;
|
|
1154
|
+
/**
|
|
1155
|
+
* List active public rulesets for a public game.
|
|
1156
|
+
*/
|
|
1157
|
+
listPublic(gameId: string, options?: ListPublicRulesetsOptions): Promise<Collection<Ruleset>>;
|
|
1158
|
+
/**
|
|
1159
|
+
* Get one ruleset by UUID.
|
|
1160
|
+
*/
|
|
1161
|
+
get(id: string, options?: GetRulesetOptions): Promise<Ruleset | null>;
|
|
1162
|
+
/**
|
|
1163
|
+
* Get one ruleset by game ID and stable key.
|
|
1164
|
+
*/
|
|
1165
|
+
getByKey(options: GetRulesetByKeyOptions): Promise<Ruleset | null>;
|
|
1166
|
+
/**
|
|
1167
|
+
* List immutable versions for a ruleset.
|
|
1168
|
+
*/
|
|
1169
|
+
versions(rulesetId: string, options?: ListRulesetVersionsOptions): Promise<Collection<RulesetVersion>>;
|
|
1170
|
+
/**
|
|
1171
|
+
* Get one immutable ruleset version by UUID.
|
|
1172
|
+
*/
|
|
1173
|
+
getVersion(id: string, options?: GetRulesetOptions): Promise<RulesetVersion | null>;
|
|
1174
|
+
/**
|
|
1175
|
+
* Get the canonical active rules JSON for a ruleset.
|
|
1176
|
+
*/
|
|
1177
|
+
validationRules(gameId: string, rulesetKey: string, options?: RulesetValidationRulesOptions): Promise<Record<string, unknown> | null>;
|
|
1178
|
+
/**
|
|
1179
|
+
* Get typed validation rules, including parsed deck sections.
|
|
1180
|
+
*/
|
|
1181
|
+
deckValidationRules(gameId: string, rulesetKey: string, options?: RulesetValidationRulesOptions): Promise<DeckValidationRules | null>;
|
|
1182
|
+
/**
|
|
1183
|
+
* Preview compiling a legacy formats dataset record into a draft ruleset version.
|
|
1184
|
+
*/
|
|
1185
|
+
previewImport(rulesetId: string, input: RulesetVersionDraftImportFromDatasetRecordInput): Promise<RulesetVersionDraftImportPreview>;
|
|
1186
|
+
/**
|
|
1187
|
+
* Preview validation impact for decks that use a ruleset version's parent ruleset.
|
|
1188
|
+
*/
|
|
1189
|
+
validationImpact(rulesetVersionId: string, options?: RulesetValidationImpactOptions): Promise<RulesetValidationImpact>;
|
|
1190
|
+
/**
|
|
1191
|
+
* Create a first-class ruleset. Requires a server-side secret credential.
|
|
1192
|
+
*/
|
|
1193
|
+
create(input: RulesetCreateInput): Promise<Ruleset>;
|
|
1194
|
+
/**
|
|
1195
|
+
* Update editable ruleset metadata. Requires a server-side secret credential.
|
|
1196
|
+
*/
|
|
1197
|
+
update(id: string, input: RulesetUpdateInput): Promise<Ruleset>;
|
|
1198
|
+
/**
|
|
1199
|
+
* Create a draft ruleset version from an explicit canonical rules payload.
|
|
1200
|
+
*/
|
|
1201
|
+
createDraft(rulesetId: string, input: RulesetVersionDraftCreateInput): Promise<RulesetVersion>;
|
|
1202
|
+
/**
|
|
1203
|
+
* Create a draft by compiling a legacy formats dataset record.
|
|
1204
|
+
*/
|
|
1205
|
+
importDraftFromDatasetRecord(rulesetId: string, input: RulesetVersionDraftImportFromDatasetRecordInput): Promise<RulesetVersion>;
|
|
1206
|
+
/**
|
|
1207
|
+
* Update a draft ruleset version.
|
|
1208
|
+
*/
|
|
1209
|
+
updateDraft(id: string, input: RulesetVersionDraftUpdateInput): Promise<RulesetVersion>;
|
|
1210
|
+
/**
|
|
1211
|
+
* Publish a draft and make it the current active ruleset version.
|
|
1212
|
+
*/
|
|
1213
|
+
publishVersion(id: string, input?: RulesetVersionPublishInput): Promise<RulesetVersion>;
|
|
1214
|
+
/**
|
|
1215
|
+
* Activate an already-published version for rollback.
|
|
1216
|
+
*/
|
|
1217
|
+
activateVersion(id: string): Promise<RulesetVersion>;
|
|
1218
|
+
}
|
|
1219
|
+
|
|
1083
1220
|
/**
|
|
1084
1221
|
* Publisher-managed import format resource for CardDB API
|
|
1085
1222
|
*/
|
|
@@ -1574,6 +1711,8 @@ declare class CardDBClient {
|
|
|
1574
1711
|
readonly decks: DecksResource;
|
|
1575
1712
|
/** Rules resource for game rules and deck formats */
|
|
1576
1713
|
readonly rules: RulesResource;
|
|
1714
|
+
/** First-class rulesets resource for deck validation rules */
|
|
1715
|
+
readonly rulesets: RulesetsResource;
|
|
1577
1716
|
/** Publisher-managed import format resource */
|
|
1578
1717
|
readonly importFormats: ImportFormatsResource;
|
|
1579
1718
|
/** Publisher import job resource */
|
|
@@ -1667,4 +1806,4 @@ declare function readCache<T>(cache: Cache, key: string): Promise<T | null>;
|
|
|
1667
1806
|
*/
|
|
1668
1807
|
declare function writeCache<T>(cache: Cache, key: string, value: T, ttl: number): Promise<void>;
|
|
1669
1808
|
|
|
1670
|
-
export { BaseResource, CardDBClient, Configuration, type ConfirmScanUploadOptions, Connection, type CreateScanJobOptions, type CreateScanUploadSessionOptions, 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 DeckReadByExternalRefOptions, type DeckReadOptions, 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 GetGameRegionsOptions, type GetImportFormatByKeyOptions, type GetImportFormatOptions, type GetPublisherOptions, type GetRecordByDatasetIdentifierOptions, type GetRecordByIdentifierOptions, type GetRecordOptions, type GetRecordsByIdentifierOptions, type GetScanJobOptions, type GraphQLResponse, type HydrateDeckEntriesOptions, ImportFormatsResource, ImportsResource, type ListAppDecksOptions, type ListDatasetsOptions, type ListDeckApiApplicationAccessesOptions, type ListDeckCollaboratorsOptions, type ListDeckImportFormatsOptions, 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 ListScanTemplatesOptions, type ListViewerDecksOptions, type PollScanJobOptions, type PollSignal, type PreviewScanTemplateOptions, PublishersResource, RecordsResource, type ResolveScanTemplateOptions, RulesResource, type SaveScanTemplateOptions, type ScanMetricsOptions, ScanTemplatesResource, ScansResource, type SearchDatasetsOptions, type SearchGamesOptions, type SearchPublishersOptions, type SearchRecordsOptions, type UpdateScanTemplateOptions, type UploadFileInput, type VerifyWebhookSignatureInput, type WaitForExportJobOptions, type WaitForImportJobOptions, type WaitForRecordDeleteJobOptions, cacheKey, getRateLimitInfo, getSDKVersion, getUserAgent, readCache, writeCache };
|
|
1809
|
+
export { BaseResource, CardDBClient, Configuration, type ConfirmScanUploadOptions, Connection, type CreateScanJobOptions, type CreateScanUploadSessionOptions, 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 DeckReadByExternalRefOptions, type DeckReadOptions, 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 GetGameRegionsOptions, type GetImportFormatByKeyOptions, type GetImportFormatOptions, type GetPublisherOptions, type GetRecordByDatasetIdentifierOptions, type GetRecordByIdentifierOptions, type GetRecordOptions, type GetRecordsByIdentifierOptions, type GetRulesetByKeyOptions, type GetRulesetOptions, type GetScanJobOptions, type GraphQLResponse, type HydrateDeckEntriesOptions, ImportFormatsResource, ImportsResource, type ListAppDecksOptions, type ListDatasetsOptions, type ListDeckApiApplicationAccessesOptions, type ListDeckCollaboratorsOptions, type ListDeckImportFormatsOptions, type ListDeckVersionsOptions, type ListDecksOptions, type ListExportJobsOptions, type ListFormatsOptions, type ListGameImportJobsOptions, type ListGamesOptions, type ListImportFormatsOptions, type ListImportJobLogsOptions, type ListImportJobsOptions, type ListMyDeckApiApplicationAccessesOptions, type ListPublicDecksOptions, type ListPublicRulesetsOptions, type ListRecordDeleteJobsOptions, type ListRecordsOptions, type ListRuleDatasetsOptions, type ListRulesOptions, type ListRulesetVersionsOptions, type ListRulesetsOptions, type ListScanTemplatesOptions, type ListViewerDecksOptions, type PollScanJobOptions, type PollSignal, type PreviewScanTemplateOptions, PublishersResource, RecordsResource, type ResolveScanTemplateOptions, RulesResource, type RulesetValidationImpactOptions, type RulesetValidationRulesOptions, RulesetsResource, type SaveScanTemplateOptions, type ScanMetricsOptions, ScanTemplatesResource, ScansResource, type SearchDatasetsOptions, type SearchGamesOptions, type SearchPublishersOptions, type SearchRecordsOptions, type UpdateScanTemplateOptions, type UploadFileInput, type VerifyWebhookSignatureInput, type WaitForExportJobOptions, type WaitForImportJobOptions, type WaitForRecordDeleteJobOptions, cacheKey, getRateLimitInfo, getSDKVersion, getUserAgent, readCache, writeCache };
|
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, GameCreateInput, GameUpdateInput, GameScanRegion, Dataset, DatasetSchema, Deck, DeckReadState, DeckPublishedVersionSelector, ViewerDecksFilterInput, AppDecksFilterInput, PublicDecksFilterInput, DeckVersion, DeckDiff, DeckValidateInput, DeckValidation, DeckHydrateEntriesInput, DeckHydrateEntriesPayload, DeckExportFormat, DeckExportPayload, DeckSectionDefinition, DeckCollaborator, 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, DeckTokenIssuerCreateInput, DeckTokenIssuer, DeckAPIApplicationAccessGrantInput, DeckTokenExchangeInput, DeckTokenExchangePayload, 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, UploadPurpose, CreateScanUploadSessionInput, ConfirmScanUploadInput, CreateScanJobInput, ScanJobPayload, ScanJob, SubmitScanFeedbackInput, ScanFeedbackPayload, ScanMetricsInput, ScanMetrics, ResolveScanTemplateInput, ScanTemplateResolution, ScanTemplatesInput, ScanTemplate, SaveScanTemplateInput, ScanTemplatePayload, PreviewScanTemplateInput, ScanTemplatePreview, APIKeyInfo } from '@carddb/core';
|
|
2
|
+
import { Logger, LogLevel, Cache, ResourceType, CardDBConfig, RateLimitInfo, GraphQLErrorInfo, Collection, Publisher, Game, GameCreateInput, GameUpdateInput, GameScanRegion, Dataset, DatasetSchema, DatasetFilterValueConnection, Deck, DeckReadState, DeckPublishedVersionSelector, ViewerDecksFilterInput, AppDecksFilterInput, PublicDecksFilterInput, DeckVersion, DeckDiff, DeckValidateInput, DeckValidation, DeckHydrateEntriesInput, DeckHydrateEntriesPayload, DeckExportFormat, DeckExportPayload, DeckSectionDefinition, DeckCollaborator, 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, DeckTokenIssuerCreateInput, DeckTokenIssuer, DeckAPIApplicationAccessGrantInput, DeckTokenExchangeInput, DeckTokenExchangePayload, HydrateDeckEntryInput, HydratedDeckEntry, FilterInput, DatasetRecord, DatasetRecordsUpsertInput, DatasetRecordsUpsertPayload, DatasetRecordsDeleteInput, DatasetRecordDeleteJob, DatasetRecordDeleteJobStatus, Ruleset, RulesetVersionStatus, RulesetVersion, DeckValidationRules, RulesetVersionDraftImportFromDatasetRecordInput, RulesetVersionDraftImportPreview, RulesetValidationImpact, RulesetCreateInput, RulesetUpdateInput, RulesetVersionDraftCreateInput, RulesetVersionDraftUpdateInput, RulesetVersionPublishInput, DatasetImportPreviewInput, DatasetImportPreviewResult, DatasetImportValidateInput, BulkImportResult, DatasetImportRunInput, ImportJob, ImportJobStatus, ImportLogLevel, ImportJobLog, GameImportPreviewInput, GameImportPreview, GameImportRunInput, GameImportJob, DatasetExportInput, ExportJob, ExportJobStatus, File, FileUploadInput, PresignedUpload, UploadPurpose, CreateScanUploadSessionInput, ConfirmScanUploadInput, CreateScanJobInput, ScanJobPayload, ScanJob, SubmitScanFeedbackInput, ScanFeedbackPayload, ScanMetricsInput, ScanMetrics, ResolveScanTemplateInput, ScanTemplateResolution, ScanTemplatesInput, ScanTemplate, SaveScanTemplateInput, ScanTemplatePayload, PreviewScanTemplateInput, ScanTemplatePreview, APIKeyInfo } from '@carddb/core';
|
|
3
3
|
export * from '@carddb/core';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -368,6 +368,16 @@ interface GetDatasetByKeyOptions extends GetDatasetOptions {
|
|
|
368
368
|
/** Stable dataset key */
|
|
369
369
|
datasetKey: string;
|
|
370
370
|
}
|
|
371
|
+
interface DatasetFilterValuesOptions extends GetDatasetOptions {
|
|
372
|
+
/** Optional case-insensitive search within values */
|
|
373
|
+
search?: string;
|
|
374
|
+
/** Include per-value record counts. More expensive than listing values only. */
|
|
375
|
+
includeCounts?: boolean;
|
|
376
|
+
/** Maximum number of values per field (default: 50, max: 500) */
|
|
377
|
+
first?: number;
|
|
378
|
+
/** Cursor for pagination. Applies to each requested field. */
|
|
379
|
+
after?: string;
|
|
380
|
+
}
|
|
371
381
|
declare class DatasetsResource extends BaseResource {
|
|
372
382
|
constructor(connection: Connection, config: Configuration);
|
|
373
383
|
/**
|
|
@@ -417,6 +427,20 @@ declare class DatasetsResource extends BaseResource {
|
|
|
417
427
|
* const datasets = await client.datasets.getMany(['id1', 'id2', 'id3'])
|
|
418
428
|
*/
|
|
419
429
|
getMany(ids: string[], options?: GetDatasetOptions): Promise<Dataset[]>;
|
|
430
|
+
/**
|
|
431
|
+
* Get distinct filter values for one or more filterable fields.
|
|
432
|
+
*
|
|
433
|
+
* @example
|
|
434
|
+
* const values = await client.datasets.filterValues('dataset-id', ['name', 'colors'], {
|
|
435
|
+
* includeCounts: true,
|
|
436
|
+
* first: 500,
|
|
437
|
+
* })
|
|
438
|
+
*/
|
|
439
|
+
filterValues(id: string, fields: string[], options?: DatasetFilterValuesOptions): Promise<DatasetFilterValueConnection[]>;
|
|
440
|
+
/**
|
|
441
|
+
* Get distinct filter values for a dataset by publisher/game/dataset keys.
|
|
442
|
+
*/
|
|
443
|
+
filterValues(publisherSlug: string, gameKey: string, datasetKey: string, fields: string[], options?: DatasetFilterValuesOptions): Promise<DatasetFilterValueConnection[]>;
|
|
420
444
|
}
|
|
421
445
|
|
|
422
446
|
/**
|
|
@@ -1080,6 +1104,119 @@ declare class RulesResource extends BaseResource {
|
|
|
1080
1104
|
private searchRuleRecords;
|
|
1081
1105
|
}
|
|
1082
1106
|
|
|
1107
|
+
/**
|
|
1108
|
+
* First-class rulesets resource for CardDB API
|
|
1109
|
+
*/
|
|
1110
|
+
|
|
1111
|
+
interface ListRulesetsOptions {
|
|
1112
|
+
/** Include archived rulesets */
|
|
1113
|
+
includeArchived?: boolean;
|
|
1114
|
+
/** Maximum number of results per page */
|
|
1115
|
+
first?: number;
|
|
1116
|
+
/** Cursor for pagination */
|
|
1117
|
+
after?: string;
|
|
1118
|
+
/** Whether to use cache (defaults to client config) */
|
|
1119
|
+
cache?: boolean;
|
|
1120
|
+
}
|
|
1121
|
+
type ListPublicRulesetsOptions = Omit<ListRulesetsOptions, 'includeArchived'>;
|
|
1122
|
+
interface GetRulesetOptions {
|
|
1123
|
+
/** Whether to use cache (defaults to client config) */
|
|
1124
|
+
cache?: boolean;
|
|
1125
|
+
}
|
|
1126
|
+
interface GetRulesetByKeyOptions extends GetRulesetOptions {
|
|
1127
|
+
/** Game ID for stable ruleset-key lookup */
|
|
1128
|
+
gameId: string;
|
|
1129
|
+
/** Stable ruleset key */
|
|
1130
|
+
key: string;
|
|
1131
|
+
}
|
|
1132
|
+
interface ListRulesetVersionsOptions extends GetRulesetOptions {
|
|
1133
|
+
/** Optional status filter */
|
|
1134
|
+
status?: RulesetVersionStatus;
|
|
1135
|
+
/** Maximum number of results per page */
|
|
1136
|
+
first?: number;
|
|
1137
|
+
/** Cursor for pagination */
|
|
1138
|
+
after?: string;
|
|
1139
|
+
}
|
|
1140
|
+
interface RulesetValidationRulesOptions extends GetRulesetOptions {
|
|
1141
|
+
/** Optional immutable ruleset version override */
|
|
1142
|
+
rulesetVersionId?: string;
|
|
1143
|
+
}
|
|
1144
|
+
interface RulesetValidationImpactOptions extends GetRulesetOptions {
|
|
1145
|
+
/** Maximum number of affected decks to include */
|
|
1146
|
+
first?: number;
|
|
1147
|
+
}
|
|
1148
|
+
declare class RulesetsResource extends BaseResource {
|
|
1149
|
+
constructor(connection: Connection, config: Configuration);
|
|
1150
|
+
/**
|
|
1151
|
+
* List first-class rulesets for a game.
|
|
1152
|
+
*/
|
|
1153
|
+
list(gameId: string, options?: ListRulesetsOptions): Promise<Collection<Ruleset>>;
|
|
1154
|
+
/**
|
|
1155
|
+
* List active public rulesets for a public game.
|
|
1156
|
+
*/
|
|
1157
|
+
listPublic(gameId: string, options?: ListPublicRulesetsOptions): Promise<Collection<Ruleset>>;
|
|
1158
|
+
/**
|
|
1159
|
+
* Get one ruleset by UUID.
|
|
1160
|
+
*/
|
|
1161
|
+
get(id: string, options?: GetRulesetOptions): Promise<Ruleset | null>;
|
|
1162
|
+
/**
|
|
1163
|
+
* Get one ruleset by game ID and stable key.
|
|
1164
|
+
*/
|
|
1165
|
+
getByKey(options: GetRulesetByKeyOptions): Promise<Ruleset | null>;
|
|
1166
|
+
/**
|
|
1167
|
+
* List immutable versions for a ruleset.
|
|
1168
|
+
*/
|
|
1169
|
+
versions(rulesetId: string, options?: ListRulesetVersionsOptions): Promise<Collection<RulesetVersion>>;
|
|
1170
|
+
/**
|
|
1171
|
+
* Get one immutable ruleset version by UUID.
|
|
1172
|
+
*/
|
|
1173
|
+
getVersion(id: string, options?: GetRulesetOptions): Promise<RulesetVersion | null>;
|
|
1174
|
+
/**
|
|
1175
|
+
* Get the canonical active rules JSON for a ruleset.
|
|
1176
|
+
*/
|
|
1177
|
+
validationRules(gameId: string, rulesetKey: string, options?: RulesetValidationRulesOptions): Promise<Record<string, unknown> | null>;
|
|
1178
|
+
/**
|
|
1179
|
+
* Get typed validation rules, including parsed deck sections.
|
|
1180
|
+
*/
|
|
1181
|
+
deckValidationRules(gameId: string, rulesetKey: string, options?: RulesetValidationRulesOptions): Promise<DeckValidationRules | null>;
|
|
1182
|
+
/**
|
|
1183
|
+
* Preview compiling a legacy formats dataset record into a draft ruleset version.
|
|
1184
|
+
*/
|
|
1185
|
+
previewImport(rulesetId: string, input: RulesetVersionDraftImportFromDatasetRecordInput): Promise<RulesetVersionDraftImportPreview>;
|
|
1186
|
+
/**
|
|
1187
|
+
* Preview validation impact for decks that use a ruleset version's parent ruleset.
|
|
1188
|
+
*/
|
|
1189
|
+
validationImpact(rulesetVersionId: string, options?: RulesetValidationImpactOptions): Promise<RulesetValidationImpact>;
|
|
1190
|
+
/**
|
|
1191
|
+
* Create a first-class ruleset. Requires a server-side secret credential.
|
|
1192
|
+
*/
|
|
1193
|
+
create(input: RulesetCreateInput): Promise<Ruleset>;
|
|
1194
|
+
/**
|
|
1195
|
+
* Update editable ruleset metadata. Requires a server-side secret credential.
|
|
1196
|
+
*/
|
|
1197
|
+
update(id: string, input: RulesetUpdateInput): Promise<Ruleset>;
|
|
1198
|
+
/**
|
|
1199
|
+
* Create a draft ruleset version from an explicit canonical rules payload.
|
|
1200
|
+
*/
|
|
1201
|
+
createDraft(rulesetId: string, input: RulesetVersionDraftCreateInput): Promise<RulesetVersion>;
|
|
1202
|
+
/**
|
|
1203
|
+
* Create a draft by compiling a legacy formats dataset record.
|
|
1204
|
+
*/
|
|
1205
|
+
importDraftFromDatasetRecord(rulesetId: string, input: RulesetVersionDraftImportFromDatasetRecordInput): Promise<RulesetVersion>;
|
|
1206
|
+
/**
|
|
1207
|
+
* Update a draft ruleset version.
|
|
1208
|
+
*/
|
|
1209
|
+
updateDraft(id: string, input: RulesetVersionDraftUpdateInput): Promise<RulesetVersion>;
|
|
1210
|
+
/**
|
|
1211
|
+
* Publish a draft and make it the current active ruleset version.
|
|
1212
|
+
*/
|
|
1213
|
+
publishVersion(id: string, input?: RulesetVersionPublishInput): Promise<RulesetVersion>;
|
|
1214
|
+
/**
|
|
1215
|
+
* Activate an already-published version for rollback.
|
|
1216
|
+
*/
|
|
1217
|
+
activateVersion(id: string): Promise<RulesetVersion>;
|
|
1218
|
+
}
|
|
1219
|
+
|
|
1083
1220
|
/**
|
|
1084
1221
|
* Publisher-managed import format resource for CardDB API
|
|
1085
1222
|
*/
|
|
@@ -1574,6 +1711,8 @@ declare class CardDBClient {
|
|
|
1574
1711
|
readonly decks: DecksResource;
|
|
1575
1712
|
/** Rules resource for game rules and deck formats */
|
|
1576
1713
|
readonly rules: RulesResource;
|
|
1714
|
+
/** First-class rulesets resource for deck validation rules */
|
|
1715
|
+
readonly rulesets: RulesetsResource;
|
|
1577
1716
|
/** Publisher-managed import format resource */
|
|
1578
1717
|
readonly importFormats: ImportFormatsResource;
|
|
1579
1718
|
/** Publisher import job resource */
|
|
@@ -1667,4 +1806,4 @@ declare function readCache<T>(cache: Cache, key: string): Promise<T | null>;
|
|
|
1667
1806
|
*/
|
|
1668
1807
|
declare function writeCache<T>(cache: Cache, key: string, value: T, ttl: number): Promise<void>;
|
|
1669
1808
|
|
|
1670
|
-
export { BaseResource, CardDBClient, Configuration, type ConfirmScanUploadOptions, Connection, type CreateScanJobOptions, type CreateScanUploadSessionOptions, 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 DeckReadByExternalRefOptions, type DeckReadOptions, 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 GetGameRegionsOptions, type GetImportFormatByKeyOptions, type GetImportFormatOptions, type GetPublisherOptions, type GetRecordByDatasetIdentifierOptions, type GetRecordByIdentifierOptions, type GetRecordOptions, type GetRecordsByIdentifierOptions, type GetScanJobOptions, type GraphQLResponse, type HydrateDeckEntriesOptions, ImportFormatsResource, ImportsResource, type ListAppDecksOptions, type ListDatasetsOptions, type ListDeckApiApplicationAccessesOptions, type ListDeckCollaboratorsOptions, type ListDeckImportFormatsOptions, 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 ListScanTemplatesOptions, type ListViewerDecksOptions, type PollScanJobOptions, type PollSignal, type PreviewScanTemplateOptions, PublishersResource, RecordsResource, type ResolveScanTemplateOptions, RulesResource, type SaveScanTemplateOptions, type ScanMetricsOptions, ScanTemplatesResource, ScansResource, type SearchDatasetsOptions, type SearchGamesOptions, type SearchPublishersOptions, type SearchRecordsOptions, type UpdateScanTemplateOptions, type UploadFileInput, type VerifyWebhookSignatureInput, type WaitForExportJobOptions, type WaitForImportJobOptions, type WaitForRecordDeleteJobOptions, cacheKey, getRateLimitInfo, getSDKVersion, getUserAgent, readCache, writeCache };
|
|
1809
|
+
export { BaseResource, CardDBClient, Configuration, type ConfirmScanUploadOptions, Connection, type CreateScanJobOptions, type CreateScanUploadSessionOptions, 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 DeckReadByExternalRefOptions, type DeckReadOptions, 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 GetGameRegionsOptions, type GetImportFormatByKeyOptions, type GetImportFormatOptions, type GetPublisherOptions, type GetRecordByDatasetIdentifierOptions, type GetRecordByIdentifierOptions, type GetRecordOptions, type GetRecordsByIdentifierOptions, type GetRulesetByKeyOptions, type GetRulesetOptions, type GetScanJobOptions, type GraphQLResponse, type HydrateDeckEntriesOptions, ImportFormatsResource, ImportsResource, type ListAppDecksOptions, type ListDatasetsOptions, type ListDeckApiApplicationAccessesOptions, type ListDeckCollaboratorsOptions, type ListDeckImportFormatsOptions, type ListDeckVersionsOptions, type ListDecksOptions, type ListExportJobsOptions, type ListFormatsOptions, type ListGameImportJobsOptions, type ListGamesOptions, type ListImportFormatsOptions, type ListImportJobLogsOptions, type ListImportJobsOptions, type ListMyDeckApiApplicationAccessesOptions, type ListPublicDecksOptions, type ListPublicRulesetsOptions, type ListRecordDeleteJobsOptions, type ListRecordsOptions, type ListRuleDatasetsOptions, type ListRulesOptions, type ListRulesetVersionsOptions, type ListRulesetsOptions, type ListScanTemplatesOptions, type ListViewerDecksOptions, type PollScanJobOptions, type PollSignal, type PreviewScanTemplateOptions, PublishersResource, RecordsResource, type ResolveScanTemplateOptions, RulesResource, type RulesetValidationImpactOptions, type RulesetValidationRulesOptions, RulesetsResource, type SaveScanTemplateOptions, type ScanMetricsOptions, ScanTemplatesResource, ScansResource, type SearchDatasetsOptions, type SearchGamesOptions, type SearchPublishersOptions, type SearchRecordsOptions, type UpdateScanTemplateOptions, type UploadFileInput, type VerifyWebhookSignatureInput, type WaitForExportJobOptions, type WaitForImportJobOptions, type WaitForRecordDeleteJobOptions, cacheKey, getRateLimitInfo, getSDKVersion, getUserAgent, readCache, writeCache };
|