discord-verify
Advanced tools
Comparing version 0.0.2-beta.7 to 0.0.2-beta.8
@@ -15,2 +15,3 @@ import type { Request, SubtleCrypto, SubtleCryptoImportKeyAlgorithm } from "../types"; | ||
namedCurve: string; | ||
public: boolean; | ||
}; | ||
@@ -17,0 +18,0 @@ Vercel: { |
@@ -0,1 +1,2 @@ | ||
// @ts-expect-error We don't have this defined globally due to conflicts | ||
const encoder = new TextEncoder(); | ||
@@ -28,2 +29,3 @@ /** | ||
namedCurve: "NODE-ED25519", | ||
public: true, | ||
}, | ||
@@ -30,0 +32,0 @@ Vercel: { |
@@ -15,7 +15,4 @@ /** | ||
export type { Request } from "./request"; | ||
declare global { | ||
export class TextEncoder { | ||
constructor(); | ||
encode(input?: string): Uint8Array; | ||
} | ||
export interface TextEncoderInstance { | ||
encode(input?: string): Uint8Array; | ||
} |
@@ -11,4 +11,6 @@ import { isValidRequest as verifyRequest } from "./lib/verify"; | ||
export async function isValidRequest(request, publicKey, algorithm = "Ed25519") { | ||
return verifyRequest(request, publicKey, crypto.subtle, algorithm); | ||
// @ts-expect-error We don't have this defined globally due to conflicts | ||
const subtleCrypto = crypto.subtle; | ||
return verifyRequest(request, publicKey, subtleCrypto, algorithm); | ||
} | ||
//# sourceMappingURL=web.js.map |
{ | ||
"name": "discord-verify", | ||
"version": "0.0.2-beta.7", | ||
"version": "0.0.2-beta.8", | ||
"author": "Ian Mitchell", | ||
@@ -5,0 +5,0 @@ "description": "A library for verifying the authenticity of requests coming from the Discord Interactions API", |
@@ -5,5 +5,7 @@ import type { | ||
SubtleCryptoImportKeyAlgorithm, | ||
TextEncoderInstance, | ||
} from "../types"; | ||
const encoder = new TextEncoder(); | ||
// @ts-expect-error We don't have this defined globally due to conflicts | ||
const encoder: TextEncoderInstance = new TextEncoder(); | ||
@@ -51,2 +53,3 @@ /** | ||
namedCurve: "NODE-ED25519", | ||
public: true, | ||
}, | ||
@@ -53,0 +56,0 @@ Vercel: { |
@@ -17,7 +17,4 @@ /** | ||
declare global { | ||
export class TextEncoder { | ||
constructor(); | ||
encode(input?: string): Uint8Array; | ||
} | ||
export interface TextEncoderInstance { | ||
encode(input?: string): Uint8Array; | ||
} |
@@ -9,6 +9,2 @@ import { isValidRequest as verifyRequest } from "./lib/verify"; | ||
declare const crypto: { | ||
subtle: SubtleCrypto; | ||
}; | ||
/** | ||
@@ -26,3 +22,5 @@ * Validates a request from Discord | ||
) { | ||
return verifyRequest(request, publicKey, crypto.subtle, algorithm); | ||
// @ts-expect-error We don't have this defined globally due to conflicts | ||
const subtleCrypto = crypto.subtle as SubtleCrypto; | ||
return verifyRequest(request, publicKey, subtleCrypto, algorithm); | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25371
572