Skip to content
2 changes: 2 additions & 0 deletions .changeset/test-snapi-detection-do-not-merge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
4 changes: 4 additions & 0 deletions packages/backend/src/webhooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ export type VerifyWebhookOptions = {
* The signing secret for the webhook. It's recommended to use the [`CLERK_WEBHOOK_SIGNING_SECRET` environment variable](https://clerk.com/docs/guides/development/clerk-environment-variables#webhooks) instead.
*/
signingSecret?: string;
/**
* Optional tolerance, in seconds, for accepting webhooks whose timestamp falls outside the default replay window.
*/
timestampToleranceSeconds?: number;
Comment thread
jacekradko marked this conversation as resolved.
};

// Standard Webhooks header names
Expand Down
10 changes: 7 additions & 3 deletions packages/shared/src/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
*
* Probably paired with:
* <input type='file' accept='application/JSON' ... />
*
* Renamed from `readJSONFile` to align naming with the rest of the parse-* helpers.
*/
export function readJSONFile(file: File): Promise<unknown> {
export function parseJSONFile(file: File): Promise<unknown> {
return new Promise((resolve, reject) => {
const reader = new FileReader();
reader.addEventListener('load', function () {
Expand All @@ -28,6 +30,8 @@ const MimeTypeToExtensionMap = Object.freeze({

export type SupportedMimeType = keyof typeof MimeTypeToExtensionMap;

export const extension = (mimeType: SupportedMimeType): string => {
return MimeTypeToExtensionMap[mimeType];
export type MimeTypeExtension = (typeof MimeTypeToExtensionMap)[SupportedMimeType];

export const extension = (mimeType: SupportedMimeType, fallback?: string): string => {
return MimeTypeToExtensionMap[mimeType] ?? fallback ?? '';
};
Loading