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.

110 lines
5.8 KiB

  1. import { Plugin } from '@nuxt/types'
  2. import { APISequenceLabelingRepository } from '~/repositories/tasks/sequenceLabeling/apiSequenceLabeling'
  3. import { APISeq2seqRepository } from '~/repositories/tasks/seq2seq/apiSeq2seq'
  4. import { APIConfigRepository } from '~/repositories/autoLabeling/config/apiConfigRepository'
  5. import { APITemplateRepository } from '~/repositories/autoLabeling/template/apiTemplateRepository'
  6. import { APIUserRepository } from '~/repositories/user/apiUserRepository'
  7. import { APIStatisticsRepository } from '~/repositories/statistics/apiStatisticsRepository'
  8. import { APIRoleRepository } from '~/repositories/role/apiRoleRepository'
  9. import { APIProjectRepository } from '~/repositories/project/apiProjectRepository'
  10. import { LocalStorageOptionRepository} from '~/repositories/option/apiOptionRepository'
  11. import { APIMemberRepository } from '~/repositories/member/apiMemberRepository'
  12. import { APILabelRepository } from '~/repositories/label/apiLabelRepository'
  13. import { APIDocumentRepository } from '~/repositories/document/apiDocumentRepository'
  14. import { APICommentRepository } from '~/repositories/comment/apiCommentRepository'
  15. import { APIAuthRepository } from '~/repositories/auth/apiAuthRepository'
  16. import { LabelApplicationService } from '~/services/application/label/labelApplicationService'
  17. import { MemberApplicationService } from '~/services/application/member/memberApplicationService'
  18. import { UserApplicationService } from '~/services/application/user/userApplicationService'
  19. import { RoleApplicationService } from '~/services/application/role/roleApplicationService'
  20. import { ProjectApplicationService } from '~/services/application/project/projectApplicationService'
  21. import { CommentApplicationService } from '~/services/application/comment/commentApplicationService'
  22. import { StatisticsApplicationService } from '~/services/application/statistics/statisticsApplicationService'
  23. import { DocumentApplicationService } from '~/services/application/document/documentApplicationService'
  24. import { OptionApplicationService } from '~/services/application/option/optionApplicationService'
  25. import { SequenceLabelingApplicationService } from '~/services/application/tasks/sequenceLabeling/sequenceLabelingApplicationService'
  26. import { Seq2seqApplicationService } from '~/services/application/tasks/seq2seq/seq2seqApplicationService'
  27. import { ConfigApplicationService } from '~/services/application/autoLabeling/configApplicationService'
  28. import { TemplateApplicationService } from '~/services/application/autoLabeling/templateApplicationService'
  29. import { APITextClassificationRepository } from '~/repositories/tasks/textClassification/apiTextClassification'
  30. import { TextClassificationApplicationService } from '~/services/application/tasks/textClassification/textClassificationApplicationService'
  31. import { AuthApplicationService } from '~/services/application/auth/authApplicationService'
  32. export interface Services {
  33. label: LabelApplicationService,
  34. member: MemberApplicationService,
  35. user: UserApplicationService,
  36. role: RoleApplicationService,
  37. project: ProjectApplicationService,
  38. comment: CommentApplicationService,
  39. statistics: StatisticsApplicationService,
  40. document: DocumentApplicationService,
  41. textClassification: TextClassificationApplicationService,
  42. sequenceLabeling: SequenceLabelingApplicationService,
  43. seq2seq: Seq2seqApplicationService,
  44. option: OptionApplicationService,
  45. config: ConfigApplicationService,
  46. template: TemplateApplicationService,
  47. auth: AuthApplicationService
  48. }
  49. declare module 'vue/types/vue' {
  50. interface Vue {
  51. readonly $services: Services
  52. }
  53. }
  54. const plugin: Plugin = (context, inject) => {
  55. const labelRepository = new APILabelRepository()
  56. const memberRepository = new APIMemberRepository()
  57. const userRepository = new APIUserRepository()
  58. const roleRepository = new APIRoleRepository()
  59. const projectRepository = new APIProjectRepository()
  60. const commentRepository = new APICommentRepository()
  61. const statisticsRepository = new APIStatisticsRepository()
  62. const documentRepository = new APIDocumentRepository()
  63. const textClassificationRepository = new APITextClassificationRepository()
  64. const sequenceLabelingRepository = new APISequenceLabelingRepository()
  65. const seq2seqRepository = new APISeq2seqRepository()
  66. const optionRepository = new LocalStorageOptionRepository()
  67. const configRepository = new APIConfigRepository()
  68. const templateRepository = new APITemplateRepository()
  69. const authRepository = new APIAuthRepository()
  70. const label = new LabelApplicationService(labelRepository)
  71. const member = new MemberApplicationService(memberRepository)
  72. const user = new UserApplicationService(userRepository)
  73. const role = new RoleApplicationService(roleRepository)
  74. const project = new ProjectApplicationService(projectRepository)
  75. const comment = new CommentApplicationService(commentRepository)
  76. const statistics = new StatisticsApplicationService(statisticsRepository)
  77. const document = new DocumentApplicationService(documentRepository)
  78. const textClassification = new TextClassificationApplicationService(textClassificationRepository)
  79. const sequenceLabeling = new SequenceLabelingApplicationService(sequenceLabelingRepository)
  80. const seq2seq = new Seq2seqApplicationService(seq2seqRepository)
  81. const option = new OptionApplicationService(optionRepository)
  82. const config = new ConfigApplicationService(configRepository)
  83. const template = new TemplateApplicationService(templateRepository)
  84. const auth = new AuthApplicationService(authRepository)
  85. const services: Services = {
  86. label,
  87. member,
  88. user,
  89. role,
  90. project,
  91. comment,
  92. statistics,
  93. document,
  94. textClassification,
  95. sequenceLabeling,
  96. seq2seq,
  97. option,
  98. config,
  99. template,
  100. auth
  101. }
  102. inject('services', services)
  103. }
  104. export default plugin