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.

146 lines
7.9 KiB

  1. import { Plugin } from '@nuxt/types'
  2. import { APITaskStatusRepository } from '@/repositories/celery/apiTaskStatusRepository'
  3. import { TaskStatusApplicationService } from '@/services/application/celery/taskStatusApplicationService'
  4. import { APICatalogRepository } from '../repositories/upload/apiCatalogRepository'
  5. import { CatalogApplicationService } from '../services/application/upload/catalogApplicationService'
  6. import { APIParseRepository } from '../repositories/upload/apiParseRepository'
  7. import { ParseApplicationService } from '../services/application/upload/parseApplicationService'
  8. import { APISequenceLabelingRepository } from '~/repositories/tasks/sequenceLabeling/apiSequenceLabeling'
  9. import { APISeq2seqRepository } from '~/repositories/tasks/seq2seq/apiSeq2seq'
  10. import { APIConfigRepository } from '~/repositories/autoLabeling/config/apiConfigRepository'
  11. import { APITemplateRepository } from '~/repositories/autoLabeling/template/apiTemplateRepository'
  12. import { APIUserRepository } from '~/repositories/user/apiUserRepository'
  13. import { APIStatisticsRepository } from '~/repositories/statistics/apiStatisticsRepository'
  14. import { APIRoleRepository } from '~/repositories/role/apiRoleRepository'
  15. import { APIProjectRepository } from '~/repositories/project/apiProjectRepository'
  16. import { LocalStorageOptionRepository} from '~/repositories/option/apiOptionRepository'
  17. import { APIMemberRepository } from '~/repositories/member/apiMemberRepository'
  18. import { APILabelRepository } from '~/repositories/label/apiLabelRepository'
  19. import { APIDocumentRepository } from '~/repositories/document/apiDocumentRepository'
  20. import { APICommentRepository } from '~/repositories/comment/apiCommentRepository'
  21. import { APIAuthRepository } from '~/repositories/auth/apiAuthRepository'
  22. import { LabelApplicationService } from '~/services/application/label/labelApplicationService'
  23. import { MemberApplicationService } from '~/services/application/member/memberApplicationService'
  24. import { UserApplicationService } from '~/services/application/user/userApplicationService'
  25. import { RoleApplicationService } from '~/services/application/role/roleApplicationService'
  26. import { ProjectApplicationService } from '~/services/application/project/projectApplicationService'
  27. import { CommentApplicationService } from '~/services/application/comment/commentApplicationService'
  28. import { StatisticsApplicationService } from '~/services/application/statistics/statisticsApplicationService'
  29. import { DocumentApplicationService } from '~/services/application/document/documentApplicationService'
  30. import { OptionApplicationService } from '~/services/application/option/optionApplicationService'
  31. import { SequenceLabelingApplicationService } from '~/services/application/tasks/sequenceLabeling/sequenceLabelingApplicationService'
  32. import { Seq2seqApplicationService } from '~/services/application/tasks/seq2seq/seq2seqApplicationService'
  33. import { ConfigApplicationService } from '~/services/application/autoLabeling/configApplicationService'
  34. import { TemplateApplicationService } from '~/services/application/autoLabeling/templateApplicationService'
  35. import { APITextClassificationRepository } from '~/repositories/tasks/textClassification/apiTextClassification'
  36. import { TextClassificationApplicationService } from '~/services/application/tasks/textClassification/textClassificationApplicationService'
  37. import { AuthApplicationService } from '~/services/application/auth/authApplicationService'
  38. import { APIDownloadFormatRepository } from '~/repositories/download/apiDownloadFormatRepository'
  39. import { APIDownloadRepository } from '~/repositories/download/apiDownloadRepository'
  40. import { DownloadApplicationService } from '~/services/application/download/downloadApplicationService'
  41. import { DownloadFormatApplicationService } from '~/services/application/download/downloadFormatApplicationService'
  42. import { APITagRepository } from '~/repositories/tag/apiTagRepository'
  43. import { TagApplicationService } from '~/services/application/tag/tagApplicationService'
  44. export interface Services {
  45. label: LabelApplicationService,
  46. member: MemberApplicationService,
  47. user: UserApplicationService,
  48. role: RoleApplicationService,
  49. project: ProjectApplicationService,
  50. comment: CommentApplicationService,
  51. statistics: StatisticsApplicationService,
  52. document: DocumentApplicationService,
  53. textClassification: TextClassificationApplicationService,
  54. sequenceLabeling: SequenceLabelingApplicationService,
  55. seq2seq: Seq2seqApplicationService,
  56. option: OptionApplicationService,
  57. config: ConfigApplicationService,
  58. template: TemplateApplicationService,
  59. auth: AuthApplicationService,
  60. catalog: CatalogApplicationService,
  61. parse: ParseApplicationService,
  62. taskStatus: TaskStatusApplicationService,
  63. downloadFormat: DownloadFormatApplicationService,
  64. download: DownloadApplicationService,
  65. tag: TagApplicationService,
  66. }
  67. declare module 'vue/types/vue' {
  68. interface Vue {
  69. readonly $services: Services
  70. }
  71. }
  72. const plugin: Plugin = (context, inject) => {
  73. const labelRepository = new APILabelRepository()
  74. const memberRepository = new APIMemberRepository()
  75. const userRepository = new APIUserRepository()
  76. const roleRepository = new APIRoleRepository()
  77. const projectRepository = new APIProjectRepository()
  78. const commentRepository = new APICommentRepository()
  79. const statisticsRepository = new APIStatisticsRepository()
  80. const documentRepository = new APIDocumentRepository()
  81. const textClassificationRepository = new APITextClassificationRepository()
  82. const sequenceLabelingRepository = new APISequenceLabelingRepository()
  83. const seq2seqRepository = new APISeq2seqRepository()
  84. const optionRepository = new LocalStorageOptionRepository()
  85. const configRepository = new APIConfigRepository()
  86. const tagRepository = new APITagRepository()
  87. const templateRepository = new APITemplateRepository()
  88. const authRepository = new APIAuthRepository()
  89. const catalogRepository = new APICatalogRepository()
  90. const parseRepository = new APIParseRepository()
  91. const taskStatusRepository = new APITaskStatusRepository()
  92. const downloadFormatRepository = new APIDownloadFormatRepository()
  93. const downloadRepository = new APIDownloadRepository()
  94. const label = new LabelApplicationService(labelRepository)
  95. const member = new MemberApplicationService(memberRepository)
  96. const user = new UserApplicationService(userRepository)
  97. const role = new RoleApplicationService(roleRepository)
  98. const project = new ProjectApplicationService(projectRepository)
  99. const comment = new CommentApplicationService(commentRepository)
  100. const statistics = new StatisticsApplicationService(statisticsRepository)
  101. const document = new DocumentApplicationService(documentRepository)
  102. const textClassification = new TextClassificationApplicationService(textClassificationRepository)
  103. const sequenceLabeling = new SequenceLabelingApplicationService(sequenceLabelingRepository)
  104. const seq2seq = new Seq2seqApplicationService(seq2seqRepository)
  105. const option = new OptionApplicationService(optionRepository)
  106. const config = new ConfigApplicationService(configRepository)
  107. const tag = new TagApplicationService(tagRepository)
  108. const template = new TemplateApplicationService(templateRepository)
  109. const auth = new AuthApplicationService(authRepository)
  110. const catalog = new CatalogApplicationService(catalogRepository)
  111. const parse = new ParseApplicationService(parseRepository)
  112. const taskStatus = new TaskStatusApplicationService(taskStatusRepository)
  113. const downloadFormat = new DownloadFormatApplicationService(downloadFormatRepository)
  114. const download = new DownloadApplicationService(downloadRepository)
  115. const services: Services = {
  116. label,
  117. member,
  118. user,
  119. role,
  120. project,
  121. comment,
  122. statistics,
  123. document,
  124. textClassification,
  125. sequenceLabeling,
  126. seq2seq,
  127. option,
  128. config,
  129. template,
  130. auth,
  131. catalog,
  132. parse,
  133. taskStatus,
  134. downloadFormat,
  135. download,
  136. tag,
  137. }
  138. inject('services', services)
  139. }
  140. export default plugin