StoredFile.ts 685 B

123456789101112131415161718192021
  1. // Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. import type { StoredFile } from '#shared/graphql/types.ts'
  3. import type { DeepPartial } from '#shared/types/utils.ts'
  4. import { faker } from '@faker-js/faker'
  5. export default (): DeepPartial<StoredFile> => {
  6. const randomFile = faker.helpers.arrayElement([
  7. { name: 'file1.png', type: 'image/png' },
  8. { name: 'file2.jpg', type: 'image/jpeg' },
  9. { name: 'file3.gif', type: 'image/gif' },
  10. { name: 'file4.pdf', type: 'application/pdf' },
  11. ])
  12. return {
  13. name: randomFile.name,
  14. type: randomFile.type,
  15. preferences: {
  16. 'original-format': faker.datatype.boolean() as any,
  17. },
  18. }
  19. }