From 2e0332c5b7f9221e55d9250c485d010c79f900b1 Mon Sep 17 00:00:00 2001 From: Yaron Dayagi Date: Tue, 28 Nov 2023 17:28:55 +0200 Subject: [PATCH] remove notifications-common FLPATH-755 https://issues.redhat.com/browse/FLPATH-755 Signed-off-by: Yaron Dayagi --- plugins/notifications-backend/README.md | 4 ++ plugins/notifications-backend/package.json | 1 - .../src/service/handlers.ts | 10 ++--- .../src/service/router.ts | 2 +- .../src/service}/types.ts | 0 plugins/notifications-common/.eslintrc.js | 1 - plugins/notifications-common/README.md | 1 - plugins/notifications-common/package.json | 39 ------------------- plugins/notifications-common/src/index.ts | 1 - plugins/notifications-common/tsconfig.json | 9 ----- plugins/notifications-common/turbo.json | 9 ----- 11 files changed, 10 insertions(+), 67 deletions(-) rename plugins/{notifications-common/src => notifications-backend/src/service}/types.ts (100%) delete mode 100644 plugins/notifications-common/.eslintrc.js delete mode 100644 plugins/notifications-common/README.md delete mode 100644 plugins/notifications-common/package.json delete mode 100644 plugins/notifications-common/src/index.ts delete mode 100644 plugins/notifications-common/tsconfig.json delete mode 100644 plugins/notifications-common/turbo.json diff --git a/plugins/notifications-backend/README.md b/plugins/notifications-backend/README.md index f814629da7..50cc7e1623 100644 --- a/plugins/notifications-backend/README.md +++ b/plugins/notifications-backend/README.md @@ -136,3 +136,7 @@ A user the notifications are filtered for, all targetUsers or targetGroups must Refer [Backstage documentation](https://backstage.io/docs/auth/) for details. For the purpose of development, there is `users.yaml` listing example data. + +## Building a client for the API + +We supply an Open API spec YAML file: openapi.yaml. diff --git a/plugins/notifications-backend/package.json b/plugins/notifications-backend/package.json index cdcda84e4f..5957f28a20 100644 --- a/plugins/notifications-backend/package.json +++ b/plugins/notifications-backend/package.json @@ -27,7 +27,6 @@ "@backstage/backend-common": "0.19.8", "@backstage/catalog-client": "^1.4.5", "@backstage/config": "^1.1.1", - "@backstage/plugin-notifications-common": "0.1.0", "@types/express": "*", "express": "^4.18.2", "express-promise-router": "^4.1.1", diff --git a/plugins/notifications-backend/src/service/handlers.ts b/plugins/notifications-backend/src/service/handlers.ts index 316a2eba6e..90f19d86aa 100644 --- a/plugins/notifications-backend/src/service/handlers.ts +++ b/plugins/notifications-backend/src/service/handlers.ts @@ -1,5 +1,9 @@ /* eslint-disable func-names */ import { CatalogClient } from '@backstage/catalog-client'; + +import { Knex } from 'knex'; + +import { ActionsInsert, MessagesInsert } from './db'; import { CreateNotificationRequest, DefaultMessageScope, @@ -13,11 +17,7 @@ import { NotificationsOrderByDirections, NotificationsOrderByFields, NotificationsSortingRequest, -} from '@backstage/plugin-notifications-common'; - -import { Knex } from 'knex'; - -import { ActionsInsert, MessagesInsert } from './db'; +} from './types'; // createNotification // returns string id of created notification diff --git a/plugins/notifications-backend/src/service/router.ts b/plugins/notifications-backend/src/service/router.ts index 7bc07f155a..8f5dbaf12b 100644 --- a/plugins/notifications-backend/src/service/router.ts +++ b/plugins/notifications-backend/src/service/router.ts @@ -1,7 +1,6 @@ import { errorHandler } from '@backstage/backend-common'; import { CatalogClient } from '@backstage/catalog-client'; import { Config } from '@backstage/config'; -import { NotificationsSortingRequest } from '@backstage/plugin-notifications-common'; import express from 'express'; import Router from 'express-promise-router'; @@ -14,6 +13,7 @@ import { getNotificationsCount, setRead, } from './handlers'; +import { NotificationsSortingRequest } from './types'; interface RouterOptions { logger: Logger; diff --git a/plugins/notifications-common/src/types.ts b/plugins/notifications-backend/src/service/types.ts similarity index 100% rename from plugins/notifications-common/src/types.ts rename to plugins/notifications-backend/src/service/types.ts diff --git a/plugins/notifications-common/.eslintrc.js b/plugins/notifications-common/.eslintrc.js deleted file mode 100644 index e2a53a6ad2..0000000000 --- a/plugins/notifications-common/.eslintrc.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require('@backstage/cli/config/eslint-factory')(__dirname); diff --git a/plugins/notifications-common/README.md b/plugins/notifications-common/README.md deleted file mode 100644 index 4710084fb1..0000000000 --- a/plugins/notifications-common/README.md +++ /dev/null @@ -1 +0,0 @@ -TO BE WRITTEN diff --git a/plugins/notifications-common/package.json b/plugins/notifications-common/package.json deleted file mode 100644 index 00e463b938..0000000000 --- a/plugins/notifications-common/package.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "@backstage/plugin-notifications-common", - "description": "Library providing common types and functionality to be used by consuming plugins.", - "version": "0.1.0", - "main": "src/index.ts", - "types": "src/index.ts", - "license": "Apache-2.0", - "publishConfig": { - "access": "public", - "main": "dist/index.cjs.js", - "module": "dist/index.esm.js", - "types": "dist/index.d.ts" - }, - "backstage": { - "role": "common-library" - }, - "scripts": { - "build": "backstage-cli package build", - "tsc": "tsc", - "lint": "backstage-cli package lint", - "test": "backstage-cli package test --passWithNoTests --coverage", - "clean": "backstage-cli package clean", - "prepack": "backstage-cli package prepack", - "postpack": "backstage-cli package postpack" - }, - "devDependencies": { - "@backstage/cli": "0.22.9" - }, - "files": [ - "dist" - ], - "repository": "github:janus-idp/backstage-plugins", - "keywords": [ - "backstage", - "plugin" - ], - "homepage": "https://janus-idp.io/", - "bugs": "https://github.com/janus-idp/backstage-plugins/issues" -} diff --git a/plugins/notifications-common/src/index.ts b/plugins/notifications-common/src/index.ts deleted file mode 100644 index fcb073fefc..0000000000 --- a/plugins/notifications-common/src/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './types'; diff --git a/plugins/notifications-common/tsconfig.json b/plugins/notifications-common/tsconfig.json deleted file mode 100644 index 86a9212e9e..0000000000 --- a/plugins/notifications-common/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "@backstage/cli/config/tsconfig.json", - "include": ["src", "dev", "migrations"], - "exclude": ["node_modules"], - "compilerOptions": { - "outDir": "../../dist-types/plugins/notifications-common", - "rootDir": "." - } -} diff --git a/plugins/notifications-common/turbo.json b/plugins/notifications-common/turbo.json deleted file mode 100644 index 98d8058e7c..0000000000 --- a/plugins/notifications-common/turbo.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": ["//"], - "pipeline": { - "tsc": { - "outputs": ["../../dist-types/plugins/notifications-common/**"], - "dependsOn": ["^tsc"] - } - } -}