@backstage-community/plugin-explore-backend 0.1.7 → 0.1.8

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @backstage-community/plugin-explore-backend
2
2
 
3
+ ## 0.1.8
4
+
5
+ ### Patch Changes
6
+
7
+ - 00f3ac0: Deprecated `createRouter` and its router options in favour of the new backend system.
8
+
3
9
  ## 0.1.7
4
10
 
5
11
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -13,6 +13,8 @@ import { ExploreTool, GetExploreToolsRequest, GetExploreToolsResponse } from '@b
13
13
  declare const explorePlugin: _backstage_backend_plugin_api.BackendFeature;
14
14
 
15
15
  /**
16
+ * @deprecated Please migrate to the new backend system as this will be removed in the future.
17
+ *
16
18
  * @public
17
19
  */
18
20
  interface RouterOptions {
@@ -20,6 +22,8 @@ interface RouterOptions {
20
22
  toolProvider: ExploreToolProvider$1;
21
23
  }
22
24
  /**
25
+ * @deprecated Please migrate to the new backend system as this will be removed in the future.
26
+ *
23
27
  * @public
24
28
  */
25
29
  declare function createRouter(options: RouterOptions): Promise<express.Router>;
@@ -1 +1 @@
1
- {"version":3,"file":"router.cjs.js","sources":["../../src/service/router.ts"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { errorHandler } from '@backstage/backend-common';\nimport { GetExploreToolsRequest } from '@backstage-community/plugin-explore-common';\nimport express from 'express';\nimport Router from 'express-promise-router';\nimport { LoggerService } from '@backstage/backend-plugin-api';\nimport { ExploreToolProvider } from '@backstage-community/plugin-explore-node';\n\n/**\n * @public\n */\nexport interface RouterOptions {\n logger: LoggerService;\n toolProvider: ExploreToolProvider;\n}\n\n/**\n * @public\n */\nexport async function createRouter(\n options: RouterOptions,\n): Promise<express.Router> {\n const { toolProvider } = options;\n\n const router = Router();\n router.use(express.json());\n\n router.get('/tools', async (request, response) => {\n const requestQuery = parseExploreToolRequestQuery(request.query);\n const result = await toolProvider.getTools(requestQuery);\n response.json(result);\n });\n\n router.use(errorHandler());\n\n return router;\n}\n\nfunction parseExploreToolRequestQuery(\n params: Record<string, unknown>,\n): GetExploreToolsRequest {\n // TODO: Implement proper query parsing for the filters\n // Also consider using a `filter` query string like catalog client does\n return {\n filter: {\n tags: [...[(params?.tag as any) ?? []]].flat(),\n lifecycle: [...[(params?.lifecycle as any) ?? []]].flat(),\n },\n };\n}\n"],"names":["Router","express","errorHandler"],"mappings":";;;;;;;;;;;AAkCA,eAAsB,aACpB,OACyB,EAAA;AACzB,EAAM,MAAA,EAAE,cAAiB,GAAA,OAAA,CAAA;AAEzB,EAAA,MAAM,SAASA,uBAAO,EAAA,CAAA;AACtB,EAAO,MAAA,CAAA,GAAA,CAAIC,wBAAQ,CAAA,IAAA,EAAM,CAAA,CAAA;AAEzB,EAAA,MAAA,CAAO,GAAI,CAAA,QAAA,EAAU,OAAO,OAAA,EAAS,QAAa,KAAA;AAChD,IAAM,MAAA,YAAA,GAAe,4BAA6B,CAAA,OAAA,CAAQ,KAAK,CAAA,CAAA;AAC/D,IAAA,MAAM,MAAS,GAAA,MAAM,YAAa,CAAA,QAAA,CAAS,YAAY,CAAA,CAAA;AACvD,IAAA,QAAA,CAAS,KAAK,MAAM,CAAA,CAAA;AAAA,GACrB,CAAA,CAAA;AAED,EAAO,MAAA,CAAA,GAAA,CAAIC,4BAAc,CAAA,CAAA;AAEzB,EAAO,OAAA,MAAA,CAAA;AACT,CAAA;AAEA,SAAS,6BACP,MACwB,EAAA;AAGxB,EAAO,OAAA;AAAA,IACL,MAAQ,EAAA;AAAA,MACN,IAAA,EAAM,CAAC,GAAG,CAAE,MAAA,EAAQ,OAAe,EAAE,CAAC,CAAA,CAAE,IAAK,EAAA;AAAA,MAC7C,SAAA,EAAW,CAAC,GAAG,CAAE,MAAA,EAAQ,aAAqB,EAAE,CAAC,CAAA,CAAE,IAAK,EAAA;AAAA,KAC1D;AAAA,GACF,CAAA;AACF;;;;"}
1
+ {"version":3,"file":"router.cjs.js","sources":["../../src/service/router.ts"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { errorHandler } from '@backstage/backend-common';\nimport { GetExploreToolsRequest } from '@backstage-community/plugin-explore-common';\nimport express from 'express';\nimport Router from 'express-promise-router';\nimport { LoggerService } from '@backstage/backend-plugin-api';\nimport { ExploreToolProvider } from '@backstage-community/plugin-explore-node';\n\n/**\n * @deprecated Please migrate to the new backend system as this will be removed in the future.\n *\n * @public\n */\nexport interface RouterOptions {\n logger: LoggerService;\n toolProvider: ExploreToolProvider;\n}\n\n/**\n * @deprecated Please migrate to the new backend system as this will be removed in the future.\n *\n * @public\n */\nexport async function createRouter(\n options: RouterOptions,\n): Promise<express.Router> {\n const { toolProvider } = options;\n\n const router = Router();\n router.use(express.json());\n\n router.get('/tools', async (request, response) => {\n const requestQuery = parseExploreToolRequestQuery(request.query);\n const result = await toolProvider.getTools(requestQuery);\n response.json(result);\n });\n\n router.use(errorHandler());\n\n return router;\n}\n\nfunction parseExploreToolRequestQuery(\n params: Record<string, unknown>,\n): GetExploreToolsRequest {\n // TODO: Implement proper query parsing for the filters\n // Also consider using a `filter` query string like catalog client does\n return {\n filter: {\n tags: [...[(params?.tag as any) ?? []]].flat(),\n lifecycle: [...[(params?.lifecycle as any) ?? []]].flat(),\n },\n };\n}\n"],"names":["Router","express","errorHandler"],"mappings":";;;;;;;;;;;AAsCA,eAAsB,aACpB,OACyB,EAAA;AACzB,EAAM,MAAA,EAAE,cAAiB,GAAA,OAAA,CAAA;AAEzB,EAAA,MAAM,SAASA,uBAAO,EAAA,CAAA;AACtB,EAAO,MAAA,CAAA,GAAA,CAAIC,wBAAQ,CAAA,IAAA,EAAM,CAAA,CAAA;AAEzB,EAAA,MAAA,CAAO,GAAI,CAAA,QAAA,EAAU,OAAO,OAAA,EAAS,QAAa,KAAA;AAChD,IAAM,MAAA,YAAA,GAAe,4BAA6B,CAAA,OAAA,CAAQ,KAAK,CAAA,CAAA;AAC/D,IAAA,MAAM,MAAS,GAAA,MAAM,YAAa,CAAA,QAAA,CAAS,YAAY,CAAA,CAAA;AACvD,IAAA,QAAA,CAAS,KAAK,MAAM,CAAA,CAAA;AAAA,GACrB,CAAA,CAAA;AAED,EAAO,MAAA,CAAA,GAAA,CAAIC,4BAAc,CAAA,CAAA;AAEzB,EAAO,OAAA,MAAA,CAAA;AACT,CAAA;AAEA,SAAS,6BACP,MACwB,EAAA;AAGxB,EAAO,OAAA;AAAA,IACL,MAAQ,EAAA;AAAA,MACN,IAAA,EAAM,CAAC,GAAG,CAAE,MAAA,EAAQ,OAAe,EAAE,CAAC,CAAA,CAAE,IAAK,EAAA;AAAA,MAC7C,SAAA,EAAW,CAAC,GAAG,CAAE,MAAA,EAAQ,aAAqB,EAAE,CAAC,CAAA,CAAE,IAAK,EAAA;AAAA,KAC1D;AAAA,GACF,CAAA;AACF;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage-community/plugin-explore-backend",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "backstage": {
5
5
  "role": "backend-plugin",
6
6
  "pluginId": "explore",