diff --git a/types/dockerode/dockerode-tests.ts b/types/dockerode/dockerode-tests.ts index 6b5858a8979a5b..6bb07b82d92e8d 100644 --- a/types/dockerode/dockerode-tests.ts +++ b/types/dockerode/dockerode-tests.ts @@ -88,6 +88,7 @@ async function foo() { const imageContainers: number = image.Containers; const foo = await docker5.getImage(image.Id); const inspect = await foo.inspect(); + const imageDescriptor = inspect.Descriptor; await foo.remove(); } diff --git a/types/dockerode/index.d.ts b/types/dockerode/index.d.ts index 28b930993c4e36..8f7ef7c1e01975 100644 --- a/types/dockerode/index.d.ts +++ b/types/dockerode/index.d.ts @@ -945,6 +945,22 @@ declare namespace Dockerode { Layers?: string[] | undefined; BaseLayer?: string | undefined; }; + Descriptor?: { + mediaType: string; + digest: string; + size: number; + urls?: string[] | undefined; + annotations?: { [key: string]: string } | undefined; + data?: string | undefined; + platform?: { + architecture: string; + os: string; + "os.version"?: string | undefined; + "os.features"?: string[] | undefined; + variant?: string | undefined; + } | undefined; + artifactType?: string | undefined; + } | undefined; } interface ImageBuildOptions { diff --git a/types/node-apple-receipt-verify/index.d.ts b/types/node-apple-receipt-verify/index.d.ts index f6c19249c4ea5f..5fbca9c02c94c6 100644 --- a/types/node-apple-receipt-verify/index.d.ts +++ b/types/node-apple-receipt-verify/index.d.ts @@ -66,6 +66,7 @@ export interface PurchasedProducts { originalPurchaseDate?: number | undefined; // only if extended = true applicationVersion?: string | undefined; // only if extended = true originalApplicationVersion?: string | undefined; // only if extended = true + originalTransactionId?: string | undefined; // only if extended = true } export interface ValidationError extends Error { diff --git a/types/node-apple-receipt-verify/node-apple-receipt-verify-tests.ts b/types/node-apple-receipt-verify/node-apple-receipt-verify-tests.ts index 76602b0e66bf85..0c0f8947af4df2 100644 --- a/types/node-apple-receipt-verify/node-apple-receipt-verify-tests.ts +++ b/types/node-apple-receipt-verify/node-apple-receipt-verify-tests.ts @@ -1,24 +1,58 @@ -import { error } from "server/router"; import appleReceiptVerify = require("node-apple-receipt-verify"); appleReceiptVerify.config({ secret: "test-secret", }); -appleReceiptVerify.validate({ receipt: "test-reciept" }, (err, products) => { - if (err) { - console.error(err.appleStatus); - console.error(err.isRetryable); - return; - } - console.log(products.map((p: appleReceiptVerify.PurchasedProducts) => p.bundleId)); -}); +appleReceiptVerify.validate( + { receipt: "test-receipt" }, + (err: appleReceiptVerify.ValidationError, products: appleReceiptVerify.PurchasedProducts[]) => { + if (err) { + console.error(err.appleStatus); + console.error(err.isRetryable); + return; + } + console.log(products.map((p) => p.bundleId)); + }, +); appleReceiptVerify - .validate({ receipt: "test-reciept" }) - .then(products => { - console.log(products.map((p: appleReceiptVerify.PurchasedProducts) => p.productId)); + .validate({ receipt: "test-receipt" }) + .then((products: appleReceiptVerify.PurchasedProducts[]) => { + products.forEach((p) => { + const { + bundleId, + transactionId, + productId, + purchaseDate, + quantity, + expirationDate, + isTrialPeriod, + isInIntroOfferPeriod, + environment, + originalPurchaseDate, + applicationVersion, + originalApplicationVersion, + originalTransactionId, + } = p; + + console.log({ + bundleId, + transactionId, + productId, + purchaseDate, + quantity, + expirationDate, + isTrialPeriod, + isInIntroOfferPeriod, + environment, + originalPurchaseDate, + applicationVersion, + originalApplicationVersion, + originalTransactionId, + }); + }); }) - .catch(err => { + .catch((err: appleReceiptVerify.ValidationError) => { console.error(err); });