{"_id":"@aliok/plugin-knative-event-mesh-backend-dynamic","name":"@aliok/plugin-knative-event-mesh-backend-dynamic","dist-tags":{"latest":"0.0.0-nightly"},"versions":{"0.0.0-nightly":{"name":"@aliok/plugin-knative-event-mesh-backend-dynamic","version":"0.0.0-nightly","main":"dist/index.cjs.js","types":"dist/index.d.ts","license":"Apache-2.0","private":false,"publishConfig":{"access":"public","main":"dist/index.cjs.js","types":"dist/index.d.ts"},"backstage":{"role":"backend-plugin"},"exports":{".":{"require":"./dist/index.cjs.js","types":"./dist/index.d.ts","default":"./dist/index.cjs.js"},"./alpha":{"require":"./dist/alpha.cjs.js","types":"./dist/alpha.d.ts","default":"./dist/alpha.cjs.js"},"./package.json":"./package.json"},"scripts":{},"dependencies":{"@types/express":"*","express":"^4.17.1","express-promise-router":"^4.1.0","node-fetch":"^2.6.7","winston":"^3.2.1","yn":"^4.0.0"},"devDependencies":{},"bundleDependencies":["@types/express","express","express-promise-router","node-fetch","winston","yn"],"peerDependencies":{"@backstage/backend-common":"^0.19.9","@backstage/backend-dynamic-feature-service":"^0.2.9","@backstage/backend-tasks":"^0.5.21","@backstage/config":"^1.1.1","@backstage/plugin-catalog-common":"^1.0.22","@backstage/catalog-client":"^1.4.6","@backstage/catalog-model":"^1.4.5","@backstage/plugin-catalog-node":"^1.11.0"},"overrides":{"@aws-sdk/util-utf8-browser":{"@smithy/util-utf8":"^2.0.0"}},"resolutions":{"@aws-sdk/util-utf8-browser":"npm:@smithy/util-utf8@~2"},"_id":"@aliok/plugin-knative-event-mesh-backend-dynamic@0.0.0-nightly","gitHead":"647a496ba355b589d7fa6d5f7804f9c7f20ad574","description":"The Event Mesh plugin is a Backstage plugin that allows you to view and manage Knative Eventing resources.","_nodeVersion":"18.18.2","_npmVersion":"9.8.1","dist":{"integrity":"sha512-KwhwBORVLXCYPhVVFugJ93tjkBlLtgGgtADKXKxjFHE7YCw/9SBLo1e8WHedsD+G4N5Q0uX8+l+p0A26zuvyQA==","shasum":"90e55957e5e46287be1c90e3d13e7752abe59163","tarball":"https://registry.npmjs.org/@aliok/plugin-knative-event-mesh-backend-dynamic/-/plugin-knative-event-mesh-backend-dynamic-0.0.0-nightly.tgz","fileCount":1181,"unpackedSize":8619182,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFaKY3/YSHG6vUBxWqPT7cbdlcHR+bQ6phaUWOwhE7ryAiEA+zcF+0FnweQUDcqZCIVJPOvBNAmWwPNmGMP7MKqg+Go="}]},"_npmUser":{"name":"aliok","email":"aliok@aliok.com.tr"},"directories":{},"maintainers":[{"name":"aliok","email":"aliok@aliok.com.tr"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-knative-event-mesh-backend-dynamic_0.0.0-nightly_1717141926045_0.7870217756428235"},"_hasShrinkwrap":false}},"time":{"created":"2024-05-31T07:52:05.976Z","0.0.0-nightly":"2024-05-31T07:52:06.292Z","modified":"2024-05-31T07:52:06.657Z"},"maintainers":[{"name":"aliok","email":"aliok@aliok.com.tr"}],"description":"The Event Mesh plugin is a Backstage plugin that allows you to view and manage Knative Eventing resources.","license":"Apache-2.0","readme":"# Knative Event Mesh plugin\n\nThe Event Mesh plugin is a Backstage plugin that allows you to view and manage Knative Eventing resources.\n\nThe Backstage plugin talks to a special backend that runs in the Kubernetes cluster and communicates with the Kubernetes\nAPI server.\n\nA demo setup for this plugin is available at https://github.com/aliok/knative-backstage-demo.\n\n## Installation\n\nInstall the backend and the relevant configuration in the Kubernetes cluster\n\n```bash\nkubectl apply -f https://github.com/knative-extensions/backstage-plugins/releases/download/v0.1.0/eventmesh.yaml\n```\n\nIn your Backstage directory, run the following command to install the plugin:\n\n```bash\nyarn workspace backend add @knative-extensions/plugin-knative-event-mesh-backend\n```\n\n## Configuration\n\n> **NOTE**: The backend needs to be accessible from the Backstage instance. If you are running the backend without\n> exposing it, you can use `kubectl port-forward` to forward the port of the backend service to your local machine.\n> ```bash\n> kubectl port-forward -n knative-eventing svc/eventmesh-backend 8080:8080\n> ```\n\n\nThe plugin needs to be configured to talk to the backend. It can be configured in the `app-config.yaml` file of the\nBackstage instance and allows configuration of one or multiple providers.\n\nUse a `knativeEventMesh` marker to start configuring the `app-config.yaml` file of Backstage:\n\n```yaml\ncatalog:\n  providers:\n    knativeEventMesh:\n      dev:\n        baseUrl: 'http://localhost:8080' # URL of the backend installed in the cluster\n        schedule: # optional; same options as in TaskScheduleDefinition\n          # supports cron, ISO duration, \"human duration\" as used in code\n          frequency: { minutes: 1 }\n          # supports ISO duration, \"human duration\" as used in code\n          timeout: { minutes: 1 }\n```\n\nConfigure the scheduler for the entity provider and enable the processor. Add the following code\nto `packages/backend/src/plugins/catalog.ts` file:\n\n```ts\nimport {CatalogClient} from \"@backstage/catalog-client\";\nimport {\n    KnativeEventMeshProcessor,\n    KnativeEventMeshProvider\n} from '@knative-extensions/plugin-knative-event-mesh-backend';\n\nexport default async function createPlugin(\n    env:PluginEnvironment,\n):Promise<Router> {\n    const builder = await CatalogBuilder.create(env);\n\n    /* ... other processors and/or providers ... */\n\n    // ADD THESE\n    builder.addEntityProvider(\n        KnativeEventMeshProvider.fromConfig(env.config, {\n            logger: env.logger,\n            scheduler: env.scheduler,\n        }),\n    );\n    const catalogApi = new CatalogClient({\n        discoveryApi: env.discovery,\n    });\n    const knativeEventMeshProcessor = new KnativeEventMeshProcessor(catalogApi, env.logger);\n    builder.addProcessor(knativeEventMeshProcessor);\n\n    /* ... other processors and/or providers ... */\n\n    const {processingEngine, router} = await builder.build();\n    await processingEngine.start();\n    return router;\n}\n```\n\n> **NOTE**: If you have made any changes to the schedule in the `app-config.yaml` file, then restart to apply the\n> changes.\n\n## Troubleshooting\n\nWhen you start your Backstage application, you can see some log lines as follows:\n\n```text\n[1] 2024-01-04T09:38:08.707Z knative-event-mesh-backend info Found 1 knative event mesh provider configs with ids: dev type=plugin\n```\n\n## Usage\n\nThe plugin will register a few entities in the Backstage catalog.\n\nScreenshots:\n\n- ![Event Mesh plugin](./event-mesh-plugin-components-view.png)\n\n- ![Event Mesh plugin](./event-mesh-plugin-apis-view.png)\n","readmeFilename":"README.md"}