@drodil/backstage-plugin-search-backend-module-qeta 2.15.0 → 3.0.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.
@@ -1,16 +1,17 @@
1
1
  'use strict';
2
2
 
3
3
  var stream = require('stream');
4
+ var backstagePluginQetaCommon = require('@drodil/backstage-plugin-qeta-common');
4
5
 
5
6
  class DefaultQetaCollatorFactory {
6
7
  type = "qeta";
7
8
  logger;
8
- discovery;
9
9
  auth;
10
+ api;
10
11
  constructor(_config, options) {
11
12
  this.logger = options.logger;
12
- this.discovery = options.discovery;
13
13
  this.auth = options.auth;
14
+ this.api = new backstagePluginQetaCommon.QetaClient({ discoveryApi: options.discovery });
14
15
  }
15
16
  static fromConfig(config, options) {
16
17
  return new DefaultQetaCollatorFactory(config, options);
@@ -22,90 +23,84 @@ class DefaultQetaCollatorFactory {
22
23
  this.logger.info("Executing QetaCollator");
23
24
  let totalQuestions = Number.MAX_VALUE;
24
25
  let indexedQuestions = 0;
25
- const baseUrl = await this.discovery.getBaseUrl("qeta");
26
26
  while (totalQuestions > indexedQuestions) {
27
- let headers = {};
27
+ let tok = void 0;
28
28
  if (this.auth) {
29
29
  const { token } = await this.auth.getPluginRequestToken({
30
30
  onBehalfOf: await this.auth.getOwnServiceCredentials(),
31
31
  targetPluginId: "qeta"
32
32
  });
33
- headers = {
34
- Authorization: `Bearer ${token}`
35
- };
33
+ tok = token;
36
34
  }
37
- const params = new URLSearchParams();
38
- params.append("includeAnswers", "true");
39
- params.append("includeComments", "true");
40
- params.append("orderBy", "created");
41
- params.append("order", "asc");
42
- params.append("limit", "50");
43
- params.append("offset", indexedQuestions.toString(10));
44
- const response = await fetch(
45
- `${baseUrl}/questions?${params.toString()}`,
35
+ const data = await this.api.getPosts(
46
36
  {
47
- headers
48
- }
37
+ includeAnswers: true,
38
+ includeComments: true,
39
+ orderBy: "created",
40
+ order: "asc",
41
+ limit: 50,
42
+ offset: indexedQuestions
43
+ },
44
+ { token: tok }
49
45
  );
50
- const data = await response.json();
51
- if (!data || "errors" in data || !("questions" in data)) {
46
+ if (!data || "errors" in data || !("posts" in data)) {
52
47
  this.logger.error(
53
- `Error while fetching questions from qeta: ${JSON.stringify(data)}`
48
+ `Error while fetching posts from qeta: ${JSON.stringify(data)}`
54
49
  );
55
50
  return;
56
51
  }
57
- const questions = data.questions;
58
- this.logger.info(`Indexing ${questions.length} questions`);
52
+ const posts = data.posts;
53
+ this.logger.info(`Indexing ${posts.length} posts`);
59
54
  totalQuestions = data.total;
60
- indexedQuestions += questions.length;
61
- for (const question of questions) {
55
+ indexedQuestions += posts.length;
56
+ for (const post of posts) {
62
57
  yield {
63
- title: question.title,
64
- text: question.content,
65
- location: `/qeta/questions/${question.id}`,
58
+ title: post.title,
59
+ text: post.content,
60
+ location: post.type === "question" ? `/qeta/questions/${post.id}` : `/qeta/articles/${post.id}`,
66
61
  docType: "qeta",
67
- author: question.author,
68
- score: question.score,
69
- entityRefs: question.entities,
70
- answerCount: question.answersCount,
71
- views: question.views,
72
- tags: question.tags
62
+ author: post.author,
63
+ score: post.score,
64
+ entityRefs: post.entities,
65
+ answerCount: post.answersCount,
66
+ views: post.views,
67
+ tags: post.tags
73
68
  };
74
- for (const answer of question.answers ?? []) {
69
+ for (const answer of post.answers ?? []) {
75
70
  yield {
76
- title: `${answer.correct ? "Correct answer" : "Answer"} for question ${question.title}`,
71
+ title: `${answer.correct ? "Correct answer" : "Answer"} for question ${post.title}`,
77
72
  text: answer.content,
78
- location: `/qeta/questions/${question.id}#answer_${answer.id}`,
73
+ location: `/qeta/questions/${post.id}#answer_${answer.id}`,
79
74
  docType: "qeta",
80
- entityRefs: question.entities,
75
+ entityRefs: post.entities,
81
76
  author: answer.author,
82
77
  score: answer.score,
83
- tags: question.tags,
78
+ tags: post.tags,
84
79
  correctAnswer: answer.correct
85
80
  };
86
81
  for (const comment of answer.comments ?? []) {
87
82
  yield {
88
- title: `Comment for ${question.title}`,
83
+ title: `Comment for ${post.title}`,
89
84
  text: comment.content,
90
- location: `/qeta/questions/${question.id}#answer_${answer.id}`,
85
+ location: `/qeta/questions/${post.id}#answer_${answer.id}`,
91
86
  docType: "qeta",
92
87
  author: comment.author,
93
88
  score: answer.score,
94
- tags: question.tags,
95
- entityRefs: question.entities
89
+ tags: post.tags,
90
+ entityRefs: post.entities
96
91
  };
97
92
  }
98
93
  }
99
- for (const comment of question.comments ?? []) {
94
+ for (const comment of post.comments ?? []) {
100
95
  yield {
101
- title: `Comment for ${question.title}`,
96
+ title: `Comment for ${post.title}`,
102
97
  text: comment.content,
103
- location: `/qeta/questions/${question.id}`,
98
+ location: post.type === "question" ? `/qeta/questions/${post.id}` : `/qeta/articles/${post.id}`,
104
99
  docType: "qeta",
105
100
  author: comment.author,
106
- score: question.score,
107
- tags: question.tags,
108
- entityRefs: question.entities
101
+ score: post.score,
102
+ tags: post.tags,
103
+ entityRefs: post.entities
109
104
  };
110
105
  }
111
106
  }
@@ -1 +1 @@
1
- {"version":3,"file":"DefaultQetaCollatorFactory.cjs.js","sources":["../../src/collators/DefaultQetaCollatorFactory.ts"],"sourcesContent":["import { Config } from '@backstage/config';\nimport { Readable } from 'stream';\nimport { DocumentCollatorFactory } from '@backstage/plugin-search-common';\nimport {\n QetaDocument,\n QuestionsResponseBody,\n} from '@drodil/backstage-plugin-qeta-common';\nimport {\n AuthService,\n DiscoveryService,\n LoggerService,\n} from '@backstage/backend-plugin-api';\n\nexport type QetaCollatorFactoryOptions = {\n logger: LoggerService;\n discovery: DiscoveryService;\n auth?: AuthService;\n};\n\nexport class DefaultQetaCollatorFactory implements DocumentCollatorFactory {\n public readonly type: string = 'qeta';\n private readonly logger: LoggerService;\n private readonly discovery: DiscoveryService;\n private readonly auth?: AuthService;\n\n private constructor(_config: Config, options: QetaCollatorFactoryOptions) {\n this.logger = options.logger;\n this.discovery = options.discovery;\n this.auth = options.auth;\n }\n\n static fromConfig(config: Config, options: QetaCollatorFactoryOptions) {\n return new DefaultQetaCollatorFactory(config, options);\n }\n\n async getCollator() {\n return Readable.from(this.execute());\n }\n\n async *execute(): AsyncGenerator<QetaDocument> {\n this.logger.info('Executing QetaCollator');\n let totalQuestions = Number.MAX_VALUE;\n let indexedQuestions = 0;\n const baseUrl = await this.discovery.getBaseUrl('qeta');\n\n while (totalQuestions > indexedQuestions) {\n let headers = {};\n\n if (this.auth) {\n const { token } = await this.auth.getPluginRequestToken({\n onBehalfOf: await this.auth.getOwnServiceCredentials(),\n targetPluginId: 'qeta',\n });\n headers = {\n Authorization: `Bearer ${token}`,\n };\n }\n\n const params = new URLSearchParams();\n params.append('includeAnswers', 'true');\n params.append('includeComments', 'true');\n params.append('orderBy', 'created');\n params.append('order', 'asc');\n params.append('limit', '50');\n params.append('offset', indexedQuestions.toString(10));\n const response = await fetch(\n `${baseUrl}/questions?${params.toString()}`,\n {\n headers,\n },\n );\n const data = (await response.json()) as QuestionsResponseBody;\n\n if (!data || 'errors' in data || !('questions' in data)) {\n this.logger.error(\n `Error while fetching questions from qeta: ${JSON.stringify(data)}`,\n );\n return;\n }\n\n const questions = data.questions;\n this.logger.info(`Indexing ${questions.length} questions`);\n totalQuestions = data.total;\n indexedQuestions += questions.length;\n\n for (const question of questions) {\n yield {\n title: question.title,\n text: question.content,\n location: `/qeta/questions/${question.id}`,\n docType: 'qeta',\n author: question.author,\n score: question.score,\n entityRefs: question.entities,\n answerCount: question.answersCount,\n views: question.views,\n tags: question.tags,\n };\n\n for (const answer of question.answers ?? []) {\n yield {\n title: `${\n answer.correct ? 'Correct answer' : 'Answer'\n } for question ${question.title}`,\n text: answer.content,\n location: `/qeta/questions/${question.id}#answer_${answer.id}`,\n docType: 'qeta',\n entityRefs: question.entities,\n author: answer.author,\n score: answer.score,\n tags: question.tags,\n correctAnswer: answer.correct,\n };\n\n for (const comment of answer.comments ?? []) {\n yield {\n title: `Comment for ${question.title}`,\n text: comment.content,\n location: `/qeta/questions/${question.id}#answer_${answer.id}`,\n docType: 'qeta',\n author: comment.author,\n score: answer.score,\n tags: question.tags,\n entityRefs: question.entities,\n };\n }\n }\n\n for (const comment of question.comments ?? []) {\n yield {\n title: `Comment for ${question.title}`,\n text: comment.content,\n location: `/qeta/questions/${question.id}`,\n docType: 'qeta',\n author: comment.author,\n score: question.score,\n tags: question.tags,\n entityRefs: question.entities,\n };\n }\n }\n }\n }\n}\n"],"names":["Readable"],"mappings":";;;;AAmBO,MAAM,0BAA8D,CAAA;AAAA,EACzD,IAAe,GAAA,MAAA,CAAA;AAAA,EACd,MAAA,CAAA;AAAA,EACA,SAAA,CAAA;AAAA,EACA,IAAA,CAAA;AAAA,EAET,WAAA,CAAY,SAAiB,OAAqC,EAAA;AACxE,IAAA,IAAA,CAAK,SAAS,OAAQ,CAAA,MAAA,CAAA;AACtB,IAAA,IAAA,CAAK,YAAY,OAAQ,CAAA,SAAA,CAAA;AACzB,IAAA,IAAA,CAAK,OAAO,OAAQ,CAAA,IAAA,CAAA;AAAA,GACtB;AAAA,EAEA,OAAO,UAAW,CAAA,MAAA,EAAgB,OAAqC,EAAA;AACrE,IAAO,OAAA,IAAI,0BAA2B,CAAA,MAAA,EAAQ,OAAO,CAAA,CAAA;AAAA,GACvD;AAAA,EAEA,MAAM,WAAc,GAAA;AAClB,IAAA,OAAOA,eAAS,CAAA,IAAA,CAAK,IAAK,CAAA,OAAA,EAAS,CAAA,CAAA;AAAA,GACrC;AAAA,EAEA,OAAO,OAAwC,GAAA;AAC7C,IAAK,IAAA,CAAA,MAAA,CAAO,KAAK,wBAAwB,CAAA,CAAA;AACzC,IAAA,IAAI,iBAAiB,MAAO,CAAA,SAAA,CAAA;AAC5B,IAAA,IAAI,gBAAmB,GAAA,CAAA,CAAA;AACvB,IAAA,MAAM,OAAU,GAAA,MAAM,IAAK,CAAA,SAAA,CAAU,WAAW,MAAM,CAAA,CAAA;AAEtD,IAAA,OAAO,iBAAiB,gBAAkB,EAAA;AACxC,MAAA,IAAI,UAAU,EAAC,CAAA;AAEf,MAAA,I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ourcesContent":["import { Config } from '@backstage/config';\nimport { Readable } from 'stream';\nimport { DocumentCollatorFactory } from '@backstage/plugin-search-common';\nimport {\n QetaApi,\n QetaClient,\n QetaDocument,\n} from '@drodil/backstage-plugin-qeta-common';\nimport {\n AuthService,\n DiscoveryService,\n LoggerService,\n} from '@backstage/backend-plugin-api';\n\nexport type QetaCollatorFactoryOptions = {\n logger: LoggerService;\n discovery: DiscoveryService;\n auth?: AuthService;\n};\n\nexport class DefaultQetaCollatorFactory implements DocumentCollatorFactory {\n public readonly type: string = 'qeta';\n private readonly logger: LoggerService;\n private readonly auth?: AuthService;\n private readonly api: QetaApi;\n\n private constructor(_config: Config, options: QetaCollatorFactoryOptions) {\n this.logger = options.logger;\n this.auth = options.auth;\n this.api = new QetaClient({ discoveryApi: options.discovery });\n }\n\n static fromConfig(config: Config, options: QetaCollatorFactoryOptions) {\n return new DefaultQetaCollatorFactory(config, options);\n }\n\n async getCollator() {\n return Readable.from(this.execute());\n }\n\n async *execute(): AsyncGenerator<QetaDocument> {\n this.logger.info('Executing QetaCollator');\n let totalQuestions = Number.MAX_VALUE;\n let indexedQuestions = 0;\n\n while (totalQuestions > indexedQuestions) {\n let tok = undefined;\n\n if (this.auth) {\n const { token } = await this.auth.getPluginRequestToken({\n onBehalfOf: await this.auth.getOwnServiceCredentials(),\n targetPluginId: 'qeta',\n });\n tok = token;\n }\n\n const data = await this.api.getPosts(\n {\n includeAnswers: true,\n includeComments: true,\n orderBy: 'created',\n order: 'asc',\n limit: 50,\n offset: indexedQuestions,\n },\n { token: tok },\n );\n\n if (!data || 'errors' in data || !('posts' in data)) {\n this.logger.error(\n `Error while fetching posts from qeta: ${JSON.stringify(data)}`,\n );\n return;\n }\n\n const posts = data.posts;\n this.logger.info(`Indexing ${posts.length} posts`);\n totalQuestions = data.total;\n indexedQuestions += posts.length;\n\n for (const post of posts) {\n yield {\n title: post.title,\n text: post.content,\n location:\n post.type === 'question'\n ? `/qeta/questions/${post.id}`\n : `/qeta/articles/${post.id}`,\n docType: 'qeta',\n author: post.author,\n score: post.score,\n entityRefs: post.entities,\n answerCount: post.answersCount,\n views: post.views,\n tags: post.tags,\n };\n\n for (const answer of post.answers ?? []) {\n yield {\n title: `${\n answer.correct ? 'Correct answer' : 'Answer'\n } for question ${post.title}`,\n text: answer.content,\n location: `/qeta/questions/${post.id}#answer_${answer.id}`,\n docType: 'qeta',\n entityRefs: post.entities,\n author: answer.author,\n score: answer.score,\n tags: post.tags,\n correctAnswer: answer.correct,\n };\n\n for (const comment of answer.comments ?? []) {\n yield {\n title: `Comment for ${post.title}`,\n text: comment.content,\n location: `/qeta/questions/${post.id}#answer_${answer.id}`,\n docType: 'qeta',\n author: comment.author,\n score: answer.score,\n tags: post.tags,\n entityRefs: post.entities,\n };\n }\n }\n\n for (const comment of post.comments ?? []) {\n yield {\n title: `Comment for ${post.title}`,\n text: comment.content,\n location:\n post.type === 'question'\n ? `/qeta/questions/${post.id}`\n : `/qeta/articles/${post.id}`,\n docType: 'qeta',\n author: comment.author,\n score: post.score,\n tags: post.tags,\n entityRefs: post.entities,\n };\n }\n }\n }\n }\n}\n"],"names":["QetaClient","Readable"],"mappings":";;;;;AAoBO,MAAM,0BAA8D,CAAA;AAAA,EACzD,IAAe,GAAA,MAAA,CAAA;AAAA,EACd,MAAA,CAAA;AAAA,EACA,IAAA,CAAA;AAAA,EACA,GAAA,CAAA;AAAA,EAET,WAAA,CAAY,SAAiB,OAAqC,EAAA;AACxE,IAAA,IAAA,CAAK,SAAS,OAAQ,CAAA,MAAA,CAAA;AACtB,IAAA,IAAA,CAAK,OAAO,OAAQ,CAAA,IAAA,CAAA;AACpB,IAAA,IAAA,CAAK,MAAM,IAAIA,oCAAA,CAAW,EAAE,YAAc,EAAA,OAAA,CAAQ,WAAW,CAAA,CAAA;AAAA,GAC/D;AAAA,EAEA,OAAO,UAAW,CAAA,MAAA,EAAgB,OAAqC,EAAA;AACrE,IAAO,OAAA,IAAI,0BAA2B,CAAA,MAAA,EAA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AAAA,YACX,YAAY,IAAK,CAAA,QAAA;AAAA,WACnB,CAAA;AAAA,SACF;AAAA,OACF;AAAA,KACF;AAAA,GACF;AACF;;;;"}
package/dist/index.d.ts CHANGED
@@ -15,8 +15,8 @@ type QetaCollatorFactoryOptions = {
15
15
  declare class DefaultQetaCollatorFactory implements DocumentCollatorFactory {
16
16
  readonly type: string;
17
17
  private readonly logger;
18
- private readonly discovery;
19
18
  private readonly auth?;
19
+ private readonly api;
20
20
  private constructor();
21
21
  static fromConfig(config: Config, options: QetaCollatorFactoryOptions): DefaultQetaCollatorFactory;
22
22
  getCollator(): Promise<Readable>;
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "search",
8
8
  "backstage.io"
9
9
  ],
10
- "version": "2.15.0",
10
+ "version": "3.0.1",
11
11
  "main": "dist/index.cjs.js",
12
12
  "types": "dist/index.d.ts",
13
13
  "prepublishOnly": "yarn tsc && yarn build",
@@ -41,15 +41,12 @@
41
41
  "tsc": "tsc"
42
42
  },
43
43
  "dependencies": {
44
- "@backstage/backend-common": "^0.25.0",
45
44
  "@backstage/backend-plugin-api": "^1.0.1",
46
- "@backstage/backend-tasks": "^0.6.1",
47
45
  "@backstage/config": "^1.2.0",
48
- "@backstage/core-plugin-api": "^1.10.0",
49
46
  "@backstage/errors": "^1.2.4",
50
47
  "@backstage/plugin-search-backend-node": "^1.3.3",
51
48
  "@backstage/plugin-search-common": "^1.2.14",
52
- "@drodil/backstage-plugin-qeta-common": "^2.15.0"
49
+ "@drodil/backstage-plugin-qeta-common": "^3.0.1"
53
50
  },
54
51
  "devDependencies": {
55
52
  "@backstage/backend-test-utils": "^1.0.1",