@drodil/backstage-plugin-qeta-node 3.29.1 → 3.30.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.
@@ -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 /**\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;AACN,CAAC;AAEM,MAAM,gCACXA,qCAAoD,CAAA;AAAA,EAClD,EAAI,EAAA;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 * Suggest tags based on post title and content\n */\n suggestTags?(\n title: string,\n content: string,\n options?: { credentials?: BackstageCredentials<BackstageUserPrincipal> },\n ): Promise<{ tags: string[] }>;\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":";;;;AAuFO,MAAM,uBAAuBA,qCAA2C,CAAA;AAAA,EAC7E,EAAI,EAAA;AACN,CAAC;AAEM,MAAM,gCACXA,qCAAoD,CAAA;AAAA,EAClD,EAAI,EAAA;AACN,CAAC;;;;;"}
package/dist/index.d.ts CHANGED
@@ -28,6 +28,14 @@ interface AIHandler {
28
28
  summarizeArticle?(article: Article, options?: {
29
29
  credentials?: BackstageCredentials<BackstageUserPrincipal>;
30
30
  }): Promise<AIResponse>;
31
+ /**
32
+ * Suggest tags based on post title and content
33
+ */
34
+ suggestTags?(title: string, content: string, options?: {
35
+ credentials?: BackstageCredentials<BackstageUserPrincipal>;
36
+ }): Promise<{
37
+ tags: string[];
38
+ }>;
31
39
  /**
32
40
  * Check if answering existing questions is enabled for specific credentials. Defaults to true.
33
41
  * Must also implement the `answerExistingQuestion` method.
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "backstage.io",
8
8
  "node"
9
9
  ],
10
- "version": "3.29.1",
10
+ "version": "3.30.0",
11
11
  "main": "dist/index.cjs.js",
12
12
  "types": "dist/index.d.ts",
13
13
  "prepublishOnly": "yarn tsc && yarn build",
@@ -60,7 +60,7 @@
60
60
  "@backstage/plugin-auth-node": "^0.6.3",
61
61
  "@backstage/plugin-permission-common": "^0.9.0",
62
62
  "@backstage/plugin-permission-node": "^0.10.0",
63
- "@drodil/backstage-plugin-qeta-common": "^3.29.1",
63
+ "@drodil/backstage-plugin-qeta-common": "^3.30.0",
64
64
  "zod": "^3.22.4"
65
65
  },
66
66
  "typesVersions": {