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.

128 lines
4.6 KiB

  1. import { Plugin } from '@nuxt/types'
  2. import { APIAssignmentRepository } from '@/repositories/example/apiAssignmentRepository'
  3. import { APIAuthRepository } from '@/repositories/auth/apiAuthRepository'
  4. import { APIConfigRepository } from '@/repositories/autoLabeling/config/apiConfigRepository'
  5. import { APITemplateRepository } from '@/repositories/autoLabeling/template/apiTemplateRepository'
  6. import { APITaskStatusRepository } from '@/repositories/celery/apiTaskStatusRepository'
  7. import { APICommentRepository } from '@/repositories/comment/apiCommentRepository'
  8. import { APIDownloadFormatRepository } from '@/repositories/download/apiDownloadFormatRepository'
  9. import { APIDownloadRepository } from '@/repositories/download/apiDownloadRepository'
  10. import { APIExampleRepository } from '@/repositories/example/apiDocumentRepository'
  11. import { APILabelRepository } from '@/repositories/label/apiLabelRepository'
  12. import { APIMemberRepository } from '@/repositories/member/apiMemberRepository'
  13. import { APIMetricsRepository } from '@/repositories/metrics/apiMetricsRepository'
  14. import { LocalStorageOptionRepository } from '@/repositories/option/apiOptionRepository'
  15. import { APIProjectRepository } from '@/repositories/project/apiProjectRepository'
  16. import { APIRoleRepository } from '@/repositories/role/apiRoleRepository'
  17. import { APITagRepository } from '@/repositories/tag/apiTagRepository'
  18. import { APIBoundingBoxRepository } from '@/repositories/tasks/apiBoundingBoxRepository'
  19. import { APICategoryRepository } from '@/repositories/tasks/apiCategoryRepository'
  20. import { APIRelationRepository } from '@/repositories/tasks/apiRelationRepository'
  21. import { APISpanRepository } from '@/repositories/tasks/apiSpanRepository'
  22. import { APITextLabelRepository } from '@/repositories/tasks/apiTextLabelRepository'
  23. import { APICatalogRepository } from '@/repositories/upload/apiCatalogRepository'
  24. import { APIParseRepository } from '@/repositories/upload/apiParseRepository'
  25. import { APIUserRepository } from '@/repositories/user/apiUserRepository'
  26. import { APISegmentationRepository } from '~/repositories/tasks/apiSegmentationRepository'
  27. export interface Repositories {
  28. // User
  29. auth: APIAuthRepository
  30. user: APIUserRepository
  31. // Project
  32. project: APIProjectRepository
  33. member: APIMemberRepository
  34. role: APIRoleRepository
  35. tag: APITagRepository
  36. // Example
  37. example: APIExampleRepository
  38. comment: APICommentRepository
  39. taskStatus: APITaskStatusRepository
  40. metrics: APIMetricsRepository
  41. option: LocalStorageOptionRepository
  42. assignment: APIAssignmentRepository
  43. // Auto Labeling
  44. config: APIConfigRepository
  45. template: APITemplateRepository
  46. // Upload
  47. catalog: APICatalogRepository
  48. parse: APIParseRepository
  49. // Download
  50. downloadFormat: APIDownloadFormatRepository
  51. download: APIDownloadRepository
  52. // Label Type
  53. categoryType: APILabelRepository
  54. spanType: APILabelRepository
  55. relationType: APILabelRepository
  56. // Label
  57. category: APICategoryRepository
  58. span: APISpanRepository
  59. relation: APIRelationRepository
  60. textLabel: APITextLabelRepository
  61. boundingBox: APIBoundingBoxRepository
  62. segmentation: APISegmentationRepository
  63. }
  64. declare module 'vue/types/vue' {
  65. interface Vue {
  66. readonly $repositories: Repositories
  67. }
  68. }
  69. const repositories: Repositories = {
  70. // User
  71. auth: new APIAuthRepository(),
  72. user: new APIUserRepository(),
  73. // Project
  74. project: new APIProjectRepository(),
  75. member: new APIMemberRepository(),
  76. role: new APIRoleRepository(),
  77. tag: new APITagRepository(),
  78. // Example
  79. example: new APIExampleRepository(),
  80. comment: new APICommentRepository(),
  81. taskStatus: new APITaskStatusRepository(),
  82. metrics: new APIMetricsRepository(),
  83. option: new LocalStorageOptionRepository(),
  84. assignment: new APIAssignmentRepository(),
  85. // Auto Labeling
  86. config: new APIConfigRepository(),
  87. template: new APITemplateRepository(),
  88. // Upload
  89. catalog: new APICatalogRepository(),
  90. parse: new APIParseRepository(),
  91. // Download
  92. downloadFormat: new APIDownloadFormatRepository(),
  93. download: new APIDownloadRepository(),
  94. // Label Type
  95. categoryType: new APILabelRepository('category-type'),
  96. spanType: new APILabelRepository('span-type'),
  97. relationType: new APILabelRepository('relation-type'),
  98. // Label
  99. category: new APICategoryRepository(),
  100. span: new APISpanRepository(),
  101. relation: new APIRelationRepository(),
  102. textLabel: new APITextLabelRepository(),
  103. boundingBox: new APIBoundingBoxRepository(),
  104. segmentation: new APISegmentationRepository()
  105. }
  106. const plugin: Plugin = (_, inject) => {
  107. inject('repositories', repositories)
  108. }
  109. export default plugin
  110. export { repositories }