index.ts 524 B

12345678910111213141516171819
  1. // Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/
  2. import type { ActivityMessageBuilder } from '../types'
  3. const builderModules = import.meta.glob<ActivityMessageBuilder>(
  4. ['./**/*.ts', '!./**/index.ts', '!./__tests__/**/*.ts'],
  5. {
  6. eager: true,
  7. import: 'default',
  8. },
  9. )
  10. export const activityMessageBuilder = Object.values(builderModules).reduce(
  11. (builders: Record<string, ActivityMessageBuilder>, builder) => {
  12. builders[builder.model] = builder
  13. return builders
  14. },
  15. {},
  16. )