You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

95 lines
5.3 KiB

2 years ago
  1. import { Plugin } from '@nuxt/types'
  2. import { TaskStatusApplicationService } from '@/services/application/celery/taskStatusApplicationService'
  3. import { CatalogApplicationService } from '@/services/application/upload/catalogApplicationService'
  4. import { ParseApplicationService } from '@/services/application/upload/parseApplicationService'
  5. import { LabelApplicationService } from '@/services/application/label/labelApplicationService'
  6. import { MemberApplicationService } from '@/services/application/member/memberApplicationService'
  7. import { UserApplicationService } from '@/services/application/user/userApplicationService'
  8. import { RoleApplicationService } from '@/services/application/role/roleApplicationService'
  9. import { ProjectApplicationService } from '@/services/application/project/projectApplicationService'
  10. import { CommentApplicationService } from '@/services/application/comment/commentApplicationService'
  11. import { MetricsApplicationService } from '@/services/application/metrics/metricsApplicationService'
  12. import { ExampleApplicationService } from '@/services/application/example/exampleApplicationService'
  13. import { OptionApplicationService } from '@/services/application/option/optionApplicationService'
  14. import { SequenceLabelingApplicationService } from '@/services/application/tasks/sequenceLabeling/sequenceLabelingApplicationService'
  15. import { Seq2seqApplicationService } from '@/services/application/tasks/seq2seq/seq2seqApplicationService'
  16. import { ConfigApplicationService } from '@/services/application/autoLabeling/configApplicationService'
  17. import { TemplateApplicationService } from '@/services/application/autoLabeling/templateApplicationService'
  18. import { TextClassificationService } from '@/services/application/tasks/textClassification/textClassificationApplicationService'
  19. import { AuthApplicationService } from '@/services/application/auth/authApplicationService'
  20. import { DownloadApplicationService } from '@/services/application/download/downloadApplicationService'
  21. import { DownloadFormatApplicationService } from '@/services/application/download/downloadFormatApplicationService'
  22. import { TagApplicationService } from '@/services/application/tag/tagApplicationService'
  23. import { BoundingBoxApplicationService } from '@/services/application/tasks/boundingBox/boundingBoxApplicationService'
  24. import { SegmentationApplicationService } from '@/services/application/tasks/segmentation/segmentationApplicationService'
  25. import { repositories } from './repositories'
  26. export interface Services {
  27. categoryType: LabelApplicationService
  28. spanType: LabelApplicationService
  29. relationType: LabelApplicationService
  30. member: MemberApplicationService
  31. user: UserApplicationService
  32. role: RoleApplicationService
  33. project: ProjectApplicationService
  34. comment: CommentApplicationService
  35. metrics: MetricsApplicationService
  36. example: ExampleApplicationService
  37. textClassification: TextClassificationService
  38. sequenceLabeling: SequenceLabelingApplicationService
  39. seq2seq: Seq2seqApplicationService
  40. option: OptionApplicationService
  41. config: ConfigApplicationService
  42. template: TemplateApplicationService
  43. auth: AuthApplicationService
  44. catalog: CatalogApplicationService
  45. parse: ParseApplicationService
  46. taskStatus: TaskStatusApplicationService
  47. downloadFormat: DownloadFormatApplicationService
  48. download: DownloadApplicationService
  49. tag: TagApplicationService
  50. bbox: BoundingBoxApplicationService
  51. segmentation: SegmentationApplicationService
  52. }
  53. declare module 'vue/types/vue' {
  54. interface Vue {
  55. readonly $services: Services
  56. }
  57. }
  58. const plugin: Plugin = (_, inject) => {
  59. const services: Services = {
  60. categoryType: new LabelApplicationService(repositories.categoryType),
  61. spanType: new LabelApplicationService(repositories.spanType),
  62. relationType: new LabelApplicationService(repositories.relationType),
  63. member: new MemberApplicationService(repositories.member),
  64. user: new UserApplicationService(repositories.user),
  65. role: new RoleApplicationService(repositories.role),
  66. project: new ProjectApplicationService(repositories.project),
  67. comment: new CommentApplicationService(repositories.comment),
  68. metrics: new MetricsApplicationService(repositories.metrics),
  69. example: new ExampleApplicationService(repositories.example),
  70. textClassification: new TextClassificationService(repositories.category),
  71. sequenceLabeling: new SequenceLabelingApplicationService(
  72. repositories.span,
  73. repositories.relation
  74. ),
  75. seq2seq: new Seq2seqApplicationService(repositories.textLabel),
  76. option: new OptionApplicationService(repositories.option),
  77. config: new ConfigApplicationService(repositories.config),
  78. template: new TemplateApplicationService(repositories.template),
  79. auth: new AuthApplicationService(repositories.auth),
  80. catalog: new CatalogApplicationService(repositories.catalog),
  81. parse: new ParseApplicationService(repositories.parse),
  82. taskStatus: new TaskStatusApplicationService(repositories.taskStatus),
  83. downloadFormat: new DownloadFormatApplicationService(repositories.downloadFormat),
  84. download: new DownloadApplicationService(repositories.download),
  85. tag: new TagApplicationService(repositories.tag),
  86. bbox: new BoundingBoxApplicationService(repositories.boundingBox),
  87. segmentation: new SegmentationApplicationService(repositories.segmentation)
  88. }
  89. inject('services', services)
  90. }
  91. export default plugin