adds unique has column because of mysql unique character limitation

Signed-off-by: Billy Stalnaker <bstalnaker@roadie.com>
This commit is contained in:
Billy Stalnaker
2025-03-25 13:14:22 -04:00
parent 4d772f6d74
commit 08972ee879
5 changed files with 63 additions and 15 deletions
@@ -11,6 +11,14 @@ export type ChannelSetting = {
origins: OriginSetting[];
};
// @public (undocumented)
export const generateSettingsHash: (
user: string,
channel: string,
origin: string,
topic: string | null,
) => string;
// @public (undocumented)
export const getProcessorFiltersFromConfig: (
config: Config,
+12
View File
@@ -14,6 +14,7 @@
* limitations under the License.
*/
import { NotificationSettings } from './types';
import crypto from 'crypto';
/** @public */
export const isNotificationsEnabledFor = (
@@ -40,3 +41,14 @@ export const isNotificationsEnabledFor = (
}
return topic.enabled;
};
/** @public */
export const generateSettingsHash = (
user: string,
channel: string,
origin: string,
topic: string | null,
): string => {
const rawKey = `${user}|${channel}|${origin}|${topic ?? ''}`;
return crypto.createHash('sha256').update(rawKey).digest('hex');
};