@pagerduty/backstage-plugin-backend 0.9.6 → 0.9.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/dist/apis/pagerduty.cjs.js +698 -0
- package/dist/apis/pagerduty.cjs.js.map +1 -0
- package/dist/auth/auth.cjs.js +170 -0
- package/dist/auth/auth.cjs.js.map +1 -0
- package/dist/db/PagerDutyBackendDatabase.cjs.js +68 -0
- package/dist/db/PagerDutyBackendDatabase.cjs.js.map +1 -0
- package/dist/index.cjs.js +6 -1640
- package/dist/index.cjs.js.map +1 -1
- package/dist/plugin.cjs.js +64 -0
- package/dist/plugin.cjs.js.map +1 -0
- package/dist/service/router.cjs.js +694 -0
- package/dist/service/router.cjs.js.map +1 -0
- package/migrations/20240527_init.js +1 -1
- package/package.json +9 -18
- package/LICENSE +0 -201
- package/README.md +0 -49
- package/dist/index.d.ts +0 -52
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"router.cjs.js","sources":["../../src/service/router.ts"],"sourcesContent":["import {\n AuthService,\n DiscoveryService,\n LoggerService,\n RootConfigService\n} from '@backstage/backend-plugin-api';\nimport {\n createLegacyAuthAdapters,\n errorHandler\n} from '@backstage/backend-common';\nimport {\n getAllEscalationPolicies,\n getChangeEvents,\n getIncidents,\n getOncallUsers,\n getServiceById,\n getServiceByIntegrationKey,\n getServiceStandards,\n getServiceMetrics,\n getAllServices,\n loadPagerDutyEndpointsFromConfig,\n createServiceIntegration,\n getServiceRelationshipsById,\n addServiceRelationsToService,\n removeServiceRelationsFromService\n} from '../apis/pagerduty';\nimport {\n HttpError,\n PagerDutyChangeEventsResponse,\n PagerDutyIncidentsResponse,\n PagerDutyOnCallUsersResponse,\n PagerDutyServiceResponse,\n PagerDutyServiceStandardsResponse,\n PagerDutyServiceMetricsResponse,\n PagerDutyServicesResponse,\n PagerDutyEntityMapping,\n PagerDutyEntityMappingsResponse,\n PagerDutyService,\n PagerDutyServiceDependency,\n PagerDutySetting\n} from '@pagerduty/backstage-plugin-common';\nimport { loadAuthConfig } from '../auth/auth';\nimport {\n PagerDutyBackendStore,\n RawDbEntityResultRow\n} from '../db/PagerDutyBackendDatabase';\nimport * as express from 'express';\nimport Router from 'express-promise-router';\nimport type {\n CatalogApi,\n GetEntitiesResponse\n} from '@backstage/catalog-client';\n\n\nexport interface RouterOptions {\n logger: LoggerService;\n config: RootConfigService;\n store: PagerDutyBackendStore;\n discovery: DiscoveryService;\n auth?: AuthService;\n catalogApi?: CatalogApi;\n}\n\nexport type Annotations = {\n \"pagerduty.com/integration-key\": string;\n \"pagerduty.com/service-id\": string;\n \"pagerduty.com/account\": string;\n}\n\nexport async function createComponentEntitiesReferenceDict({ items: componentEntities }: GetEntitiesResponse): Promise<Record<string, { ref: string, name: string }>> {\n const componentEntitiesDict: Record<string, { ref: string, name: string }> = {};\n\n await Promise.all(componentEntities.map(async (entity) => {\n const serviceId = entity.metadata.annotations?.['pagerduty.com/service-id'];\n const integrationKey = entity.metadata.annotations?.['pagerduty.com/integration-key'];\n const account = entity.metadata.annotations?.['pagerduty.com/account'];\n\n if (serviceId !== undefined && serviceId !== \"\") {\n componentEntitiesDict[serviceId] = {\n ref: `${entity.kind}:${entity.metadata.namespace}/${entity.metadata.name}`.toLowerCase(),\n name: entity.metadata.name,\n };\n }\n else if (integrationKey !== undefined && integrationKey !== \"\") {\n // get service id from integration key, we ignore errors here since we're focused\n // only on building a mapping between valid service IDs and the corresponding Backstage entity\n const service = await getServiceByIntegrationKey(integrationKey, account).catch(() => undefined);\n\n if (service !== undefined) {\n componentEntitiesDict[service.id] = {\n ref: `${entity.kind}:${entity.metadata.namespace}/${entity.metadata.name}`.toLowerCase(),\n name: entity.metadata.name,\n };\n }\n }\n }));\n\n return componentEntitiesDict;\n}\n\nexport async function buildEntityMappingsResponse(\n entityMappings: RawDbEntityResultRow[],\n componentEntitiesDict: Record<string, {\n ref: string;\n name: string;\n }>,\n componentEntities: GetEntitiesResponse,\n pagerDutyServices: PagerDutyService[]\n): Promise<PagerDutyEntityMappingsResponse> {\n\n const result: PagerDutyEntityMappingsResponse = {\n mappings: []\n };\n\n pagerDutyServices.forEach((service) => {\n // Check for service mapping annotation in any entity config file and get the entity ref\n const entityRef = componentEntitiesDict[service.id]?.ref;\n const entityName = componentEntitiesDict[service.id]?.name;\n\n // Check if the service is mapped to an entity in the database\n const entityMapping = entityMappings.find((mapping) => mapping.serviceId === service.id);\n\n if (entityMapping) {\n if (entityRef === undefined) {\n if (entityMapping.entityRef === \"\" || entityMapping.entityRef === undefined) {\n result.mappings.push({\n entityRef: \"\",\n entityName: \"\",\n integrationKey: entityMapping.integrationKey,\n serviceId: entityMapping.serviceId,\n status: \"NotMapped\",\n serviceName: service.name,\n team: service.teams?.[0]?.name ?? \"\",\n escalationPolicy: service.escalation_policy !== undefined ? service.escalation_policy.name : \"\",\n serviceUrl: service.html_url,\n account: service.account,\n });\n }\n else {\n const entityRefName = componentEntities.items.find((entity) => `${entity.kind}:${entity.metadata.namespace}/${entity.metadata.name}`.toLowerCase() === entityMapping.entityRef)?.metadata.name ?? \"\";\n\n result.mappings.push({\n entityRef: entityMapping.entityRef,\n entityName: entityRefName,\n serviceId: entityMapping.serviceId,\n integrationKey: entityMapping.integrationKey,\n status: \"OutOfSync\",\n serviceName: service.name,\n team: service.teams?.[0]?.name ?? \"\",\n escalationPolicy: service.escalation_policy !== undefined ? service.escalation_policy.name : \"\",\n serviceUrl: service.html_url,\n account: service.account,\n });\n }\n } else if (entityRef !== entityMapping.entityRef) {\n const entityRefName = componentEntities.items.find((entity) => `${entity.kind}:${entity.metadata.namespace}/${entity.metadata.name}`.toLowerCase() === entityMapping.entityRef)?.metadata.name ?? \"\";\n\n result.mappings.push({\n entityRef: entityMapping.entityRef !== \"\" ? entityMapping.entityRef : \"\",\n entityName: entityMapping.entityRef !== \"\" ? entityRefName : \"\",\n serviceId: entityMapping.serviceId,\n integrationKey: entityMapping.integrationKey,\n status: \"OutOfSync\",\n serviceName: service.name,\n team: service.teams?.[0]?.name ?? \"\",\n escalationPolicy: service.escalation_policy !== undefined ? service.escalation_policy.name : \"\",\n serviceUrl: service.html_url,\n account: service.account,\n });\n } else if (entityRef === entityMapping.entityRef) {\n result.mappings.push({\n entityRef: entityMapping.entityRef !== \"\" ? entityMapping.entityRef : \"\",\n entityName: entityMapping.entityRef !== \"\" ? entityName : \"\",\n serviceId: entityMapping.serviceId,\n integrationKey: entityMapping.integrationKey,\n status: \"InSync\",\n serviceName: service.name,\n team: service.teams?.[0]?.name ?? \"\",\n escalationPolicy: service.escalation_policy !== undefined ? service.escalation_policy.name : \"\",\n serviceUrl: service.html_url,\n account: service.account,\n });\n }\n } else {\n const backstageVendorId = 'PRO19CT';\n const backstageIntegrationKey = service.integrations?.find((integration) => integration.vendor?.id === backstageVendorId)?.integration_key ?? \"\";\n\n if (entityRef !== undefined) {\n result.mappings.push({\n entityRef: entityRef,\n entityName: entityName,\n serviceId: service.id,\n integrationKey: backstageIntegrationKey,\n status: \"InSync\",\n serviceName: service.name,\n team: service.teams?.[0]?.name ?? \"\",\n escalationPolicy: service.escalation_policy !== undefined ? service.escalation_policy.name : \"\",\n serviceUrl: service.html_url,\n account: service.account,\n });\n } else {\n result.mappings.push({\n entityRef: \"\",\n entityName: \"\",\n serviceId: service.id,\n integrationKey: backstageIntegrationKey,\n status: \"NotMapped\",\n serviceName: service.name,\n team: service.teams?.[0]?.name ?? \"\",\n escalationPolicy: service.escalation_policy !== undefined ? service.escalation_policy.name : \"\",\n serviceUrl: service.html_url,\n account: service.account,\n });\n }\n }\n });\n\n const sortedResult = result.mappings.sort((a, b) => {\n if (a.serviceName! < b.serviceName!) { return -1; }\n else if (a.serviceName! > b.serviceName!) { return 1; }\n return 0;\n });\n\n result.mappings = sortedResult;\n\n return result;\n}\n\nexport async function createRouter(\n options: RouterOptions\n): Promise<express.Router> {\n const { logger, config, store, catalogApi } = options;\n let { auth } = options;\n\n if (!auth) {\n auth = createLegacyAuthAdapters(options).auth;\n }\n\n // Get authentication Config\n await loadAuthConfig(config, logger);\n\n // Get optional PagerDuty custom endpoints from config\n loadPagerDutyEndpointsFromConfig(config, logger);\n\n // Create the router\n const router = Router();\n router.use(express.json());\n\n // DELETE /dependencies/service/:serviceId\n router.delete('/dependencies/service/:serviceId', async (request, response) => {\n try {\n // Get the serviceId from the request parameters\n const serviceId = request.params.serviceId || '';\n const account = request.query.account as string || '';\n\n if(serviceId === '') {\n response.status(400).json(\"Bad Request: ':serviceId' must be provided as part of the path\");\n return;\n }\n\n const dependencies: string[] = Object.keys(request.body).length === 0 ? [] : request.body;\n if(!dependencies || dependencies.length === 0) {\n response.status(400).json(\"Bad Request: 'dependencies' must be provided as part of the request body\");\n return;\n }\n\n const serviceRelations : PagerDutyServiceDependency[] = [];\n\n dependencies.forEach(async (dependency) => {\n serviceRelations.push({\n supporting_service: {\n id: dependency,\n type: \"service\"\n },\n dependent_service: {\n id: serviceId,\n type: \"service\"\n }\n });\n });\n\n await removeServiceRelationsFromService(serviceRelations, account);\n \n response.sendStatus(200);\n\n } catch (error) {\n if (error instanceof HttpError) {\n logger.error(`Error occurred while processing request: ${error.message}`);\n response.status(error.status).json({\n errors: [\n `${error.message}`\n ]\n });\n }\n }\n });\n\n // POST /dependencies/service/:serviceId\n router.post('/dependencies/service/:serviceId', async (request, response) => {\n try {\n // Get the serviceId from the request parameters\n const serviceId = request.params.serviceId || '';\n const account = request.query.account as string || '';\n\n if(serviceId === '') {\n response.status(400).json(\"Bad Request: ':serviceId' must be provided as part of the path\");\n return;\n }\n\n const dependencies: string[] = Object.keys(request.body).length === 0 ? [] : request.body;\n if(!dependencies || dependencies.length === 0) {\n response.status(400).json(\"Bad Request: 'dependencies' must be provided as part of the request body\");\n return;\n }\n\n const serviceRelations : PagerDutyServiceDependency[] = [];\n\n dependencies.forEach(async (dependency) => {\n serviceRelations.push({\n supporting_service: {\n id: dependency,\n type: \"service\"\n },\n dependent_service: {\n id: serviceId,\n type: \"service\"\n }\n });\n });\n\n await addServiceRelationsToService(serviceRelations, account);\n \n response.sendStatus(200);\n\n } catch (error) {\n if (error instanceof HttpError) {\n logger.error(`Error occurred while processing request: ${error.message}`);\n response.status(error.status).json({\n errors: [\n `${error.message}`\n ]\n });\n }\n }\n });\n\n\n router.get('/dependencies/service/:serviceId', async (request, response) => {\n try {\n const serviceId = request.params.serviceId;\n const account = request.query.account as string || '';\n\n if (serviceId) {\n const serviceRelationships: PagerDutyServiceDependency[] = await getServiceRelationshipsById(serviceId, account);\n\n if (serviceRelationships) {\n response.json({\n relationships: serviceRelationships\n });\n }\n }\n else {\n response.status(400).json(\"Bad Request: ':serviceId' must be provided as part of the path\");\n }\n }\n catch (error) {\n if (error instanceof HttpError) {\n response.status(error.status).json({\n errors: [\n `${error.message}`\n ]\n });\n }\n }\n });\n\n // GET /catalog/entity/:entityRef\n router.get('/catalog/entity/:type/:namespace/:name', async (request, response) => {\n const type = request.params.type;\n const namespace = request.params.namespace;\n const name = request.params.name;\n\n try {\n if (type && namespace && name) {\n const entityRef = `${type}:${namespace}/${name}`.toLowerCase();\n const foundEntity = await catalogApi?.getEntityByRef(entityRef);\n\n if (foundEntity) {\n response.json(foundEntity.metadata.annotations?.[\"pagerduty.com/service-id\"]);\n\n }\n else {\n response.status(404);\n }\n }\n else {\n response.status(400).json(\"Bad Request: ':entityRef' must be provided as part of the path\");\n }\n }\n catch (error) {\n if (error instanceof HttpError) {\n response.status(error.status).json({\n errors: [\n `${error.message}`\n ]\n });\n }\n }\n });\n\n // POST /settings\n router.post('/settings', async (request, response) => {\n try {\n // Get the serviceId from the request parameters\n const settings : PagerDutySetting[] = request.body;\n\n // For each setting, update or insert the value in the database\n await Promise.all(settings.map(async (setting) => {\n if(setting.id === undefined || setting.value === undefined) {\n response.status(400).json(\"Bad Request: 'id' and 'value' are required\");\n return;\n }\n\n if(!isValidSetting(setting.value)) {\n response.status(400).json(\"Bad Request: 'value' is invalid. Valid options are 'backstage', 'pagerduty', 'both' or 'disabled'\");\n return;\n }\n\n await store.updateSetting(setting);\n }));\n\n response.sendStatus(200);\n\n } catch (error) {\n if (error instanceof HttpError) {\n logger.error(`Error occurred while processing request: ${error.message}`);\n response.status(error.status).json({\n errors: [\n `${error.message}`\n ]\n });\n }\n }\n });\n\n // GET /settings/:settingId\n router.get('/settings/:settingId', async (request, response) => {\n try {\n // Get param from the request\n const settingId = request.params.settingId;\n \n // Find setting by id\n const setting = await store.findSetting(settingId);\n\n if (!setting) {\n response.status(404).json({});\n return;\n }\n\n response.json(setting);\n } catch (error) {\n if (error instanceof HttpError) {\n response.status(error.status).json({\n errors: [\n `${error.message}`\n ]\n });\n }\n }\n });\n\n function isValidSetting(value: string): boolean {\n if(value === \"backstage\" || value === \"pagerduty\" || value === \"both\" || value === \"disabled\") {\n return true;\n }\n\n return false;\n }\n\n // POST /mapping/entity\n router.post('/mapping/entity', async (request, response) => {\n try {\n // Get the serviceId from the request parameters\n const entity: PagerDutyEntityMapping = request.body;\n\n if (!entity.serviceId) {\n response.status(400).json(\"Bad Request: 'serviceId' must be provided as part of the request body\");\n return;\n }\n\n // Get all the entity mappings from the database\n const entityMappings = await store.getAllEntityMappings();\n const oldMapping = entityMappings.find((mapping) => mapping.serviceId === entity.serviceId);\n\n // in case a mapping is defined and no integration exists, \n // we need to create one\n if (entity.entityRef !== \"\" &&\n (entity.integrationKey === \"\" || entity.integrationKey === undefined)) {\n\n const backstageVendorId = 'PRO19CT';\n // check for existing integration key on service\n const service = await getServiceById(entity.serviceId, entity.account);\n const backstageIntegration = service.integrations?.find((integration) => integration.vendor?.id === backstageVendorId);\n\n if (!backstageIntegration) {\n // If an integration does not exist for service, \n // create it in PagerDuty\n const integrationKey = await createServiceIntegration({\n serviceId: entity.serviceId,\n vendorId: backstageVendorId,\n account: entity.account\n });\n\n entity.integrationKey = integrationKey;\n } else {\n entity.integrationKey = backstageIntegration.integration_key;\n }\n }\n\n const entityMappingId = await store.insertEntityMapping(entity);\n\n // Refresh new and old entity unless they are empty strings\n if (entity.entityRef !== \"\") {\n // force refresh of new entity\n await catalogApi?.refreshEntity(entity.entityRef);\n }\n\n if (oldMapping && oldMapping.entityRef !== \"\") {\n // force refresh of old entity\n await catalogApi?.refreshEntity(oldMapping.entityRef);\n }\n\n response.json({\n id: entityMappingId,\n entityRef: entity.entityRef,\n integrationKey: entity.integrationKey,\n serviceId: entity.serviceId,\n status: entity.status,\n account: entity.account,\n });\n } catch (error) {\n if (error instanceof HttpError) {\n logger.error(`Error occurred while processing request: ${error.message}`);\n response.status(error.status).json({\n errors: [\n `${error.message}`\n ]\n });\n }\n }\n });\n\n // GET /mapping/entity\n router.get('/mapping/entity', async (_, response) => {\n try {\n // Get all the entity mappings from the database\n const entityMappings = await store.getAllEntityMappings();\n\n // Get all the entities from the catalog\n const componentEntities = await catalogApi!.getEntities({\n filter: {\n kind: 'Component',\n }\n });\n\n // Build reference dictionary of componentEntities with serviceId as the key and entity reference and name pair as the value\n const componentEntitiesDict: Record<string, { ref: string, name: string }> = await createComponentEntitiesReferenceDict(componentEntities);\n\n // Get all services from PagerDuty\n const pagerDutyServices = await getAllServices();\n\n // Build the response object\n const result: PagerDutyEntityMappingsResponse = await buildEntityMappingsResponse(entityMappings, componentEntitiesDict, componentEntities, pagerDutyServices);\n\n response.json(result);\n } catch (error) {\n if (error instanceof HttpError) {\n response.status(error.status).json({\n errors: [\n `${error.message}`\n ]\n });\n }\n }\n });\n\n // GET /mapping/entity\n router.get('/mapping/entity/:type/:namespace/:name', async (request, response) => {\n try {\n // Get the type, namespace and entity name from the request parameters\n const entityType: string = request.params.type || '';\n const entityNamespace: string = request.params.namespace || '';\n const entityName: string = request.params.name || '';\n\n if (entityType === ''\n || entityNamespace === ''\n || entityName === '') {\n response.status(400).json(\"Required params not specified.\");\n return;\n }\n\n const entityRef = `${entityType}:${entityNamespace}/${entityName}`.toLowerCase();\n\n // Get all the entity mappings from the database\n const entityMapping = await store.findEntityMappingByEntityRef(entityRef);\n\n if (!entityMapping) {\n response.status(404).json(`Mapping for entityRef ${entityRef} not found.`);\n return;\n }\n\n response.json({\n mapping: entityMapping\n });\n\n } catch (error) {\n if (error instanceof HttpError) {\n response.status(error.status).json({\n errors: [\n `${error.message}`\n ]\n });\n }\n }\n });\n\n // GET /mapping/entity/service/:serviceId\n router.get('/mapping/entity/service/:serviceId', async (request, response) => {\n try {\n // Get the type, namespace and entity name from the request parameters\n const serviceId: string = request.params.serviceId ?? '';\n\n if (serviceId === '') {\n response.status(400).json(\"Required params not specified.\");\n return;\n }\n\n // Get all the entity mappings from the database\n const entityMapping = await store.findEntityMappingByServiceId(serviceId);\n\n if (!entityMapping) {\n response.status(404).json(`Mapping for serviceId ${serviceId} not found.`);\n return;\n }\n\n response.json({\n mapping: entityMapping\n });\n\n } catch (error) {\n if (error instanceof HttpError) {\n response.status(error.status).json({\n errors: [\n `${error.message}`\n ]\n });\n }\n }\n });\n\n // GET /escalation_policies\n router.get('/escalation_policies', async (_, response) => {\n\n try {\n let escalationPolicyList = await getAllEscalationPolicies();\n\n // sort the escalation policies by account and name\n escalationPolicyList = escalationPolicyList.sort((a, b) => {\n if (a.account === b.account) {\n return a.name.localeCompare(b.name);\n }\n return a.account!.localeCompare(b.account!);\n });\n\n const escalationPolicyDropDownOptions = escalationPolicyList.map((policy) => {\n let policyLabel = policy.name;\n if (policy.account && policy.account !== 'default') {\n policyLabel = `(${policy.account}) ${policy.name}`;\n }\n\n return {\n label: policyLabel,\n value: policy.id,\n };\n });\n\n response.json(escalationPolicyDropDownOptions);\n } catch (error) {\n if (error instanceof HttpError) {\n response.status(error.status).json({\n errors: [\n `${error.message}`\n ]\n });\n }\n }\n });\n\n // GET /oncall\n router.get('/oncall-users', async (request, response) => {\n try {\n // Get the escalation policy ID from the request parameters with parameter name \"escalation_policy_ids[]\"\n const escalationPolicyId: string = request.query.escalation_policy_ids as string || '';\n const account = request.query.account as string || '';\n\n if (escalationPolicyId === '') {\n response.status(400).json(\"Bad Request: 'escalation_policy_ids[]' is required\");\n return;\n }\n\n const oncallUsers = await getOncallUsers(escalationPolicyId, account);\n const onCallUsersResponse: PagerDutyOnCallUsersResponse = {\n users: oncallUsers\n };\n\n response.json(onCallUsersResponse);\n } catch (error) {\n if (error instanceof HttpError) {\n response.status(error.status).json({\n errors: [\n `${error.message}`\n ]\n });\n }\n }\n });\n\n // GET /services/:serviceId\n router.get('/services/:serviceId', async (request, response) => {\n try {\n // Get the serviceId from the request parameters\n const serviceId: string = request.params.serviceId || '';\n const account = request.query.account as string || '';\n\n if (serviceId === '') {\n response.status(400).json(\"Bad Request: ':serviceId' must be provided as part of the path or 'integration_key' as a query parameter\");\n return;\n }\n\n const service = await getServiceById(serviceId, account);\n const serviceResponse: PagerDutyServiceResponse = {\n service: service\n }\n\n response.json(serviceResponse);\n } catch (error) {\n if (error instanceof HttpError) {\n response.status(error.status).json({\n errors: [\n `${error.message}`\n ]\n });\n }\n }\n });\n\n // GET /services?integration_key=:integrationKey\n router.get('/services', async (request, response) => {\n try {\n // Get the serviceId from the request parameters\n const integrationKey: string = request.query.integration_key as string || '';\n const account = request.query.account as string || '';\n\n if (integrationKey !== '') {\n const service = await getServiceByIntegrationKey(integrationKey, account);\n const serviceResponse: PagerDutyServiceResponse = {\n service: service\n }\n\n response.json(serviceResponse);\n } else {\n const services = await getAllServices();\n const servicesResponse: PagerDutyServicesResponse = {\n services: services\n }\n\n response.json(servicesResponse);\n }\n } catch (error) {\n if (error instanceof HttpError) {\n response.status(error.status).json({\n errors: [\n `${error.message}`\n ]\n });\n }\n }\n });\n\n // POST /services/:serviceId/integration/:vendorId\n router.post('/services/:serviceId/integration/:vendorId', async (request, response) => {\n try {\n const serviceId: string = request.params.serviceId || '';\n const vendorId: string = request.params.vendorId || '';\n const account = request.query.account as string || '';\n\n if (serviceId === '' || vendorId === '') {\n response.status(400).json(\"Bad Request: ':serviceId' and ':vendorId' must be provided as part of the path\");\n return;\n }\n\n const integrationKey = await createServiceIntegration({\n serviceId,\n vendorId,\n account\n });\n\n response.json(integrationKey);\n } catch (error) {\n if (error instanceof HttpError) {\n logger.error(`Error occurred while processing request: ${error.message}`);\n response.status(error.status).json({\n errors: [\n `${error.message}`\n ]\n });\n }\n }\n });\n\n // GET /services/:serviceId/change-events\n router.get('/services/:serviceId/change-events', async (request, response) => {\n try {\n // Get the serviceId from the request parameters\n const serviceId: string = request.params.serviceId || '';\n const account = request.query.account as string || '';\n\n const changeEvents = await getChangeEvents(serviceId, account);\n const changeEventsResponse: PagerDutyChangeEventsResponse = {\n change_events: changeEvents\n }\n\n response.json(changeEventsResponse);\n } catch (error) {\n if (error instanceof HttpError) {\n response.status(error.status).json({\n errors: [\n `${error.message}`\n ]\n });\n }\n }\n });\n\n // GET /services/:serviceId/incidents\n router.get('/services/:serviceId/incidents', async (request, response) => {\n try {\n // Get the serviceId from the request parameters\n const serviceId: string = request.params.serviceId || '';\n const account = request.query.account as string || '';\n\n const incidents = await getIncidents(serviceId, account);\n const incidentsResponse: PagerDutyIncidentsResponse = {\n incidents\n }\n\n response.json(incidentsResponse);\n } catch (error) {\n if (error instanceof HttpError) {\n response.status(error.status).json({\n errors: [\n `${error.message}`\n ]\n });\n }\n }\n });\n\n // GET /services/:serviceId/standards\n router.get('/services/:serviceId/standards', async (request, response) => {\n try {\n\n // Get the serviceId from the request parameters\n const serviceId: string = request.params.serviceId || '';\n const account = request.query.account as string || '';\n\n const serviceStandards = await getServiceStandards(serviceId, account);\n const serviceStandardsResponse: PagerDutyServiceStandardsResponse = {\n standards: serviceStandards\n }\n\n response.json(serviceStandardsResponse);\n } catch (error) {\n if (error instanceof HttpError) {\n response.status(error.status).json({\n errors: [\n `${error.message}`\n ]\n });\n }\n }\n });\n\n // GET /services/:serviceId/metrics\n router.get('/services/:serviceId/metrics', async (request, response) => {\n try {\n // Get the serviceId from the request parameters\n const serviceId: string = request.params.serviceId || '';\n const account = request.query.account as string || '';\n\n const metrics = await getServiceMetrics(serviceId, account);\n\n\n const metricsResponse: PagerDutyServiceMetricsResponse = {\n metrics: metrics\n };\n\n response.json(metricsResponse);\n\n } catch (error) {\n if (error instanceof HttpError) {\n response.status(error.status).json({\n errors: [\n `${error.message}`\n ]\n });\n }\n }\n });\n\n // GET /health\n router.get('/health', async (_, response) => {\n response.status(200).json({ status: 'ok' });\n });\n\n // Add error handler\n router.use(errorHandler());\n\n // Return the router\n return router;\n}\n"],"names":["getServiceByIntegrationKey","auth","createLegacyAuthAdapters","loadAuthConfig","loadPagerDutyEndpointsFromConfig","Router","express","removeServiceRelationsFromService","HttpError","addServiceRelationsToService","getServiceRelationshipsById","getServiceById","createServiceIntegration","getAllServices","getAllEscalationPolicies","getOncallUsers","getChangeEvents","getIncidents","getServiceStandards","getServiceMetrics","errorHandler"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqEA,eAAsB,oCAAA,CAAqC,EAAE,KAAA,EAAO,iBAAA,EAAkB,EAAgF;AAClK,EAAA,MAAM,wBAAuE,EAAC;AAE9E,EAAA,MAAM,OAAA,CAAQ,GAAA,CAAI,iBAAA,CAAkB,GAAA,CAAI,OAAO,MAAA,KAAW;AACtD,IAAA,MAAM,SAAA,GAAY,MAAA,CAAO,QAAA,CAAS,WAAA,GAAc,0BAA0B,CAAA;AAC1E,IAAA,MAAM,cAAA,GAAiB,MAAA,CAAO,QAAA,CAAS,WAAA,GAAc,+BAA+B,CAAA;AACpF,IAAA,MAAM,OAAA,GAAU,MAAA,CAAO,QAAA,CAAS,WAAA,GAAc,uBAAuB,CAAA;AAErE,IAAA,IAAI,SAAA,KAAc,MAAA,IAAa,SAAA,KAAc,EAAA,EAAI;AAC7C,MAAA,qBAAA,CAAsB,SAAS,CAAA,GAAI;AAAA,QAC/B,GAAA,EAAK,CAAA,EAAG,MAAA,CAAO,IAAI,CAAA,CAAA,EAAI,MAAA,CAAO,QAAA,CAAS,SAAS,CAAA,CAAA,EAAI,MAAA,CAAO,QAAA,CAAS,IAAI,GAAG,WAAA,EAAY;AAAA,QACvF,IAAA,EAA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,8 @@
|
|
|
25
25
|
},
|
|
26
26
|
"homepage": "https://pagerduty.github.io/backstage-plugin-docs/index.html",
|
|
27
27
|
"scripts": {
|
|
28
|
-
"start": "
|
|
29
|
-
"build": "
|
|
28
|
+
"start": "backstage-cli package start",
|
|
29
|
+
"build": "backstage-cli package build",
|
|
30
30
|
"lint": "backstage-cli package lint",
|
|
31
31
|
"test": "backstage-cli package test",
|
|
32
32
|
"clean": "backstage-cli package clean",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@backstage/plugin-catalog-node": "^1.12.4",
|
|
47
47
|
"@backstage/plugin-scaffolder-node": "^0.4.8",
|
|
48
48
|
"@material-ui/core": "^4.12.4",
|
|
49
|
-
"@pagerduty/backstage-plugin-common": "
|
|
49
|
+
"@pagerduty/backstage-plugin-common": "workspace:~",
|
|
50
50
|
"@rjsf/core": "^5.14.3",
|
|
51
51
|
"@types/express": "^4.17.6",
|
|
52
52
|
"express": "^4.20.0",
|
|
@@ -60,23 +60,14 @@
|
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@backstage/backend-test-utils": "^0.4.4",
|
|
63
|
-
"@backstage/cli": "^0.
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"@types/supertest": "^2.0.12",
|
|
67
|
-
"@types/uuid": "^9.0.8",
|
|
68
|
-
"@types/webpack-env": "1.18.4",
|
|
69
|
-
"better-sqlite3": "^10.0.0",
|
|
70
|
-
"jest-mock": "29.7.0",
|
|
71
|
-
"msw": "^1.0.0",
|
|
72
|
-
"supertest": "^6.2.4",
|
|
73
|
-
"typescript": "~5.3.0"
|
|
63
|
+
"@backstage/cli": "^0.33.0",
|
|
64
|
+
"jest-mock": "^30.0.2",
|
|
65
|
+
"supertest": "^7.1.3"
|
|
74
66
|
},
|
|
75
67
|
"files": [
|
|
76
68
|
"dist",
|
|
77
69
|
"config.d.ts",
|
|
78
70
|
"migrations/**/*.{js,d.ts}"
|
|
79
71
|
],
|
|
80
|
-
"configSchema": "config.d.ts"
|
|
81
|
-
|
|
82
|
-
}
|
|
72
|
+
"configSchema": "config.d.ts"
|
|
73
|
+
}
|
package/LICENSE
DELETED
|
@@ -1,201 +0,0 @@
|
|
|
1
|
-
Apache License
|
|
2
|
-
Version 2.0, January 2004
|
|
3
|
-
http://www.apache.org/licenses/
|
|
4
|
-
|
|
5
|
-
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
-
|
|
7
|
-
1. Definitions.
|
|
8
|
-
|
|
9
|
-
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
-
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
-
|
|
12
|
-
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
-
the copyright owner that is granting the License.
|
|
14
|
-
|
|
15
|
-
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
-
other entities that control, are controlled by, or are under common
|
|
17
|
-
control with that entity. For the purposes of this definition,
|
|
18
|
-
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
-
direction or management of such entity, whether by contract or
|
|
20
|
-
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
-
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
-
|
|
23
|
-
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
-
exercising permissions granted by this License.
|
|
25
|
-
|
|
26
|
-
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
-
including but not limited to software source code, documentation
|
|
28
|
-
source, and configuration files.
|
|
29
|
-
|
|
30
|
-
"Object" form shall mean any form resulting from mechanical
|
|
31
|
-
transformation or translation of a Source form, including but
|
|
32
|
-
not limited to compiled object code, generated documentation,
|
|
33
|
-
and conversions to other media types.
|
|
34
|
-
|
|
35
|
-
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
-
Object form, made available under the License, as indicated by a
|
|
37
|
-
copyright notice that is included in or attached to the work
|
|
38
|
-
(an example is provided in the Appendix below).
|
|
39
|
-
|
|
40
|
-
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
-
form, that is based on (or derived from) the Work and for which the
|
|
42
|
-
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
-
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
-
of this License, Derivative Works shall not include works that remain
|
|
45
|
-
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
-
the Work and Derivative Works thereof.
|
|
47
|
-
|
|
48
|
-
"Contribution" shall mean any work of authorship, including
|
|
49
|
-
the original version of the Work and any modifications or additions
|
|
50
|
-
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
-
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
-
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
-
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
-
means any form of electronic, verbal, or written communication sent
|
|
55
|
-
to the Licensor or its representatives, including but not limited to
|
|
56
|
-
communication on electronic mailing lists, source code control systems,
|
|
57
|
-
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
-
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
-
excluding communication that is conspicuously marked or otherwise
|
|
60
|
-
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
-
|
|
62
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
-
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
-
subsequently incorporated within the Work.
|
|
65
|
-
|
|
66
|
-
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
-
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
-
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
-
Work and such Derivative Works in Source or Object form.
|
|
72
|
-
|
|
73
|
-
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
-
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
-
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
-
(except as stated in this section) patent license to make, have made,
|
|
77
|
-
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
-
where such license applies only to those patent claims licensable
|
|
79
|
-
by such Contributor that are necessarily infringed by their
|
|
80
|
-
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
-
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
-
institute patent litigation against any entity (including a
|
|
83
|
-
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
-
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
-
or contributory patent infringement, then any patent licenses
|
|
86
|
-
granted to You under this License for that Work shall terminate
|
|
87
|
-
as of the date such litigation is filed.
|
|
88
|
-
|
|
89
|
-
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
-
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
-
modifications, and in Source or Object form, provided that You
|
|
92
|
-
meet the following conditions:
|
|
93
|
-
|
|
94
|
-
(a) You must give any other recipients of the Work or
|
|
95
|
-
Derivative Works a copy of this License; and
|
|
96
|
-
|
|
97
|
-
(b) You must cause any modified files to carry prominent notices
|
|
98
|
-
stating that You changed the files; and
|
|
99
|
-
|
|
100
|
-
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
-
that You distribute, all copyright, patent, trademark, and
|
|
102
|
-
attribution notices from the Source form of the Work,
|
|
103
|
-
excluding those notices that do not pertain to any part of
|
|
104
|
-
the Derivative Works; and
|
|
105
|
-
|
|
106
|
-
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
-
distribution, then any Derivative Works that You distribute must
|
|
108
|
-
include a readable copy of the attribution notices contained
|
|
109
|
-
within such NOTICE file, excluding those notices that do not
|
|
110
|
-
pertain to any part of the Derivative Works, in at least one
|
|
111
|
-
of the following places: within a NOTICE text file distributed
|
|
112
|
-
as part of the Derivative Works; within the Source form or
|
|
113
|
-
documentation, if provided along with the Derivative Works; or,
|
|
114
|
-
within a display generated by the Derivative Works, if and
|
|
115
|
-
wherever such third-party notices normally appear. The contents
|
|
116
|
-
of the NOTICE file are for informational purposes only and
|
|
117
|
-
do not modify the License. You may add Your own attribution
|
|
118
|
-
notices within Derivative Works that You distribute, alongside
|
|
119
|
-
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
-
that such additional attribution notices cannot be construed
|
|
121
|
-
as modifying the License.
|
|
122
|
-
|
|
123
|
-
You may add Your own copyright statement to Your modifications and
|
|
124
|
-
may provide additional or different license terms and conditions
|
|
125
|
-
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
-
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
-
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
-
the conditions stated in this License.
|
|
129
|
-
|
|
130
|
-
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
-
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
-
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
-
this License, without any additional terms or conditions.
|
|
134
|
-
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
-
the terms of any separate license agreement you may have executed
|
|
136
|
-
with Licensor regarding such Contributions.
|
|
137
|
-
|
|
138
|
-
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
-
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
-
except as required for reasonable and customary use in describing the
|
|
141
|
-
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
-
|
|
143
|
-
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
-
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
-
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
-
implied, including, without limitation, any warranties or conditions
|
|
148
|
-
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
-
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
-
appropriateness of using or redistributing the Work and assume any
|
|
151
|
-
risks associated with Your exercise of permissions under this License.
|
|
152
|
-
|
|
153
|
-
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
-
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
-
unless required by applicable law (such as deliberate and grossly
|
|
156
|
-
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
-
liable to You for damages, including any direct, indirect, special,
|
|
158
|
-
incidental, or consequential damages of any character arising as a
|
|
159
|
-
result of this License or out of the use or inability to use the
|
|
160
|
-
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
-
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
-
other commercial damages or losses), even if such Contributor
|
|
163
|
-
has been advised of the possibility of such damages.
|
|
164
|
-
|
|
165
|
-
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
-
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
-
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
-
or other liability obligations and/or rights consistent with this
|
|
169
|
-
License. However, in accepting such obligations, You may act only
|
|
170
|
-
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
-
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
-
defend, and hold each Contributor harmless for any liability
|
|
173
|
-
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
-
of your accepting any such warranty or additional liability.
|
|
175
|
-
|
|
176
|
-
END OF TERMS AND CONDITIONS
|
|
177
|
-
|
|
178
|
-
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
-
|
|
180
|
-
To apply the Apache License to your work, attach the following
|
|
181
|
-
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
-
replaced with your own identifying information. (Don't include
|
|
183
|
-
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
-
comment syntax for the file format. We also recommend that a
|
|
185
|
-
file or class name and description of purpose be included on the
|
|
186
|
-
same "printed page" as the copyright notice for easier
|
|
187
|
-
identification within third-party archives.
|
|
188
|
-
|
|
189
|
-
Copyright [yyyy] [name of copyright owner]
|
|
190
|
-
|
|
191
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
-
you may not use this file except in compliance with the License.
|
|
193
|
-
You may obtain a copy of the License at
|
|
194
|
-
|
|
195
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
-
|
|
197
|
-
Unless required by applicable law or agreed to in writing, software
|
|
198
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
-
See the License for the specific language governing permissions and
|
|
201
|
-
limitations under the License.
|
package/README.md
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
# PagerDuty plugin for Backstage - Backend
|
|
2
|
-
|
|
3
|
-
[](https://github.com/PagerDuty/backstage-plugin-backend/actions/workflows/on_release_created.yml)
|
|
4
|
-
[](https://badge.fury.io/js/@pagerduty%2Fbackstage-plugin-backend)
|
|
5
|
-
[](https://opensource.org/licenses/Apache-2.0)
|
|
6
|
-
|
|
7
|
-
**Bring the power of PagerDuty to Backstage!**
|
|
8
|
-
The PagerDuty backend plugin reduces the cognitive load on developers responsible for maintaining services in production. Instead of having to go to PagerDuty's console, you can now access the necessary information directly within Backstage. This includes finding active incidents or opening a new incident, reviewing recent changes made to the service, and checking who is on-call.
|
|
9
|
-
|
|
10
|
-
The PagerDuty backend plugin augments the capabilities of the [PagerDuty frontend plugin](https://github.com/PagerDuty/backstage-plugin) by improving security and enabling PagerDuty a standardization through easy configuration.
|
|
11
|
-
|
|
12
|
-
## Features
|
|
13
|
-
|
|
14
|
-
- **REST APIs** The backend is responsible for all requests to PagerDuty REST APIs. Centralizing these in the backend plugin allows us to only expose the information the frontend needs and therefore improve security and performance.
|
|
15
|
-
|
|
16
|
-
## Getting Started
|
|
17
|
-
|
|
18
|
-
Find the complete project's documentation [here](https://pagerduty.github.io/backstage-plugin-docs/).
|
|
19
|
-
|
|
20
|
-
### Installation
|
|
21
|
-
|
|
22
|
-
The installation of the PagerDuty plugin for Backstage is done with *yarn* as all other plugins in Backstage. This plugin follows a modular approach which means that every individual component will be a separate package (e.g. frontend, backend, common). In this case, you are installing a **backend plugin**.
|
|
23
|
-
|
|
24
|
-
To install this plugin run the following command from the Backstage root folder.
|
|
25
|
-
|
|
26
|
-
```bash
|
|
27
|
-
yarn add --cwd packages/backend @pagerduty/backstage-plugin-backend @pagerduty/backstage-plugin-common
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
### Configuration
|
|
31
|
-
|
|
32
|
-
To use the backend plugin follow the instructions on the `Add the backend plugin to your application` section of the project's documentation [here](https://pagerduty.github.io/backstage-plugin-docs/getting-started/backstage/#add-the-backend-plugin-to-your-application).
|
|
33
|
-
|
|
34
|
-
## Support
|
|
35
|
-
|
|
36
|
-
If you need help with this plugin, please open an issue in [GitHub](https://github.com/PagerDuty/backstage-plugin-backend), reach out on the [Backstage Discord server](https://discord.gg/backstage-687207715902193673) or [PagerDuty's community forum](https://community.pagerduty.com).
|
|
37
|
-
|
|
38
|
-
## Contributing
|
|
39
|
-
|
|
40
|
-
If you are interested in contributing to this project, please refer to our [Contributing Guidelines](https://github.com/PagerDuty/backstage-plugin-backend/blob/main/CONTRIBUTING.md).
|
|
41
|
-
|
|
42
|
-
<a href="https://next.ossinsight.io/widgets/official/compose-contributors?limit=30&repo_id=721084927" target="_blank" style="display: block" align="center">
|
|
43
|
-
<picture>
|
|
44
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://next.ossinsight.io/widgets/official/compose-contributors/thumbnail.png?limit=30&repo_id=721084927&image_size=auto&color_scheme=dark" width="655" height="auto">
|
|
45
|
-
<img alt="Contributors of PagerDuty/backstage-plugin-backend" src="https://next.ossinsight.io/widgets/official/compose-contributors/thumbnail.png?limit=30&repo_id=721084927&image_size=auto&color_scheme=light" width="655" height="auto">
|
|
46
|
-
</picture>
|
|
47
|
-
</a>
|
|
48
|
-
|
|
49
|
-
<!-- Made with [OSS Insight](https://ossinsight.io/) -->
|
package/dist/index.d.ts
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import * as _backstage_backend_plugin_api from '@backstage/backend-plugin-api';
|
|
2
|
-
import { LoggerService, RootConfigService, DiscoveryService, AuthService } from '@backstage/backend-plugin-api';
|
|
3
|
-
import { PagerDutyEntityMapping, PagerDutySetting, PagerDutyService, PagerDutyEntityMappingsResponse } from '@pagerduty/backstage-plugin-common';
|
|
4
|
-
import * as express from 'express';
|
|
5
|
-
import { CatalogApi, GetEntitiesResponse } from '@backstage/catalog-client';
|
|
6
|
-
|
|
7
|
-
type RawDbEntityResultRow = {
|
|
8
|
-
id: string;
|
|
9
|
-
entityRef: string;
|
|
10
|
-
serviceId: string;
|
|
11
|
-
integrationKey: string;
|
|
12
|
-
account?: string;
|
|
13
|
-
processedDate?: Date;
|
|
14
|
-
};
|
|
15
|
-
/** @public */
|
|
16
|
-
interface PagerDutyBackendStore {
|
|
17
|
-
insertEntityMapping(entity: PagerDutyEntityMapping): Promise<string>;
|
|
18
|
-
getAllEntityMappings(): Promise<RawDbEntityResultRow[]>;
|
|
19
|
-
findEntityMappingByEntityRef(entityRef: string): Promise<RawDbEntityResultRow | undefined>;
|
|
20
|
-
findEntityMappingByServiceId(serviceId: string): Promise<RawDbEntityResultRow | undefined>;
|
|
21
|
-
updateSetting(setting: PagerDutySetting): Promise<string>;
|
|
22
|
-
findSetting(settingId: string): Promise<PagerDutySetting | undefined>;
|
|
23
|
-
getAllSettings(): Promise<PagerDutySetting[]>;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
interface RouterOptions {
|
|
27
|
-
logger: LoggerService;
|
|
28
|
-
config: RootConfigService;
|
|
29
|
-
store: PagerDutyBackendStore;
|
|
30
|
-
discovery: DiscoveryService;
|
|
31
|
-
auth?: AuthService;
|
|
32
|
-
catalogApi?: CatalogApi;
|
|
33
|
-
}
|
|
34
|
-
type Annotations = {
|
|
35
|
-
"pagerduty.com/integration-key": string;
|
|
36
|
-
"pagerduty.com/service-id": string;
|
|
37
|
-
"pagerduty.com/account": string;
|
|
38
|
-
};
|
|
39
|
-
declare function createComponentEntitiesReferenceDict({ items: componentEntities }: GetEntitiesResponse): Promise<Record<string, {
|
|
40
|
-
ref: string;
|
|
41
|
-
name: string;
|
|
42
|
-
}>>;
|
|
43
|
-
declare function buildEntityMappingsResponse(entityMappings: RawDbEntityResultRow[], componentEntitiesDict: Record<string, {
|
|
44
|
-
ref: string;
|
|
45
|
-
name: string;
|
|
46
|
-
}>, componentEntities: GetEntitiesResponse, pagerDutyServices: PagerDutyService[]): Promise<PagerDutyEntityMappingsResponse>;
|
|
47
|
-
declare function createRouter(options: RouterOptions): Promise<express.Router>;
|
|
48
|
-
|
|
49
|
-
/** @public */
|
|
50
|
-
declare const pagerDutyPlugin: _backstage_backend_plugin_api.BackendFeatureCompat;
|
|
51
|
-
|
|
52
|
-
export { type Annotations, type RouterOptions, buildEntityMappingsResponse, createComponentEntitiesReferenceDict, createRouter, pagerDutyPlugin as default };
|