rename to UserSettingsStorage and adjust error handling

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2022-09-06 10:50:49 +02:00
parent 8f7e5a7517
commit 9895e6bfb2
15 changed files with 97 additions and 86 deletions
@@ -13,9 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { TestDatabaseId, TestDatabases } from '@backstage/backend-test-utils';
import { Knex } from 'knex';
import {
DatabaseUserSettingsStore,
RawDbUserSettingsRow,
@@ -13,13 +13,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {
PluginDatabaseManager,
resolvePackagePath,
} from '@backstage/backend-common';
import { NotFoundError } from '@backstage/errors';
import { Knex } from 'knex';
import { type UserSetting, UserSettingsStore } from './UserSettingsStore';
const migrationsDir = resolvePackagePath(
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export {
DatabaseUserSettingsStore,
type RawDbUserSettingsRow,
@@ -13,5 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export * from './service';
export * from './database';
+1
View File
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { getRootLogger } from '@backstage/backend-common';
import yn from 'yn';
@@ -13,4 +13,5 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export { createRouter, type RouterOptions } from './router';
@@ -13,11 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { AuthenticationError } from '@backstage/errors';
import { IdentityClient } from '@backstage/plugin-auth-node';
import express from 'express';
import request from 'supertest';
import { UserSettingsStore } from '../database';
import { createRouter } from './router';
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { errorHandler } from '@backstage/backend-common';
import { AuthenticationError, InputError } from '@backstage/errors';
import {
@@ -21,7 +22,6 @@ import {
} from '@backstage/plugin-auth-node';
import express, { Request } from 'express';
import Router from 'express-promise-router';
import { UserSettingsStore } from '../database';
/**
@@ -13,16 +13,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Server } from 'http';
import { createServiceBuilder, useHotMemoize } from '@backstage/backend-common';
import Knex from 'knex';
import { Logger } from 'winston';
import { DatabaseUserSettingsStore } from '../database';
import { createRouter } from './router';
import { IdentityClient } from '@backstage/plugin-auth-node';
import { Router } from 'express';
import { Server } from 'http';
import Knex from 'knex';
import { Logger } from 'winston';
import { DatabaseUserSettingsStore } from '../database';
import { createRouter } from './router';
export interface ServerOptions {
port: number;
@@ -13,4 +13,5 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export {};