@carddb/core 0.3.0 → 0.4.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 +334 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +307 -2
- package/dist/index.d.ts +307 -2
- package/dist/index.js +334 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Core types for CardDB JavaScript clients
|
|
3
3
|
*/
|
|
4
4
|
type LogLevel = 'debug' | 'info' | 'warn' | 'error';
|
|
5
|
-
type ResourceType = 'publishers' | 'games' | 'datasets' | 'records' | 'decks' | 'importFormats' | 'imports' | 'exports' | 'files';
|
|
5
|
+
type ResourceType = 'publishers' | 'games' | 'datasets' | 'records' | 'decks' | 'importFormats' | 'imports' | 'exports' | 'files' | 'scans' | 'scanTemplates';
|
|
6
6
|
interface Logger {
|
|
7
7
|
debug(message: string, ...args: unknown[]): void;
|
|
8
8
|
info(message: string, ...args: unknown[]): void;
|
|
@@ -112,6 +112,7 @@ interface PresignedUpload {
|
|
|
112
112
|
uploadUrl: string;
|
|
113
113
|
expiresAt: string;
|
|
114
114
|
}
|
|
115
|
+
type UploadPurpose = 'scan_image' | 'import' | 'scan_template_example' | (string & {});
|
|
115
116
|
type PublisherStatus = 'ACTIVE' | 'DEACTIVATED';
|
|
116
117
|
interface Publisher {
|
|
117
118
|
id: string;
|
|
@@ -175,6 +176,271 @@ interface GameRef {
|
|
|
175
176
|
key: string;
|
|
176
177
|
name: string;
|
|
177
178
|
}
|
|
179
|
+
type ScanJobStatus = 'pending' | 'processing' | 'completed' | 'failed' | 'cancelled';
|
|
180
|
+
interface CreateScanJobInput {
|
|
181
|
+
publisherSlug: string;
|
|
182
|
+
gameKey: string;
|
|
183
|
+
datasetKey: string;
|
|
184
|
+
fileId: string;
|
|
185
|
+
clientRequestId?: string;
|
|
186
|
+
templateId?: string;
|
|
187
|
+
templateVersionId?: string;
|
|
188
|
+
hints?: Record<string, unknown>;
|
|
189
|
+
clientOcrHints?: Record<string, unknown>;
|
|
190
|
+
clientNormalization?: Record<string, unknown>;
|
|
191
|
+
webhookUrl?: string;
|
|
192
|
+
webhookSecret?: string;
|
|
193
|
+
}
|
|
194
|
+
interface ScanJobPayload {
|
|
195
|
+
job: ScanJob;
|
|
196
|
+
created: boolean;
|
|
197
|
+
}
|
|
198
|
+
interface ScanJob {
|
|
199
|
+
jobId: string;
|
|
200
|
+
status: ScanJobStatus | (string & {});
|
|
201
|
+
publisherSlug: string;
|
|
202
|
+
gameKey: string;
|
|
203
|
+
datasetKey: string;
|
|
204
|
+
fileId: string;
|
|
205
|
+
clientRequestId: string | null;
|
|
206
|
+
templateId: string | null;
|
|
207
|
+
templateVersionId: string | null;
|
|
208
|
+
bestMatch: ScanBestMatch | null;
|
|
209
|
+
candidates: ScanCandidate[];
|
|
210
|
+
extracted: Record<string, unknown>;
|
|
211
|
+
metrics: ScanJobMetrics | null;
|
|
212
|
+
webhook: ScanWebhookState | null;
|
|
213
|
+
error: ScanJobError | null;
|
|
214
|
+
createdAt: string;
|
|
215
|
+
updatedAt: string;
|
|
216
|
+
startedAt: string | null;
|
|
217
|
+
completedAt: string | null;
|
|
218
|
+
}
|
|
219
|
+
interface ScanBestMatch {
|
|
220
|
+
recordId: string;
|
|
221
|
+
score: number | null;
|
|
222
|
+
confidence: string | null;
|
|
223
|
+
}
|
|
224
|
+
interface ScanCandidate {
|
|
225
|
+
recordId: string;
|
|
226
|
+
rank: number;
|
|
227
|
+
score: number;
|
|
228
|
+
confidence: string | null;
|
|
229
|
+
reasons: string[];
|
|
230
|
+
}
|
|
231
|
+
interface ScanJobError {
|
|
232
|
+
code: string;
|
|
233
|
+
message: string;
|
|
234
|
+
}
|
|
235
|
+
interface ScanWebhookState {
|
|
236
|
+
configured: boolean;
|
|
237
|
+
url: string | null;
|
|
238
|
+
latestDeliveryId: string | null;
|
|
239
|
+
status: string | null;
|
|
240
|
+
attemptCount: number | null;
|
|
241
|
+
nextAttemptAt: string | null;
|
|
242
|
+
lastAttemptAt: string | null;
|
|
243
|
+
deliveredAt: string | null;
|
|
244
|
+
lastStatusCode: number | null;
|
|
245
|
+
lastError: string | null;
|
|
246
|
+
}
|
|
247
|
+
interface ScanJobMetrics {
|
|
248
|
+
featureVersion: string;
|
|
249
|
+
candidateCount: number;
|
|
250
|
+
confidenceScore: number | null;
|
|
251
|
+
confidenceLabel: string | null;
|
|
252
|
+
stages: ScanStageMetrics[];
|
|
253
|
+
timings: Record<string, unknown> | null;
|
|
254
|
+
}
|
|
255
|
+
interface ScanStageMetrics {
|
|
256
|
+
name: string;
|
|
257
|
+
status: string | null;
|
|
258
|
+
durationMs: number | null;
|
|
259
|
+
completedAt: string | null;
|
|
260
|
+
details: Record<string, unknown> | null;
|
|
261
|
+
}
|
|
262
|
+
interface SubmitScanFeedbackInput {
|
|
263
|
+
jobId: string;
|
|
264
|
+
selectedRecordId?: string;
|
|
265
|
+
correct?: boolean;
|
|
266
|
+
notes?: string;
|
|
267
|
+
metadata?: Record<string, unknown>;
|
|
268
|
+
}
|
|
269
|
+
interface ScanFeedbackPayload {
|
|
270
|
+
feedbackId: string;
|
|
271
|
+
jobId: string;
|
|
272
|
+
status: string;
|
|
273
|
+
persisted: boolean;
|
|
274
|
+
correct: boolean | null;
|
|
275
|
+
predictedRecordId: string | null;
|
|
276
|
+
selectedRecordId: string | null;
|
|
277
|
+
featureVersion: string;
|
|
278
|
+
message: string;
|
|
279
|
+
}
|
|
280
|
+
interface ScanMetricsInput {
|
|
281
|
+
publisherSlug: string;
|
|
282
|
+
gameKey: string;
|
|
283
|
+
datasetKey: string;
|
|
284
|
+
since?: string;
|
|
285
|
+
until?: string;
|
|
286
|
+
}
|
|
287
|
+
interface ScanMetrics {
|
|
288
|
+
publisherSlug: string;
|
|
289
|
+
gameKey: string;
|
|
290
|
+
datasetKey: string;
|
|
291
|
+
since: string;
|
|
292
|
+
until: string;
|
|
293
|
+
generatedAt: string;
|
|
294
|
+
totalJobs: number;
|
|
295
|
+
completedJobs: number;
|
|
296
|
+
failedJobs: number;
|
|
297
|
+
failureRate: number;
|
|
298
|
+
averageShortlistSize: number;
|
|
299
|
+
confidenceDistribution: Record<string, unknown>;
|
|
300
|
+
feedback: ScanFeedbackMetrics;
|
|
301
|
+
featureVersions: ScanFeatureVersionMetrics[];
|
|
302
|
+
}
|
|
303
|
+
interface ScanFeedbackMetrics {
|
|
304
|
+
total: number;
|
|
305
|
+
correct: number;
|
|
306
|
+
corrected: number;
|
|
307
|
+
unknown: number;
|
|
308
|
+
accuracy: number | null;
|
|
309
|
+
}
|
|
310
|
+
interface ScanFeatureVersionMetrics {
|
|
311
|
+
featureVersion: string;
|
|
312
|
+
jobCount: number;
|
|
313
|
+
completedJobs: number;
|
|
314
|
+
failedJobs: number;
|
|
315
|
+
averageConfidence: number | null;
|
|
316
|
+
averageShortlistSize: number;
|
|
317
|
+
feedbackCount: number;
|
|
318
|
+
correctFeedback: number;
|
|
319
|
+
correctedFeedback: number;
|
|
320
|
+
feedbackAccuracy: number | null;
|
|
321
|
+
}
|
|
322
|
+
interface ResolveScanTemplateInput {
|
|
323
|
+
publisherSlug: string;
|
|
324
|
+
gameKey: string;
|
|
325
|
+
datasetKey?: string;
|
|
326
|
+
templateId?: string;
|
|
327
|
+
}
|
|
328
|
+
interface ScanTemplatesInput {
|
|
329
|
+
publisherSlug: string;
|
|
330
|
+
gameKey: string;
|
|
331
|
+
datasetKey?: string;
|
|
332
|
+
includeArchived?: boolean;
|
|
333
|
+
}
|
|
334
|
+
interface SaveScanTemplateInput {
|
|
335
|
+
publisherSlug: string;
|
|
336
|
+
gameKey: string;
|
|
337
|
+
datasetKey: string;
|
|
338
|
+
key: string;
|
|
339
|
+
name: string;
|
|
340
|
+
status: string;
|
|
341
|
+
version: number;
|
|
342
|
+
isDefault: boolean;
|
|
343
|
+
exampleFileId?: string;
|
|
344
|
+
cardAspectRatio?: number;
|
|
345
|
+
notes?: string;
|
|
346
|
+
config?: Record<string, unknown>;
|
|
347
|
+
regions: ScanTemplateRegionInput[];
|
|
348
|
+
}
|
|
349
|
+
interface PreviewScanTemplateInput extends SaveScanTemplateInput {
|
|
350
|
+
datasetKey: string;
|
|
351
|
+
regionOcrHints?: Record<string, unknown>;
|
|
352
|
+
}
|
|
353
|
+
interface ScanTemplateRegionInput {
|
|
354
|
+
id?: string;
|
|
355
|
+
key: string;
|
|
356
|
+
label: string;
|
|
357
|
+
sortOrder: number;
|
|
358
|
+
shapeType: string;
|
|
359
|
+
geometry: Record<string, unknown>;
|
|
360
|
+
semanticType: string;
|
|
361
|
+
extractionMode: string;
|
|
362
|
+
lookupMode: string;
|
|
363
|
+
isRequired: boolean;
|
|
364
|
+
weight?: number;
|
|
365
|
+
config?: Record<string, unknown>;
|
|
366
|
+
}
|
|
367
|
+
interface ScanTemplateResolution {
|
|
368
|
+
template: ScanTemplate | null;
|
|
369
|
+
warnings: ScanTemplateWarning[];
|
|
370
|
+
}
|
|
371
|
+
interface ScanTemplateList {
|
|
372
|
+
templates: ScanTemplate[];
|
|
373
|
+
}
|
|
374
|
+
interface ScanTemplatePayload {
|
|
375
|
+
template: ScanTemplate;
|
|
376
|
+
warnings: ScanTemplateWarning[];
|
|
377
|
+
}
|
|
378
|
+
interface ScanTemplatePreview {
|
|
379
|
+
warnings: ScanTemplateWarning[];
|
|
380
|
+
regions: ScanTemplateRegionPreview[];
|
|
381
|
+
message: string;
|
|
382
|
+
}
|
|
383
|
+
interface ScanTemplate {
|
|
384
|
+
id: string;
|
|
385
|
+
key: string;
|
|
386
|
+
name: string;
|
|
387
|
+
status: string;
|
|
388
|
+
version: number;
|
|
389
|
+
isDefault: boolean;
|
|
390
|
+
publisherSlug: string;
|
|
391
|
+
gameKey: string;
|
|
392
|
+
datasetKey: string | null;
|
|
393
|
+
exampleFileId: string | null;
|
|
394
|
+
coordinateSpace: string;
|
|
395
|
+
cardAspectRatio: number | null;
|
|
396
|
+
notes: string | null;
|
|
397
|
+
config: Record<string, unknown>;
|
|
398
|
+
regions: ScanTemplateRegion[];
|
|
399
|
+
createdAt: string;
|
|
400
|
+
updatedAt: string;
|
|
401
|
+
}
|
|
402
|
+
interface ScanTemplateRegion {
|
|
403
|
+
id: string;
|
|
404
|
+
key: string;
|
|
405
|
+
label: string;
|
|
406
|
+
sortOrder: number;
|
|
407
|
+
shapeType: string;
|
|
408
|
+
geometry: Record<string, unknown>;
|
|
409
|
+
semanticType: string;
|
|
410
|
+
extractionMode: string;
|
|
411
|
+
lookupMode: string;
|
|
412
|
+
isRequired: boolean;
|
|
413
|
+
weight: number | null;
|
|
414
|
+
config: Record<string, unknown>;
|
|
415
|
+
}
|
|
416
|
+
interface ScanTemplateRegionPreview {
|
|
417
|
+
key: string;
|
|
418
|
+
label: string;
|
|
419
|
+
semanticType: string;
|
|
420
|
+
extractionMode: string;
|
|
421
|
+
lookupMode: string;
|
|
422
|
+
rawText: string;
|
|
423
|
+
normalizedValue: string;
|
|
424
|
+
source: string;
|
|
425
|
+
status: string;
|
|
426
|
+
confidence: number | null;
|
|
427
|
+
}
|
|
428
|
+
interface ScanTemplateWarning {
|
|
429
|
+
code: string;
|
|
430
|
+
region: string | null;
|
|
431
|
+
message: string;
|
|
432
|
+
}
|
|
433
|
+
interface GameScanRegion {
|
|
434
|
+
id: string;
|
|
435
|
+
key: string;
|
|
436
|
+
name: string;
|
|
437
|
+
description: string | null;
|
|
438
|
+
sortOrder: number;
|
|
439
|
+
isActive: boolean;
|
|
440
|
+
metadata: Record<string, unknown>;
|
|
441
|
+
createdAt: string;
|
|
442
|
+
updatedAt: string;
|
|
443
|
+
}
|
|
178
444
|
interface Dataset {
|
|
179
445
|
id: string;
|
|
180
446
|
publisherId: string;
|
|
@@ -2017,6 +2283,36 @@ declare const QueryBuilder: {
|
|
|
2017
2283
|
fileDelete(): {
|
|
2018
2284
|
query: string;
|
|
2019
2285
|
};
|
|
2286
|
+
createScanJob(): {
|
|
2287
|
+
query: string;
|
|
2288
|
+
};
|
|
2289
|
+
scanJob(): {
|
|
2290
|
+
query: string;
|
|
2291
|
+
};
|
|
2292
|
+
submitScanFeedback(): {
|
|
2293
|
+
query: string;
|
|
2294
|
+
};
|
|
2295
|
+
scanMetrics(): {
|
|
2296
|
+
query: string;
|
|
2297
|
+
};
|
|
2298
|
+
resolveScanTemplate(): {
|
|
2299
|
+
query: string;
|
|
2300
|
+
};
|
|
2301
|
+
scanTemplates(): {
|
|
2302
|
+
query: string;
|
|
2303
|
+
};
|
|
2304
|
+
createScanTemplate(): {
|
|
2305
|
+
query: string;
|
|
2306
|
+
};
|
|
2307
|
+
updateScanTemplate(): {
|
|
2308
|
+
query: string;
|
|
2309
|
+
};
|
|
2310
|
+
previewScanTemplate(): {
|
|
2311
|
+
query: string;
|
|
2312
|
+
};
|
|
2313
|
+
gameScanRegions(): {
|
|
2314
|
+
query: string;
|
|
2315
|
+
};
|
|
2020
2316
|
exportJob(): {
|
|
2021
2317
|
query: string;
|
|
2022
2318
|
};
|
|
@@ -2286,6 +2582,15 @@ declare const QueryBuilder: {
|
|
|
2286
2582
|
datasetRecordsUpsertVariables(input: DatasetRecordsUpsertInput): Record<string, unknown>;
|
|
2287
2583
|
datasetRecordsDeleteVariables(input: DatasetRecordsDeleteInput): Record<string, unknown>;
|
|
2288
2584
|
fileUploadRequestVariables(input: FileUploadInput): Record<string, unknown>;
|
|
2585
|
+
createScanJobVariables(input: CreateScanJobInput): Record<string, unknown>;
|
|
2586
|
+
submitScanFeedbackVariables(input: SubmitScanFeedbackInput): Record<string, unknown>;
|
|
2587
|
+
scanMetricsVariables(input: ScanMetricsInput): Record<string, unknown>;
|
|
2588
|
+
resolveScanTemplateVariables(input: ResolveScanTemplateInput): Record<string, unknown>;
|
|
2589
|
+
scanTemplatesVariables(input: ScanTemplatesInput): Record<string, unknown>;
|
|
2590
|
+
createScanTemplateVariables(input: SaveScanTemplateInput): Record<string, unknown>;
|
|
2591
|
+
updateScanTemplateVariables(id: string, input: SaveScanTemplateInput): Record<string, unknown>;
|
|
2592
|
+
previewScanTemplateVariables(input: PreviewScanTemplateInput): Record<string, unknown>;
|
|
2593
|
+
gameScanRegionsVariables(publisherSlug: string, gameKey: string, includeInactive?: boolean): Record<string, unknown>;
|
|
2289
2594
|
datasetExportVariables(input: DatasetExportInput): Record<string, unknown>;
|
|
2290
2595
|
fetchMe(): {
|
|
2291
2596
|
query: string;
|
|
@@ -2422,4 +2727,4 @@ declare class Collection<T> implements AsyncIterable<T> {
|
|
|
2422
2727
|
each(): AsyncIterable<T>;
|
|
2423
2728
|
}
|
|
2424
2729
|
|
|
2425
|
-
export { type APIAccount, type APIApplication, type APIKeyInfo, type AppDecksFilterInput, type AppDecksParams, AuthenticationError, type BulkCreateResult, type BulkImportResult, type BulkInsertMode, type BulkRecordError, type Cache, type CardDBConfig, CardDBError, Collection, type Connection, ConnectionError, type CsvOptions, type Dataset, type DatasetExportInput, type DatasetImportFromFileInput, type DatasetImportFromPayloadInput, type DatasetImportFromUrlInput, type DatasetImportPreview, type DatasetImportPreviewInput, type DatasetImportPreviewResult, type DatasetImportRunInput, type DatasetImportValidateInput, type DatasetPurpose, type DatasetRecord, type DatasetRecordDeleteJob, type DatasetRecordDeleteJobConnection, type DatasetRecordDeleteJobResult, type DatasetRecordDeleteJobStatus, type DatasetRecordDeleteResultStatus, type DatasetRecordDeleteTargetType, type DatasetRecordsDeleteInput, type DatasetRecordsUpsertInput, type DatasetRecordsUpsertPayload, type DatasetRef, type DatasetSchema, type DatasetVisibility, type Deck, type DeckAPIApplicationAccess, type DeckAPIApplicationAccessGrantInput, type DeckAPIApplicationAccessGrantSource, type DeckAPIApplicationAccessRole, type DeckAccessApplication, type DeckAccessMode, type DeckAccessToken, type DeckAccessTokenExchangeInput, type DeckAccessTokenExchangePayload, type DeckAccessTokenIssuer, type DeckAccessTokenIssuerCreateInput, type DeckAccessTokenIssuerSigningKeyInput, type DeckAccessTokenSigningAlgorithm, type DeckAppAccessRetention, type DeckClaimInput, type DeckCollaborator, type DeckCollaboratorRole, type DeckCopyInput, type DeckCopyPayload, type DeckCreateInput, type DeckDiff, type DeckDiscoverability, type DeckEmbedToken, type DeckEmbedTokenCreateInput, type DeckEmbedTokenCreatePayload, type DeckEntriesReplaceInput, type DeckEntriesReplacePayload, type DeckEntry, type DeckEntryAddInput, type DeckEntryInput, type DeckEntryMutationPayload, type DeckEntryReorderInput, type DeckEntryReorderItemInput, type DeckEntryReorderPayload, type DeckEntryUpdateInput, type DeckEnvironment, type DeckExportFormat, type DeckExportPayload, type DeckHydrateEntriesInput, type DeckHydrateEntriesPayload, type DeckImportAmbiguousEntry, type DeckImportCandidate, type DeckImportEntry, type DeckImportFormat, type DeckImportFormatCreateInput, type DeckImportFormatDefinition, type DeckImportFormatDefinitionConnection, type DeckImportFormatDetection, type DeckImportFormatTestInput, type DeckImportFormatTestPayload, type DeckImportFormatUpdateInput, type DeckImportInput, type DeckImportIssue, type DeckImportPayload, type DeckImportUnmatchedEntry, type DeckOwnerType, type DeckOwnershipTransferPayload, type DeckPreviewToken, type DeckPreviewTokenCreateInput, type DeckPreviewTokenCreatePayload, type DeckPublishInput, type DeckPublishPayload, type DeckRemoveInvalidEntriesInput, type DeckSectionDefinition, type DeckSectionDefinitionsParams, type DeckSessionScope, type DeckSessionToken, type DeckSessionTokenExchangeInput, type DeckSessionTokenExchangePayload, type DeckState, type DeckTokenReadMode, type DeckTransferOwnershipInput, type DeckUpdateInput, type DeckUpsertByExternalRefInput, type DeckUpsertByExternalRefPayload, type DeckValidateInput, type DeckValidatedAgainst, type DeckValidation, type DeckValidationAffectedEntry, type DeckValidationIssue, type DeckValidationSeverity, type DeckVersion, type DeckVersionConnection, type DeckVisibility, type Edge, type ExportFormat, type ExportJob, type ExportJobConnection, type ExportJobStatus, type FieldInfo, type FieldMapping, type FieldMappingOverrideInput, type FieldMappingStatus, type FieldType, type File, type FileInfo, type FileStatus, type FileUploadInput, FilterBuilder, type FilterBuilderInterface, type FilterCondition, type FilterInput, type FilterOperatorValue, type FilterValue, type Game, type GameCreateInput, type GameImportDatasetStatus, type GameImportFromFileInput, type GameImportFromPayloadInput, type GameImportFromUrlInput, type GameImportJob, type GameImportJobConnection, type GameImportPreview, type GameImportPreviewInput, type GameImportRunInput, type GameRef, type GameUpdateInput, type GameVisibility, GraphQLError, type GraphQLErrorInfo, type HydrateDeckEntryInput, type HydratedDeckEntry, type ImportFormat, type ImportJob, type ImportJobAsset, type ImportJobAssetInput, type ImportJobConnection, type ImportJobLog, type ImportJobLogConnection, type ImportJobStatus, type ImportLogLevel, type ImportMode, type ImportOptions, type ImportStats, type ImportValidationError, type ImportWarning, type ImportWarningSeverity, type InferredChildField, type LinkFieldInfo, LinkResolutionError, type LinkResolutionFailure, type ListDeckImportFormatsParams, type ListDeckVersionsParams, type ListDecksParams, type LogLevel, type Logger, type NextPageLoader, NotFoundError, type ObjectField, type OnConflict, type PageInfo, type PresignedUpload, type PublicDecksFilterInput, type PublicDecksParams, type Publisher, type PublisherRef, type PublisherStatus, QueryBuilder, RateLimitError, type RateLimitInfo, type ResolvedLink, type ResourceType, RestrictedError, type SearchDatasetsParams, type SearchGamesParams, type SearchPublishersParams, type SearchRecordsParams, ServerError, type TCGPlayerPrice, type TCGPlayerPricing, TimeoutError, ValidationError, type ViewerDecksFilterInput, type ViewerDecksParams, contains, eq, gt, gte, ilike, isNotNull, isNull, like, lt, lte, neq, notWithin, resolveFilter, within };
|
|
2730
|
+
export { type APIAccount, type APIApplication, type APIKeyInfo, type AppDecksFilterInput, type AppDecksParams, AuthenticationError, type BulkCreateResult, type BulkImportResult, type BulkInsertMode, type BulkRecordError, type Cache, type CardDBConfig, CardDBError, Collection, type Connection, ConnectionError, type CreateScanJobInput, type CsvOptions, type Dataset, type DatasetExportInput, type DatasetImportFromFileInput, type DatasetImportFromPayloadInput, type DatasetImportFromUrlInput, type DatasetImportPreview, type DatasetImportPreviewInput, type DatasetImportPreviewResult, type DatasetImportRunInput, type DatasetImportValidateInput, type DatasetPurpose, type DatasetRecord, type DatasetRecordDeleteJob, type DatasetRecordDeleteJobConnection, type DatasetRecordDeleteJobResult, type DatasetRecordDeleteJobStatus, type DatasetRecordDeleteResultStatus, type DatasetRecordDeleteTargetType, type DatasetRecordsDeleteInput, type DatasetRecordsUpsertInput, type DatasetRecordsUpsertPayload, type DatasetRef, type DatasetSchema, type DatasetVisibility, type Deck, type DeckAPIApplicationAccess, type DeckAPIApplicationAccessGrantInput, type DeckAPIApplicationAccessGrantSource, type DeckAPIApplicationAccessRole, type DeckAccessApplication, type DeckAccessMode, type DeckAccessToken, type DeckAccessTokenExchangeInput, type DeckAccessTokenExchangePayload, type DeckAccessTokenIssuer, type DeckAccessTokenIssuerCreateInput, type DeckAccessTokenIssuerSigningKeyInput, type DeckAccessTokenSigningAlgorithm, type DeckAppAccessRetention, type DeckClaimInput, type DeckCollaborator, type DeckCollaboratorRole, type DeckCopyInput, type DeckCopyPayload, type DeckCreateInput, type DeckDiff, type DeckDiscoverability, type DeckEmbedToken, type DeckEmbedTokenCreateInput, type DeckEmbedTokenCreatePayload, type DeckEntriesReplaceInput, type DeckEntriesReplacePayload, type DeckEntry, type DeckEntryAddInput, type DeckEntryInput, type DeckEntryMutationPayload, type DeckEntryReorderInput, type DeckEntryReorderItemInput, type DeckEntryReorderPayload, type DeckEntryUpdateInput, type DeckEnvironment, type DeckExportFormat, type DeckExportPayload, type DeckHydrateEntriesInput, type DeckHydrateEntriesPayload, type DeckImportAmbiguousEntry, type DeckImportCandidate, type DeckImportEntry, type DeckImportFormat, type DeckImportFormatCreateInput, type DeckImportFormatDefinition, type DeckImportFormatDefinitionConnection, type DeckImportFormatDetection, type DeckImportFormatTestInput, type DeckImportFormatTestPayload, type DeckImportFormatUpdateInput, type DeckImportInput, type DeckImportIssue, type DeckImportPayload, type DeckImportUnmatchedEntry, type DeckOwnerType, type DeckOwnershipTransferPayload, type DeckPreviewToken, type DeckPreviewTokenCreateInput, type DeckPreviewTokenCreatePayload, type DeckPublishInput, type DeckPublishPayload, type DeckRemoveInvalidEntriesInput, type DeckSectionDefinition, type DeckSectionDefinitionsParams, type DeckSessionScope, type DeckSessionToken, type DeckSessionTokenExchangeInput, type DeckSessionTokenExchangePayload, type DeckState, type DeckTokenReadMode, type DeckTransferOwnershipInput, type DeckUpdateInput, type DeckUpsertByExternalRefInput, type DeckUpsertByExternalRefPayload, type DeckValidateInput, type DeckValidatedAgainst, type DeckValidation, type DeckValidationAffectedEntry, type DeckValidationIssue, type DeckValidationSeverity, type DeckVersion, type DeckVersionConnection, type DeckVisibility, type Edge, type ExportFormat, type ExportJob, type ExportJobConnection, type ExportJobStatus, type FieldInfo, type FieldMapping, type FieldMappingOverrideInput, type FieldMappingStatus, type FieldType, type File, type FileInfo, type FileStatus, type FileUploadInput, FilterBuilder, type FilterBuilderInterface, type FilterCondition, type FilterInput, type FilterOperatorValue, type FilterValue, type Game, type GameCreateInput, type GameImportDatasetStatus, type GameImportFromFileInput, type GameImportFromPayloadInput, type GameImportFromUrlInput, type GameImportJob, type GameImportJobConnection, type GameImportPreview, type GameImportPreviewInput, type GameImportRunInput, type GameRef, type GameScanRegion, type GameUpdateInput, type GameVisibility, GraphQLError, type GraphQLErrorInfo, type HydrateDeckEntryInput, type HydratedDeckEntry, type ImportFormat, type ImportJob, type ImportJobAsset, type ImportJobAssetInput, type ImportJobConnection, type ImportJobLog, type ImportJobLogConnection, type ImportJobStatus, type ImportLogLevel, type ImportMode, type ImportOptions, type ImportStats, type ImportValidationError, type ImportWarning, type ImportWarningSeverity, type InferredChildField, type LinkFieldInfo, LinkResolutionError, type LinkResolutionFailure, type ListDeckImportFormatsParams, type ListDeckVersionsParams, type ListDecksParams, type LogLevel, type Logger, type NextPageLoader, NotFoundError, type ObjectField, type OnConflict, type PageInfo, type PresignedUpload, type PreviewScanTemplateInput, type PublicDecksFilterInput, type PublicDecksParams, type Publisher, type PublisherRef, type PublisherStatus, QueryBuilder, RateLimitError, type RateLimitInfo, type ResolveScanTemplateInput, type ResolvedLink, type ResourceType, RestrictedError, type SaveScanTemplateInput, type ScanBestMatch, type ScanCandidate, type ScanFeatureVersionMetrics, type ScanFeedbackMetrics, type ScanFeedbackPayload, type ScanJob, type ScanJobError, type ScanJobMetrics, type ScanJobPayload, type ScanJobStatus, type ScanMetrics, type ScanMetricsInput, type ScanStageMetrics, type ScanTemplate, type ScanTemplateList, type ScanTemplatePayload, type ScanTemplatePreview, type ScanTemplateRegion, type ScanTemplateRegionInput, type ScanTemplateRegionPreview, type ScanTemplateResolution, type ScanTemplateWarning, type ScanTemplatesInput, type ScanWebhookState, type SearchDatasetsParams, type SearchGamesParams, type SearchPublishersParams, type SearchRecordsParams, ServerError, type SubmitScanFeedbackInput, type TCGPlayerPrice, type TCGPlayerPricing, TimeoutError, type UploadPurpose, ValidationError, type ViewerDecksFilterInput, type ViewerDecksParams, contains, eq, gt, gte, ilike, isNotNull, isNull, like, lt, lte, neq, notWithin, resolveFilter, within };
|
package/dist/index.js
CHANGED
|
@@ -1205,6 +1205,169 @@ var EXPORT_JOB_FIELDS = `
|
|
|
1205
1205
|
updatedAt
|
|
1206
1206
|
lastCheckpointIndex
|
|
1207
1207
|
`;
|
|
1208
|
+
var SCAN_CANDIDATE_FIELDS = `
|
|
1209
|
+
recordId
|
|
1210
|
+
rank
|
|
1211
|
+
score
|
|
1212
|
+
confidence
|
|
1213
|
+
reasons
|
|
1214
|
+
`;
|
|
1215
|
+
var SCAN_WEBHOOK_FIELDS = `
|
|
1216
|
+
configured
|
|
1217
|
+
url
|
|
1218
|
+
latestDeliveryId
|
|
1219
|
+
status
|
|
1220
|
+
attemptCount
|
|
1221
|
+
nextAttemptAt
|
|
1222
|
+
lastAttemptAt
|
|
1223
|
+
deliveredAt
|
|
1224
|
+
lastStatusCode
|
|
1225
|
+
lastError
|
|
1226
|
+
`;
|
|
1227
|
+
var SCAN_JOB_METRICS_FIELDS = `
|
|
1228
|
+
featureVersion
|
|
1229
|
+
candidateCount
|
|
1230
|
+
confidenceScore
|
|
1231
|
+
confidenceLabel
|
|
1232
|
+
stages {
|
|
1233
|
+
name
|
|
1234
|
+
status
|
|
1235
|
+
durationMs
|
|
1236
|
+
completedAt
|
|
1237
|
+
details
|
|
1238
|
+
}
|
|
1239
|
+
timings
|
|
1240
|
+
`;
|
|
1241
|
+
var SCAN_JOB_FIELDS = `
|
|
1242
|
+
jobId
|
|
1243
|
+
status
|
|
1244
|
+
publisherSlug
|
|
1245
|
+
gameKey
|
|
1246
|
+
datasetKey
|
|
1247
|
+
fileId
|
|
1248
|
+
clientRequestId
|
|
1249
|
+
templateId
|
|
1250
|
+
templateVersionId
|
|
1251
|
+
bestMatch {
|
|
1252
|
+
recordId
|
|
1253
|
+
score
|
|
1254
|
+
confidence
|
|
1255
|
+
}
|
|
1256
|
+
candidates {
|
|
1257
|
+
${SCAN_CANDIDATE_FIELDS}
|
|
1258
|
+
}
|
|
1259
|
+
extracted
|
|
1260
|
+
metrics {
|
|
1261
|
+
${SCAN_JOB_METRICS_FIELDS}
|
|
1262
|
+
}
|
|
1263
|
+
webhook {
|
|
1264
|
+
${SCAN_WEBHOOK_FIELDS}
|
|
1265
|
+
}
|
|
1266
|
+
error {
|
|
1267
|
+
code
|
|
1268
|
+
message
|
|
1269
|
+
}
|
|
1270
|
+
createdAt
|
|
1271
|
+
updatedAt
|
|
1272
|
+
startedAt
|
|
1273
|
+
completedAt
|
|
1274
|
+
`;
|
|
1275
|
+
var SCAN_METRICS_FIELDS = `
|
|
1276
|
+
publisherSlug
|
|
1277
|
+
gameKey
|
|
1278
|
+
datasetKey
|
|
1279
|
+
since
|
|
1280
|
+
until
|
|
1281
|
+
generatedAt
|
|
1282
|
+
totalJobs
|
|
1283
|
+
completedJobs
|
|
1284
|
+
failedJobs
|
|
1285
|
+
failureRate
|
|
1286
|
+
averageShortlistSize
|
|
1287
|
+
confidenceDistribution
|
|
1288
|
+
feedback {
|
|
1289
|
+
total
|
|
1290
|
+
correct
|
|
1291
|
+
corrected
|
|
1292
|
+
unknown
|
|
1293
|
+
accuracy
|
|
1294
|
+
}
|
|
1295
|
+
featureVersions {
|
|
1296
|
+
featureVersion
|
|
1297
|
+
jobCount
|
|
1298
|
+
completedJobs
|
|
1299
|
+
failedJobs
|
|
1300
|
+
averageConfidence
|
|
1301
|
+
averageShortlistSize
|
|
1302
|
+
feedbackCount
|
|
1303
|
+
correctFeedback
|
|
1304
|
+
correctedFeedback
|
|
1305
|
+
feedbackAccuracy
|
|
1306
|
+
}
|
|
1307
|
+
`;
|
|
1308
|
+
var SCAN_TEMPLATE_WARNING_FIELDS = `
|
|
1309
|
+
code
|
|
1310
|
+
region
|
|
1311
|
+
message
|
|
1312
|
+
`;
|
|
1313
|
+
var SCAN_TEMPLATE_REGION_FIELDS = `
|
|
1314
|
+
id
|
|
1315
|
+
key
|
|
1316
|
+
label
|
|
1317
|
+
sortOrder
|
|
1318
|
+
shapeType
|
|
1319
|
+
geometry
|
|
1320
|
+
semanticType
|
|
1321
|
+
extractionMode
|
|
1322
|
+
lookupMode
|
|
1323
|
+
isRequired
|
|
1324
|
+
weight
|
|
1325
|
+
config
|
|
1326
|
+
`;
|
|
1327
|
+
var SCAN_TEMPLATE_FIELDS = `
|
|
1328
|
+
id
|
|
1329
|
+
key
|
|
1330
|
+
name
|
|
1331
|
+
status
|
|
1332
|
+
version
|
|
1333
|
+
isDefault
|
|
1334
|
+
publisherSlug
|
|
1335
|
+
gameKey
|
|
1336
|
+
datasetKey
|
|
1337
|
+
exampleFileId
|
|
1338
|
+
coordinateSpace
|
|
1339
|
+
cardAspectRatio
|
|
1340
|
+
notes
|
|
1341
|
+
config
|
|
1342
|
+
regions {
|
|
1343
|
+
${SCAN_TEMPLATE_REGION_FIELDS}
|
|
1344
|
+
}
|
|
1345
|
+
createdAt
|
|
1346
|
+
updatedAt
|
|
1347
|
+
`;
|
|
1348
|
+
var SCAN_TEMPLATE_PREVIEW_REGION_FIELDS = `
|
|
1349
|
+
key
|
|
1350
|
+
label
|
|
1351
|
+
semanticType
|
|
1352
|
+
extractionMode
|
|
1353
|
+
lookupMode
|
|
1354
|
+
rawText
|
|
1355
|
+
normalizedValue
|
|
1356
|
+
source
|
|
1357
|
+
status
|
|
1358
|
+
confidence
|
|
1359
|
+
`;
|
|
1360
|
+
var GAME_SCAN_REGION_FIELDS = `
|
|
1361
|
+
id
|
|
1362
|
+
key
|
|
1363
|
+
name
|
|
1364
|
+
description
|
|
1365
|
+
sortOrder
|
|
1366
|
+
isActive
|
|
1367
|
+
metadata
|
|
1368
|
+
createdAt
|
|
1369
|
+
updatedAt
|
|
1370
|
+
`;
|
|
1208
1371
|
function connectionFields(nodeFields) {
|
|
1209
1372
|
return `
|
|
1210
1373
|
totalCount
|
|
@@ -2190,6 +2353,150 @@ ${RESOLVED_LINKS_FIELDS}` : selectedRecordFields;
|
|
|
2190
2353
|
`
|
|
2191
2354
|
};
|
|
2192
2355
|
},
|
|
2356
|
+
createScanJob() {
|
|
2357
|
+
return {
|
|
2358
|
+
query: `
|
|
2359
|
+
mutation CreateScanJob($input: CreateScanJobInput!) {
|
|
2360
|
+
createScanJob(input: $input) {
|
|
2361
|
+
job {
|
|
2362
|
+
${SCAN_JOB_FIELDS}
|
|
2363
|
+
}
|
|
2364
|
+
created
|
|
2365
|
+
}
|
|
2366
|
+
}
|
|
2367
|
+
`
|
|
2368
|
+
};
|
|
2369
|
+
},
|
|
2370
|
+
scanJob() {
|
|
2371
|
+
return {
|
|
2372
|
+
query: `
|
|
2373
|
+
query ScanJob($id: UUID!) {
|
|
2374
|
+
scanJob(id: $id) {
|
|
2375
|
+
${SCAN_JOB_FIELDS}
|
|
2376
|
+
}
|
|
2377
|
+
}
|
|
2378
|
+
`
|
|
2379
|
+
};
|
|
2380
|
+
},
|
|
2381
|
+
submitScanFeedback() {
|
|
2382
|
+
return {
|
|
2383
|
+
query: `
|
|
2384
|
+
mutation SubmitScanFeedback($input: SubmitScanFeedbackInput!) {
|
|
2385
|
+
submitScanFeedback(input: $input) {
|
|
2386
|
+
feedbackId
|
|
2387
|
+
jobId
|
|
2388
|
+
status
|
|
2389
|
+
persisted
|
|
2390
|
+
correct
|
|
2391
|
+
predictedRecordId
|
|
2392
|
+
selectedRecordId
|
|
2393
|
+
featureVersion
|
|
2394
|
+
message
|
|
2395
|
+
}
|
|
2396
|
+
}
|
|
2397
|
+
`
|
|
2398
|
+
};
|
|
2399
|
+
},
|
|
2400
|
+
scanMetrics() {
|
|
2401
|
+
return {
|
|
2402
|
+
query: `
|
|
2403
|
+
query ScanMetrics($input: ScanMetricsInput!) {
|
|
2404
|
+
scanMetrics(input: $input) {
|
|
2405
|
+
${SCAN_METRICS_FIELDS}
|
|
2406
|
+
}
|
|
2407
|
+
}
|
|
2408
|
+
`
|
|
2409
|
+
};
|
|
2410
|
+
},
|
|
2411
|
+
resolveScanTemplate() {
|
|
2412
|
+
return {
|
|
2413
|
+
query: `
|
|
2414
|
+
query ResolveScanTemplate($input: ResolveScanTemplateInput!) {
|
|
2415
|
+
resolveScanTemplate(input: $input) {
|
|
2416
|
+
template {
|
|
2417
|
+
${SCAN_TEMPLATE_FIELDS}
|
|
2418
|
+
}
|
|
2419
|
+
warnings {
|
|
2420
|
+
${SCAN_TEMPLATE_WARNING_FIELDS}
|
|
2421
|
+
}
|
|
2422
|
+
}
|
|
2423
|
+
}
|
|
2424
|
+
`
|
|
2425
|
+
};
|
|
2426
|
+
},
|
|
2427
|
+
scanTemplates() {
|
|
2428
|
+
return {
|
|
2429
|
+
query: `
|
|
2430
|
+
query ScanTemplates($input: ScanTemplatesInput!) {
|
|
2431
|
+
scanTemplates(input: $input) {
|
|
2432
|
+
templates {
|
|
2433
|
+
${SCAN_TEMPLATE_FIELDS}
|
|
2434
|
+
}
|
|
2435
|
+
}
|
|
2436
|
+
}
|
|
2437
|
+
`
|
|
2438
|
+
};
|
|
2439
|
+
},
|
|
2440
|
+
createScanTemplate() {
|
|
2441
|
+
return {
|
|
2442
|
+
query: `
|
|
2443
|
+
mutation CreateScanTemplate($input: SaveScanTemplateInput!) {
|
|
2444
|
+
createScanTemplate(input: $input) {
|
|
2445
|
+
template {
|
|
2446
|
+
${SCAN_TEMPLATE_FIELDS}
|
|
2447
|
+
}
|
|
2448
|
+
warnings {
|
|
2449
|
+
${SCAN_TEMPLATE_WARNING_FIELDS}
|
|
2450
|
+
}
|
|
2451
|
+
}
|
|
2452
|
+
}
|
|
2453
|
+
`
|
|
2454
|
+
};
|
|
2455
|
+
},
|
|
2456
|
+
updateScanTemplate() {
|
|
2457
|
+
return {
|
|
2458
|
+
query: `
|
|
2459
|
+
mutation UpdateScanTemplate($id: UUID!, $input: SaveScanTemplateInput!) {
|
|
2460
|
+
updateScanTemplate(id: $id, input: $input) {
|
|
2461
|
+
template {
|
|
2462
|
+
${SCAN_TEMPLATE_FIELDS}
|
|
2463
|
+
}
|
|
2464
|
+
warnings {
|
|
2465
|
+
${SCAN_TEMPLATE_WARNING_FIELDS}
|
|
2466
|
+
}
|
|
2467
|
+
}
|
|
2468
|
+
}
|
|
2469
|
+
`
|
|
2470
|
+
};
|
|
2471
|
+
},
|
|
2472
|
+
previewScanTemplate() {
|
|
2473
|
+
return {
|
|
2474
|
+
query: `
|
|
2475
|
+
mutation PreviewScanTemplate($input: PreviewScanTemplateInput!) {
|
|
2476
|
+
previewScanTemplate(input: $input) {
|
|
2477
|
+
warnings {
|
|
2478
|
+
${SCAN_TEMPLATE_WARNING_FIELDS}
|
|
2479
|
+
}
|
|
2480
|
+
regions {
|
|
2481
|
+
${SCAN_TEMPLATE_PREVIEW_REGION_FIELDS}
|
|
2482
|
+
}
|
|
2483
|
+
message
|
|
2484
|
+
}
|
|
2485
|
+
}
|
|
2486
|
+
`
|
|
2487
|
+
};
|
|
2488
|
+
},
|
|
2489
|
+
gameScanRegions() {
|
|
2490
|
+
return {
|
|
2491
|
+
query: `
|
|
2492
|
+
query GameScanRegions($publisherSlug: String!, $gameKey: String!, $includeInactive: Boolean) {
|
|
2493
|
+
gameScanRegions(publisherSlug: $publisherSlug, gameKey: $gameKey, includeInactive: $includeInactive) {
|
|
2494
|
+
${GAME_SCAN_REGION_FIELDS}
|
|
2495
|
+
}
|
|
2496
|
+
}
|
|
2497
|
+
`
|
|
2498
|
+
};
|
|
2499
|
+
},
|
|
2193
2500
|
exportJob() {
|
|
2194
2501
|
return {
|
|
2195
2502
|
query: `
|
|
@@ -3320,6 +3627,33 @@ ${RESOLVED_LINKS_FIELDS}` : selectedRecordFields;
|
|
|
3320
3627
|
fileUploadRequestVariables(input) {
|
|
3321
3628
|
return { input };
|
|
3322
3629
|
},
|
|
3630
|
+
createScanJobVariables(input) {
|
|
3631
|
+
return { input };
|
|
3632
|
+
},
|
|
3633
|
+
submitScanFeedbackVariables(input) {
|
|
3634
|
+
return { input };
|
|
3635
|
+
},
|
|
3636
|
+
scanMetricsVariables(input) {
|
|
3637
|
+
return { input };
|
|
3638
|
+
},
|
|
3639
|
+
resolveScanTemplateVariables(input) {
|
|
3640
|
+
return { input };
|
|
3641
|
+
},
|
|
3642
|
+
scanTemplatesVariables(input) {
|
|
3643
|
+
return { input };
|
|
3644
|
+
},
|
|
3645
|
+
createScanTemplateVariables(input) {
|
|
3646
|
+
return { input };
|
|
3647
|
+
},
|
|
3648
|
+
updateScanTemplateVariables(id, input) {
|
|
3649
|
+
return { id, input };
|
|
3650
|
+
},
|
|
3651
|
+
previewScanTemplateVariables(input) {
|
|
3652
|
+
return { input };
|
|
3653
|
+
},
|
|
3654
|
+
gameScanRegionsVariables(publisherSlug, gameKey, includeInactive) {
|
|
3655
|
+
return includeInactive === void 0 ? { publisherSlug, gameKey } : { publisherSlug, gameKey, includeInactive };
|
|
3656
|
+
},
|
|
3323
3657
|
datasetExportVariables(input) {
|
|
3324
3658
|
return { input };
|
|
3325
3659
|
},
|