add migration to remove the old tables, and some cleanup
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
@@ -238,7 +238,6 @@ export class BuiltinKindsEntityProcessor implements CatalogProcessor {
|
||||
|
||||
// @public
|
||||
export class CatalogBuilder {
|
||||
constructor(env: CatalogEnvironment);
|
||||
addEntityPolicy(...policies: EntityPolicy[]): CatalogBuilder;
|
||||
addEntityProvider(...providers: EntityProvider[]): CatalogBuilder;
|
||||
addPermissionRules(
|
||||
@@ -463,9 +462,7 @@ export function createRandomRefreshInterval(options: {
|
||||
maxSeconds: number;
|
||||
}): RefreshIntervalFunction;
|
||||
|
||||
// Warning: (ae-missing-release-tag) "createRouter" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
// @public
|
||||
export function createRouter(options: RouterOptions): Promise<express.Router>;
|
||||
|
||||
// Warning: (ae-missing-release-tag) "DefaultCatalogCollator" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
@@ -1080,9 +1077,7 @@ declare namespace results {
|
||||
}
|
||||
export { results };
|
||||
|
||||
// Warning: (ae-missing-release-tag) "RouterOptions" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
||||
//
|
||||
// @public (undocumented)
|
||||
// @public
|
||||
export interface RouterOptions {
|
||||
// (undocumented)
|
||||
config: Config;
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Copyright 2021 The Backstage Authors
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// @ts-check
|
||||
|
||||
/**
|
||||
* @param {import('knex').Knex} knex
|
||||
*/
|
||||
exports.up = async function up(knex) {
|
||||
await knex.schema.dropTable('entities_relations');
|
||||
await knex.schema.dropTable('entities_search');
|
||||
await knex.schema.dropTable('entities');
|
||||
};
|
||||
|
||||
exports.down = async function down() {};
|
||||
@@ -154,7 +154,7 @@ export class CatalogBuilder {
|
||||
return new CatalogBuilder(env);
|
||||
}
|
||||
|
||||
constructor(env: CatalogEnvironment) {
|
||||
private constructor(env: CatalogEnvironment) {
|
||||
this.env = env;
|
||||
this.entityPolicies = [];
|
||||
this.entityPoliciesReplace = false;
|
||||
|
||||
@@ -37,6 +37,11 @@ import {
|
||||
import { disallowReadonlyMode, validateRequestBody } from './util';
|
||||
import { RefreshOptions, LocationService, RefreshService } from './types';
|
||||
|
||||
/**
|
||||
* Options used by {@link createRouter}.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export interface RouterOptions {
|
||||
entitiesCatalog?: EntitiesCatalog;
|
||||
locationAnalyzer?: LocationAnalyzer;
|
||||
@@ -47,6 +52,11 @@ export interface RouterOptions {
|
||||
permissionIntegrationRouter?: express.Router;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a catalog router.
|
||||
*
|
||||
* @public
|
||||
*/
|
||||
export async function createRouter(
|
||||
options: RouterOptions,
|
||||
): Promise<express.Router> {
|
||||
|
||||
@@ -62,7 +62,7 @@ export async function startStandaloneServer(
|
||||
|
||||
logger.debug('Creating application...');
|
||||
await applyDatabaseMigrations(await database.getClient());
|
||||
const builder = new CatalogBuilder({
|
||||
const builder = CatalogBuilder.create({
|
||||
logger,
|
||||
database,
|
||||
config,
|
||||
|
||||
Reference in New Issue
Block a user