@pagerduty/backstage-plugin-backend 0.9.9 → 0.9.10

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.
Files changed (2) hide show
  1. package/dist/index.d.ts +53 -0
  2. package/package.json +13 -3
@@ -0,0 +1,53 @@
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 { buildEntityMappingsResponse, createComponentEntitiesReferenceDict, createRouter, pagerDutyPlugin as default };
53
+ export type { Annotations, RouterOptions };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pagerduty/backstage-plugin-backend",
3
- "version": "0.9.9",
3
+ "version": "0.9.10",
4
4
  "main": "dist/index.cjs.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "license": "Apache-2.0",
@@ -16,7 +16,10 @@
16
16
  "@pagerduty/backstage-plugin",
17
17
  "@pagerduty/backstage-plugin-common",
18
18
  "@pagerduty/backstage-plugin-backend"
19
- ]
19
+ ],
20
+ "features": {
21
+ ".": "@backstage/BackendFeature"
22
+ }
20
23
  },
21
24
  "repository": {
22
25
  "type": "git",
@@ -69,5 +72,12 @@
69
72
  "config.d.ts",
70
73
  "migrations/**/*.{js,d.ts}"
71
74
  ],
72
- "configSchema": "config.d.ts"
75
+ "configSchema": "config.d.ts",
76
+ "typesVersions": {
77
+ "*": {
78
+ "package.json": [
79
+ "package.json"
80
+ ]
81
+ }
82
+ }
73
83
  }