@opengovsg/formsg-sdk
Advanced tools
Comparing version 0.6.1 to 0.7.0
@@ -31,3 +31,3 @@ /** | ||
declare function decryptFile(formSecretKey: string, { submissionPublicKey, nonce, binary: encryptedBinary }: EncryptedFileContent): Promise<Uint8Array | null>; | ||
declare const _default: ({ mode }: Pick<PackageInitParams, "mode">) => { | ||
declare const _default: ({ mode }: Pick<PackageInitParams, "mode" | "verificationOptions">) => { | ||
encrypt: typeof encrypt; | ||
@@ -34,0 +34,0 @@ decrypt: (formSecretKey: string, encryptedContent: string, verifiedContent?: string | undefined) => DecryptedContent | null; |
@@ -25,2 +25,9 @@ declare const _default: (options?: PackageInitParams) => { | ||
}; | ||
verification: { | ||
authenticate: Function; | ||
generateSignature: ({ transactionId, formId, fieldId, answer }: VerificationSignatureOptions) => string; | ||
} | { | ||
authenticate?: undefined; | ||
generateSignature?: undefined; | ||
}; | ||
}; | ||
@@ -27,0 +34,0 @@ /** |
@@ -7,5 +7,6 @@ "use strict"; | ||
var crypto_1 = __importDefault(require("./crypto")); | ||
var verification_1 = __importDefault(require("./verification")); | ||
module.exports = function (options) { | ||
if (options === void 0) { options = {}; } | ||
var mode = options.mode, webhookSecretKey = options.webhookSecretKey; | ||
var mode = options.mode, webhookSecretKey = options.webhookSecretKey, verificationOptions = options.verificationOptions; | ||
return { | ||
@@ -19,3 +20,7 @@ webhooks: webhooks_1.default({ | ||
}), | ||
verification: verification_1.default({ | ||
mode: mode || 'production', | ||
verificationOptions: verificationOptions | ||
}) | ||
}; | ||
}; |
@@ -6,2 +6,9 @@ module.exports = { | ||
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'], | ||
collectCoverage: true, | ||
coverageThreshold: { | ||
global: { | ||
statements: 85, | ||
functions: 80, | ||
} | ||
} | ||
} |
{ | ||
"name": "@opengovsg/formsg-sdk", | ||
"version": "0.6.1", | ||
"version": "0.7.0", | ||
"repository": { | ||
@@ -5,0 +5,0 @@ "type": "git", |
@@ -50,3 +50,3 @@ *Please note that this is an SDK for webhooks integration, and* ***not*** *the FormSG system.* | ||
try { | ||
formsg.webhooks.authenticate(req.headers['X-FormSG-Signature'], POST_URI) | ||
formsg.webhooks.authenticate(req.get('X-FormSG-Signature'), POST_URI) | ||
// Continue processing the POST body | ||
@@ -53,0 +53,0 @@ return next() |
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
211131
65
2381