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.

154 lines
8.4 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 { APIExampleRepository } from '~/repositories/example/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 { ExampleApplicationService } from '~/services/application/example/exampleApplicationService'
  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. import {ApiLinkRepository} from "~/repositories/links/apiLinkRepository";
  45. import {LinkTypesApplicationService} from "~/services/application/links/linkTypesApplicationService";
  46. import {ApiLinkTypesRepository} from "~/repositories/links/apiLinkTypesRepository";
  47. export interface Services {
  48. label: LabelApplicationService,
  49. linkTypes: LinkTypesApplicationService,
  50. member: MemberApplicationService,
  51. user: UserApplicationService,
  52. role: RoleApplicationService,
  53. project: ProjectApplicationService,
  54. comment: CommentApplicationService,
  55. statistics: StatisticsApplicationService,
  56. example: ExampleApplicationService,
  57. textClassification: TextClassificationApplicationService,
  58. sequenceLabeling: SequenceLabelingApplicationService,
  59. seq2seq: Seq2seqApplicationService,
  60. option: OptionApplicationService,
  61. config: ConfigApplicationService,
  62. template: TemplateApplicationService,
  63. auth: AuthApplicationService,
  64. catalog: CatalogApplicationService,
  65. parse: ParseApplicationService,
  66. taskStatus: TaskStatusApplicationService,
  67. downloadFormat: DownloadFormatApplicationService,
  68. download: DownloadApplicationService,
  69. tag: TagApplicationService,
  70. }
  71. declare module 'vue/types/vue' {
  72. interface Vue {
  73. readonly $services: Services
  74. }
  75. }
  76. const plugin: Plugin = (context, inject) => {
  77. const labelRepository = new APILabelRepository()
  78. const linkTypesRepository = new ApiLinkTypesRepository()
  79. const memberRepository = new APIMemberRepository()
  80. const userRepository = new APIUserRepository()
  81. const roleRepository = new APIRoleRepository()
  82. const projectRepository = new APIProjectRepository()
  83. const commentRepository = new APICommentRepository()
  84. const statisticsRepository = new APIStatisticsRepository()
  85. const exampleRepository = new APIExampleRepository()
  86. const textClassificationRepository = new APITextClassificationRepository()
  87. const sequenceLabelingRepository = new APISequenceLabelingRepository()
  88. const linkRepository = new ApiLinkRepository()
  89. const seq2seqRepository = new APISeq2seqRepository()
  90. const optionRepository = new LocalStorageOptionRepository()
  91. const configRepository = new APIConfigRepository()
  92. const tagRepository = new APITagRepository()
  93. const templateRepository = new APITemplateRepository()
  94. const authRepository = new APIAuthRepository()
  95. const catalogRepository = new APICatalogRepository()
  96. const parseRepository = new APIParseRepository()
  97. const taskStatusRepository = new APITaskStatusRepository()
  98. const downloadFormatRepository = new APIDownloadFormatRepository()
  99. const downloadRepository = new APIDownloadRepository()
  100. const label = new LabelApplicationService(labelRepository)
  101. const linkTypes = new LinkTypesApplicationService(linkTypesRepository)
  102. const member = new MemberApplicationService(memberRepository)
  103. const user = new UserApplicationService(userRepository)
  104. const role = new RoleApplicationService(roleRepository)
  105. const project = new ProjectApplicationService(projectRepository)
  106. const comment = new CommentApplicationService(commentRepository)
  107. const statistics = new StatisticsApplicationService(statisticsRepository)
  108. const example = new ExampleApplicationService(exampleRepository)
  109. const textClassification = new TextClassificationApplicationService(textClassificationRepository)
  110. const sequenceLabeling = new SequenceLabelingApplicationService(sequenceLabelingRepository, linkRepository)
  111. const seq2seq = new Seq2seqApplicationService(seq2seqRepository)
  112. const option = new OptionApplicationService(optionRepository)
  113. const config = new ConfigApplicationService(configRepository)
  114. const tag = new TagApplicationService(tagRepository)
  115. const template = new TemplateApplicationService(templateRepository)
  116. const auth = new AuthApplicationService(authRepository)
  117. const catalog = new CatalogApplicationService(catalogRepository)
  118. const parse = new ParseApplicationService(parseRepository)
  119. const taskStatus = new TaskStatusApplicationService(taskStatusRepository)
  120. const downloadFormat = new DownloadFormatApplicationService(downloadFormatRepository)
  121. const download = new DownloadApplicationService(downloadRepository)
  122. const services: Services = {
  123. label,
  124. linkTypes,
  125. member,
  126. user,
  127. role,
  128. project,
  129. comment,
  130. statistics,
  131. example,
  132. textClassification,
  133. sequenceLabeling,
  134. seq2seq,
  135. option,
  136. config,
  137. template,
  138. auth,
  139. catalog,
  140. parse,
  141. taskStatus,
  142. downloadFormat,
  143. download,
  144. tag,
  145. }
  146. inject('services', services)
  147. }
  148. export default plugin