@carddb/client 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/README.md +1 -1
- package/dist/index.cjs +736 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +421 -2
- package/dist/index.d.ts +421 -2
- package/dist/index.js +733 -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, Dataset, 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, 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, DeckSessionTokenExchangeInput, DeckSessionTokenExchangePayload, 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
|
/**
|
|
@@ -232,8 +232,52 @@ interface GetGameOptions {
|
|
|
232
232
|
/** Whether to use cache (defaults to client config) */
|
|
233
233
|
cache?: boolean;
|
|
234
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
|
+
}
|
|
235
259
|
declare class GamesResource extends BaseResource {
|
|
236
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>;
|
|
237
281
|
/**
|
|
238
282
|
* Search for games
|
|
239
283
|
*
|
|
@@ -292,8 +336,40 @@ interface GetDatasetOptions {
|
|
|
292
336
|
/** Whether to use cache (defaults to client config) */
|
|
293
337
|
cache?: boolean;
|
|
294
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
|
+
}
|
|
295
359
|
declare class DatasetsResource extends BaseResource {
|
|
296
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>;
|
|
297
373
|
/**
|
|
298
374
|
* Search for datasets
|
|
299
375
|
*
|
|
@@ -659,6 +735,10 @@ declare class DecksResource extends BaseResource {
|
|
|
659
735
|
* Exchange the current trusted API application credential for a deck access token.
|
|
660
736
|
*/
|
|
661
737
|
exchangeAccessToken(input: DeckAccessTokenExchangeInput): Promise<DeckAccessTokenExchangePayload>;
|
|
738
|
+
/**
|
|
739
|
+
* Exchange the current secret API application credential for an app-owned deck session token.
|
|
740
|
+
*/
|
|
741
|
+
exchangeSessionToken(input: DeckSessionTokenExchangeInput): Promise<DeckSessionTokenExchangePayload>;
|
|
662
742
|
/**
|
|
663
743
|
* Revoke an exchanged deck access token.
|
|
664
744
|
*/
|
|
@@ -753,8 +833,83 @@ interface GetRecordsByIdentifierOptions {
|
|
|
753
833
|
/** Whether to use cache (defaults to client config) */
|
|
754
834
|
cache?: boolean;
|
|
755
835
|
}
|
|
836
|
+
interface ListRecordsOptions {
|
|
837
|
+
/** Dataset ID to list records from */
|
|
838
|
+
datasetId: string;
|
|
839
|
+
/** Filter conditions - can be an object or a builder function */
|
|
840
|
+
filter?: FilterInput;
|
|
841
|
+
/** Sort field and direction */
|
|
842
|
+
orderBy?: {
|
|
843
|
+
field: string;
|
|
844
|
+
direction?: 'ASC' | 'DESC';
|
|
845
|
+
};
|
|
846
|
+
/** Maximum number of results per page */
|
|
847
|
+
first?: number;
|
|
848
|
+
/** Cursor for forward pagination */
|
|
849
|
+
after?: string;
|
|
850
|
+
/** Maximum number of results for backward pagination */
|
|
851
|
+
last?: number;
|
|
852
|
+
/** Cursor for backward pagination */
|
|
853
|
+
before?: string;
|
|
854
|
+
/** Validate and sanitize against schema */
|
|
855
|
+
validateSchema?: boolean;
|
|
856
|
+
/** Whether to use cache (defaults to client config) */
|
|
857
|
+
cache?: boolean;
|
|
858
|
+
}
|
|
859
|
+
interface GetRecordByDatasetIdentifierOptions extends GetRecordOptions {
|
|
860
|
+
/** Dataset ID to search */
|
|
861
|
+
datasetId: string;
|
|
862
|
+
/** Identifier value to look up */
|
|
863
|
+
identifier: string;
|
|
864
|
+
}
|
|
865
|
+
interface ListRecordDeleteJobsOptions {
|
|
866
|
+
/** Dataset ID to filter jobs */
|
|
867
|
+
datasetId?: string;
|
|
868
|
+
/** Job status to filter by */
|
|
869
|
+
status?: DatasetRecordDeleteJobStatus;
|
|
870
|
+
/** Maximum number of results per page */
|
|
871
|
+
first?: number;
|
|
872
|
+
/** Cursor for pagination */
|
|
873
|
+
after?: string;
|
|
874
|
+
/** Whether to use cache (defaults to client config) */
|
|
875
|
+
cache?: boolean;
|
|
876
|
+
}
|
|
877
|
+
interface WaitForRecordDeleteJobOptions {
|
|
878
|
+
/** Polling interval in milliseconds */
|
|
879
|
+
intervalMs?: number;
|
|
880
|
+
/** Max time to wait in milliseconds */
|
|
881
|
+
timeoutMs?: number;
|
|
882
|
+
}
|
|
756
883
|
declare class RecordsResource extends BaseResource {
|
|
757
884
|
constructor(connection: Connection, config: Configuration);
|
|
885
|
+
/**
|
|
886
|
+
* List records in a publisher-accessible dataset by dataset ID.
|
|
887
|
+
*/
|
|
888
|
+
list(options: ListRecordsOptions): Promise<Collection<DatasetRecord>>;
|
|
889
|
+
/**
|
|
890
|
+
* Get a publisher-accessible record by dataset ID and identifier value.
|
|
891
|
+
*/
|
|
892
|
+
getByDatasetIdentifier(options: GetRecordByDatasetIdentifierOptions): Promise<DatasetRecord | null>;
|
|
893
|
+
/**
|
|
894
|
+
* Start an import-backed batch upsert, or return a dry-run result. Requires a secret credential.
|
|
895
|
+
*/
|
|
896
|
+
upsertBatch(input: DatasetRecordsUpsertInput): Promise<DatasetRecordsUpsertPayload>;
|
|
897
|
+
/**
|
|
898
|
+
* Create a dry-run or destructive bulk delete/reconciliation job. Requires a secret credential.
|
|
899
|
+
*/
|
|
900
|
+
deleteBatch(input: DatasetRecordsDeleteInput): Promise<DatasetRecordDeleteJob>;
|
|
901
|
+
/**
|
|
902
|
+
* Get one bulk delete/reconciliation job.
|
|
903
|
+
*/
|
|
904
|
+
getDeleteJob(id: string, options?: GetRecordOptions): Promise<DatasetRecordDeleteJob | null>;
|
|
905
|
+
/**
|
|
906
|
+
* List bulk delete/reconciliation jobs for a publisher.
|
|
907
|
+
*/
|
|
908
|
+
listDeleteJobs(publisherId: string, options?: ListRecordDeleteJobsOptions): Promise<Collection<DatasetRecordDeleteJob>>;
|
|
909
|
+
/**
|
|
910
|
+
* Poll a delete job until it reaches a terminal state.
|
|
911
|
+
*/
|
|
912
|
+
waitForDeleteJob(id: string, options?: WaitForRecordDeleteJobOptions): Promise<DatasetRecordDeleteJob>;
|
|
758
913
|
/**
|
|
759
914
|
* Search for records in a dataset with filtering, search, and pagination
|
|
760
915
|
*
|
|
@@ -933,6 +1088,262 @@ declare class RulesResource extends BaseResource {
|
|
|
933
1088
|
private searchRuleRecords;
|
|
934
1089
|
}
|
|
935
1090
|
|
|
1091
|
+
/**
|
|
1092
|
+
* Publisher-managed import format resource for CardDB API
|
|
1093
|
+
*/
|
|
1094
|
+
|
|
1095
|
+
interface ListImportFormatsOptions {
|
|
1096
|
+
/** Publisher ID for publisher-scoped listing */
|
|
1097
|
+
publisherId?: string;
|
|
1098
|
+
/** Game ID for game-scoped listing */
|
|
1099
|
+
gameId?: string;
|
|
1100
|
+
/** Include archived definitions */
|
|
1101
|
+
includeArchived?: boolean;
|
|
1102
|
+
/** Maximum number of results per page */
|
|
1103
|
+
first?: number;
|
|
1104
|
+
/** Cursor for pagination */
|
|
1105
|
+
after?: string;
|
|
1106
|
+
/** Whether to use cache (defaults to client config) */
|
|
1107
|
+
cache?: boolean;
|
|
1108
|
+
}
|
|
1109
|
+
interface GetImportFormatOptions {
|
|
1110
|
+
/** Whether to use cache (defaults to client config) */
|
|
1111
|
+
cache?: boolean;
|
|
1112
|
+
}
|
|
1113
|
+
interface GetImportFormatByKeyOptions extends GetImportFormatOptions {
|
|
1114
|
+
/** Game ID for stable format-key lookup */
|
|
1115
|
+
gameId: string;
|
|
1116
|
+
/** Stable import format key */
|
|
1117
|
+
key: string;
|
|
1118
|
+
}
|
|
1119
|
+
declare class ImportFormatsResource extends BaseResource {
|
|
1120
|
+
constructor(connection: Connection, config: Configuration);
|
|
1121
|
+
/**
|
|
1122
|
+
* List publisher-managed import formats by publisher or game scope.
|
|
1123
|
+
*/
|
|
1124
|
+
list(options: ListImportFormatsOptions): Promise<Collection<DeckImportFormatDefinition>>;
|
|
1125
|
+
/**
|
|
1126
|
+
* Get one import format by UUID.
|
|
1127
|
+
*/
|
|
1128
|
+
get(id: string, options?: GetImportFormatOptions): Promise<DeckImportFormatDefinition | null>;
|
|
1129
|
+
/**
|
|
1130
|
+
* Get one import format by game ID and stable key.
|
|
1131
|
+
*/
|
|
1132
|
+
getByKey(options: GetImportFormatByKeyOptions): Promise<DeckImportFormatDefinition | null>;
|
|
1133
|
+
/**
|
|
1134
|
+
* Preview parsing and record resolution for a configured import format.
|
|
1135
|
+
*/
|
|
1136
|
+
test(input: DeckImportFormatTestInput): Promise<DeckImportFormatTestPayload>;
|
|
1137
|
+
/**
|
|
1138
|
+
* Create an import format. Requires a server-side secret credential.
|
|
1139
|
+
*/
|
|
1140
|
+
create(input: DeckImportFormatCreateInput): Promise<DeckImportFormatDefinition>;
|
|
1141
|
+
/**
|
|
1142
|
+
* Update an import format. Requires a server-side secret credential.
|
|
1143
|
+
*/
|
|
1144
|
+
update(id: string, input: DeckImportFormatUpdateInput): Promise<DeckImportFormatDefinition>;
|
|
1145
|
+
/**
|
|
1146
|
+
* Archive an import format. Requires a server-side secret credential.
|
|
1147
|
+
*/
|
|
1148
|
+
archive(id: string): Promise<DeckImportFormatDefinition>;
|
|
1149
|
+
/**
|
|
1150
|
+
* Restore an archived import format. Requires a server-side secret credential.
|
|
1151
|
+
*/
|
|
1152
|
+
unarchive(id: string): Promise<DeckImportFormatDefinition>;
|
|
1153
|
+
}
|
|
1154
|
+
|
|
1155
|
+
/**
|
|
1156
|
+
* Publisher import jobs resource for CardDB API
|
|
1157
|
+
*/
|
|
1158
|
+
|
|
1159
|
+
interface ListImportJobsOptions {
|
|
1160
|
+
/** Dataset ID to filter by */
|
|
1161
|
+
datasetId?: string;
|
|
1162
|
+
/** Job status to filter by */
|
|
1163
|
+
status?: ImportJobStatus;
|
|
1164
|
+
/** Maximum number of results per page */
|
|
1165
|
+
first?: number;
|
|
1166
|
+
/** Cursor for pagination */
|
|
1167
|
+
after?: string;
|
|
1168
|
+
/** Whether to use cache (defaults to client config) */
|
|
1169
|
+
cache?: boolean;
|
|
1170
|
+
}
|
|
1171
|
+
interface ListGameImportJobsOptions {
|
|
1172
|
+
/** Job status to filter by */
|
|
1173
|
+
status?: ImportJobStatus;
|
|
1174
|
+
/** Maximum number of results per page */
|
|
1175
|
+
first?: number;
|
|
1176
|
+
/** Cursor for pagination */
|
|
1177
|
+
after?: string;
|
|
1178
|
+
/** Whether to use cache (defaults to client config) */
|
|
1179
|
+
cache?: boolean;
|
|
1180
|
+
}
|
|
1181
|
+
interface ListImportJobLogsOptions {
|
|
1182
|
+
/** Log level to filter by */
|
|
1183
|
+
level?: ImportLogLevel;
|
|
1184
|
+
/** Dataset key to filter by */
|
|
1185
|
+
datasetKey?: string;
|
|
1186
|
+
/** Maximum number of results per page */
|
|
1187
|
+
first?: number;
|
|
1188
|
+
/** Cursor for pagination */
|
|
1189
|
+
after?: string;
|
|
1190
|
+
/** Whether to use cache (defaults to client config) */
|
|
1191
|
+
cache?: boolean;
|
|
1192
|
+
}
|
|
1193
|
+
interface WaitForImportJobOptions {
|
|
1194
|
+
/** Polling interval in milliseconds */
|
|
1195
|
+
intervalMs?: number;
|
|
1196
|
+
/** Max time to wait in milliseconds */
|
|
1197
|
+
timeoutMs?: number;
|
|
1198
|
+
}
|
|
1199
|
+
declare class ImportsResource extends BaseResource {
|
|
1200
|
+
constructor(connection: Connection, config: Configuration);
|
|
1201
|
+
/**
|
|
1202
|
+
* Preview a single-dataset import source without writing records or schema.
|
|
1203
|
+
*/
|
|
1204
|
+
preview(input: DatasetImportPreviewInput): Promise<DatasetImportPreviewResult>;
|
|
1205
|
+
/**
|
|
1206
|
+
* Validate a single-dataset import source with dry-run enforced.
|
|
1207
|
+
*/
|
|
1208
|
+
validate(input: DatasetImportValidateInput): Promise<BulkImportResult>;
|
|
1209
|
+
/**
|
|
1210
|
+
* Start an async single-dataset import from `fileId`, `data`, or `sourceUrl`.
|
|
1211
|
+
*/
|
|
1212
|
+
run(input: DatasetImportRunInput): Promise<ImportJob>;
|
|
1213
|
+
/**
|
|
1214
|
+
* Fetch one single-dataset import job.
|
|
1215
|
+
*/
|
|
1216
|
+
getJob(id: string, options?: {
|
|
1217
|
+
cache?: boolean;
|
|
1218
|
+
}): Promise<ImportJob | null>;
|
|
1219
|
+
/**
|
|
1220
|
+
* List single-dataset import jobs for a publisher.
|
|
1221
|
+
*/
|
|
1222
|
+
listJobs(publisherId: string, options?: ListImportJobsOptions): Promise<Collection<ImportJob>>;
|
|
1223
|
+
/**
|
|
1224
|
+
* Cancel a pending or processing single-dataset import job.
|
|
1225
|
+
*/
|
|
1226
|
+
cancelJob(id: string): Promise<ImportJob>;
|
|
1227
|
+
/**
|
|
1228
|
+
* List structured logs for one single-dataset import job.
|
|
1229
|
+
*/
|
|
1230
|
+
listJobLogs(importJobId: string, options?: ListImportJobLogsOptions): Promise<Collection<ImportJobLog>>;
|
|
1231
|
+
/**
|
|
1232
|
+
* Poll a single-dataset import job until completion or failure.
|
|
1233
|
+
*/
|
|
1234
|
+
waitForJob(id: string, options?: WaitForImportJobOptions): Promise<ImportJob>;
|
|
1235
|
+
/**
|
|
1236
|
+
* Preview an advanced game-level import source without writing records or schema.
|
|
1237
|
+
*/
|
|
1238
|
+
previewGame(input: GameImportPreviewInput): Promise<GameImportPreview>;
|
|
1239
|
+
/**
|
|
1240
|
+
* Start an async advanced game-level import from `fileId`, `data`, or `sourceUrl`.
|
|
1241
|
+
*/
|
|
1242
|
+
runGame(input: GameImportRunInput): Promise<GameImportJob>;
|
|
1243
|
+
/**
|
|
1244
|
+
* Fetch one advanced game-level import job.
|
|
1245
|
+
*/
|
|
1246
|
+
getGameJob(id: string, options?: {
|
|
1247
|
+
cache?: boolean;
|
|
1248
|
+
}): Promise<GameImportJob | null>;
|
|
1249
|
+
/**
|
|
1250
|
+
* List advanced game-level import jobs.
|
|
1251
|
+
*/
|
|
1252
|
+
listGameJobs(gameId: string, options?: ListGameImportJobsOptions): Promise<Collection<GameImportJob>>;
|
|
1253
|
+
/**
|
|
1254
|
+
* Cancel a pending or processing advanced game-level import job.
|
|
1255
|
+
*/
|
|
1256
|
+
cancelGameJob(id: string): Promise<GameImportJob>;
|
|
1257
|
+
/**
|
|
1258
|
+
* Poll an advanced game-level import job until completion or failure.
|
|
1259
|
+
*/
|
|
1260
|
+
waitForGameJob(id: string, options?: WaitForImportJobOptions): Promise<GameImportJob>;
|
|
1261
|
+
}
|
|
1262
|
+
|
|
1263
|
+
/**
|
|
1264
|
+
* Publisher dataset export jobs resource for CardDB API
|
|
1265
|
+
*/
|
|
1266
|
+
|
|
1267
|
+
interface ListExportJobsOptions {
|
|
1268
|
+
/** Game ID to filter by */
|
|
1269
|
+
gameId?: string;
|
|
1270
|
+
/** Dataset ID to filter by */
|
|
1271
|
+
datasetId?: string;
|
|
1272
|
+
/** Job status to filter by */
|
|
1273
|
+
status?: ExportJobStatus;
|
|
1274
|
+
/** Maximum number of results per page */
|
|
1275
|
+
first?: number;
|
|
1276
|
+
/** Cursor for pagination */
|
|
1277
|
+
after?: string;
|
|
1278
|
+
/** Whether to use cache (defaults to client config) */
|
|
1279
|
+
cache?: boolean;
|
|
1280
|
+
}
|
|
1281
|
+
interface WaitForExportJobOptions {
|
|
1282
|
+
/** Polling interval in milliseconds */
|
|
1283
|
+
intervalMs?: number;
|
|
1284
|
+
/** Max time to wait in milliseconds */
|
|
1285
|
+
timeoutMs?: number;
|
|
1286
|
+
}
|
|
1287
|
+
declare class ExportsResource extends BaseResource {
|
|
1288
|
+
constructor(connection: Connection, config: Configuration);
|
|
1289
|
+
/**
|
|
1290
|
+
* Start an async dataset export. Requires a server-side secret credential.
|
|
1291
|
+
*/
|
|
1292
|
+
run(input: DatasetExportInput): Promise<ExportJob>;
|
|
1293
|
+
/** Alias for `run`. */
|
|
1294
|
+
create(input: DatasetExportInput): Promise<ExportJob>;
|
|
1295
|
+
/**
|
|
1296
|
+
* Fetch one export job.
|
|
1297
|
+
*/
|
|
1298
|
+
getJob(id: string, options?: {
|
|
1299
|
+
cache?: boolean;
|
|
1300
|
+
}): Promise<ExportJob | null>;
|
|
1301
|
+
/**
|
|
1302
|
+
* List export jobs for a publisher, optionally filtered by game, dataset, or status.
|
|
1303
|
+
*/
|
|
1304
|
+
listJobs(publisherId: string, options?: ListExportJobsOptions): Promise<Collection<ExportJob>>;
|
|
1305
|
+
/**
|
|
1306
|
+
* Refresh the signed download URL for a completed export job.
|
|
1307
|
+
*/
|
|
1308
|
+
refreshUrl(id: string): Promise<ExportJob>;
|
|
1309
|
+
/**
|
|
1310
|
+
* Cancel a pending or processing export job. Requires a server-side secret credential.
|
|
1311
|
+
*/
|
|
1312
|
+
cancel(id: string): Promise<ExportJob>;
|
|
1313
|
+
/**
|
|
1314
|
+
* Poll an export job until completion or failure.
|
|
1315
|
+
*/
|
|
1316
|
+
waitForJob(id: string, options?: WaitForExportJobOptions): Promise<ExportJob>;
|
|
1317
|
+
}
|
|
1318
|
+
|
|
1319
|
+
/**
|
|
1320
|
+
* File upload helper resource for CardDB API
|
|
1321
|
+
*/
|
|
1322
|
+
|
|
1323
|
+
interface GetFileOptions {
|
|
1324
|
+
/** Whether to use cache (defaults to client config) */
|
|
1325
|
+
cache?: boolean;
|
|
1326
|
+
}
|
|
1327
|
+
declare class FilesResource extends BaseResource {
|
|
1328
|
+
constructor(connection: Connection, config: Configuration);
|
|
1329
|
+
/**
|
|
1330
|
+
* Get one file by ID.
|
|
1331
|
+
*/
|
|
1332
|
+
get(id: string, options?: GetFileOptions): Promise<File | null>;
|
|
1333
|
+
/**
|
|
1334
|
+
* Request a presigned URL for direct upload. Requires a server-side secret credential.
|
|
1335
|
+
*/
|
|
1336
|
+
requestUpload(input: FileUploadInput): Promise<PresignedUpload>;
|
|
1337
|
+
/**
|
|
1338
|
+
* Confirm that a presigned upload completed.
|
|
1339
|
+
*/
|
|
1340
|
+
confirmUpload(id: string): Promise<File>;
|
|
1341
|
+
/**
|
|
1342
|
+
* Delete a file. Requires a server-side secret credential.
|
|
1343
|
+
*/
|
|
1344
|
+
delete(id: string): Promise<boolean>;
|
|
1345
|
+
}
|
|
1346
|
+
|
|
936
1347
|
/**
|
|
937
1348
|
* CardDB API Client
|
|
938
1349
|
*
|
|
@@ -996,6 +1407,14 @@ declare class CardDBClient {
|
|
|
996
1407
|
readonly decks: DecksResource;
|
|
997
1408
|
/** Rules resource for game rules and deck formats */
|
|
998
1409
|
readonly rules: RulesResource;
|
|
1410
|
+
/** Publisher-managed import format resource */
|
|
1411
|
+
readonly importFormats: ImportFormatsResource;
|
|
1412
|
+
/** Publisher import job resource */
|
|
1413
|
+
readonly imports: ImportsResource;
|
|
1414
|
+
/** Publisher dataset export job resource */
|
|
1415
|
+
readonly exports: ExportsResource;
|
|
1416
|
+
/** File upload helper resource */
|
|
1417
|
+
readonly files: FilesResource;
|
|
999
1418
|
/**
|
|
1000
1419
|
* Create a new CardDB client
|
|
1001
1420
|
*
|
|
@@ -1077,4 +1496,4 @@ declare function readCache<T>(cache: Cache, key: string): Promise<T | null>;
|
|
|
1077
1496
|
*/
|
|
1078
1497
|
declare function writeCache<T>(cache: Cache, key: string, value: T, ttl: number): Promise<void>;
|
|
1079
1498
|
|
|
1080
|
-
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, type FetchDeckByExternalRefOptions, type FetchDeckBySlugOptions, type FetchDeckOptions, GamesResource, type GetDatasetOptions, type GetGameOptions, type GetPublisherOptions, type GetRecordByIdentifierOptions, type GetRecordOptions, type GetRecordsByIdentifierOptions, type GraphQLResponse, type HydrateDeckEntriesOptions, type ListAppDecksOptions, type ListDeckAccessTokenIssuersOptions, type ListDeckApiApplicationAccessesOptions, type ListDeckCollaboratorsOptions, type ListDeckEmbedTokensOptions, type ListDeckImportFormatsOptions, type ListDeckPreviewTokensOptions, type ListDeckVersionsOptions, type ListDecksOptions, type ListFormatsOptions, type ListMyDeckApiApplicationAccessesOptions, type ListPublicDecksOptions, type ListRuleDatasetsOptions, type ListRulesOptions, type ListViewerDecksOptions, PublishersResource, RecordsResource, RulesResource, type SearchDatasetsOptions, type SearchGamesOptions, type SearchPublishersOptions, type SearchRecordsOptions, cacheKey, getRateLimitInfo, getSDKVersion, getUserAgent, readCache, writeCache };
|
|
1499
|
+
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 };
|