@pagerduty/backstage-plugin-backend 0.8.2 → 0.9.0-next.1

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/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as _backstage_backend_plugin_api from '@backstage/backend-plugin-api';
2
2
  import { LoggerService, RootConfigService, DiscoveryService, AuthService } from '@backstage/backend-plugin-api';
3
- import { PagerDutyEntityMapping, PagerDutyService, PagerDutyEntityMappingsResponse } from '@pagerduty/backstage-plugin-common';
3
+ import { PagerDutyEntityMapping, PagerDutySetting, PagerDutyService, PagerDutyEntityMappingsResponse } from '@pagerduty/backstage-plugin-common';
4
4
  import * as express from 'express';
5
5
  import { CatalogApi, GetEntitiesResponse } from '@backstage/catalog-client';
6
6
 
@@ -17,6 +17,10 @@ interface PagerDutyBackendStore {
17
17
  insertEntityMapping(entity: PagerDutyEntityMapping): Promise<string>;
18
18
  getAllEntityMappings(): Promise<RawDbEntityResultRow[]>;
19
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[]>;
20
24
  }
21
25
 
22
26
  interface RouterOptions {
@@ -43,6 +47,6 @@ declare function buildEntityMappingsResponse(entityMappings: RawDbEntityResultRo
43
47
  declare function createRouter(options: RouterOptions): Promise<express.Router>;
44
48
 
45
49
  /** @public */
46
- declare const pagerDutyPlugin: _backstage_backend_plugin_api.BackendFeatureCompat;
50
+ declare const pagerDutyPlugin: () => _backstage_backend_plugin_api.BackendFeature;
47
51
 
48
52
  export { type Annotations, type RouterOptions, buildEntityMappingsResponse, createComponentEntitiesReferenceDict, createRouter, pagerDutyPlugin as default };
@@ -0,0 +1,27 @@
1
+ /**
2
+ * @param {import('knex').Knex} knex
3
+ */
4
+ exports.up = async function up(knex) {
5
+ await knex.schema.createTable('pagerduty_settings', table => {
6
+ table
7
+ .string('id')
8
+ .unique()
9
+ .notNullable();
10
+ table
11
+ .string('value');
12
+ table
13
+ .dateTime('updatedAt')
14
+ .defaultTo(knex.fn.now());
15
+ table.index(['id'], 'settings_id_idx');
16
+ });
17
+ };
18
+
19
+ /**
20
+ * @param {import('knex').Knex} knex
21
+ */
22
+ exports.down = async function down(knex) {
23
+ await knex.schema.alterTable('pagerduty_settings', table => {
24
+ table.dropIndex([], 'settings_id_idx');
25
+ });
26
+ await knex.schema.dropTable('pagerduty_settings');
27
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pagerduty/backstage-plugin-backend",
3
- "version": "0.8.2",
3
+ "version": "0.9.0-next.1",
4
4
  "main": "dist/index.cjs.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "license": "Apache-2.0",
@@ -10,8 +10,6 @@
10
10
  "types": "dist/index.d.ts"
11
11
  },
12
12
  "backstage": {
13
- "pluginPackages": "pagerduty",
14
- "pluginId": "backend",
15
13
  "role": "backend-plugin"
16
14
  },
17
15
  "repository": {
@@ -29,19 +27,19 @@
29
27
  "postpack": "backstage-cli package postpack"
30
28
  },
31
29
  "dependencies": {
32
- "@backstage/backend-common": "^0.23.3",
33
- "@backstage/backend-defaults": "^0.4.1",
34
- "@backstage/backend-plugin-api": "^0.7.0",
35
- "@backstage/backend-tasks": "^0.5.27",
30
+ "@backstage/backend-common": "^0.22.0",
31
+ "@backstage/backend-defaults": "^0.2.18",
32
+ "@backstage/backend-plugin-api": "^0.6.18",
33
+ "@backstage/backend-tasks": "^0.5.25",
36
34
  "@backstage/catalog-client": "^1.6.5",
37
35
  "@backstage/catalog-model": "^1.5.0",
38
36
  "@backstage/config": "^1.2.0",
39
- "@backstage/core-plugin-api": "^1.9.3",
40
- "@backstage/plugin-catalog-common": "^1.0.25",
41
- "@backstage/plugin-catalog-node": "^1.12.4",
42
- "@backstage/plugin-scaffolder-node": "^0.4.8",
37
+ "@backstage/core-plugin-api": "^1.9.2",
38
+ "@backstage/plugin-catalog-common": "^1.0.24",
39
+ "@backstage/plugin-catalog-node": "^1.12.0",
40
+ "@backstage/plugin-scaffolder-node": "^0.4.4",
43
41
  "@material-ui/core": "^4.12.4",
44
- "@pagerduty/backstage-plugin-common": "0.2.0",
42
+ "@pagerduty/backstage-plugin-common": "0.2.1-next.5",
45
43
  "@rjsf/core": "^5.14.3",
46
44
  "@types/express": "^4.17.6",
47
45
  "express": "^4.19.2",
@@ -54,8 +52,8 @@
54
52
  "yn": "^4.0.0"
55
53
  },
56
54
  "devDependencies": {
57
- "@backstage/backend-test-utils": "^0.4.4",
58
- "@backstage/cli": "^0.26.11",
55
+ "@backstage/backend-test-utils": "^0.4.3",
56
+ "@backstage/cli": "^0.26.6",
59
57
  "@types/node": "^20.9.2",
60
58
  "@types/node-fetch": "2.6.11",
61
59
  "@types/supertest": "^2.0.12",