@carddb/client 0.4.0 → 0.4.2
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 +37 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +28 -6
- package/dist/index.d.ts +28 -6
- package/dist/index.js +37 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -186,7 +186,7 @@ var Configuration = class _Configuration {
|
|
|
186
186
|
};
|
|
187
187
|
|
|
188
188
|
// src/user-agent.ts
|
|
189
|
-
var SDK_VERSION = "0.1
|
|
189
|
+
var SDK_VERSION = "0.4.1";
|
|
190
190
|
function detectRuntime() {
|
|
191
191
|
if (typeof globalThis !== "undefined" && "Bun" in globalThis) {
|
|
192
192
|
const bunVersion = globalThis.Bun && typeof globalThis.Bun === "object" && globalThis.Bun.version;
|
|
@@ -2609,6 +2609,30 @@ var ScansResource = class extends BaseResource {
|
|
|
2609
2609
|
constructor(connection, config) {
|
|
2610
2610
|
super(connection, config);
|
|
2611
2611
|
}
|
|
2612
|
+
/**
|
|
2613
|
+
* Create a mobile-safe scan image upload session using a scan-scoped credential.
|
|
2614
|
+
*/
|
|
2615
|
+
async createUploadSession(input) {
|
|
2616
|
+
const scopedInput = this.resolveCreateUploadSessionInput(input);
|
|
2617
|
+
const { query } = core.QueryBuilder.createScanUploadSession();
|
|
2618
|
+
const result = await this.connection.execute(
|
|
2619
|
+
query,
|
|
2620
|
+
core.QueryBuilder.createScanUploadSessionVariables(scopedInput)
|
|
2621
|
+
);
|
|
2622
|
+
return result["createScanUploadSession"];
|
|
2623
|
+
}
|
|
2624
|
+
/**
|
|
2625
|
+
* Confirm that a scan image upload completed and return the uploaded file.
|
|
2626
|
+
*/
|
|
2627
|
+
async confirmUpload(input) {
|
|
2628
|
+
const scopedInput = this.resolveConfirmUploadInput(input);
|
|
2629
|
+
const { query } = core.QueryBuilder.confirmScanUpload();
|
|
2630
|
+
const result = await this.connection.execute(
|
|
2631
|
+
query,
|
|
2632
|
+
core.QueryBuilder.confirmScanUploadVariables(scopedInput)
|
|
2633
|
+
);
|
|
2634
|
+
return result["confirmScanUpload"];
|
|
2635
|
+
}
|
|
2612
2636
|
/**
|
|
2613
2637
|
* Create a scan job for an already uploaded image file.
|
|
2614
2638
|
*/
|
|
@@ -2700,6 +2724,18 @@ var ScansResource = class extends BaseResource {
|
|
|
2700
2724
|
this.validateAccess(publisherSlug, gameKey);
|
|
2701
2725
|
return { ...input, publisherSlug, gameKey };
|
|
2702
2726
|
}
|
|
2727
|
+
resolveCreateUploadSessionInput(input) {
|
|
2728
|
+
const publisherSlug = this.resolvePublisher(input.publisherSlug);
|
|
2729
|
+
const gameKey = this.resolveGame(input.gameKey);
|
|
2730
|
+
this.validateAccess(publisherSlug, gameKey);
|
|
2731
|
+
return { ...input, publisherSlug, gameKey };
|
|
2732
|
+
}
|
|
2733
|
+
resolveConfirmUploadInput(input) {
|
|
2734
|
+
const publisherSlug = this.resolvePublisher(input.publisherSlug);
|
|
2735
|
+
const gameKey = this.resolveGame(input.gameKey);
|
|
2736
|
+
this.validateAccess(publisherSlug, gameKey);
|
|
2737
|
+
return { ...input, publisherSlug, gameKey };
|
|
2738
|
+
}
|
|
2703
2739
|
resolveMetricsInput(input) {
|
|
2704
2740
|
const publisherSlug = this.resolvePublisher(input.publisherSlug);
|
|
2705
2741
|
const gameKey = this.resolveGame(input.gameKey);
|