StoredFile.ts 686 B

12345678910111213141516171819202122
  1. // Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. import { faker } from '@faker-js/faker'
  3. import type { StoredFile } from '#shared/graphql/types.ts'
  4. import type { DeepPartial } from '#shared/types/utils.ts'
  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. }