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.

156 lines
8.6 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. categoryType: LabelApplicationService,
  49. spanType: LabelApplicationService,
  50. linkTypes: LinkTypesApplicationService,
  51. member: MemberApplicationService,
  52. user: UserApplicationService,
  53. role: RoleApplicationService,
  54. project: ProjectApplicationService,
  55. comment: CommentApplicationService,
  56. statistics: StatisticsApplicationService,
  57. example: ExampleApplicationService,
  58. textClassification: TextClassificationApplicationService,
  59. sequenceLabeling: SequenceLabelingApplicationService,
  60. seq2seq: Seq2seqApplicationService,
  61. option: OptionApplicationService,
  62. config: ConfigApplicationService,
  63. template: TemplateApplicationService,
  64. auth: AuthApplicationService,
  65. catalog: CatalogApplicationService,
  66. parse: ParseApplicationService,
  67. taskStatus: TaskStatusApplicationService,
  68. downloadFormat: DownloadFormatApplicationService,
  69. download: DownloadApplicationService,
  70. tag: TagApplicationService,
  71. }
  72. declare module 'vue/types/vue' {
  73. interface Vue {
  74. readonly $services: Services
  75. }
  76. }
  77. const plugin: Plugin = (context, inject) => {
  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 categoryType = new LabelApplicationService(new APILabelRepository('category-type'))
  101. const spanType = new LabelApplicationService(new APILabelRepository('span-type'))
  102. const linkTypes = new LinkTypesApplicationService(linkTypesRepository)
  103. const member = new MemberApplicationService(memberRepository)
  104. const user = new UserApplicationService(userRepository)
  105. const role = new RoleApplicationService(roleRepository)
  106. const project = new ProjectApplicationService(projectRepository)
  107. const comment = new CommentApplicationService(commentRepository)
  108. const statistics = new StatisticsApplicationService(statisticsRepository)
  109. const example = new ExampleApplicationService(exampleRepository)
  110. const textClassification = new TextClassificationApplicationService(textClassificationRepository)
  111. const sequenceLabeling = new SequenceLabelingApplicationService(sequenceLabelingRepository, linkRepository)
  112. const seq2seq = new Seq2seqApplicationService(seq2seqRepository)
  113. const option = new OptionApplicationService(optionRepository)
  114. const config = new ConfigApplicationService(configRepository)
  115. const tag = new TagApplicationService(tagRepository)
  116. const template = new TemplateApplicationService(templateRepository)
  117. const auth = new AuthApplicationService(authRepository)
  118. const catalog = new CatalogApplicationService(catalogRepository)
  119. const parse = new ParseApplicationService(parseRepository)
  120. const taskStatus = new TaskStatusApplicationService(taskStatusRepository)
  121. const downloadFormat = new DownloadFormatApplicationService(downloadFormatRepository)
  122. const download = new DownloadApplicationService(downloadRepository)
  123. const services: Services = {
  124. categoryType,
  125. spanType,
  126. linkTypes,
  127. member,
  128. user,
  129. role,
  130. project,
  131. comment,
  132. statistics,
  133. example,
  134. textClassification,
  135. sequenceLabeling,
  136. seq2seq,
  137. option,
  138. config,
  139. template,
  140. auth,
  141. catalog,
  142. parse,
  143. taskStatus,
  144. downloadFormat,
  145. download,
  146. tag,
  147. }
  148. inject('services', services)
  149. }
  150. export default plugin