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.

126 lines
4.4 KiB

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