@drodil/backstage-plugin-qeta-common 1.17.0 → 1.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.d.ts +37 -1
  2. package/package.json +3 -2
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  /// <reference types="node" />
2
2
  import * as _backstage_plugin_permission_common from '@backstage/plugin-permission-common';
3
3
  import { IndexableDocument } from '@backstage/plugin-search-common';
4
+ import { ErrorObject } from 'ajv';
4
5
 
5
6
  declare const qetaReadPermission: _backstage_plugin_permission_common.BasicPermission;
6
7
  declare const qetaCreateQuestionPermission: _backstage_plugin_permission_common.BasicPermission;
@@ -83,6 +84,41 @@ interface QetaDocument extends IndexableDocument {
83
84
  score: number;
84
85
  answerCount?: number;
85
86
  views?: number;
87
+ tags?: string[];
88
+ }
89
+ interface CustomError {
90
+ message: string;
91
+ }
92
+ interface ErrorResponse {
93
+ errors: ErrorObject<string, any>[] | CustomError[] | null | undefined;
94
+ type: 'query' | 'body';
95
+ }
96
+ interface QuestionsResponse {
97
+ questions: Question[];
98
+ total: number;
99
+ }
100
+ type QuestionsResponseBody = QuestionsResponse | ErrorResponse;
101
+ type QuestionResponseBody = Question | ErrorResponse;
102
+ interface QuestionRequest {
103
+ title: string;
104
+ content: string;
105
+ tags?: string[];
106
+ entities?: string[];
107
+ images?: number[];
108
+ }
109
+ interface AnswerRequest {
110
+ questionId: number;
111
+ answer: string;
112
+ images?: number[];
113
+ anonymous?: boolean;
114
+ }
115
+ type AnswerResponseBody = Answer | ErrorResponse;
116
+ interface TagResponse {
117
+ tag: string;
118
+ questionsCount: number;
86
119
  }
120
+ type AttachmentResponseBody = Attachment | ErrorResponse;
121
+ type QuestionResponse = Question;
122
+ type AnswerResponse = Answer;
87
123
 
88
- export { Answer, Attachment, Comment, QetaDocument, QetaEntity, Question, QuestionAnswerEntity, Statistic, StatisticResponse, StatisticsOptions, StatisticsRequestParameters, Vote, qetaCreateAnswerPermission, qetaCreateQuestionPermission, qetaPermissions, qetaReadPermission };
124
+ export { Answer, AnswerRequest, AnswerResponse, AnswerResponseBody, Attachment, AttachmentResponseBody, Comment, QetaDocument, QetaEntity, Question, QuestionAnswerEntity, QuestionRequest, QuestionResponse, QuestionResponseBody, QuestionsResponse, QuestionsResponseBody, Statistic, StatisticResponse, StatisticsOptions, StatisticsRequestParameters, TagResponse, Vote, qetaCreateAnswerPermission, qetaCreateQuestionPermission, qetaPermissions, qetaReadPermission };
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "frontend",
8
8
  "backstage.io"
9
9
  ],
10
- "version": "1.17.0",
10
+ "version": "1.18.0",
11
11
  "main": "dist/index.cjs.js",
12
12
  "types": "dist/index.d.ts",
13
13
  "prepublishOnly": "yarn tsc && yarn build",
@@ -40,7 +40,8 @@
40
40
  },
41
41
  "dependencies": {
42
42
  "@backstage/plugin-permission-common": "^0.7.11",
43
- "@backstage/plugin-search-common": "^1.2.9"
43
+ "@backstage/plugin-search-common": "^1.2.9",
44
+ "ajv": "^8.12.0"
44
45
  },
45
46
  "peerDependencies": {
46
47
  "@backstage/catalog-model": "^1.4.3"