@backstage/plugin-catalog-backend-module-logs 0.1.2-next.1 → 0.1.2

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,23 @@
1
1
  # @backstage/plugin-catalog-backend-module-logs
2
2
 
3
+ ## 0.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+ - @backstage/plugin-catalog-backend@1.27.0
9
+ - @backstage/plugin-events-node@0.4.1
10
+ - @backstage/backend-plugin-api@1.0.1
11
+
12
+ ## 0.1.2-next.2
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies
17
+ - @backstage/plugin-catalog-backend@1.26.2-next.2
18
+ - @backstage/backend-plugin-api@1.0.1-next.1
19
+ - @backstage/plugin-events-node@0.4.1-next.1
20
+
3
21
  ## 0.1.2-next.1
4
22
 
5
23
  ### Patch Changes
package/dist/index.cjs.js CHANGED
@@ -2,38 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var backendPluginApi = require('@backstage/backend-plugin-api');
6
- var pluginCatalogBackend = require('@backstage/plugin-catalog-backend');
7
- var pluginEventsNode = require('@backstage/plugin-events-node');
5
+ var module$1 = require('./module.cjs.js');
8
6
 
9
- const catalogModuleLogs = backendPluginApi.createBackendModule({
10
- pluginId: "catalog",
11
- moduleId: "logs",
12
- register(env) {
13
- env.registerInit({
14
- deps: {
15
- events: pluginEventsNode.eventsServiceRef,
16
- logger: backendPluginApi.coreServices.logger
17
- },
18
- async init({ events, logger }) {
19
- events.subscribe({
20
- id: "catalog",
21
- topics: [pluginCatalogBackend.CATALOG_ERRORS_TOPIC],
22
- async onEvent(params) {
23
- const event = params;
24
- const { entity, location, errors } = event.eventPayload;
25
- for (const error of errors) {
26
- logger.warn(error.message, {
27
- entity,
28
- location
29
- });
30
- }
31
- }
32
- });
33
- }
34
- });
35
- }
36
- });
37
7
 
38
- exports.default = catalogModuleLogs;
8
+
9
+ exports.default = module$1.catalogModuleLogs;
39
10
  //# sourceMappingURL=index.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","sources":["../src/module.ts"],"sourcesContent":["/*\n * Copyright 2024 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 {\n coreServices,\n createBackendModule,\n} from '@backstage/backend-plugin-api';\nimport { CATALOG_ERRORS_TOPIC } from '@backstage/plugin-catalog-backend';\nimport { eventsServiceRef, EventParams } from '@backstage/plugin-events-node';\n\ninterface EventsPayload {\n entity: string;\n location?: string;\n errors: Error[];\n}\n\ninterface EventsParamsWithPayload extends EventParams {\n eventPayload: EventsPayload;\n}\n\n/**\n * A catalog module that logs catalog errors using the logger service.\n *\n * @public\n */\nexport const catalogModuleLogs = createBackendModule({\n pluginId: 'catalog',\n moduleId: 'logs',\n register(env) {\n env.registerInit({\n deps: {\n events: eventsServiceRef,\n logger: coreServices.logger,\n },\n async init({ events, logger }) {\n events.subscribe({\n id: 'catalog',\n topics: [CATALOG_ERRORS_TOPIC],\n async onEvent(params: EventParams): Promise<void> {\n const event = params as EventsParamsWithPayload;\n const { entity, location, errors } = event.eventPayload;\n for (const error of errors) {\n logger.warn(error.message, {\n entity,\n location,\n });\n }\n },\n });\n },\n });\n },\n});\n"],"names":["createBackendModule","eventsServiceRef","coreServices","CATALOG_ERRORS_TOPIC"],"mappings":";;;;;;;;AAsCO,MAAM,oBAAoBA,oCAAoB,CAAA;AAAA,EACnD,QAAU,EAAA,SAAA;AAAA,EACV,QAAU,EAAA,MAAA;AAAA,EACV,SAAS,GAAK,EAAA;AACZ,IAAA,GAAA,CAAI,YAAa,CAAA;AAAA,MACf,IAAM,EAAA;AAAA,QACJ,MAAQ,EAAAC,iCAAA;AAAA,QACR,QAAQC,6BAAa,CAAA,MAAA;AAAA,OACvB;AAAA,MACA,MAAM,IAAA,CAAK,EAAE,MAAA,EAAQ,QAAU,EAAA;AAC7B,QAAA,MAAA,CAAO,SAAU,CAAA;AAAA,UACf,EAAI,EAAA,SAAA;AAAA,UACJ,MAAA,EAAQ,CAACC,yCAAoB,CAAA;AAAA,UAC7B,MAAM,QAAQ,MAAoC,EAAA;AAChD,YAAA,MAAM,KAAQ,GAAA,MAAA,CAAA;AACd,YAAA,MAAM,EAAE,MAAA,EAAQ,QAAU,EAAA,MAAA,KAAW,KAAM,CAAA,YAAA,CAAA;AAC3C,YAAA,KAAA,MAAW,SAAS,MAAQ,EAAA;AAC1B,cAAO,MAAA,CAAA,IAAA,CAAK,MAAM,OAAS,EAAA;AAAA,gBACzB,MAAA;AAAA,gBACA,QAAA;AAAA,eACD,CAAA,CAAA;AAAA,aACH;AAAA,WACF;AAAA,SACD,CAAA,CAAA;AAAA,OACH;AAAA,KACD,CAAA,CAAA;AAAA,GACH;AACF,CAAC;;;;"}
1
+ {"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
@@ -0,0 +1,37 @@
1
+ 'use strict';
2
+
3
+ var backendPluginApi = require('@backstage/backend-plugin-api');
4
+ var pluginCatalogBackend = require('@backstage/plugin-catalog-backend');
5
+ var pluginEventsNode = require('@backstage/plugin-events-node');
6
+
7
+ const catalogModuleLogs = backendPluginApi.createBackendModule({
8
+ pluginId: "catalog",
9
+ moduleId: "logs",
10
+ register(env) {
11
+ env.registerInit({
12
+ deps: {
13
+ events: pluginEventsNode.eventsServiceRef,
14
+ logger: backendPluginApi.coreServices.logger
15
+ },
16
+ async init({ events, logger }) {
17
+ events.subscribe({
18
+ id: "catalog",
19
+ topics: [pluginCatalogBackend.CATALOG_ERRORS_TOPIC],
20
+ async onEvent(params) {
21
+ const event = params;
22
+ const { entity, location, errors } = event.eventPayload;
23
+ for (const error of errors) {
24
+ logger.warn(error.message, {
25
+ entity,
26
+ location
27
+ });
28
+ }
29
+ }
30
+ });
31
+ }
32
+ });
33
+ }
34
+ });
35
+
36
+ exports.catalogModuleLogs = catalogModuleLogs;
37
+ //# sourceMappingURL=module.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.cjs.js","sources":["../src/module.ts"],"sourcesContent":["/*\n * Copyright 2024 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 {\n coreServices,\n createBackendModule,\n} from '@backstage/backend-plugin-api';\nimport { CATALOG_ERRORS_TOPIC } from '@backstage/plugin-catalog-backend';\nimport { eventsServiceRef, EventParams } from '@backstage/plugin-events-node';\n\ninterface EventsPayload {\n entity: string;\n location?: string;\n errors: Error[];\n}\n\ninterface EventsParamsWithPayload extends EventParams {\n eventPayload: EventsPayload;\n}\n\n/**\n * A catalog module that logs catalog errors using the logger service.\n *\n * @public\n */\nexport const catalogModuleLogs = createBackendModule({\n pluginId: 'catalog',\n moduleId: 'logs',\n register(env) {\n env.registerInit({\n deps: {\n events: eventsServiceRef,\n logger: coreServices.logger,\n },\n async init({ events, logger }) {\n events.subscribe({\n id: 'catalog',\n topics: [CATALOG_ERRORS_TOPIC],\n async onEvent(params: EventParams): Promise<void> {\n const event = params as EventsParamsWithPayload;\n const { entity, location, errors } = event.eventPayload;\n for (const error of errors) {\n logger.warn(error.message, {\n entity,\n location,\n });\n }\n },\n });\n },\n });\n },\n});\n"],"names":["createBackendModule","eventsServiceRef","coreServices","CATALOG_ERRORS_TOPIC"],"mappings":";;;;;;AAsCO,MAAM,oBAAoBA,oCAAoB,CAAA;AAAA,EACnD,QAAU,EAAA,SAAA;AAAA,EACV,QAAU,EAAA,MAAA;AAAA,EACV,SAAS,GAAK,EAAA;AACZ,IAAA,GAAA,CAAI,YAAa,CAAA;AAAA,MACf,IAAM,EAAA;AAAA,QACJ,MAAQ,EAAAC,iCAAA;AAAA,QACR,QAAQC,6BAAa,CAAA,MAAA;AAAA,OACvB;AAAA,MACA,MAAM,IAAA,CAAK,EAAE,MAAA,EAAQ,QAAU,EAAA;AAC7B,QAAA,MAAA,CAAO,SAAU,CAAA;AAAA,UACf,EAAI,EAAA,SAAA;AAAA,UACJ,MAAA,EAAQ,CAACC,yCAAoB,CAAA;AAAA,UAC7B,MAAM,QAAQ,MAAoC,EAAA;AAChD,YAAA,MAAM,KAAQ,GAAA,MAAA,CAAA;AACd,YAAA,MAAM,EAAE,MAAA,EAAQ,QAAU,EAAA,MAAA,KAAW,KAAM,CAAA,YAAA,CAAA;AAC3C,YAAA,KAAA,MAAW,SAAS,MAAQ,EAAA;AAC1B,cAAO,MAAA,CAAA,IAAA,CAAK,MAAM,OAAS,EAAA;AAAA,gBACzB,MAAA;AAAA,gBACA,QAAA;AAAA,eACD,CAAA,CAAA;AAAA,aACH;AAAA,WACF;AAAA,SACD,CAAA,CAAA;AAAA,OACH;AAAA,KACD,CAAA,CAAA;AAAA,GACH;AACF,CAAC;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-catalog-backend-module-logs",
3
- "version": "0.1.2-next.1",
3
+ "version": "0.1.2",
4
4
  "description": "A module that subscribes to catalog releated events and logs them.",
5
5
  "backstage": {
6
6
  "role": "backend-plugin-module",
@@ -33,13 +33,13 @@
33
33
  "test": "backstage-cli package test"
34
34
  },
35
35
  "dependencies": {
36
- "@backstage/backend-plugin-api": "1.0.1-next.0",
37
- "@backstage/plugin-catalog-backend": "1.26.2-next.1",
38
- "@backstage/plugin-events-node": "0.4.1-next.0"
36
+ "@backstage/backend-plugin-api": "^1.0.1",
37
+ "@backstage/plugin-catalog-backend": "^1.27.0",
38
+ "@backstage/plugin-events-node": "^0.4.1"
39
39
  },
40
40
  "devDependencies": {
41
- "@backstage/backend-test-utils": "1.0.1-next.1",
42
- "@backstage/cli": "0.28.0-next.1",
43
- "@backstage/plugin-events-backend-test-utils": "0.1.36-next.0"
41
+ "@backstage/backend-test-utils": "^1.0.1",
42
+ "@backstage/cli": "^0.28.0",
43
+ "@backstage/plugin-events-backend-test-utils": "^0.1.36"
44
44
  }
45
45
  }