@drodil/backstage-plugin-qeta-node 3.9.3 → 3.10.1

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.
@@ -5,6 +5,10 @@ var backendPluginApi = require('@backstage/backend-plugin-api');
5
5
  const qetaAIExtensionPoint = backendPluginApi.createExtensionPoint({
6
6
  id: "qeta.ai"
7
7
  });
8
+ const qetaTagDatabaseExtensionPoint = backendPluginApi.createExtensionPoint({
9
+ id: "qeta.tags"
10
+ });
8
11
 
9
12
  exports.qetaAIExtensionPoint = qetaAIExtensionPoint;
13
+ exports.qetaTagDatabaseExtensionPoint = qetaTagDatabaseExtensionPoint;
10
14
  //# sourceMappingURL=extensions.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"extensions.cjs.js","sources":["../src/extensions.ts"],"sourcesContent":["import {\n BackstageCredentials,\n BackstageUserPrincipal,\n createExtensionPoint,\n} from '@backstage/backend-plugin-api';\nimport {\n AIResponse,\n Article,\n Question,\n} from '@drodil/backstage-plugin-qeta-common';\n\nexport interface AIHandler {\n /**\n * Answer question that has already been posted in the question page\n */\n answerExistingQuestion?(\n question: Question,\n options?: { credentials?: BackstageCredentials<BackstageUserPrincipal> },\n ): Promise<AIResponse>;\n\n /**\n * Answer a draft question in the Ask a question page\n */\n answerNewQuestion?(\n title: string,\n content: string,\n options?: { credentials?: BackstageCredentials<BackstageUserPrincipal> },\n ): Promise<AIResponse>;\n\n /**\n * Summarize article\n */\n summarizeArticle?(\n article: Article,\n options?: { credentials?: BackstageCredentials<BackstageUserPrincipal> },\n ): Promise<AIResponse>;\n}\n\nexport interface QetaAIExtensionPoint {\n setAIHandler(handler: AIHandler): void;\n}\n\nexport const qetaAIExtensionPoint = createExtensionPoint<QetaAIExtensionPoint>({\n id: 'qeta.ai',\n});\n"],"names":["createExtensionPoint"],"mappings":";;;;AA0CO,MAAM,uBAAuBA,qCAA2C,CAAA;AAAA,EAC7E,EAAI,EAAA,SAAA;AACN,CAAC;;;;"}
1
+ {"version":3,"file":"extensions.cjs.js","sources":["../src/extensions.ts"],"sourcesContent":["import {\n BackstageCredentials,\n BackstageUserPrincipal,\n createExtensionPoint,\n} from '@backstage/backend-plugin-api';\nimport {\n AIResponse,\n Article,\n Question,\n} from '@drodil/backstage-plugin-qeta-common';\n\nexport interface AIHandler {\n /**\n * Answer question that has already been posted in the question page\n */\n answerExistingQuestion?(\n question: Question,\n options?: { credentials?: BackstageCredentials<BackstageUserPrincipal> },\n ): Promise<AIResponse>;\n\n /**\n * Answer a draft question in the Ask a question page\n */\n answerNewQuestion?(\n title: string,\n content: string,\n options?: { credentials?: BackstageCredentials<BackstageUserPrincipal> },\n ): Promise<AIResponse>;\n\n /**\n * Summarize article\n */\n summarizeArticle?(\n article: Article,\n options?: { credentials?: BackstageCredentials<BackstageUserPrincipal> },\n ): Promise<AIResponse>;\n\n /**\n * Check if answering existing questions is enabled for specific credentials. Defaults to true.\n * Must also implement the `answerExistingQuestion` method.\n */\n isExistingQuestionEnabled?(options?: {\n credentials?: BackstageCredentials;\n }): Promise<boolean>;\n\n /**\n * Check if answering new questions is enabled for specific credentials. Defaults to true.\n * Must also implement the `answerNewQuestion` method.\n */\n isNewQuestionEnabled?(options?: {\n credentials?: BackstageCredentials;\n }): Promise<boolean>;\n\n /**\n * Check if article summarization is enabled for specific credentials. Defaults to true.\n * Must also implement the `summarizeArticle` method.\n */\n isArticleSummarizationEnabled?(options?: {\n credentials?: BackstageCredentials;\n }): Promise<boolean>;\n}\n\nexport interface QetaAIExtensionPoint {\n setAIHandler(handler: AIHandler): void;\n}\n\nexport interface TagDatabase {\n /**\n * Get custom tag descriptions that are updated to the plugin.\n * The format is {`tag name`: `tag description`}.\n */\n getTags(): Promise<Record<string, string>>;\n}\n\nexport interface QetaTagDatabaseExtensionPoint {\n setTagDatabase(tagDatabase: TagDatabase): void;\n}\n\nexport const qetaAIExtensionPoint = createExtensionPoint<QetaAIExtensionPoint>({\n id: 'qeta.ai',\n});\n\nexport const qetaTagDatabaseExtensionPoint =\n createExtensionPoint<QetaTagDatabaseExtensionPoint>({\n id: 'qeta.tags',\n });\n"],"names":["createExtensionPoint"],"mappings":";;;;AA8EO,MAAM,uBAAuBA,qCAA2C,CAAA;AAAA,EAC7E,EAAI,EAAA,SAAA;AACN,CAAC,EAAA;AAEM,MAAM,gCACXA,qCAAoD,CAAA;AAAA,EAClD,EAAI,EAAA,WAAA;AACN,CAAC;;;;;"}
package/dist/index.cjs.js CHANGED
@@ -5,4 +5,5 @@ var extensions = require('./extensions.cjs.js');
5
5
 
6
6
 
7
7
  exports.qetaAIExtensionPoint = extensions.qetaAIExtensionPoint;
8
+ exports.qetaTagDatabaseExtensionPoint = extensions.qetaTagDatabaseExtensionPoint;
8
9
  //# sourceMappingURL=index.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
1
+ {"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
package/dist/index.d.ts CHANGED
@@ -21,10 +21,42 @@ interface AIHandler {
21
21
  summarizeArticle?(article: Article, options?: {
22
22
  credentials?: BackstageCredentials<BackstageUserPrincipal>;
23
23
  }): Promise<AIResponse>;
24
+ /**
25
+ * Check if answering existing questions is enabled for specific credentials. Defaults to true.
26
+ * Must also implement the `answerExistingQuestion` method.
27
+ */
28
+ isExistingQuestionEnabled?(options?: {
29
+ credentials?: BackstageCredentials;
30
+ }): Promise<boolean>;
31
+ /**
32
+ * Check if answering new questions is enabled for specific credentials. Defaults to true.
33
+ * Must also implement the `answerNewQuestion` method.
34
+ */
35
+ isNewQuestionEnabled?(options?: {
36
+ credentials?: BackstageCredentials;
37
+ }): Promise<boolean>;
38
+ /**
39
+ * Check if article summarization is enabled for specific credentials. Defaults to true.
40
+ * Must also implement the `summarizeArticle` method.
41
+ */
42
+ isArticleSummarizationEnabled?(options?: {
43
+ credentials?: BackstageCredentials;
44
+ }): Promise<boolean>;
24
45
  }
25
46
  interface QetaAIExtensionPoint {
26
47
  setAIHandler(handler: AIHandler): void;
27
48
  }
49
+ interface TagDatabase {
50
+ /**
51
+ * Get custom tag descriptions that are updated to the plugin.
52
+ * The format is {`tag name`: `tag description`}.
53
+ */
54
+ getTags(): Promise<Record<string, string>>;
55
+ }
56
+ interface QetaTagDatabaseExtensionPoint {
57
+ setTagDatabase(tagDatabase: TagDatabase): void;
58
+ }
28
59
  declare const qetaAIExtensionPoint: _backstage_backend_plugin_api.ExtensionPoint<QetaAIExtensionPoint>;
60
+ declare const qetaTagDatabaseExtensionPoint: _backstage_backend_plugin_api.ExtensionPoint<QetaTagDatabaseExtensionPoint>;
29
61
 
30
- export { type AIHandler, type QetaAIExtensionPoint, qetaAIExtensionPoint };
62
+ export { type AIHandler, type QetaAIExtensionPoint, type QetaTagDatabaseExtensionPoint, type TagDatabase, qetaAIExtensionPoint, qetaTagDatabaseExtensionPoint };
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "backstage.io",
8
8
  "node"
9
9
  ],
10
- "version": "3.9.3",
10
+ "version": "3.10.1",
11
11
  "main": "dist/index.cjs.js",
12
12
  "types": "dist/index.d.ts",
13
13
  "prepublishOnly": "yarn tsc && yarn build",
@@ -54,6 +54,6 @@
54
54
  ],
55
55
  "dependencies": {
56
56
  "@backstage/backend-plugin-api": "^1.0.1",
57
- "@drodil/backstage-plugin-qeta-common": "^3.9.3"
57
+ "@drodil/backstage-plugin-qeta-common": "^3.10.1"
58
58
  }
59
59
  }