@backstage/plugin-catalog-backend 1.31.0 → 1.32.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/CHANGELOG.md +39 -0
- package/config.d.ts +7 -0
- package/dist/database/DefaultProviderDatabase.cjs.js +7 -0
- package/dist/database/DefaultProviderDatabase.cjs.js.map +1 -1
- package/dist/database/operations/provider/refreshByRefreshKeys.cjs.js +1 -1
- package/dist/database/operations/provider/refreshByRefreshKeys.cjs.js.map +1 -1
- package/dist/processing/evictEntitiesFromOrphanedProviders.cjs.js +47 -0
- package/dist/processing/evictEntitiesFromOrphanedProviders.cjs.js.map +1 -0
- package/dist/schema/openapi/generated/router.cjs.js +21 -5
- package/dist/schema/openapi/generated/router.cjs.js.map +1 -1
- package/dist/service/CatalogBuilder.cjs.js +9 -1
- package/dist/service/CatalogBuilder.cjs.js.map +1 -1
- package/package.json +22 -22
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,44 @@
|
|
|
1
1
|
# @backstage/plugin-catalog-backend
|
|
2
2
|
|
|
3
|
+
## 1.32.0-next.1
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- ca9c51b: Added opt-in ability to evict entities from the catalog whose provider is no longer configured. See [Catalog configuration documentation](https://backstage.io/docs/features/software-catalog/configuration#clean-up-entities-from-orphaned-entity-providers)
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- fbc1666: Correctly use the `catalog.useUrlReadersSearch` config.
|
|
12
|
+
- 75cadc1: Minor internal tweak to `refreshByRefreshKeys`
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
- @backstage/backend-openapi-utils@0.5.1-next.1
|
|
15
|
+
- @backstage/backend-plugin-api@1.2.1-next.1
|
|
16
|
+
- @backstage/catalog-client@1.9.1
|
|
17
|
+
- @backstage/catalog-model@1.7.3
|
|
18
|
+
- @backstage/config@1.3.2
|
|
19
|
+
- @backstage/errors@1.2.7
|
|
20
|
+
- @backstage/integration@1.16.1
|
|
21
|
+
- @backstage/types@1.2.1
|
|
22
|
+
- @backstage/plugin-catalog-common@1.1.3
|
|
23
|
+
- @backstage/plugin-catalog-node@1.16.1-next.1
|
|
24
|
+
- @backstage/plugin-events-node@0.4.9-next.1
|
|
25
|
+
- @backstage/plugin-permission-common@0.8.4
|
|
26
|
+
- @backstage/plugin-permission-node@0.8.9-next.1
|
|
27
|
+
- @backstage/plugin-search-backend-module-catalog@0.3.2-next.1
|
|
28
|
+
- @backstage/plugin-search-common@1.2.17
|
|
29
|
+
|
|
30
|
+
## 1.31.1-next.0
|
|
31
|
+
|
|
32
|
+
### Patch Changes
|
|
33
|
+
|
|
34
|
+
- Updated dependencies
|
|
35
|
+
- @backstage/plugin-permission-node@0.8.9-next.0
|
|
36
|
+
- @backstage/backend-plugin-api@1.2.1-next.0
|
|
37
|
+
- @backstage/plugin-catalog-node@1.16.1-next.0
|
|
38
|
+
- @backstage/plugin-events-node@0.4.9-next.0
|
|
39
|
+
- @backstage/plugin-search-backend-module-catalog@0.3.2-next.0
|
|
40
|
+
- @backstage/backend-openapi-utils@0.5.1-next.0
|
|
41
|
+
|
|
3
42
|
## 1.31.0
|
|
4
43
|
|
|
5
44
|
### Minor Changes
|
package/config.d.ts
CHANGED
|
@@ -155,6 +155,13 @@ export interface Config {
|
|
|
155
155
|
*/
|
|
156
156
|
orphanStrategy?: 'keep' | 'delete';
|
|
157
157
|
|
|
158
|
+
/**
|
|
159
|
+
* The strategy to use for entities that are referenced by providers that are orphaned,
|
|
160
|
+
* i.e. entities with no providers currently configured in the catalog. The default value is
|
|
161
|
+
* "keep".
|
|
162
|
+
*/
|
|
163
|
+
orphanProviderStrategy?: 'keep' | 'delete';
|
|
164
|
+
|
|
158
165
|
/**
|
|
159
166
|
* The strategy to use when stitching together the final entities.
|
|
160
167
|
*/
|
|
@@ -140,6 +140,13 @@ class DefaultProviderDatabase {
|
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
|
+
async listReferenceSourceKeys(txOpaque) {
|
|
144
|
+
const tx = txOpaque;
|
|
145
|
+
const rows = await tx(
|
|
146
|
+
"refresh_state_references"
|
|
147
|
+
).distinct("source_key").whereNotNull("source_key");
|
|
148
|
+
return rows.map((row) => row.source_key).filter((key) => !!key);
|
|
149
|
+
}
|
|
143
150
|
async refreshByRefreshKeys(txOpaque, options) {
|
|
144
151
|
const tx = txOpaque;
|
|
145
152
|
await refreshByRefreshKeys.refreshByRefreshKeys({ tx, keys: options.keys });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultProviderDatabase.cjs.js","sources":["../../src/database/DefaultProviderDatabase.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { stringifyEntityRef } from '@backstage/catalog-model';\nimport { DeferredEntity } from '@backstage/plugin-catalog-node';\nimport { Knex } from 'knex';\nimport lodash from 'lodash';\nimport { v4 as uuid } from 'uuid';\nimport { rethrowError } from './conversion';\nimport { deleteWithEagerPruningOfChildren } from './operations/provider/deleteWithEagerPruningOfChildren';\nimport { refreshByRefreshKeys } from './operations/provider/refreshByRefreshKeys';\nimport { checkLocationKeyConflict } from './operations/refreshState/checkLocationKeyConflict';\nimport { insertUnprocessedEntity } from './operations/refreshState/insertUnprocessedEntity';\nimport { updateUnprocessedEntity } from './operations/refreshState/updateUnprocessedEntity';\nimport { DbRefreshStateReferencesRow, DbRefreshStateRow } from './tables';\nimport {\n ProviderDatabase,\n RefreshByKeyOptions,\n ReplaceUnprocessedEntitiesOptions,\n Transaction,\n} from './types';\nimport { generateStableHash } from './util';\nimport {\n LoggerService,\n isDatabaseConflictError,\n} from '@backstage/backend-plugin-api';\n\n// The number of items that are sent per batch to the database layer, when\n// doing .batchInsert calls to knex. This needs to be low enough to not cause\n// errors in the underlying engine due to exceeding query limits, but large\n// enough to get the speed benefits.\nconst BATCH_SIZE = 50;\n\nexport class DefaultProviderDatabase implements ProviderDatabase {\n constructor(\n private readonly options: {\n database: Knex;\n logger: LoggerService;\n },\n ) {}\n\n async transaction<T>(fn: (tx: Transaction) => Promise<T>): Promise<T> {\n try {\n let result: T | undefined = undefined;\n await this.options.database.transaction(\n async tx => {\n // We can't return here, as knex swallows the return type in case the\n // transaction is rolled back:\n // https://github.com/knex/knex/blob/e37aeaa31c8ef9c1b07d2e4d3ec6607e557d800d/lib/transaction.js#L136\n result = await fn(tx);\n },\n {\n // If we explicitly trigger a rollback, don't fail.\n doNotRejectOnRollback: true,\n },\n );\n return result!;\n } catch (e) {\n this.options.logger.debug(`Error during transaction, ${e}`);\n throw rethrowError(e);\n }\n }\n\n async replaceUnprocessedEntities(\n txOpaque: Knex | Transaction,\n options: ReplaceUnprocessedEntitiesOptions,\n ): Promise<void> {\n const tx = txOpaque as Knex | Knex.Transaction;\n const { toAdd, toUpsert, toRemove } = await this.createDelta(tx, options);\n\n if (toRemove.length) {\n const removedCount = await deleteWithEagerPruningOfChildren({\n knex: tx,\n entityRefs: toRemove,\n sourceKey: options.sourceKey,\n });\n this.options.logger.debug(\n `removed, ${removedCount} entities: ${JSON.stringify(toRemove)}`,\n );\n }\n\n if (toAdd.length) {\n // The reason for this chunking, rather than just massively batch\n // inserting the entire payload, is that we fall back to the individual\n // upsert mechanism below on conflicts. That path is massively slower than\n // the fast batch path, so we don't want to end up accidentally having to\n // for example item-by-item upsert tens of thousands of entities in a\n // large initial delivery dump. The implication is that the size of these\n // chunks needs to weigh the benefit of fast successful inserts, against\n // the drawback of super slow but more rare fallbacks. There's quickly\n // diminishing returns though with turning up this value way high.\n for (const chunk of lodash.chunk(toAdd, 50)) {\n try {\n await tx.batchInsert(\n 'refresh_state',\n chunk.map(item => ({\n entity_id: uuid(),\n entity_ref: stringifyEntityRef(item.deferred.entity),\n unprocessed_entity: JSON.stringify(item.deferred.entity),\n unprocessed_hash: item.hash,\n errors: '',\n location_key: item.deferred.locationKey,\n next_update_at: tx.fn.now(),\n last_discovery_at: tx.fn.now(),\n })),\n BATCH_SIZE,\n );\n await tx.batchInsert(\n 'refresh_state_references',\n chunk.map(item => ({\n source_key: options.sourceKey,\n target_entity_ref: stringifyEntityRef(item.deferred.entity),\n })),\n BATCH_SIZE,\n );\n } catch (error) {\n if (!isDatabaseConflictError(error)) {\n throw error;\n } else {\n this.options.logger.debug(\n `Fast insert path failed, falling back to slow path, ${error}`,\n );\n toUpsert.push(...chunk);\n }\n }\n }\n }\n\n if (toUpsert.length) {\n for (const {\n deferred: { entity, locationKey },\n hash,\n } of toUpsert) {\n const entityRef = stringifyEntityRef(entity);\n\n try {\n let ok = await updateUnprocessedEntity({\n tx,\n entity,\n hash,\n locationKey,\n });\n if (!ok) {\n ok = await insertUnprocessedEntity({\n tx,\n entity,\n hash,\n locationKey,\n logger: this.options.logger,\n });\n }\n if (ok) {\n await tx<DbRefreshStateReferencesRow>('refresh_state_references')\n .where('target_entity_ref', entityRef)\n .delete();\n\n await tx<DbRefreshStateReferencesRow>(\n 'refresh_state_references',\n ).insert({\n source_key: options.sourceKey,\n target_entity_ref: entityRef,\n });\n } else {\n await tx<DbRefreshStateReferencesRow>('refresh_state_references')\n .where('target_entity_ref', entityRef)\n .andWhere({ source_key: options.sourceKey })\n .delete();\n\n const conflictingKey = await checkLocationKeyConflict({\n tx,\n entityRef,\n locationKey,\n });\n if (conflictingKey) {\n this.options.logger.warn(\n `Source ${options.sourceKey} detected conflicting entityRef ${entityRef} already referenced by ${conflictingKey} and now also ${locationKey}`,\n );\n }\n }\n } catch (error) {\n this.options.logger.error(\n `Failed to add '${entityRef}' from source '${options.sourceKey}', ${error}`,\n );\n }\n }\n }\n }\n\n async refreshByRefreshKeys(\n txOpaque: Transaction,\n options: RefreshByKeyOptions,\n ) {\n const tx = txOpaque as Knex.Transaction;\n await refreshByRefreshKeys({ tx, keys: options.keys });\n }\n\n private async createDelta(\n tx: Knex | Knex.Transaction,\n options: ReplaceUnprocessedEntitiesOptions,\n ): Promise<{\n toAdd: { deferred: DeferredEntity; hash: string }[];\n toUpsert: { deferred: DeferredEntity; hash: string }[];\n toRemove: string[];\n }> {\n if (options.type === 'delta') {\n const toAdd = new Array<{ deferred: DeferredEntity; hash: string }>();\n const toUpsert = new Array<{ deferred: DeferredEntity; hash: string }>();\n const toRemove = options.removed.map(e => e.entityRef);\n\n for (const chunk of lodash.chunk(options.added, 1000)) {\n const entityRefs = chunk.map(e => stringifyEntityRef(e.entity));\n const rows = await tx<DbRefreshStateRow>('refresh_state')\n .select(['entity_ref', 'unprocessed_hash', 'location_key'])\n .whereIn('entity_ref', entityRefs);\n const oldStates = new Map(\n rows.map(row => [\n row.entity_ref,\n {\n unprocessed_hash: row.unprocessed_hash,\n location_key: row.location_key,\n },\n ]),\n );\n\n chunk.forEach((deferred, i) => {\n const entityRef = entityRefs[i];\n const newHash = generateStableHash(deferred.entity);\n const oldState = oldStates.get(entityRef);\n if (oldState === undefined) {\n // Add any entity that does not exist in the database\n toAdd.push({ deferred, hash: newHash });\n } else if (\n (deferred.locationKey ?? null) !== (oldState.location_key ?? null)\n ) {\n // Remove and then re-add any entity that exists, but with a different location key\n toRemove.push(entityRef);\n toAdd.push({ deferred, hash: newHash });\n } else if (newHash !== oldState.unprocessed_hash) {\n // Entities with modifications should be pushed through too\n toUpsert.push({ deferred, hash: newHash });\n }\n });\n }\n\n return { toAdd, toUpsert, toRemove };\n }\n\n // Grab all of the existing references from the same source, and their locationKeys as well\n const oldRefs = await tx<DbRefreshStateReferencesRow>(\n 'refresh_state_references',\n )\n .leftJoin<DbRefreshStateRow>('refresh_state', {\n target_entity_ref: 'entity_ref',\n })\n .where({ source_key: options.sourceKey })\n .select({\n target_entity_ref: 'refresh_state_references.target_entity_ref',\n location_key: 'refresh_state.location_key',\n unprocessed_hash: 'refresh_state.unprocessed_hash',\n });\n\n const items = options.items.map(deferred => ({\n deferred,\n ref: stringifyEntityRef(deferred.entity),\n hash: generateStableHash(deferred.entity),\n }));\n\n const oldRefsSet = new Map(\n oldRefs.map(r => [\n r.target_entity_ref,\n {\n locationKey: r.location_key,\n oldEntityHash: r.unprocessed_hash,\n },\n ]),\n );\n const newRefsSet = new Set(items.map(item => item.ref));\n\n const toAdd = new Array<{ deferred: DeferredEntity; hash: string }>();\n const toUpsert = new Array<{ deferred: DeferredEntity; hash: string }>();\n const toRemove = oldRefs\n .map(row => row.target_entity_ref)\n .filter(ref => !newRefsSet.has(ref));\n\n for (const item of items) {\n const oldRef = oldRefsSet.get(item.ref);\n const upsertItem = { deferred: item.deferred, hash: item.hash };\n if (!oldRef) {\n // Add any entity that does not exist in the database\n toAdd.push(upsertItem);\n } else if (\n (oldRef.locationKey ?? undefined) !==\n (item.deferred.locationKey ?? undefined)\n ) {\n // Remove and then re-add any entity that exists, but with a different location key\n toRemove.push(item.ref);\n toAdd.push(upsertItem);\n } else if (oldRef.oldEntityHash !== item.hash) {\n // Entities with modifications should be pushed through too\n toUpsert.push(upsertItem);\n }\n }\n\n return { toAdd, toUpsert, toRemove };\n }\n}\n"],"names":["rethrowError","deleteWithEagerPruningOfChildren","lodash","uuid","stringifyEntityRef","isDatabaseConflictError","updateUnprocessedEntity","insertUnprocessedEntity","checkLocationKeyConflict","refreshByRefreshKeys","toAdd","toUpsert","toRemove","generateStableHash"],"mappings":";;;;;;;;;;;;;;;;;;AA4CA,MAAM,UAAa,GAAA,EAAA;AAEZ,MAAM,uBAAoD,CAAA;AAAA,EAC/D,YACmB,OAIjB,EAAA;AAJiB,IAAA,IAAA,CAAA,OAAA,GAAA,OAAA;AAAA;AAIhB,EAEH,MAAM,YAAe,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AAU,CAAA;AAAA,OACZ,MAAA,IAAA,MAAA,CAAO,aAAkB,KAAA,IAAA,CAAK,IAAM,EAAA;AAE7C,QAAA,QAAA,CAAS,KAAK,UAAU,CAAA;AAAA;AAC1B;AAGF,IAAO,OAAA,EAAE,KAAO,EAAA,QAAA,EAAU,QAAS,EAAA;AAAA;AAEvC;;;;"}
|
|
1
|
+
{"version":3,"file":"DefaultProviderDatabase.cjs.js","sources":["../../src/database/DefaultProviderDatabase.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { stringifyEntityRef } from '@backstage/catalog-model';\nimport { DeferredEntity } from '@backstage/plugin-catalog-node';\nimport { Knex } from 'knex';\nimport lodash from 'lodash';\nimport { v4 as uuid } from 'uuid';\nimport { rethrowError } from './conversion';\nimport { deleteWithEagerPruningOfChildren } from './operations/provider/deleteWithEagerPruningOfChildren';\nimport { refreshByRefreshKeys } from './operations/provider/refreshByRefreshKeys';\nimport { checkLocationKeyConflict } from './operations/refreshState/checkLocationKeyConflict';\nimport { insertUnprocessedEntity } from './operations/refreshState/insertUnprocessedEntity';\nimport { updateUnprocessedEntity } from './operations/refreshState/updateUnprocessedEntity';\nimport { DbRefreshStateReferencesRow, DbRefreshStateRow } from './tables';\nimport {\n ProviderDatabase,\n RefreshByKeyOptions,\n ReplaceUnprocessedEntitiesOptions,\n Transaction,\n} from './types';\nimport { generateStableHash } from './util';\nimport {\n LoggerService,\n isDatabaseConflictError,\n} from '@backstage/backend-plugin-api';\n\n// The number of items that are sent per batch to the database layer, when\n// doing .batchInsert calls to knex. This needs to be low enough to not cause\n// errors in the underlying engine due to exceeding query limits, but large\n// enough to get the speed benefits.\nconst BATCH_SIZE = 50;\n\nexport class DefaultProviderDatabase implements ProviderDatabase {\n constructor(\n private readonly options: {\n database: Knex;\n logger: LoggerService;\n },\n ) {}\n\n async transaction<T>(fn: (tx: Transaction) => Promise<T>): Promise<T> {\n try {\n let result: T | undefined = undefined;\n await this.options.database.transaction(\n async tx => {\n // We can't return here, as knex swallows the return type in case the\n // transaction is rolled back:\n // https://github.com/knex/knex/blob/e37aeaa31c8ef9c1b07d2e4d3ec6607e557d800d/lib/transaction.js#L136\n result = await fn(tx);\n },\n {\n // If we explicitly trigger a rollback, don't fail.\n doNotRejectOnRollback: true,\n },\n );\n return result!;\n } catch (e) {\n this.options.logger.debug(`Error during transaction, ${e}`);\n throw rethrowError(e);\n }\n }\n\n async replaceUnprocessedEntities(\n txOpaque: Knex | Transaction,\n options: ReplaceUnprocessedEntitiesOptions,\n ): Promise<void> {\n const tx = txOpaque as Knex | Knex.Transaction;\n const { toAdd, toUpsert, toRemove } = await this.createDelta(tx, options);\n\n if (toRemove.length) {\n const removedCount = await deleteWithEagerPruningOfChildren({\n knex: tx,\n entityRefs: toRemove,\n sourceKey: options.sourceKey,\n });\n this.options.logger.debug(\n `removed, ${removedCount} entities: ${JSON.stringify(toRemove)}`,\n );\n }\n\n if (toAdd.length) {\n // The reason for this chunking, rather than just massively batch\n // inserting the entire payload, is that we fall back to the individual\n // upsert mechanism below on conflicts. That path is massively slower than\n // the fast batch path, so we don't want to end up accidentally having to\n // for example item-by-item upsert tens of thousands of entities in a\n // large initial delivery dump. The implication is that the size of these\n // chunks needs to weigh the benefit of fast successful inserts, against\n // the drawback of super slow but more rare fallbacks. There's quickly\n // diminishing returns though with turning up this value way high.\n for (const chunk of lodash.chunk(toAdd, 50)) {\n try {\n await tx.batchInsert(\n 'refresh_state',\n chunk.map(item => ({\n entity_id: uuid(),\n entity_ref: stringifyEntityRef(item.deferred.entity),\n unprocessed_entity: JSON.stringify(item.deferred.entity),\n unprocessed_hash: item.hash,\n errors: '',\n location_key: item.deferred.locationKey,\n next_update_at: tx.fn.now(),\n last_discovery_at: tx.fn.now(),\n })),\n BATCH_SIZE,\n );\n await tx.batchInsert(\n 'refresh_state_references',\n chunk.map(item => ({\n source_key: options.sourceKey,\n target_entity_ref: stringifyEntityRef(item.deferred.entity),\n })),\n BATCH_SIZE,\n );\n } catch (error) {\n if (!isDatabaseConflictError(error)) {\n throw error;\n } else {\n this.options.logger.debug(\n `Fast insert path failed, falling back to slow path, ${error}`,\n );\n toUpsert.push(...chunk);\n }\n }\n }\n }\n\n if (toUpsert.length) {\n for (const {\n deferred: { entity, locationKey },\n hash,\n } of toUpsert) {\n const entityRef = stringifyEntityRef(entity);\n\n try {\n let ok = await updateUnprocessedEntity({\n tx,\n entity,\n hash,\n locationKey,\n });\n if (!ok) {\n ok = await insertUnprocessedEntity({\n tx,\n entity,\n hash,\n locationKey,\n logger: this.options.logger,\n });\n }\n if (ok) {\n await tx<DbRefreshStateReferencesRow>('refresh_state_references')\n .where('target_entity_ref', entityRef)\n .delete();\n\n await tx<DbRefreshStateReferencesRow>(\n 'refresh_state_references',\n ).insert({\n source_key: options.sourceKey,\n target_entity_ref: entityRef,\n });\n } else {\n await tx<DbRefreshStateReferencesRow>('refresh_state_references')\n .where('target_entity_ref', entityRef)\n .andWhere({ source_key: options.sourceKey })\n .delete();\n\n const conflictingKey = await checkLocationKeyConflict({\n tx,\n entityRef,\n locationKey,\n });\n if (conflictingKey) {\n this.options.logger.warn(\n `Source ${options.sourceKey} detected conflicting entityRef ${entityRef} already referenced by ${conflictingKey} and now also ${locationKey}`,\n );\n }\n }\n } catch (error) {\n this.options.logger.error(\n `Failed to add '${entityRef}' from source '${options.sourceKey}', ${error}`,\n );\n }\n }\n }\n }\n\n async listReferenceSourceKeys(txOpaque: Transaction): Promise<string[]> {\n const tx = txOpaque as Knex | Knex.Transaction;\n\n const rows = await tx<DbRefreshStateReferencesRow>(\n 'refresh_state_references',\n )\n .distinct('source_key')\n .whereNotNull('source_key');\n\n return rows\n .map(row => row.source_key)\n .filter((key): key is string => !!key);\n }\n\n async refreshByRefreshKeys(\n txOpaque: Transaction,\n options: RefreshByKeyOptions,\n ) {\n const tx = txOpaque as Knex.Transaction;\n await refreshByRefreshKeys({ tx, keys: options.keys });\n }\n\n private async createDelta(\n tx: Knex | Knex.Transaction,\n options: ReplaceUnprocessedEntitiesOptions,\n ): Promise<{\n toAdd: { deferred: DeferredEntity; hash: string }[];\n toUpsert: { deferred: DeferredEntity; hash: string }[];\n toRemove: string[];\n }> {\n if (options.type === 'delta') {\n const toAdd = new Array<{ deferred: DeferredEntity; hash: string }>();\n const toUpsert = new Array<{ deferred: DeferredEntity; hash: string }>();\n const toRemove = options.removed.map(e => e.entityRef);\n\n for (const chunk of lodash.chunk(options.added, 1000)) {\n const entityRefs = chunk.map(e => stringifyEntityRef(e.entity));\n const rows = await tx<DbRefreshStateRow>('refresh_state')\n .select(['entity_ref', 'unprocessed_hash', 'location_key'])\n .whereIn('entity_ref', entityRefs);\n const oldStates = new Map(\n rows.map(row => [\n row.entity_ref,\n {\n unprocessed_hash: row.unprocessed_hash,\n location_key: row.location_key,\n },\n ]),\n );\n\n chunk.forEach((deferred, i) => {\n const entityRef = entityRefs[i];\n const newHash = generateStableHash(deferred.entity);\n const oldState = oldStates.get(entityRef);\n if (oldState === undefined) {\n // Add any entity that does not exist in the database\n toAdd.push({ deferred, hash: newHash });\n } else if (\n (deferred.locationKey ?? null) !== (oldState.location_key ?? null)\n ) {\n // Remove and then re-add any entity that exists, but with a different location key\n toRemove.push(entityRef);\n toAdd.push({ deferred, hash: newHash });\n } else if (newHash !== oldState.unprocessed_hash) {\n // Entities with modifications should be pushed through too\n toUpsert.push({ deferred, hash: newHash });\n }\n });\n }\n\n return { toAdd, toUpsert, toRemove };\n }\n\n // Grab all of the existing references from the same source, and their locationKeys as well\n const oldRefs = await tx<DbRefreshStateReferencesRow>(\n 'refresh_state_references',\n )\n .leftJoin<DbRefreshStateRow>('refresh_state', {\n target_entity_ref: 'entity_ref',\n })\n .where({ source_key: options.sourceKey })\n .select({\n target_entity_ref: 'refresh_state_references.target_entity_ref',\n location_key: 'refresh_state.location_key',\n unprocessed_hash: 'refresh_state.unprocessed_hash',\n });\n\n const items = options.items.map(deferred => ({\n deferred,\n ref: stringifyEntityRef(deferred.entity),\n hash: generateStableHash(deferred.entity),\n }));\n\n const oldRefsSet = new Map(\n oldRefs.map(r => [\n r.target_entity_ref,\n {\n locationKey: r.location_key,\n oldEntityHash: r.unprocessed_hash,\n },\n ]),\n );\n const newRefsSet = new Set(items.map(item => item.ref));\n\n const toAdd = new Array<{ deferred: DeferredEntity; hash: string }>();\n const toUpsert = new Array<{ deferred: DeferredEntity; hash: string }>();\n const toRemove = oldRefs\n .map(row => row.target_entity_ref)\n .filter(ref => !newRefsSet.has(ref));\n\n for (const item of items) {\n const oldRef = oldRefsSet.get(item.ref);\n const upsertItem = { deferred: item.deferred, hash: item.hash };\n if (!oldRef) {\n // Add any entity that does not exist in the database\n toAdd.push(upsertItem);\n } else if (\n (oldRef.locationKey ?? undefined) !==\n (item.deferred.locationKey ?? undefined)\n ) {\n // Remove and then re-add any entity that exists, but with a different location key\n toRemove.push(item.ref);\n toAdd.push(upsertItem);\n } else if (oldRef.oldEntityHash !== item.hash) {\n // Entities with modifications should be pushed through too\n toUpsert.push(upsertItem);\n }\n }\n\n return { toAdd, toUpsert, toRemove };\n }\n}\n"],"names":["rethrowError","deleteWithEagerPruningOfChildren","lodash","uuid","stringifyEntityRef","isDatabaseConflictError","updateUnprocessedEntity","insertUnprocessedEntity","checkLocationKeyConflict","refreshByRefreshKeys","toAdd","toUpsert","toRemove","generateStableHash"],"mappings":";;;;;;;;;;;;;;;;;;AA4CA,MAAM,UAAa,GAAA,EAAA;AAEZ,MAAM,uBAAoD,CAAA;AAAA,EAC/D,YACmB,OAIjB,EAAA;AAJiB,IAAA,IAAA,CAAA,OA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AI,CAAA,IAAA,CAAK,GAAG,CAAA;AACtC,MAAA,MAAM,aAAa,EAAE,QAAA,EAAU,KAAK,QAAU,EAAA,IAAA,EAAM,KAAK,IAAK,EAAA;AAC9D,MAAA,IAAI,CAAC,MAAQ,EAAA;AAEX,QAAA,KAAA,CAAM,KAAK,UAAU,CAAA;AAAA,kBAEpB,MAAO,CAAA,WAAA,IAAe,aACtB,IAAK,CAAA,QAAA,CAAS,eAAe,KAC9B,CAAA,CAAA,EAAA;AAEA,QAAS,QAAA,CAAA,IAAA,CAAK,KAAK,GAAG,CAAA;AACtB,QAAA,KAAA,CAAM,KAAK,UAAU,CAAA;AAAA,OACZ,MAAA,IAAA,MAAA,CAAO,aAAkB,KAAA,IAAA,CAAK,IAAM,EAAA;AAE7C,QAAA,QAAA,CAAS,KAAK,UAAU,CAAA;AAAA;AAC1B;AAGF,IAAO,OAAA,EAAE,KAAO,EAAA,QAAA,EAAU,QAAS,EAAA;AAAA;AAEvC;;;;"}
|
|
@@ -6,7 +6,7 @@ async function refreshByRefreshKeys(options) {
|
|
|
6
6
|
const { tx, keys } = options;
|
|
7
7
|
const hashedKeys = keys.map((k) => util.generateTargetKey(k));
|
|
8
8
|
await tx("refresh_state").whereIn("entity_id", function selectEntityRefs(inner) {
|
|
9
|
-
inner.whereIn("key", hashedKeys).select({
|
|
9
|
+
return inner.whereIn("key", hashedKeys).select({
|
|
10
10
|
entity_id: "refresh_keys.entity_id"
|
|
11
11
|
}).from("refresh_keys");
|
|
12
12
|
}).update({ next_update_at: tx.fn.now() });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"refreshByRefreshKeys.cjs.js","sources":["../../../../src/database/operations/provider/refreshByRefreshKeys.ts"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Knex } from 'knex';\nimport { DbRefreshStateRow } from '../../tables';\nimport { generateTargetKey } from '../../util';\n\n/**\n * Schedules a future refresh of entities, by so called \"refresh keys\" that may\n * be associated with one or more entities. Note that this does not mean that\n * the refresh happens immediately, but rather that their scheduling time gets\n * moved up the queue and will get picked up eventually by the regular\n * processing loop.\n */\nexport async function refreshByRefreshKeys(options: {\n tx: Knex.Transaction;\n keys: string[];\n}): Promise<void> {\n const { tx, keys } = options;\n\n const hashedKeys = keys.map(k => generateTargetKey(k));\n\n await tx<DbRefreshStateRow>('refresh_state')\n .whereIn('entity_id', function selectEntityRefs(inner) {\n inner\n .whereIn('key', hashedKeys)\n .select({\n entity_id: 'refresh_keys.entity_id',\n })\n .from('refresh_keys');\n })\n .update({ next_update_at: tx.fn.now() });\n}\n"],"names":["generateTargetKey"],"mappings":";;;;AA2BA,eAAsB,qBAAqB,OAGzB,EAAA;AAChB,EAAM,MAAA,EAAE,EAAI,EAAA,IAAA,EAAS,GAAA,OAAA;AAErB,EAAA,MAAM,aAAa,IAAK,CAAA,GAAA,CAAI,CAAK,CAAA,KAAAA,sBAAA,CAAkB,CAAC,CAAC,CAAA;AAErD,EAAA,MAAM,GAAsB,eAAe,CAAA,CACxC,QAAQ,WAAa,EAAA,SAAS,iBAAiB,KAAO,EAAA;AACrD,IAAA,
|
|
1
|
+
{"version":3,"file":"refreshByRefreshKeys.cjs.js","sources":["../../../../src/database/operations/provider/refreshByRefreshKeys.ts"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Knex } from 'knex';\nimport { DbRefreshStateRow } from '../../tables';\nimport { generateTargetKey } from '../../util';\n\n/**\n * Schedules a future refresh of entities, by so called \"refresh keys\" that may\n * be associated with one or more entities. Note that this does not mean that\n * the refresh happens immediately, but rather that their scheduling time gets\n * moved up the queue and will get picked up eventually by the regular\n * processing loop.\n */\nexport async function refreshByRefreshKeys(options: {\n tx: Knex | Knex.Transaction;\n keys: string[];\n}): Promise<void> {\n const { tx, keys } = options;\n\n const hashedKeys = keys.map(k => generateTargetKey(k));\n\n await tx<DbRefreshStateRow>('refresh_state')\n .whereIn('entity_id', function selectEntityRefs(inner) {\n return inner\n .whereIn('key', hashedKeys)\n .select({\n entity_id: 'refresh_keys.entity_id',\n })\n .from('refresh_keys');\n })\n .update({ next_update_at: tx.fn.now() });\n}\n"],"names":["generateTargetKey"],"mappings":";;;;AA2BA,eAAsB,qBAAqB,OAGzB,EAAA;AAChB,EAAM,MAAA,EAAE,EAAI,EAAA,IAAA,EAAS,GAAA,OAAA;AAErB,EAAA,MAAM,aAAa,IAAK,CAAA,GAAA,CAAI,CAAK,CAAA,KAAAA,sBAAA,CAAkB,CAAC,CAAC,CAAA;AAErD,EAAA,MAAM,GAAsB,eAAe,CAAA,CACxC,QAAQ,WAAa,EAAA,SAAS,iBAAiB,KAAO,EAAA;AACrD,IAAA,OAAO,KACJ,CAAA,OAAA,CAAQ,KAAO,EAAA,UAAU,EACzB,MAAO,CAAA;AAAA,MACN,SAAW,EAAA;AAAA,KACZ,CACA,CAAA,IAAA,CAAK,cAAc,CAAA;AAAA,GACvB,EACA,MAAO,CAAA,EAAE,gBAAgB,EAAG,CAAA,EAAA,CAAG,GAAI,EAAA,EAAG,CAAA;AAC3C;;;;"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
async function getOrphanedEntityProviderNames({
|
|
4
|
+
db,
|
|
5
|
+
providers
|
|
6
|
+
}) {
|
|
7
|
+
const dbProviderNames = await db.transaction(
|
|
8
|
+
async (tx) => db.listReferenceSourceKeys(tx)
|
|
9
|
+
);
|
|
10
|
+
const providerNames = providers.map((p) => p.getProviderName());
|
|
11
|
+
return dbProviderNames.filter(
|
|
12
|
+
(dbProviderName) => !providerNames.includes(dbProviderName)
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
async function removeEntitiesForProvider({
|
|
16
|
+
db,
|
|
17
|
+
providerName,
|
|
18
|
+
logger
|
|
19
|
+
}) {
|
|
20
|
+
try {
|
|
21
|
+
await db.transaction(async (tx) => {
|
|
22
|
+
await db.replaceUnprocessedEntities(tx, {
|
|
23
|
+
sourceKey: providerName,
|
|
24
|
+
type: "full",
|
|
25
|
+
items: []
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
logger.info(`Removed entities for orphaned provider ${providerName}`);
|
|
29
|
+
} catch (e) {
|
|
30
|
+
logger.error(
|
|
31
|
+
`Failed to remove entities for orphaned provider ${providerName}`,
|
|
32
|
+
e
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
async function evictEntitiesFromOrphanedProviders(options) {
|
|
37
|
+
for (const providerName of await getOrphanedEntityProviderNames(options)) {
|
|
38
|
+
await removeEntitiesForProvider({
|
|
39
|
+
db: options.db,
|
|
40
|
+
providerName,
|
|
41
|
+
logger: options.logger
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
exports.evictEntitiesFromOrphanedProviders = evictEntitiesFromOrphanedProviders;
|
|
47
|
+
//# sourceMappingURL=evictEntitiesFromOrphanedProviders.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"evictEntitiesFromOrphanedProviders.cjs.js","sources":["../../src/processing/evictEntitiesFromOrphanedProviders.ts"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { EntityProvider } from '@backstage/plugin-catalog-node';\nimport { LoggerService } from '@backstage/backend-plugin-api';\nimport { ProviderDatabase } from '../database/types';\n\nasync function getOrphanedEntityProviderNames({\n db,\n providers,\n}: {\n db: ProviderDatabase;\n providers: EntityProvider[];\n}): Promise<string[]> {\n const dbProviderNames = await db.transaction(async tx =>\n db.listReferenceSourceKeys(tx),\n );\n\n const providerNames = providers.map(p => p.getProviderName());\n\n return dbProviderNames.filter(\n dbProviderName => !providerNames.includes(dbProviderName),\n );\n}\n\nasync function removeEntitiesForProvider({\n db,\n providerName,\n logger,\n}: {\n db: ProviderDatabase;\n providerName: string;\n logger: LoggerService;\n}) {\n try {\n await db.transaction(async tx => {\n await db.replaceUnprocessedEntities(tx, {\n sourceKey: providerName,\n type: 'full',\n items: [],\n });\n });\n logger.info(`Removed entities for orphaned provider ${providerName}`);\n } catch (e) {\n logger.error(\n `Failed to remove entities for orphaned provider ${providerName}`,\n e,\n );\n }\n}\n\nexport async function evictEntitiesFromOrphanedProviders(options: {\n db: ProviderDatabase;\n providers: EntityProvider[];\n logger: LoggerService;\n}) {\n for (const providerName of await getOrphanedEntityProviderNames(options)) {\n await removeEntitiesForProvider({\n db: options.db,\n providerName,\n logger: options.logger,\n });\n }\n}\n"],"names":[],"mappings":";;AAoBA,eAAe,8BAA+B,CAAA;AAAA,EAC5C,EAAA;AAAA,EACA;AACF,CAGsB,EAAA;AACpB,EAAM,MAAA,eAAA,GAAkB,MAAM,EAAG,CAAA,WAAA;AAAA,IAAY,OAAM,EAAA,KACjD,EAAG,CAAA,uBAAA,CAAwB,EAAE;AAAA,GAC/B;AAEA,EAAA,MAAM,gBAAgB,SAAU,CAAA,GAAA,CAAI,CAAK,CAAA,KAAA,CAAA,CAAE,iBAAiB,CAAA;AAE5D,EAAA,OAAO,eAAgB,CAAA,MAAA;AAAA,IACrB,CAAkB,cAAA,KAAA,CAAC,aAAc,CAAA,QAAA,CAAS,cAAc;AAAA,GAC1D;AACF;AAEA,eAAe,yBAA0B,CAAA;AAAA,EACvC,EAAA;AAAA,EACA,YAAA;AAAA,EACA;AACF,CAIG,EAAA;AACD,EAAI,IAAA;AACF,IAAM,MAAA,EAAA,CAAG,WAAY,CAAA,OAAM,EAAM,KAAA;AAC/B,MAAM,MAAA,EAAA,CAAG,2BAA2B,EAAI,EAAA;AAAA,QACtC,SAAW,EAAA,YAAA;AAAA,QACX,IAAM,EAAA,MAAA;AAAA,QACN,OAAO;AAAC,OACT,CAAA;AAAA,KACF,CAAA;AACD,IAAO,MAAA,CAAA,IAAA,CAAK,CAA0C,uCAAA,EAAA,YAAY,CAAE,CAAA,CAAA;AAAA,WAC7D,CAAG,EAAA;AACV,IAAO,MAAA,CAAA,KAAA;AAAA,MACL,mDAAmD,YAAY,CAAA,CAAA;AAAA,MAC/D;AAAA,KACF;AAAA;AAEJ;AAEA,eAAsB,mCAAmC,OAItD,EAAA;AACD,EAAA,KAAA,MAAW,YAAgB,IAAA,MAAM,8BAA+B,CAAA,OAAO,CAAG,EAAA;AACxE,IAAA,MAAM,yBAA0B,CAAA;AAAA,MAC9B,IAAI,OAAQ,CAAA,EAAA;AAAA,MACZ,YAAA;AAAA,MACA,QAAQ,OAAQ,CAAA;AAAA,KACjB,CAAA;AAAA;AAEL;;;;"}
|
|
@@ -7,7 +7,7 @@ const spec = {
|
|
|
7
7
|
info: {
|
|
8
8
|
title: "catalog",
|
|
9
9
|
version: "1",
|
|
10
|
-
description: "The
|
|
10
|
+
description: "The API surface consists of a few distinct groups of functionality. Each has a\ndedicated section below.\n\n> **Note:** This page only describes some of the most commonly used parts of the\n> API, and is a work in progress.\n\nAll of the URL paths in this article are assumed to be on top of some base URL\npointing at your catalog installation. For example, if the path given in a\nsection below is `/entities`, and the catalog is located at\n`http://localhost:7007/api/catalog` during local development, the full URL would\nbe `http://localhost:7007/api/catalog/entities`. The actual URL may vary from\none organization to the other, especially in production, but is commonly your\n`backend.baseUrl` in your app config, plus `/api/catalog` at the end.\n\nSome or all of the endpoints may accept or require an `Authorization` header\nwith a `Bearer` token, which should then be the Backstage token returned by the\n[`identity API`](https://backstage.io/docs/reference/core-plugin-api.identityapiref).\n",
|
|
11
11
|
license: {
|
|
12
12
|
name: "Apache-2.0",
|
|
13
13
|
url: "http://www.apache.org/licenses/LICENSE-2.0.html"
|
|
@@ -62,7 +62,7 @@ const spec = {
|
|
|
62
62
|
cursor: {
|
|
63
63
|
name: "cursor",
|
|
64
64
|
in: "query",
|
|
65
|
-
description: "
|
|
65
|
+
description: 'You may pass the `cursor` query parameters to perform cursor based pagination\nthrough the set of entities. The value of `cursor` will be returned in the response, under the `pageInfo` property:\n\n```json\n "pageInfo": {\n "nextCursor": "a-cursor",\n "prevCursor": "another-cursor"\n }\n```\n\nIf `nextCursor` exists, it can be used to retrieve the next batch of entities. Following the same approach,\nif `prevCursor` exists, it can be used to retrieve the previous batch of entities.\n\n- [`filter`](#filtering), for selecting only a subset of all entities\n- [`fields`](#field-selection), for selecting only parts of the full data\n structure of each entity\n- `limit` for limiting the number of entities returned (20 is the default)\n- [`orderField`](#ordering), for deciding the order of the entities\n- `fullTextFilter`\n **NOTE**: [`filter`, `orderField`, `fullTextFilter`] and `cursor` are mutually exclusive. This means that,\n it isn\'t possible to change any of [`filter`, `orderField`, `fullTextFilter`] when passing `cursor` as query parameters,\n as changing any of these properties will affect pagination. If any of `filter`, `orderField`, `fullTextFilter` is specified together with `cursor`, only the latter is taken into consideration.\n',
|
|
66
66
|
required: false,
|
|
67
67
|
allowReserved: true,
|
|
68
68
|
schema: {
|
|
@@ -84,7 +84,7 @@ const spec = {
|
|
|
84
84
|
fields: {
|
|
85
85
|
name: "fields",
|
|
86
86
|
in: "query",
|
|
87
|
-
description: "
|
|
87
|
+
description: "By default the full entities are returned, but you can pass in a `fields` query\nparameter which selects what parts of the entity data to retain. This makes the\nresponse smaller and faster to transfer, and may allow the catalog to perform\nmore efficient queries.\n\nThe query parameter value is a comma separated list of simplified JSON paths\nlike above. Each path corresponds to the key of either a value, or of a subtree\nroot that you want to keep in the output. The rest is pruned away. For example,\nspecifying `?fields=metadata.name,metadata.annotations,spec` retains only the\n`name` and `annotations` fields of the `metadata` of each entity (it'll be an\nobject with at most two keys), keeps the entire `spec` unchanged, and cuts out\nall other roots such as `relations`.\n\nSome more real world usable examples:\n\n- Return only enough data to form the full ref of each entity:\n\n `/entities/by-query?fields=kind,metadata.namespace,metadata.name`\n",
|
|
88
88
|
required: false,
|
|
89
89
|
allowReserved: true,
|
|
90
90
|
explode: false,
|
|
@@ -106,7 +106,7 @@ const spec = {
|
|
|
106
106
|
filter: {
|
|
107
107
|
name: "filter",
|
|
108
108
|
in: "query",
|
|
109
|
-
description:
|
|
109
|
+
description: 'You can pass in one or more filter sets that get matched against each entity.\nEach filter set is a number of conditions that all have to match for the\ncondition to be true (conditions effectively have an AND between them). At least\none filter set has to be true for the entity to be part of the result set\n(filter sets effectively have an OR between them).\n\nExample:\n\n```text\n/entities/by-query?filter=kind=user,metadata.namespace=default&filter=kind=group,spec.type\n\n Return entities that match\n\n Filter set 1:\n Condition 1: kind = user\n AND\n Condition 2: metadata.namespace = default\n\n OR\n\n Filter set 2:\n Condition 1: kind = group\n AND\n Condition 2: spec.type exists\n```\n\nEach condition is either on the form `<key>`, or on the form `<key>=<value>`.\nThe first form asserts on the existence of a certain key (with any value), and\nthe second asserts that the key exists and has a certain value. All checks are\nalways case _insensitive_.\n\nIn all cases, the key is a simplified JSON path in a given piece of entity data.\nEach part of the path is a key of an object, and the traversal also descends\nthrough arrays. There are two special forms:\n\n- Array items that are simple value types (such as strings) match on a key-value\n pair where the key is the item as a string, and the value is the string `true`\n- Relations can be matched on a `relations.<type>=<targetRef>` form\n\nLet\'s look at a simplified example to illustrate the concept:\n\n```json\n{\n "a": {\n "b": ["c", { "d": 1 }],\n "e": 7\n }\n}\n```\n\nThis would match any one of the following conditions:\n\n- `a`\n- `a.b`\n- `a.b.c`\n- `a.b.c=true`\n- `a.b.d`\n- `a.b.d=1`\n- `a.e`\n- `a.e=7`\n\nSome more real world usable examples:\n\n- Return all orphaned entities:\n\n `/entities/by-query?filter=metadata.annotations.backstage.io/orphan=true`\n\n- Return all users and groups:\n\n `/entities/by-query?filter=kind=user&filter=kind=group`\n\n- Return all service components:\n\n `/entities/by-query?filter=kind=component,spec.type=service`\n\n- Return all entities with the `java` tag:\n\n `/entities/by-query?filter=metadata.tags.java`\n\n- Return all users who are members of the `ops` group (note that the full\n [reference](references.md) of the group is used):\n\n `/entities/by-query?filter=kind=user,relations.memberof=group:default/ops`\n',
|
|
110
110
|
required: false,
|
|
111
111
|
allowReserved: true,
|
|
112
112
|
schema: {
|
|
@@ -151,7 +151,7 @@ const spec = {
|
|
|
151
151
|
orderField: {
|
|
152
152
|
name: "orderField",
|
|
153
153
|
in: "query",
|
|
154
|
-
description: "
|
|
154
|
+
description: "By default the entities are returned ordered by their internal uid. You can\ncustomize the `orderField` query parameters to affect that ordering.\n\nFor example, to return entities by their name:\n\n`/entities/by-query?orderField=metadata.name,asc`\n\nEach parameter can be followed by `asc` for ascending lexicographical order or\n`desc` for descending (reverse) lexicographical order.\n",
|
|
155
155
|
required: false,
|
|
156
156
|
allowReserved: true,
|
|
157
157
|
schema: {
|
|
@@ -736,6 +736,7 @@ const spec = {
|
|
|
736
736
|
"/refresh": {
|
|
737
737
|
post: {
|
|
738
738
|
operationId: "RefreshEntity",
|
|
739
|
+
tags: ["Entity"],
|
|
739
740
|
description: "Refresh the entity related to entityRef.",
|
|
740
741
|
responses: {
|
|
741
742
|
"200": {
|
|
@@ -782,6 +783,7 @@ const spec = {
|
|
|
782
783
|
"/entities": {
|
|
783
784
|
get: {
|
|
784
785
|
operationId: "GetEntities",
|
|
786
|
+
tags: ["Entity"],
|
|
785
787
|
description: "Get all entities matching a given filter.",
|
|
786
788
|
responses: {
|
|
787
789
|
"200": {
|
|
@@ -844,6 +846,7 @@ const spec = {
|
|
|
844
846
|
"/entities/by-uid/{uid}": {
|
|
845
847
|
get: {
|
|
846
848
|
operationId: "GetEntityByUid",
|
|
849
|
+
tags: ["Entity"],
|
|
847
850
|
description: "Get a single entity by the UID.",
|
|
848
851
|
responses: {
|
|
849
852
|
"200": {
|
|
@@ -877,6 +880,7 @@ const spec = {
|
|
|
877
880
|
},
|
|
878
881
|
delete: {
|
|
879
882
|
operationId: "DeleteEntityByUid",
|
|
883
|
+
tags: ["Entity"],
|
|
880
884
|
description: "Delete a single entity by UID.",
|
|
881
885
|
responses: {
|
|
882
886
|
"204": {
|
|
@@ -905,6 +909,7 @@ const spec = {
|
|
|
905
909
|
"/entities/by-name/{kind}/{namespace}/{name}": {
|
|
906
910
|
get: {
|
|
907
911
|
operationId: "GetEntityByName",
|
|
912
|
+
tags: ["Entity"],
|
|
908
913
|
description: "Get an entity by an entity ref.",
|
|
909
914
|
responses: {
|
|
910
915
|
"200": {
|
|
@@ -946,6 +951,7 @@ const spec = {
|
|
|
946
951
|
"/entities/by-name/{kind}/{namespace}/{name}/ancestry": {
|
|
947
952
|
get: {
|
|
948
953
|
operationId: "GetEntityAncestryByName",
|
|
954
|
+
tags: ["Entity"],
|
|
949
955
|
description: "Get an entity's ancestry by entity ref.",
|
|
950
956
|
responses: {
|
|
951
957
|
"200": {
|
|
@@ -987,6 +993,7 @@ const spec = {
|
|
|
987
993
|
"/entities/by-refs": {
|
|
988
994
|
post: {
|
|
989
995
|
operationId: "GetEntitiesByRefs",
|
|
996
|
+
tags: ["Entity"],
|
|
990
997
|
description: "Get a batch set of entities given an array of entityRefs.",
|
|
991
998
|
responses: {
|
|
992
999
|
"200": {
|
|
@@ -1063,6 +1070,7 @@ const spec = {
|
|
|
1063
1070
|
"/entities/by-query": {
|
|
1064
1071
|
get: {
|
|
1065
1072
|
operationId: "GetEntitiesByQuery",
|
|
1073
|
+
tags: ["Entity"],
|
|
1066
1074
|
description: "Search for entities by a given query.",
|
|
1067
1075
|
responses: {
|
|
1068
1076
|
"200": {
|
|
@@ -1138,6 +1146,7 @@ const spec = {
|
|
|
1138
1146
|
"/entity-facets": {
|
|
1139
1147
|
get: {
|
|
1140
1148
|
operationId: "GetEntityFacets",
|
|
1149
|
+
tags: ["Entity"],
|
|
1141
1150
|
description: "Get all entity facets that match the given filters.",
|
|
1142
1151
|
responses: {
|
|
1143
1152
|
"200": {
|
|
@@ -1193,6 +1202,7 @@ const spec = {
|
|
|
1193
1202
|
"/locations": {
|
|
1194
1203
|
post: {
|
|
1195
1204
|
operationId: "CreateLocation",
|
|
1205
|
+
tags: ["Locations"],
|
|
1196
1206
|
description: "Create a location for a given target.",
|
|
1197
1207
|
responses: {
|
|
1198
1208
|
"201": {
|
|
@@ -1266,6 +1276,7 @@ const spec = {
|
|
|
1266
1276
|
},
|
|
1267
1277
|
get: {
|
|
1268
1278
|
operationId: "GetLocations",
|
|
1279
|
+
tags: ["Locations"],
|
|
1269
1280
|
description: "Get all locations",
|
|
1270
1281
|
responses: {
|
|
1271
1282
|
"200": {
|
|
@@ -1303,6 +1314,7 @@ const spec = {
|
|
|
1303
1314
|
"/locations/{id}": {
|
|
1304
1315
|
get: {
|
|
1305
1316
|
operationId: "GetLocation",
|
|
1317
|
+
tags: ["Locations"],
|
|
1306
1318
|
description: "Get a location by id.",
|
|
1307
1319
|
responses: {
|
|
1308
1320
|
"200": {
|
|
@@ -1339,6 +1351,7 @@ const spec = {
|
|
|
1339
1351
|
},
|
|
1340
1352
|
delete: {
|
|
1341
1353
|
operationId: "DeleteLocation",
|
|
1354
|
+
tags: ["Locations"],
|
|
1342
1355
|
description: "Delete a location by id.",
|
|
1343
1356
|
responses: {
|
|
1344
1357
|
"204": {
|
|
@@ -1373,6 +1386,7 @@ const spec = {
|
|
|
1373
1386
|
"/locations/by-entity/{kind}/{namespace}/{name}": {
|
|
1374
1387
|
get: {
|
|
1375
1388
|
operationId: "getLocationByEntity",
|
|
1389
|
+
tags: ["Locations"],
|
|
1376
1390
|
description: "Get a location for entity.",
|
|
1377
1391
|
responses: {
|
|
1378
1392
|
"200": {
|
|
@@ -1429,6 +1443,7 @@ const spec = {
|
|
|
1429
1443
|
"/analyze-location": {
|
|
1430
1444
|
post: {
|
|
1431
1445
|
operationId: "AnalyzeLocation",
|
|
1446
|
+
tags: ["Locations"],
|
|
1432
1447
|
description: "Validate a given location.",
|
|
1433
1448
|
responses: {
|
|
1434
1449
|
"200": {
|
|
@@ -1479,6 +1494,7 @@ const spec = {
|
|
|
1479
1494
|
"/validate-entity": {
|
|
1480
1495
|
post: {
|
|
1481
1496
|
operationId: "ValidateEntity",
|
|
1497
|
+
tags: ["Entity"],
|
|
1482
1498
|
description: "Validate that a passed in entity has no errors in schema.",
|
|
1483
1499
|
responses: {
|
|
1484
1500
|
"200": {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router.cjs.js","sources":["../../../../src/schema/openapi/generated/router.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// ******************************************************************\n// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. *\n// ******************************************************************\nimport { createValidatedOpenApiRouterFromGeneratedEndpointMap } from '@backstage/backend-openapi-utils';\nimport { EndpointMap } from './';\n\nexport const spec = {\n openapi: '3.0.3',\n info: {\n title: 'catalog',\n version: '1',\n description:\n 'The Backstage backend plugin that provides the Backstage catalog',\n license: {\n name: 'Apache-2.0',\n url: 'http://www.apache.org/licenses/LICENSE-2.0.html',\n },\n contact: {},\n },\n servers: [\n {\n url: '/',\n },\n ],\n components: {\n examples: {},\n headers: {},\n parameters: {\n kind: {\n name: 'kind',\n in: 'path',\n required: true,\n allowReserved: true,\n schema: {\n type: 'string',\n },\n },\n namespace: {\n name: 'namespace',\n in: 'path',\n required: true,\n allowReserved: true,\n schema: {\n type: 'string',\n },\n },\n name: {\n name: 'name',\n in: 'path',\n required: true,\n allowReserved: true,\n schema: {\n type: 'string',\n },\n },\n uid: {\n name: 'uid',\n in: 'path',\n required: true,\n allowReserved: true,\n schema: {\n type: 'string',\n },\n },\n cursor: {\n name: 'cursor',\n in: 'query',\n description: 'Cursor to a set page of results.',\n required: false,\n allowReserved: true,\n schema: {\n type: 'string',\n minLength: 1,\n },\n },\n after: {\n name: 'after',\n in: 'query',\n description: 'Pointer to the previous page of results.',\n required: false,\n allowReserved: true,\n schema: {\n type: 'string',\n minLength: 1,\n },\n },\n fields: {\n name: 'fields',\n in: 'query',\n description: 'Restrict to just these fields in the response.',\n required: false,\n allowReserved: true,\n explode: false,\n schema: {\n type: 'array',\n items: {\n type: 'string',\n },\n },\n examples: {\n 'Get name and the entire relations collection': {\n value: ['metadata.name', 'relations'],\n },\n 'Get kind, name and namespace': {\n value: ['kind', 'metadata.name', 'metadata.namespace'],\n },\n },\n },\n filter: {\n name: 'filter',\n in: 'query',\n description: 'Filter for just the entities defined by this filter.',\n required: false,\n allowReserved: true,\n schema: {\n type: 'array',\n items: {\n type: 'string',\n },\n },\n examples: {\n 'Get groups': {\n value: ['kind=group'],\n },\n 'Get orphaned components': {\n value: [\n 'kind=component,metadata.annotations.backstage.io/orphan=true',\n ],\n },\n },\n },\n offset: {\n name: 'offset',\n in: 'query',\n description: 'Number of records to skip in the query page.',\n required: false,\n allowReserved: true,\n schema: {\n type: 'integer',\n minimum: 0,\n },\n },\n limit: {\n name: 'limit',\n in: 'query',\n description: 'Number of records to return in the response.',\n required: false,\n allowReserved: true,\n schema: {\n type: 'integer',\n minimum: 0,\n },\n },\n orderField: {\n name: 'orderField',\n in: 'query',\n description: 'The fields to sort returned results by.',\n required: false,\n allowReserved: true,\n schema: {\n type: 'array',\n items: {\n type: 'string',\n description: 'A two-item tuple of [field, order].',\n },\n },\n explode: true,\n style: 'form',\n examples: {\n 'Order ascending by name': {\n value: ['metadata.name,asc'],\n },\n 'Order descending by owner': {\n value: ['spec.owner,desc'],\n },\n },\n },\n },\n requestBodies: {},\n responses: {\n ErrorResponse: {\n description: 'An error response from the backend.',\n content: {\n 'application/json': {\n schema: {\n $ref: '#/components/schemas/Error',\n },\n },\n },\n },\n },\n schemas: {\n Error: {\n type: 'object',\n properties: {\n error: {\n type: 'object',\n properties: {\n name: {\n type: 'string',\n },\n message: {\n type: 'string',\n },\n stack: {\n type: 'string',\n },\n code: {\n type: 'string',\n },\n },\n required: ['name', 'message'],\n },\n request: {\n type: 'object',\n properties: {\n method: {\n type: 'string',\n },\n url: {\n type: 'string',\n },\n },\n required: ['method', 'url'],\n },\n response: {\n type: 'object',\n properties: {\n statusCode: {\n type: 'number',\n },\n },\n required: ['statusCode'],\n },\n },\n required: ['error', 'response'],\n additionalProperties: {},\n },\n JsonObject: {\n type: 'object',\n properties: {},\n description: 'A type representing all allowed JSON object values.',\n additionalProperties: {},\n },\n MapStringString: {\n type: 'object',\n properties: {},\n additionalProperties: {\n type: 'string',\n },\n description: 'Construct a type with a set of properties K of type T',\n },\n EntityLink: {\n type: 'object',\n properties: {\n type: {\n type: 'string',\n description:\n 'An optional value to categorize links into specific groups',\n },\n icon: {\n type: 'string',\n description:\n 'An optional semantic key that represents a visual icon.',\n },\n title: {\n type: 'string',\n description: 'An optional descriptive title for the link.',\n },\n url: {\n type: 'string',\n description: 'The url to the external site, document, etc.',\n },\n },\n required: ['url'],\n description:\n 'A link to external information that is related to the entity.',\n additionalProperties: false,\n },\n EntityMeta: {\n type: 'object',\n properties: {\n links: {\n type: 'array',\n items: {\n $ref: '#/components/schemas/EntityLink',\n },\n description: 'A list of external hyperlinks related to the entity.',\n },\n tags: {\n type: 'array',\n items: {\n type: 'string',\n },\n description:\n 'A list of single-valued strings, to for example classify catalog entities in\\nvarious ways.',\n },\n annotations: {\n $ref: '#/components/schemas/MapStringString',\n },\n labels: {\n $ref: '#/components/schemas/MapStringString',\n },\n description: {\n type: 'string',\n description:\n 'A short (typically relatively few words, on one line) description of the\\nentity.',\n },\n title: {\n type: 'string',\n description:\n 'A display name of the entity, to be presented in user interfaces instead\\nof the `name` property above, when available.\\nThis field is sometimes useful when the `name` is cumbersome or ends up\\nbeing perceived as overly technical. The title generally does not have\\nas stringent format requirements on it, so it may contain special\\ncharacters and be more explanatory. Do keep it very short though, and\\navoid situations where a title can be confused with the name of another\\nentity, or where two entities share a title.\\nNote that this is only for display purposes, and may be ignored by some\\nparts of the code. Entity references still always make use of the `name`\\nproperty, not the title.',\n },\n namespace: {\n type: 'string',\n description: 'The namespace that the entity belongs to.',\n },\n name: {\n type: 'string',\n description:\n 'The name of the entity.\\nMust be unique within the catalog at any given point in time, for any\\ngiven namespace + kind pair. This value is part of the technical\\nidentifier of the entity, and as such it will appear in URLs, database\\ntables, entity references, and similar. It is subject to restrictions\\nregarding what characters are allowed.\\nIf you want to use a different, more human readable string with fewer\\nrestrictions on it in user interfaces, see the `title` field below.',\n },\n etag: {\n type: 'string',\n description:\n 'An opaque string that changes for each update operation to any part of\\nthe entity, including metadata.\\nThis field can not be set by the user at creation time, and the server\\nwill reject an attempt to do so. The field will be populated in read\\noperations. The field can (optionally) be specified when performing\\nupdate or delete operations, and the server will then reject the\\noperation if it does not match the current stored value.',\n },\n uid: {\n type: 'string',\n description:\n 'A globally unique ID for the entity.\\nThis field can not be set by the user at creation time, and the server\\nwill reject an attempt to do so. The field will be populated in read\\noperations. The field can (optionally) be specified when performing\\nupdate or delete operations, but the server is free to reject requests\\nthat do so in such a way that it breaks semantics.',\n },\n },\n required: ['name'],\n description: 'Metadata fields common to all versions/kinds of entity.',\n additionalProperties: {},\n },\n EntityRelation: {\n type: 'object',\n properties: {\n targetRef: {\n type: 'string',\n description: 'The entity ref of the target of this relation.',\n },\n type: {\n type: 'string',\n description: 'The type of the relation.',\n },\n },\n required: ['targetRef', 'type'],\n description:\n 'A relation of a specific type to another entity in the catalog.',\n additionalProperties: false,\n },\n Entity: {\n type: 'object',\n properties: {\n relations: {\n type: 'array',\n items: {\n $ref: '#/components/schemas/EntityRelation',\n },\n description:\n 'The relations that this entity has with other entities.',\n },\n spec: {\n $ref: '#/components/schemas/JsonObject',\n },\n metadata: {\n $ref: '#/components/schemas/EntityMeta',\n },\n kind: {\n type: 'string',\n description: 'The high level entity type being described.',\n },\n apiVersion: {\n type: 'string',\n description:\n 'The version of specification format for this particular entity that\\nthis is written against.',\n },\n },\n required: ['metadata', 'kind', 'apiVersion'],\n description:\n \"The parts of the format that's common to all versions/kinds of entity.\",\n },\n NullableEntity: {\n type: 'object',\n properties: {\n relations: {\n type: 'array',\n items: {\n $ref: '#/components/schemas/EntityRelation',\n },\n description:\n 'The relations that this entity has with other entities.',\n },\n spec: {\n $ref: '#/components/schemas/JsonObject',\n },\n metadata: {\n $ref: '#/components/schemas/EntityMeta',\n },\n kind: {\n type: 'string',\n description: 'The high level entity type being described.',\n },\n apiVersion: {\n type: 'string',\n description:\n 'The version of specification format for this particular entity that\\nthis is written against.',\n },\n },\n required: ['metadata', 'kind', 'apiVersion'],\n description:\n \"The parts of the format that's common to all versions/kinds of entity.\",\n nullable: true,\n },\n EntityAncestryResponse: {\n type: 'object',\n properties: {\n items: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n parentEntityRefs: {\n items: {\n type: 'string',\n },\n type: 'array',\n },\n entity: {\n $ref: '#/components/schemas/Entity',\n },\n },\n required: ['parentEntityRefs', 'entity'],\n },\n },\n rootEntityRef: {\n type: 'string',\n },\n },\n required: ['items', 'rootEntityRef'],\n additionalProperties: false,\n },\n EntitiesBatchResponse: {\n type: 'object',\n properties: {\n items: {\n type: 'array',\n items: {\n $ref: '#/components/schemas/NullableEntity',\n },\n description:\n 'The list of entities, in the same order as the refs in the request. Entries\\nthat are null signify that no entity existed with that ref.',\n },\n },\n required: ['items'],\n additionalProperties: false,\n },\n EntityFacet: {\n type: 'object',\n properties: {\n value: {\n type: 'string',\n },\n count: {\n type: 'number',\n },\n },\n required: ['value', 'count'],\n additionalProperties: false,\n },\n EntityFacetsResponse: {\n type: 'object',\n properties: {\n facets: {\n type: 'object',\n additionalProperties: {\n type: 'array',\n items: {\n $ref: '#/components/schemas/EntityFacet',\n },\n },\n },\n },\n required: ['facets'],\n additionalProperties: false,\n },\n Location: {\n type: 'object',\n properties: {\n target: {\n type: 'string',\n },\n type: {\n type: 'string',\n },\n id: {\n type: 'string',\n },\n },\n required: ['target', 'type', 'id'],\n description: 'Entity location for a specific entity.',\n additionalProperties: false,\n },\n LocationSpec: {\n type: 'object',\n properties: {\n target: {\n type: 'string',\n },\n type: {\n type: 'string',\n },\n },\n required: ['target', 'type'],\n description: 'Holds the entity location information.',\n additionalProperties: false,\n },\n AnalyzeLocationExistingEntity: {\n type: 'object',\n properties: {\n entity: {\n $ref: '#/components/schemas/Entity',\n },\n isRegistered: {\n type: 'boolean',\n },\n location: {\n $ref: '#/components/schemas/LocationSpec',\n },\n },\n required: ['entity', 'isRegistered', 'location'],\n description:\n \"If the folder pointed to already contained catalog info yaml files, they are\\nread and emitted like this so that the frontend can inform the user that it\\nlocated them and can make sure to register them as well if they weren't\\nalready\",\n additionalProperties: false,\n },\n RecursivePartialEntityRelation: {\n type: 'object',\n properties: {\n targetRef: {\n type: 'string',\n description: 'The entity ref of the target of this relation.',\n },\n type: {\n type: 'string',\n description: 'The type of the relation.',\n },\n },\n description:\n 'A relation of a specific type to another entity in the catalog.',\n additionalProperties: false,\n },\n RecursivePartialEntityMeta: {\n allOf: [\n {\n $ref: '#/components/schemas/JsonObject',\n },\n {\n type: 'object',\n properties: {\n links: {\n type: 'array',\n items: {\n $ref: '#/components/schemas/EntityLink',\n },\n description:\n 'A list of external hyperlinks related to the entity.',\n },\n tags: {\n type: 'array',\n items: {\n type: 'string',\n },\n description:\n 'A list of single-valued strings, to for example classify catalog entities in\\nvarious ways.',\n },\n annotations: {\n $ref: '#/components/schemas/MapStringString',\n },\n labels: {\n $ref: '#/components/schemas/MapStringString',\n },\n description: {\n type: 'string',\n description:\n 'A short (typically relatively few words, on one line) description of the\\nentity.',\n },\n title: {\n type: 'string',\n description:\n 'A display name of the entity, to be presented in user interfaces instead\\nof the `name` property above, when available.\\nThis field is sometimes useful when the `name` is cumbersome or ends up\\nbeing perceived as overly technical. The title generally does not have\\nas stringent format requirements on it, so it may contain special\\ncharacters and be more explanatory. Do keep it very short though, and\\navoid situations where a title can be confused with the name of another\\nentity, or where two entities share a title.\\nNote that this is only for display purposes, and may be ignored by some\\nparts of the code. Entity references still always make use of the `name`\\nproperty, not the title.',\n },\n namespace: {\n type: 'string',\n description: 'The namespace that the entity belongs to.',\n },\n name: {\n type: 'string',\n description:\n 'The name of the entity.\\nMust be unique within the catalog at any given point in time, for any\\ngiven namespace + kind pair. This value is part of the technical\\nidentifier of the entity, and as such it will appear in URLs, database\\ntables, entity references, and similar. It is subject to restrictions\\nregarding what characters are allowed.\\nIf you want to use a different, more human readable string with fewer\\nrestrictions on it in user interfaces, see the `title` field below.',\n },\n etag: {\n type: 'string',\n description:\n 'An opaque string that changes for each update operation to any part of\\nthe entity, including metadata.\\nThis field can not be set by the user at creation time, and the server\\nwill reject an attempt to do so. The field will be populated in read\\noperations. The field can (optionally) be specified when performing\\nupdate or delete operations, and the server will then reject the\\noperation if it does not match the current stored value.',\n },\n uid: {\n type: 'string',\n description:\n 'A globally unique ID for the entity.\\nThis field can not be set by the user at creation time, and the server\\nwill reject an attempt to do so. The field will be populated in read\\noperations. The field can (optionally) be specified when performing\\nupdate or delete operations, but the server is free to reject requests\\nthat do so in such a way that it breaks semantics.',\n },\n },\n description:\n 'Metadata fields common to all versions/kinds of entity.',\n },\n ],\n additionalProperties: false,\n },\n RecursivePartialEntity: {\n type: 'object',\n properties: {\n apiVersion: {\n type: 'string',\n description:\n 'The version of specification format for this particular entity that\\nthis is written against.',\n },\n kind: {\n type: 'string',\n description: 'The high level entity type being described.',\n },\n metadata: {\n $ref: '#/components/schemas/RecursivePartialEntityMeta',\n },\n spec: {\n $ref: '#/components/schemas/JsonObject',\n },\n relations: {\n type: 'array',\n items: {\n $ref: '#/components/schemas/RecursivePartialEntityRelation',\n },\n description:\n 'The relations that this entity has with other entities.',\n },\n },\n description: 'Makes all keys of an entire hierarchy optional.',\n additionalProperties: false,\n },\n AnalyzeLocationEntityField: {\n type: 'object',\n properties: {\n description: {\n type: 'string',\n description:\n 'A text to show to the user to inform about the choices made. Like, it could say\\n\"Found a CODEOWNERS file that covers this target, so we suggest leaving this\\nfield empty; which would currently make it owned by X\" where X is taken from the\\ncodeowners file.',\n },\n value: {\n type: 'string',\n nullable: true,\n },\n state: {\n type: 'string',\n enum: [\n 'analysisSuggestedValue',\n 'analysisSuggestedNoValue',\n 'needsUserInput',\n ],\n description:\n 'The outcome of the analysis for this particular field',\n },\n field: {\n type: 'string',\n description:\n 'e.g. \"spec.owner\"? The frontend needs to know how to \"inject\" the field into the\\nentity again if the user wants to change it',\n },\n },\n required: ['description', 'value', 'state', 'field'],\n additionalProperties: false,\n },\n AnalyzeLocationGenerateEntity: {\n type: 'object',\n properties: {\n fields: {\n type: 'array',\n items: {\n $ref: '#/components/schemas/AnalyzeLocationEntityField',\n },\n },\n entity: {\n $ref: '#/components/schemas/RecursivePartialEntity',\n },\n },\n required: ['fields', 'entity'],\n description:\n \"This is some form of representation of what the analyzer could deduce.\\nWe should probably have a chat about how this can best be conveyed to\\nthe frontend. It'll probably contain a (possibly incomplete) entity, plus\\nenough info for the frontend to know what form data to show to the user\\nfor overriding/completing the info.\",\n additionalProperties: false,\n },\n AnalyzeLocationResponse: {\n type: 'object',\n properties: {\n generateEntities: {\n items: {\n $ref: '#/components/schemas/AnalyzeLocationGenerateEntity',\n },\n type: 'array',\n },\n existingEntityFiles: {\n items: {\n $ref: '#/components/schemas/AnalyzeLocationExistingEntity',\n },\n type: 'array',\n },\n },\n required: ['generateEntities', 'existingEntityFiles'],\n additionalProperties: false,\n },\n LocationInput: {\n type: 'object',\n properties: {\n type: {\n type: 'string',\n },\n target: {\n type: 'string',\n },\n },\n required: ['type', 'target'],\n additionalProperties: false,\n },\n EntitiesQueryResponse: {\n type: 'object',\n properties: {\n items: {\n type: 'array',\n items: {\n $ref: '#/components/schemas/Entity',\n },\n description: 'The list of entities paginated by a specific filter.',\n },\n totalItems: {\n type: 'number',\n },\n pageInfo: {\n type: 'object',\n properties: {\n nextCursor: {\n type: 'string',\n description: 'The cursor for the next batch of entities.',\n },\n prevCursor: {\n type: 'string',\n description: 'The cursor for the previous batch of entities.',\n },\n },\n },\n },\n required: ['items', 'totalItems', 'pageInfo'],\n additionalProperties: false,\n },\n },\n securitySchemes: {\n JWT: {\n type: 'http',\n scheme: 'bearer',\n bearerFormat: 'JWT',\n },\n },\n },\n paths: {\n '/refresh': {\n post: {\n operationId: 'RefreshEntity',\n description: 'Refresh the entity related to entityRef.',\n responses: {\n '200': {\n description: 'Refreshed',\n },\n '400': {\n $ref: '#/components/responses/ErrorResponse',\n },\n default: {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [],\n requestBody: {\n required: true,\n content: {\n 'application/json': {\n schema: {\n type: 'object',\n properties: {\n authorizationToken: {\n type: 'string',\n },\n entityRef: {\n type: 'string',\n description:\n 'The reference to a single entity that should be refreshed',\n },\n },\n required: ['entityRef'],\n description:\n 'Options for requesting a refresh of entities in the catalog.',\n additionalProperties: false,\n },\n },\n },\n },\n },\n },\n '/entities': {\n get: {\n operationId: 'GetEntities',\n description: 'Get all entities matching a given filter.',\n responses: {\n '200': {\n description: '',\n content: {\n 'application/json': {\n schema: {\n type: 'array',\n items: {\n $ref: '#/components/schemas/Entity',\n },\n },\n },\n },\n },\n '400': {\n $ref: '#/components/responses/ErrorResponse',\n },\n default: {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [\n {\n $ref: '#/components/parameters/fields',\n },\n {\n $ref: '#/components/parameters/limit',\n },\n {\n $ref: '#/components/parameters/filter',\n },\n {\n $ref: '#/components/parameters/offset',\n },\n {\n $ref: '#/components/parameters/after',\n },\n {\n name: 'order',\n in: 'query',\n allowReserved: true,\n required: false,\n schema: {\n type: 'array',\n items: {\n type: 'string',\n },\n },\n },\n ],\n },\n },\n '/entities/by-uid/{uid}': {\n get: {\n operationId: 'GetEntityByUid',\n description: 'Get a single entity by the UID.',\n responses: {\n '200': {\n description: 'Ok',\n content: {\n 'application/json': {\n schema: {\n $ref: '#/components/schemas/Entity',\n },\n },\n },\n },\n '400': {\n $ref: '#/components/responses/ErrorResponse',\n },\n default: {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [\n {\n $ref: '#/components/parameters/uid',\n },\n ],\n },\n delete: {\n operationId: 'DeleteEntityByUid',\n description: 'Delete a single entity by UID.',\n responses: {\n '204': {\n description: 'Deleted successfully.',\n },\n '400': {\n $ref: '#/components/responses/ErrorResponse',\n },\n default: {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [\n {\n $ref: '#/components/parameters/uid',\n },\n ],\n },\n },\n '/entities/by-name/{kind}/{namespace}/{name}': {\n get: {\n operationId: 'GetEntityByName',\n description: 'Get an entity by an entity ref.',\n responses: {\n '200': {\n description: 'Ok',\n content: {\n 'application/json': {\n schema: {\n $ref: '#/components/schemas/Entity',\n },\n },\n },\n },\n '400': {\n $ref: '#/components/responses/ErrorResponse',\n },\n default: {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [\n {\n $ref: '#/components/parameters/kind',\n },\n {\n $ref: '#/components/parameters/namespace',\n },\n {\n $ref: '#/components/parameters/name',\n },\n ],\n },\n },\n '/entities/by-name/{kind}/{namespace}/{name}/ancestry': {\n get: {\n operationId: 'GetEntityAncestryByName',\n description: \"Get an entity's ancestry by entity ref.\",\n responses: {\n '200': {\n description: 'Ok',\n content: {\n 'application/json': {\n schema: {\n $ref: '#/components/schemas/EntityAncestryResponse',\n },\n },\n },\n },\n '400': {\n $ref: '#/components/responses/ErrorResponse',\n },\n default: {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [\n {\n $ref: '#/components/parameters/kind',\n },\n {\n $ref: '#/components/parameters/namespace',\n },\n {\n $ref: '#/components/parameters/name',\n },\n ],\n },\n },\n '/entities/by-refs': {\n post: {\n operationId: 'GetEntitiesByRefs',\n description:\n 'Get a batch set of entities given an array of entityRefs.',\n responses: {\n '200': {\n description: 'Ok',\n content: {\n 'application/json': {\n schema: {\n $ref: '#/components/schemas/EntitiesBatchResponse',\n },\n },\n },\n },\n '400': {\n $ref: '#/components/responses/ErrorResponse',\n },\n default: {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n requestBody: {\n required: false,\n content: {\n 'application/json': {\n schema: {\n type: 'object',\n required: ['entityRefs'],\n properties: {\n entityRefs: {\n type: 'array',\n items: {\n type: 'string',\n },\n },\n fields: {\n type: 'array',\n items: {\n type: 'string',\n },\n },\n },\n },\n examples: {\n 'Fetch Backstage entities': {\n value: {\n entityRefs: [\n 'component:default/backstage',\n 'api:default/backstage',\n ],\n },\n },\n 'Fetch annotations for backstage entity': {\n value: {\n entityRefs: ['component:default/backstage'],\n fields: ['metadata.annotations'],\n },\n },\n },\n },\n },\n },\n parameters: [\n {\n $ref: '#/components/parameters/filter',\n },\n ],\n },\n },\n '/entities/by-query': {\n get: {\n operationId: 'GetEntitiesByQuery',\n description: 'Search for entities by a given query.',\n responses: {\n '200': {\n description: 'Ok',\n content: {\n 'application/json': {\n schema: {\n $ref: '#/components/schemas/EntitiesQueryResponse',\n },\n },\n },\n },\n '400': {\n $ref: '#/components/responses/ErrorResponse',\n },\n default: {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [\n {\n $ref: '#/components/parameters/fields',\n },\n {\n $ref: '#/components/parameters/limit',\n },\n {\n $ref: '#/components/parameters/offset',\n },\n {\n $ref: '#/components/parameters/orderField',\n },\n {\n $ref: '#/components/parameters/cursor',\n },\n {\n $ref: '#/components/parameters/filter',\n },\n {\n name: 'fullTextFilterTerm',\n in: 'query',\n description: 'Text search term.',\n required: false,\n allowReserved: true,\n schema: {\n type: 'string',\n },\n },\n {\n name: 'fullTextFilterFields',\n in: 'query',\n description:\n 'A comma separated list of fields to sort returned results by.',\n required: false,\n allowReserved: true,\n schema: {\n type: 'array',\n items: {\n type: 'string',\n },\n },\n explode: false,\n style: 'form',\n },\n ],\n },\n },\n '/entity-facets': {\n get: {\n operationId: 'GetEntityFacets',\n description: 'Get all entity facets that match the given filters.',\n responses: {\n '200': {\n description: 'Ok',\n content: {\n 'application/json': {\n schema: {\n $ref: '#/components/schemas/EntityFacetsResponse',\n },\n },\n },\n },\n '400': {\n $ref: '#/components/responses/ErrorResponse',\n },\n default: {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [\n {\n in: 'query',\n name: 'facet',\n required: true,\n allowReserved: true,\n schema: {\n type: 'array',\n items: {\n type: 'string',\n },\n },\n examples: {\n 'Entities by kind': {\n value: ['kind'],\n },\n 'Entities by spec type': {\n value: ['spec.type'],\n },\n },\n },\n {\n $ref: '#/components/parameters/filter',\n },\n ],\n },\n },\n '/locations': {\n post: {\n operationId: 'CreateLocation',\n description: 'Create a location for a given target.',\n responses: {\n '201': {\n description: 'Created',\n content: {\n 'application/json': {\n schema: {\n type: 'object',\n properties: {\n exists: {\n type: 'boolean',\n },\n entities: {\n items: {\n $ref: '#/components/schemas/Entity',\n },\n type: 'array',\n },\n location: {\n $ref: '#/components/schemas/Location',\n },\n },\n required: ['entities', 'location'],\n },\n },\n },\n },\n '400': {\n $ref: '#/components/responses/ErrorResponse',\n },\n default: {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [\n {\n in: 'query',\n name: 'dryRun',\n required: false,\n allowReserved: true,\n schema: {\n type: 'string',\n },\n },\n ],\n requestBody: {\n required: true,\n content: {\n 'application/json': {\n schema: {\n type: 'object',\n properties: {\n target: {\n type: 'string',\n },\n type: {\n type: 'string',\n },\n },\n required: ['target', 'type'],\n },\n },\n },\n },\n },\n get: {\n operationId: 'GetLocations',\n description: 'Get all locations',\n responses: {\n '200': {\n description: 'Ok',\n content: {\n 'application/json': {\n schema: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n data: {\n $ref: '#/components/schemas/Location',\n },\n },\n required: ['data'],\n },\n },\n },\n },\n },\n default: {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [],\n },\n },\n '/locations/{id}': {\n get: {\n operationId: 'GetLocation',\n description: 'Get a location by id.',\n responses: {\n '200': {\n description: 'Ok',\n content: {\n 'application/json': {\n schema: {\n $ref: '#/components/schemas/Location',\n },\n },\n },\n },\n default: {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [\n {\n in: 'path',\n name: 'id',\n required: true,\n allowReserved: true,\n schema: {\n type: 'string',\n },\n },\n ],\n },\n delete: {\n operationId: 'DeleteLocation',\n description: 'Delete a location by id.',\n responses: {\n '204': {\n description: 'No content',\n },\n '400': {\n $ref: '#/components/responses/ErrorResponse',\n },\n default: {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [\n {\n in: 'path',\n name: 'id',\n required: true,\n allowReserved: true,\n schema: {\n type: 'string',\n },\n },\n ],\n },\n },\n '/locations/by-entity/{kind}/{namespace}/{name}': {\n get: {\n operationId: 'getLocationByEntity',\n description: 'Get a location for entity.',\n responses: {\n '200': {\n description: 'Ok',\n content: {\n 'application/json': {\n schema: {\n $ref: '#/components/schemas/Location',\n },\n },\n },\n },\n default: {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [\n {\n in: 'path',\n name: 'kind',\n required: true,\n allowReserved: true,\n schema: {\n type: 'string',\n },\n },\n {\n in: 'path',\n name: 'namespace',\n required: true,\n allowReserved: true,\n schema: {\n type: 'string',\n },\n },\n {\n in: 'path',\n name: 'name',\n required: true,\n allowReserved: true,\n schema: {\n type: 'string',\n },\n },\n ],\n },\n },\n '/analyze-location': {\n post: {\n operationId: 'AnalyzeLocation',\n description: 'Validate a given location.',\n responses: {\n '200': {\n description: 'Ok',\n content: {\n 'application/json': {\n schema: {\n $ref: '#/components/schemas/AnalyzeLocationResponse',\n },\n },\n },\n },\n '400': {\n $ref: '#/components/responses/ErrorResponse',\n },\n default: {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [],\n requestBody: {\n required: true,\n content: {\n 'application/json': {\n schema: {\n type: 'object',\n properties: {\n catalogFileName: {\n type: 'string',\n },\n location: {\n $ref: '#/components/schemas/LocationInput',\n },\n },\n required: ['location'],\n },\n },\n },\n },\n },\n },\n '/validate-entity': {\n post: {\n operationId: 'ValidateEntity',\n description:\n 'Validate that a passed in entity has no errors in schema.',\n responses: {\n '200': {\n description: 'Ok',\n },\n '400': {\n description: 'Validation errors.',\n content: {\n 'application/json': {\n schema: {\n type: 'object',\n properties: {\n errors: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n name: {\n type: 'string',\n },\n message: {\n type: 'string',\n },\n },\n required: ['name', 'message'],\n additionalProperties: {},\n },\n },\n },\n required: ['errors'],\n },\n },\n },\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [],\n requestBody: {\n required: true,\n content: {\n 'application/json': {\n schema: {\n type: 'object',\n properties: {\n location: {\n type: 'string',\n },\n entity: {\n type: 'object',\n additionalProperties: {},\n },\n },\n required: ['location', 'entity'],\n },\n },\n },\n },\n },\n },\n },\n} as const;\nexport const createOpenApiRouter = async (\n options?: Parameters<\n typeof createValidatedOpenApiRouterFromGeneratedEndpointMap\n >['1'],\n) =>\n createValidatedOpenApiRouterFromGeneratedEndpointMap<EndpointMap>(\n spec,\n options,\n );\n"],"names":["createValidatedOpenApiRouterFromGeneratedEndpointMap"],"mappings":";;;;AAsBO,MAAM,IAAO,GAAA;AAAA,EAClB,OAAS,EAAA,OAAA;AAAA,EACT,IAAM,EAAA;AAAA,IACJ,KAAO,EAAA,SAAA;AAAA,IACP,OAAS,EAAA,GAAA;AAAA,IACT,WACE,EAAA,kEAAA;AAAA,IACF,OAAS,EAAA;AAAA,MACP,IAAM,EAAA,YAAA;AAAA,MACN,GAAK,EAAA;AAAA,KACP;AAAA,IACA,SAAS;AAAC,GACZ;AAAA,EACA,OAAS,EAAA;AAAA,IACP;AAAA,MACE,GAAK,EAAA;AAAA;AACP,GACF;AAAA,EACA,UAAY,EAAA;AAAA,IACV,UAAU,EAAC;AAAA,IACX,SAAS,EAAC;AAAA,IACV,UAAY,EAAA;AAAA,MACV,IAAM,EAAA;AAAA,QACJ,IAAM,EAAA,MAAA;AAAA,QACN,EAAI,EAAA,MAAA;AAAA,QACJ,QAAU,EAAA,IAAA;AAAA,QACV,aAAe,EAAA,IAAA;AAAA,QACf,MAAQ,EAAA;AAAA,UACN,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;AAAA,UACD;AAAA,YACE,KAAK;AAAC;AACR,SACF;AAAA,QACA,YAAY,EAAC;AAAA,QACb,WAAa,EAAA;AAAA,UACX,QAAU,EAAA,IAAA;AAAA,UACV,OAAS,EAAA;AAAA,YACP,kBAAoB,EAAA;AAAA,cAClB,MAAQ,EAAA;AAAA,gBACN,IAAM,EAAA,QAAA;AAAA,gBACN,UAAY,EAAA;AAAA,kBACV,QAAU,EAAA;AAAA,oBACR,IAAM,EAAA;AAAA,mBACR;AAAA,kBACA,MAAQ,EAAA;AAAA,oBACN,IAAM,EAAA,QAAA;AAAA,oBACN,sBAAsB;AAAC;AACzB,iBACF;AAAA,gBACA,QAAA,EAAU,CAAC,UAAA,EAAY,QAAQ;AAAA;AACjC;AACF;AACF;AACF;AACF;AACF;AAEJ;AACa,MAAA,mBAAA,GAAsB,OACjC,OAIA,KAAAA,wEAAA;AAAA,EACE,IAAA;AAAA,EACA;AACF;;;;;"}
|
|
1
|
+
{"version":3,"file":"router.cjs.js","sources":["../../../../src/schema/openapi/generated/router.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// ******************************************************************\n// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. *\n// ******************************************************************\nimport { createValidatedOpenApiRouterFromGeneratedEndpointMap } from '@backstage/backend-openapi-utils';\nimport { EndpointMap } from './';\n\nexport const spec = {\n openapi: '3.0.3',\n info: {\n title: 'catalog',\n version: '1',\n description:\n 'The API surface consists of a few distinct groups of functionality. Each has a\\ndedicated section below.\\n\\n> **Note:** This page only describes some of the most commonly used parts of the\\n> API, and is a work in progress.\\n\\nAll of the URL paths in this article are assumed to be on top of some base URL\\npointing at your catalog installation. For example, if the path given in a\\nsection below is `/entities`, and the catalog is located at\\n`http://localhost:7007/api/catalog` during local development, the full URL would\\nbe `http://localhost:7007/api/catalog/entities`. The actual URL may vary from\\none organization to the other, especially in production, but is commonly your\\n`backend.baseUrl` in your app config, plus `/api/catalog` at the end.\\n\\nSome or all of the endpoints may accept or require an `Authorization` header\\nwith a `Bearer` token, which should then be the Backstage token returned by the\\n[`identity API`](https://backstage.io/docs/reference/core-plugin-api.identityapiref).\\n',\n license: {\n name: 'Apache-2.0',\n url: 'http://www.apache.org/licenses/LICENSE-2.0.html',\n },\n contact: {},\n },\n servers: [\n {\n url: '/',\n },\n ],\n components: {\n examples: {},\n headers: {},\n parameters: {\n kind: {\n name: 'kind',\n in: 'path',\n required: true,\n allowReserved: true,\n schema: {\n type: 'string',\n },\n },\n namespace: {\n name: 'namespace',\n in: 'path',\n required: true,\n allowReserved: true,\n schema: {\n type: 'string',\n },\n },\n name: {\n name: 'name',\n in: 'path',\n required: true,\n allowReserved: true,\n schema: {\n type: 'string',\n },\n },\n uid: {\n name: 'uid',\n in: 'path',\n required: true,\n allowReserved: true,\n schema: {\n type: 'string',\n },\n },\n cursor: {\n name: 'cursor',\n in: 'query',\n description:\n 'You may pass the `cursor` query parameters to perform cursor based pagination\\nthrough the set of entities. The value of `cursor` will be returned in the response, under the `pageInfo` property:\\n\\n```json\\n \"pageInfo\": {\\n \"nextCursor\": \"a-cursor\",\\n \"prevCursor\": \"another-cursor\"\\n }\\n```\\n\\nIf `nextCursor` exists, it can be used to retrieve the next batch of entities. Following the same approach,\\nif `prevCursor` exists, it can be used to retrieve the previous batch of entities.\\n\\n- [`filter`](#filtering), for selecting only a subset of all entities\\n- [`fields`](#field-selection), for selecting only parts of the full data\\n structure of each entity\\n- `limit` for limiting the number of entities returned (20 is the default)\\n- [`orderField`](#ordering), for deciding the order of the entities\\n- `fullTextFilter`\\n **NOTE**: [`filter`, `orderField`, `fullTextFilter`] and `cursor` are mutually exclusive. This means that,\\n it isn\\'t possible to change any of [`filter`, `orderField`, `fullTextFilter`] when passing `cursor` as query parameters,\\n as changing any of these properties will affect pagination. If any of `filter`, `orderField`, `fullTextFilter` is specified together with `cursor`, only the latter is taken into consideration.\\n',\n required: false,\n allowReserved: true,\n schema: {\n type: 'string',\n minLength: 1,\n },\n },\n after: {\n name: 'after',\n in: 'query',\n description: 'Pointer to the previous page of results.',\n required: false,\n allowReserved: true,\n schema: {\n type: 'string',\n minLength: 1,\n },\n },\n fields: {\n name: 'fields',\n in: 'query',\n description:\n \"By default the full entities are returned, but you can pass in a `fields` query\\nparameter which selects what parts of the entity data to retain. This makes the\\nresponse smaller and faster to transfer, and may allow the catalog to perform\\nmore efficient queries.\\n\\nThe query parameter value is a comma separated list of simplified JSON paths\\nlike above. Each path corresponds to the key of either a value, or of a subtree\\nroot that you want to keep in the output. The rest is pruned away. For example,\\nspecifying `?fields=metadata.name,metadata.annotations,spec` retains only the\\n`name` and `annotations` fields of the `metadata` of each entity (it'll be an\\nobject with at most two keys), keeps the entire `spec` unchanged, and cuts out\\nall other roots such as `relations`.\\n\\nSome more real world usable examples:\\n\\n- Return only enough data to form the full ref of each entity:\\n\\n `/entities/by-query?fields=kind,metadata.namespace,metadata.name`\\n\",\n required: false,\n allowReserved: true,\n explode: false,\n schema: {\n type: 'array',\n items: {\n type: 'string',\n },\n },\n examples: {\n 'Get name and the entire relations collection': {\n value: ['metadata.name', 'relations'],\n },\n 'Get kind, name and namespace': {\n value: ['kind', 'metadata.name', 'metadata.namespace'],\n },\n },\n },\n filter: {\n name: 'filter',\n in: 'query',\n description:\n 'You can pass in one or more filter sets that get matched against each entity.\\nEach filter set is a number of conditions that all have to match for the\\ncondition to be true (conditions effectively have an AND between them). At least\\none filter set has to be true for the entity to be part of the result set\\n(filter sets effectively have an OR between them).\\n\\nExample:\\n\\n```text\\n/entities/by-query?filter=kind=user,metadata.namespace=default&filter=kind=group,spec.type\\n\\n Return entities that match\\n\\n Filter set 1:\\n Condition 1: kind = user\\n AND\\n Condition 2: metadata.namespace = default\\n\\n OR\\n\\n Filter set 2:\\n Condition 1: kind = group\\n AND\\n Condition 2: spec.type exists\\n```\\n\\nEach condition is either on the form `<key>`, or on the form `<key>=<value>`.\\nThe first form asserts on the existence of a certain key (with any value), and\\nthe second asserts that the key exists and has a certain value. All checks are\\nalways case _insensitive_.\\n\\nIn all cases, the key is a simplified JSON path in a given piece of entity data.\\nEach part of the path is a key of an object, and the traversal also descends\\nthrough arrays. There are two special forms:\\n\\n- Array items that are simple value types (such as strings) match on a key-value\\n pair where the key is the item as a string, and the value is the string `true`\\n- Relations can be matched on a `relations.<type>=<targetRef>` form\\n\\nLet\\'s look at a simplified example to illustrate the concept:\\n\\n```json\\n{\\n \"a\": {\\n \"b\": [\"c\", { \"d\": 1 }],\\n \"e\": 7\\n }\\n}\\n```\\n\\nThis would match any one of the following conditions:\\n\\n- `a`\\n- `a.b`\\n- `a.b.c`\\n- `a.b.c=true`\\n- `a.b.d`\\n- `a.b.d=1`\\n- `a.e`\\n- `a.e=7`\\n\\nSome more real world usable examples:\\n\\n- Return all orphaned entities:\\n\\n `/entities/by-query?filter=metadata.annotations.backstage.io/orphan=true`\\n\\n- Return all users and groups:\\n\\n `/entities/by-query?filter=kind=user&filter=kind=group`\\n\\n- Return all service components:\\n\\n `/entities/by-query?filter=kind=component,spec.type=service`\\n\\n- Return all entities with the `java` tag:\\n\\n `/entities/by-query?filter=metadata.tags.java`\\n\\n- Return all users who are members of the `ops` group (note that the full\\n [reference](references.md) of the group is used):\\n\\n `/entities/by-query?filter=kind=user,relations.memberof=group:default/ops`\\n',\n required: false,\n allowReserved: true,\n schema: {\n type: 'array',\n items: {\n type: 'string',\n },\n },\n examples: {\n 'Get groups': {\n value: ['kind=group'],\n },\n 'Get orphaned components': {\n value: [\n 'kind=component,metadata.annotations.backstage.io/orphan=true',\n ],\n },\n },\n },\n offset: {\n name: 'offset',\n in: 'query',\n description: 'Number of records to skip in the query page.',\n required: false,\n allowReserved: true,\n schema: {\n type: 'integer',\n minimum: 0,\n },\n },\n limit: {\n name: 'limit',\n in: 'query',\n description: 'Number of records to return in the response.',\n required: false,\n allowReserved: true,\n schema: {\n type: 'integer',\n minimum: 0,\n },\n },\n orderField: {\n name: 'orderField',\n in: 'query',\n description:\n 'By default the entities are returned ordered by their internal uid. You can\\ncustomize the `orderField` query parameters to affect that ordering.\\n\\nFor example, to return entities by their name:\\n\\n`/entities/by-query?orderField=metadata.name,asc`\\n\\nEach parameter can be followed by `asc` for ascending lexicographical order or\\n`desc` for descending (reverse) lexicographical order.\\n',\n required: false,\n allowReserved: true,\n schema: {\n type: 'array',\n items: {\n type: 'string',\n description: 'A two-item tuple of [field, order].',\n },\n },\n explode: true,\n style: 'form',\n examples: {\n 'Order ascending by name': {\n value: ['metadata.name,asc'],\n },\n 'Order descending by owner': {\n value: ['spec.owner,desc'],\n },\n },\n },\n },\n requestBodies: {},\n responses: {\n ErrorResponse: {\n description: 'An error response from the backend.',\n content: {\n 'application/json': {\n schema: {\n $ref: '#/components/schemas/Error',\n },\n },\n },\n },\n },\n schemas: {\n Error: {\n type: 'object',\n properties: {\n error: {\n type: 'object',\n properties: {\n name: {\n type: 'string',\n },\n message: {\n type: 'string',\n },\n stack: {\n type: 'string',\n },\n code: {\n type: 'string',\n },\n },\n required: ['name', 'message'],\n },\n request: {\n type: 'object',\n properties: {\n method: {\n type: 'string',\n },\n url: {\n type: 'string',\n },\n },\n required: ['method', 'url'],\n },\n response: {\n type: 'object',\n properties: {\n statusCode: {\n type: 'number',\n },\n },\n required: ['statusCode'],\n },\n },\n required: ['error', 'response'],\n additionalProperties: {},\n },\n JsonObject: {\n type: 'object',\n properties: {},\n description: 'A type representing all allowed JSON object values.',\n additionalProperties: {},\n },\n MapStringString: {\n type: 'object',\n properties: {},\n additionalProperties: {\n type: 'string',\n },\n description: 'Construct a type with a set of properties K of type T',\n },\n EntityLink: {\n type: 'object',\n properties: {\n type: {\n type: 'string',\n description:\n 'An optional value to categorize links into specific groups',\n },\n icon: {\n type: 'string',\n description:\n 'An optional semantic key that represents a visual icon.',\n },\n title: {\n type: 'string',\n description: 'An optional descriptive title for the link.',\n },\n url: {\n type: 'string',\n description: 'The url to the external site, document, etc.',\n },\n },\n required: ['url'],\n description:\n 'A link to external information that is related to the entity.',\n additionalProperties: false,\n },\n EntityMeta: {\n type: 'object',\n properties: {\n links: {\n type: 'array',\n items: {\n $ref: '#/components/schemas/EntityLink',\n },\n description: 'A list of external hyperlinks related to the entity.',\n },\n tags: {\n type: 'array',\n items: {\n type: 'string',\n },\n description:\n 'A list of single-valued strings, to for example classify catalog entities in\\nvarious ways.',\n },\n annotations: {\n $ref: '#/components/schemas/MapStringString',\n },\n labels: {\n $ref: '#/components/schemas/MapStringString',\n },\n description: {\n type: 'string',\n description:\n 'A short (typically relatively few words, on one line) description of the\\nentity.',\n },\n title: {\n type: 'string',\n description:\n 'A display name of the entity, to be presented in user interfaces instead\\nof the `name` property above, when available.\\nThis field is sometimes useful when the `name` is cumbersome or ends up\\nbeing perceived as overly technical. The title generally does not have\\nas stringent format requirements on it, so it may contain special\\ncharacters and be more explanatory. Do keep it very short though, and\\navoid situations where a title can be confused with the name of another\\nentity, or where two entities share a title.\\nNote that this is only for display purposes, and may be ignored by some\\nparts of the code. Entity references still always make use of the `name`\\nproperty, not the title.',\n },\n namespace: {\n type: 'string',\n description: 'The namespace that the entity belongs to.',\n },\n name: {\n type: 'string',\n description:\n 'The name of the entity.\\nMust be unique within the catalog at any given point in time, for any\\ngiven namespace + kind pair. This value is part of the technical\\nidentifier of the entity, and as such it will appear in URLs, database\\ntables, entity references, and similar. It is subject to restrictions\\nregarding what characters are allowed.\\nIf you want to use a different, more human readable string with fewer\\nrestrictions on it in user interfaces, see the `title` field below.',\n },\n etag: {\n type: 'string',\n description:\n 'An opaque string that changes for each update operation to any part of\\nthe entity, including metadata.\\nThis field can not be set by the user at creation time, and the server\\nwill reject an attempt to do so. The field will be populated in read\\noperations. The field can (optionally) be specified when performing\\nupdate or delete operations, and the server will then reject the\\noperation if it does not match the current stored value.',\n },\n uid: {\n type: 'string',\n description:\n 'A globally unique ID for the entity.\\nThis field can not be set by the user at creation time, and the server\\nwill reject an attempt to do so. The field will be populated in read\\noperations. The field can (optionally) be specified when performing\\nupdate or delete operations, but the server is free to reject requests\\nthat do so in such a way that it breaks semantics.',\n },\n },\n required: ['name'],\n description: 'Metadata fields common to all versions/kinds of entity.',\n additionalProperties: {},\n },\n EntityRelation: {\n type: 'object',\n properties: {\n targetRef: {\n type: 'string',\n description: 'The entity ref of the target of this relation.',\n },\n type: {\n type: 'string',\n description: 'The type of the relation.',\n },\n },\n required: ['targetRef', 'type'],\n description:\n 'A relation of a specific type to another entity in the catalog.',\n additionalProperties: false,\n },\n Entity: {\n type: 'object',\n properties: {\n relations: {\n type: 'array',\n items: {\n $ref: '#/components/schemas/EntityRelation',\n },\n description:\n 'The relations that this entity has with other entities.',\n },\n spec: {\n $ref: '#/components/schemas/JsonObject',\n },\n metadata: {\n $ref: '#/components/schemas/EntityMeta',\n },\n kind: {\n type: 'string',\n description: 'The high level entity type being described.',\n },\n apiVersion: {\n type: 'string',\n description:\n 'The version of specification format for this particular entity that\\nthis is written against.',\n },\n },\n required: ['metadata', 'kind', 'apiVersion'],\n description:\n \"The parts of the format that's common to all versions/kinds of entity.\",\n },\n NullableEntity: {\n type: 'object',\n properties: {\n relations: {\n type: 'array',\n items: {\n $ref: '#/components/schemas/EntityRelation',\n },\n description:\n 'The relations that this entity has with other entities.',\n },\n spec: {\n $ref: '#/components/schemas/JsonObject',\n },\n metadata: {\n $ref: '#/components/schemas/EntityMeta',\n },\n kind: {\n type: 'string',\n description: 'The high level entity type being described.',\n },\n apiVersion: {\n type: 'string',\n description:\n 'The version of specification format for this particular entity that\\nthis is written against.',\n },\n },\n required: ['metadata', 'kind', 'apiVersion'],\n description:\n \"The parts of the format that's common to all versions/kinds of entity.\",\n nullable: true,\n },\n EntityAncestryResponse: {\n type: 'object',\n properties: {\n items: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n parentEntityRefs: {\n items: {\n type: 'string',\n },\n type: 'array',\n },\n entity: {\n $ref: '#/components/schemas/Entity',\n },\n },\n required: ['parentEntityRefs', 'entity'],\n },\n },\n rootEntityRef: {\n type: 'string',\n },\n },\n required: ['items', 'rootEntityRef'],\n additionalProperties: false,\n },\n EntitiesBatchResponse: {\n type: 'object',\n properties: {\n items: {\n type: 'array',\n items: {\n $ref: '#/components/schemas/NullableEntity',\n },\n description:\n 'The list of entities, in the same order as the refs in the request. Entries\\nthat are null signify that no entity existed with that ref.',\n },\n },\n required: ['items'],\n additionalProperties: false,\n },\n EntityFacet: {\n type: 'object',\n properties: {\n value: {\n type: 'string',\n },\n count: {\n type: 'number',\n },\n },\n required: ['value', 'count'],\n additionalProperties: false,\n },\n EntityFacetsResponse: {\n type: 'object',\n properties: {\n facets: {\n type: 'object',\n additionalProperties: {\n type: 'array',\n items: {\n $ref: '#/components/schemas/EntityFacet',\n },\n },\n },\n },\n required: ['facets'],\n additionalProperties: false,\n },\n Location: {\n type: 'object',\n properties: {\n target: {\n type: 'string',\n },\n type: {\n type: 'string',\n },\n id: {\n type: 'string',\n },\n },\n required: ['target', 'type', 'id'],\n description: 'Entity location for a specific entity.',\n additionalProperties: false,\n },\n LocationSpec: {\n type: 'object',\n properties: {\n target: {\n type: 'string',\n },\n type: {\n type: 'string',\n },\n },\n required: ['target', 'type'],\n description: 'Holds the entity location information.',\n additionalProperties: false,\n },\n AnalyzeLocationExistingEntity: {\n type: 'object',\n properties: {\n entity: {\n $ref: '#/components/schemas/Entity',\n },\n isRegistered: {\n type: 'boolean',\n },\n location: {\n $ref: '#/components/schemas/LocationSpec',\n },\n },\n required: ['entity', 'isRegistered', 'location'],\n description:\n \"If the folder pointed to already contained catalog info yaml files, they are\\nread and emitted like this so that the frontend can inform the user that it\\nlocated them and can make sure to register them as well if they weren't\\nalready\",\n additionalProperties: false,\n },\n RecursivePartialEntityRelation: {\n type: 'object',\n properties: {\n targetRef: {\n type: 'string',\n description: 'The entity ref of the target of this relation.',\n },\n type: {\n type: 'string',\n description: 'The type of the relation.',\n },\n },\n description:\n 'A relation of a specific type to another entity in the catalog.',\n additionalProperties: false,\n },\n RecursivePartialEntityMeta: {\n allOf: [\n {\n $ref: '#/components/schemas/JsonObject',\n },\n {\n type: 'object',\n properties: {\n links: {\n type: 'array',\n items: {\n $ref: '#/components/schemas/EntityLink',\n },\n description:\n 'A list of external hyperlinks related to the entity.',\n },\n tags: {\n type: 'array',\n items: {\n type: 'string',\n },\n description:\n 'A list of single-valued strings, to for example classify catalog entities in\\nvarious ways.',\n },\n annotations: {\n $ref: '#/components/schemas/MapStringString',\n },\n labels: {\n $ref: '#/components/schemas/MapStringString',\n },\n description: {\n type: 'string',\n description:\n 'A short (typically relatively few words, on one line) description of the\\nentity.',\n },\n title: {\n type: 'string',\n description:\n 'A display name of the entity, to be presented in user interfaces instead\\nof the `name` property above, when available.\\nThis field is sometimes useful when the `name` is cumbersome or ends up\\nbeing perceived as overly technical. The title generally does not have\\nas stringent format requirements on it, so it may contain special\\ncharacters and be more explanatory. Do keep it very short though, and\\navoid situations where a title can be confused with the name of another\\nentity, or where two entities share a title.\\nNote that this is only for display purposes, and may be ignored by some\\nparts of the code. Entity references still always make use of the `name`\\nproperty, not the title.',\n },\n namespace: {\n type: 'string',\n description: 'The namespace that the entity belongs to.',\n },\n name: {\n type: 'string',\n description:\n 'The name of the entity.\\nMust be unique within the catalog at any given point in time, for any\\ngiven namespace + kind pair. This value is part of the technical\\nidentifier of the entity, and as such it will appear in URLs, database\\ntables, entity references, and similar. It is subject to restrictions\\nregarding what characters are allowed.\\nIf you want to use a different, more human readable string with fewer\\nrestrictions on it in user interfaces, see the `title` field below.',\n },\n etag: {\n type: 'string',\n description:\n 'An opaque string that changes for each update operation to any part of\\nthe entity, including metadata.\\nThis field can not be set by the user at creation time, and the server\\nwill reject an attempt to do so. The field will be populated in read\\noperations. The field can (optionally) be specified when performing\\nupdate or delete operations, and the server will then reject the\\noperation if it does not match the current stored value.',\n },\n uid: {\n type: 'string',\n description:\n 'A globally unique ID for the entity.\\nThis field can not be set by the user at creation time, and the server\\nwill reject an attempt to do so. The field will be populated in read\\noperations. The field can (optionally) be specified when performing\\nupdate or delete operations, but the server is free to reject requests\\nthat do so in such a way that it breaks semantics.',\n },\n },\n description:\n 'Metadata fields common to all versions/kinds of entity.',\n },\n ],\n additionalProperties: false,\n },\n RecursivePartialEntity: {\n type: 'object',\n properties: {\n apiVersion: {\n type: 'string',\n description:\n 'The version of specification format for this particular entity that\\nthis is written against.',\n },\n kind: {\n type: 'string',\n description: 'The high level entity type being described.',\n },\n metadata: {\n $ref: '#/components/schemas/RecursivePartialEntityMeta',\n },\n spec: {\n $ref: '#/components/schemas/JsonObject',\n },\n relations: {\n type: 'array',\n items: {\n $ref: '#/components/schemas/RecursivePartialEntityRelation',\n },\n description:\n 'The relations that this entity has with other entities.',\n },\n },\n description: 'Makes all keys of an entire hierarchy optional.',\n additionalProperties: false,\n },\n AnalyzeLocationEntityField: {\n type: 'object',\n properties: {\n description: {\n type: 'string',\n description:\n 'A text to show to the user to inform about the choices made. Like, it could say\\n\"Found a CODEOWNERS file that covers this target, so we suggest leaving this\\nfield empty; which would currently make it owned by X\" where X is taken from the\\ncodeowners file.',\n },\n value: {\n type: 'string',\n nullable: true,\n },\n state: {\n type: 'string',\n enum: [\n 'analysisSuggestedValue',\n 'analysisSuggestedNoValue',\n 'needsUserInput',\n ],\n description:\n 'The outcome of the analysis for this particular field',\n },\n field: {\n type: 'string',\n description:\n 'e.g. \"spec.owner\"? The frontend needs to know how to \"inject\" the field into the\\nentity again if the user wants to change it',\n },\n },\n required: ['description', 'value', 'state', 'field'],\n additionalProperties: false,\n },\n AnalyzeLocationGenerateEntity: {\n type: 'object',\n properties: {\n fields: {\n type: 'array',\n items: {\n $ref: '#/components/schemas/AnalyzeLocationEntityField',\n },\n },\n entity: {\n $ref: '#/components/schemas/RecursivePartialEntity',\n },\n },\n required: ['fields', 'entity'],\n description:\n \"This is some form of representation of what the analyzer could deduce.\\nWe should probably have a chat about how this can best be conveyed to\\nthe frontend. It'll probably contain a (possibly incomplete) entity, plus\\nenough info for the frontend to know what form data to show to the user\\nfor overriding/completing the info.\",\n additionalProperties: false,\n },\n AnalyzeLocationResponse: {\n type: 'object',\n properties: {\n generateEntities: {\n items: {\n $ref: '#/components/schemas/AnalyzeLocationGenerateEntity',\n },\n type: 'array',\n },\n existingEntityFiles: {\n items: {\n $ref: '#/components/schemas/AnalyzeLocationExistingEntity',\n },\n type: 'array',\n },\n },\n required: ['generateEntities', 'existingEntityFiles'],\n additionalProperties: false,\n },\n LocationInput: {\n type: 'object',\n properties: {\n type: {\n type: 'string',\n },\n target: {\n type: 'string',\n },\n },\n required: ['type', 'target'],\n additionalProperties: false,\n },\n EntitiesQueryResponse: {\n type: 'object',\n properties: {\n items: {\n type: 'array',\n items: {\n $ref: '#/components/schemas/Entity',\n },\n description: 'The list of entities paginated by a specific filter.',\n },\n totalItems: {\n type: 'number',\n },\n pageInfo: {\n type: 'object',\n properties: {\n nextCursor: {\n type: 'string',\n description: 'The cursor for the next batch of entities.',\n },\n prevCursor: {\n type: 'string',\n description: 'The cursor for the previous batch of entities.',\n },\n },\n },\n },\n required: ['items', 'totalItems', 'pageInfo'],\n additionalProperties: false,\n },\n },\n securitySchemes: {\n JWT: {\n type: 'http',\n scheme: 'bearer',\n bearerFormat: 'JWT',\n },\n },\n },\n paths: {\n '/refresh': {\n post: {\n operationId: 'RefreshEntity',\n tags: ['Entity'],\n description: 'Refresh the entity related to entityRef.',\n responses: {\n '200': {\n description: 'Refreshed',\n },\n '400': {\n $ref: '#/components/responses/ErrorResponse',\n },\n default: {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [],\n requestBody: {\n required: true,\n content: {\n 'application/json': {\n schema: {\n type: 'object',\n properties: {\n authorizationToken: {\n type: 'string',\n },\n entityRef: {\n type: 'string',\n description:\n 'The reference to a single entity that should be refreshed',\n },\n },\n required: ['entityRef'],\n description:\n 'Options for requesting a refresh of entities in the catalog.',\n additionalProperties: false,\n },\n },\n },\n },\n },\n },\n '/entities': {\n get: {\n operationId: 'GetEntities',\n tags: ['Entity'],\n description: 'Get all entities matching a given filter.',\n responses: {\n '200': {\n description: '',\n content: {\n 'application/json': {\n schema: {\n type: 'array',\n items: {\n $ref: '#/components/schemas/Entity',\n },\n },\n },\n },\n },\n '400': {\n $ref: '#/components/responses/ErrorResponse',\n },\n default: {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [\n {\n $ref: '#/components/parameters/fields',\n },\n {\n $ref: '#/components/parameters/limit',\n },\n {\n $ref: '#/components/parameters/filter',\n },\n {\n $ref: '#/components/parameters/offset',\n },\n {\n $ref: '#/components/parameters/after',\n },\n {\n name: 'order',\n in: 'query',\n allowReserved: true,\n required: false,\n schema: {\n type: 'array',\n items: {\n type: 'string',\n },\n },\n },\n ],\n },\n },\n '/entities/by-uid/{uid}': {\n get: {\n operationId: 'GetEntityByUid',\n tags: ['Entity'],\n description: 'Get a single entity by the UID.',\n responses: {\n '200': {\n description: 'Ok',\n content: {\n 'application/json': {\n schema: {\n $ref: '#/components/schemas/Entity',\n },\n },\n },\n },\n '400': {\n $ref: '#/components/responses/ErrorResponse',\n },\n default: {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [\n {\n $ref: '#/components/parameters/uid',\n },\n ],\n },\n delete: {\n operationId: 'DeleteEntityByUid',\n tags: ['Entity'],\n description: 'Delete a single entity by UID.',\n responses: {\n '204': {\n description: 'Deleted successfully.',\n },\n '400': {\n $ref: '#/components/responses/ErrorResponse',\n },\n default: {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [\n {\n $ref: '#/components/parameters/uid',\n },\n ],\n },\n },\n '/entities/by-name/{kind}/{namespace}/{name}': {\n get: {\n operationId: 'GetEntityByName',\n tags: ['Entity'],\n description: 'Get an entity by an entity ref.',\n responses: {\n '200': {\n description: 'Ok',\n content: {\n 'application/json': {\n schema: {\n $ref: '#/components/schemas/Entity',\n },\n },\n },\n },\n '400': {\n $ref: '#/components/responses/ErrorResponse',\n },\n default: {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [\n {\n $ref: '#/components/parameters/kind',\n },\n {\n $ref: '#/components/parameters/namespace',\n },\n {\n $ref: '#/components/parameters/name',\n },\n ],\n },\n },\n '/entities/by-name/{kind}/{namespace}/{name}/ancestry': {\n get: {\n operationId: 'GetEntityAncestryByName',\n tags: ['Entity'],\n description: \"Get an entity's ancestry by entity ref.\",\n responses: {\n '200': {\n description: 'Ok',\n content: {\n 'application/json': {\n schema: {\n $ref: '#/components/schemas/EntityAncestryResponse',\n },\n },\n },\n },\n '400': {\n $ref: '#/components/responses/ErrorResponse',\n },\n default: {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [\n {\n $ref: '#/components/parameters/kind',\n },\n {\n $ref: '#/components/parameters/namespace',\n },\n {\n $ref: '#/components/parameters/name',\n },\n ],\n },\n },\n '/entities/by-refs': {\n post: {\n operationId: 'GetEntitiesByRefs',\n tags: ['Entity'],\n description:\n 'Get a batch set of entities given an array of entityRefs.',\n responses: {\n '200': {\n description: 'Ok',\n content: {\n 'application/json': {\n schema: {\n $ref: '#/components/schemas/EntitiesBatchResponse',\n },\n },\n },\n },\n '400': {\n $ref: '#/components/responses/ErrorResponse',\n },\n default: {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n requestBody: {\n required: false,\n content: {\n 'application/json': {\n schema: {\n type: 'object',\n required: ['entityRefs'],\n properties: {\n entityRefs: {\n type: 'array',\n items: {\n type: 'string',\n },\n },\n fields: {\n type: 'array',\n items: {\n type: 'string',\n },\n },\n },\n },\n examples: {\n 'Fetch Backstage entities': {\n value: {\n entityRefs: [\n 'component:default/backstage',\n 'api:default/backstage',\n ],\n },\n },\n 'Fetch annotations for backstage entity': {\n value: {\n entityRefs: ['component:default/backstage'],\n fields: ['metadata.annotations'],\n },\n },\n },\n },\n },\n },\n parameters: [\n {\n $ref: '#/components/parameters/filter',\n },\n ],\n },\n },\n '/entities/by-query': {\n get: {\n operationId: 'GetEntitiesByQuery',\n tags: ['Entity'],\n description: 'Search for entities by a given query.',\n responses: {\n '200': {\n description: 'Ok',\n content: {\n 'application/json': {\n schema: {\n $ref: '#/components/schemas/EntitiesQueryResponse',\n },\n },\n },\n },\n '400': {\n $ref: '#/components/responses/ErrorResponse',\n },\n default: {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [\n {\n $ref: '#/components/parameters/fields',\n },\n {\n $ref: '#/components/parameters/limit',\n },\n {\n $ref: '#/components/parameters/offset',\n },\n {\n $ref: '#/components/parameters/orderField',\n },\n {\n $ref: '#/components/parameters/cursor',\n },\n {\n $ref: '#/components/parameters/filter',\n },\n {\n name: 'fullTextFilterTerm',\n in: 'query',\n description: 'Text search term.',\n required: false,\n allowReserved: true,\n schema: {\n type: 'string',\n },\n },\n {\n name: 'fullTextFilterFields',\n in: 'query',\n description:\n 'A comma separated list of fields to sort returned results by.',\n required: false,\n allowReserved: true,\n schema: {\n type: 'array',\n items: {\n type: 'string',\n },\n },\n explode: false,\n style: 'form',\n },\n ],\n },\n },\n '/entity-facets': {\n get: {\n operationId: 'GetEntityFacets',\n tags: ['Entity'],\n description: 'Get all entity facets that match the given filters.',\n responses: {\n '200': {\n description: 'Ok',\n content: {\n 'application/json': {\n schema: {\n $ref: '#/components/schemas/EntityFacetsResponse',\n },\n },\n },\n },\n '400': {\n $ref: '#/components/responses/ErrorResponse',\n },\n default: {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [\n {\n in: 'query',\n name: 'facet',\n required: true,\n allowReserved: true,\n schema: {\n type: 'array',\n items: {\n type: 'string',\n },\n },\n examples: {\n 'Entities by kind': {\n value: ['kind'],\n },\n 'Entities by spec type': {\n value: ['spec.type'],\n },\n },\n },\n {\n $ref: '#/components/parameters/filter',\n },\n ],\n },\n },\n '/locations': {\n post: {\n operationId: 'CreateLocation',\n tags: ['Locations'],\n description: 'Create a location for a given target.',\n responses: {\n '201': {\n description: 'Created',\n content: {\n 'application/json': {\n schema: {\n type: 'object',\n properties: {\n exists: {\n type: 'boolean',\n },\n entities: {\n items: {\n $ref: '#/components/schemas/Entity',\n },\n type: 'array',\n },\n location: {\n $ref: '#/components/schemas/Location',\n },\n },\n required: ['entities', 'location'],\n },\n },\n },\n },\n '400': {\n $ref: '#/components/responses/ErrorResponse',\n },\n default: {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [\n {\n in: 'query',\n name: 'dryRun',\n required: false,\n allowReserved: true,\n schema: {\n type: 'string',\n },\n },\n ],\n requestBody: {\n required: true,\n content: {\n 'application/json': {\n schema: {\n type: 'object',\n properties: {\n target: {\n type: 'string',\n },\n type: {\n type: 'string',\n },\n },\n required: ['target', 'type'],\n },\n },\n },\n },\n },\n get: {\n operationId: 'GetLocations',\n tags: ['Locations'],\n description: 'Get all locations',\n responses: {\n '200': {\n description: 'Ok',\n content: {\n 'application/json': {\n schema: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n data: {\n $ref: '#/components/schemas/Location',\n },\n },\n required: ['data'],\n },\n },\n },\n },\n },\n default: {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [],\n },\n },\n '/locations/{id}': {\n get: {\n operationId: 'GetLocation',\n tags: ['Locations'],\n description: 'Get a location by id.',\n responses: {\n '200': {\n description: 'Ok',\n content: {\n 'application/json': {\n schema: {\n $ref: '#/components/schemas/Location',\n },\n },\n },\n },\n default: {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [\n {\n in: 'path',\n name: 'id',\n required: true,\n allowReserved: true,\n schema: {\n type: 'string',\n },\n },\n ],\n },\n delete: {\n operationId: 'DeleteLocation',\n tags: ['Locations'],\n description: 'Delete a location by id.',\n responses: {\n '204': {\n description: 'No content',\n },\n '400': {\n $ref: '#/components/responses/ErrorResponse',\n },\n default: {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [\n {\n in: 'path',\n name: 'id',\n required: true,\n allowReserved: true,\n schema: {\n type: 'string',\n },\n },\n ],\n },\n },\n '/locations/by-entity/{kind}/{namespace}/{name}': {\n get: {\n operationId: 'getLocationByEntity',\n tags: ['Locations'],\n description: 'Get a location for entity.',\n responses: {\n '200': {\n description: 'Ok',\n content: {\n 'application/json': {\n schema: {\n $ref: '#/components/schemas/Location',\n },\n },\n },\n },\n default: {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [\n {\n in: 'path',\n name: 'kind',\n required: true,\n allowReserved: true,\n schema: {\n type: 'string',\n },\n },\n {\n in: 'path',\n name: 'namespace',\n required: true,\n allowReserved: true,\n schema: {\n type: 'string',\n },\n },\n {\n in: 'path',\n name: 'name',\n required: true,\n allowReserved: true,\n schema: {\n type: 'string',\n },\n },\n ],\n },\n },\n '/analyze-location': {\n post: {\n operationId: 'AnalyzeLocation',\n tags: ['Locations'],\n description: 'Validate a given location.',\n responses: {\n '200': {\n description: 'Ok',\n content: {\n 'application/json': {\n schema: {\n $ref: '#/components/schemas/AnalyzeLocationResponse',\n },\n },\n },\n },\n '400': {\n $ref: '#/components/responses/ErrorResponse',\n },\n default: {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [],\n requestBody: {\n required: true,\n content: {\n 'application/json': {\n schema: {\n type: 'object',\n properties: {\n catalogFileName: {\n type: 'string',\n },\n location: {\n $ref: '#/components/schemas/LocationInput',\n },\n },\n required: ['location'],\n },\n },\n },\n },\n },\n },\n '/validate-entity': {\n post: {\n operationId: 'ValidateEntity',\n tags: ['Entity'],\n description:\n 'Validate that a passed in entity has no errors in schema.',\n responses: {\n '200': {\n description: 'Ok',\n },\n '400': {\n description: 'Validation errors.',\n content: {\n 'application/json': {\n schema: {\n type: 'object',\n properties: {\n errors: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n name: {\n type: 'string',\n },\n message: {\n type: 'string',\n },\n },\n required: ['name', 'message'],\n additionalProperties: {},\n },\n },\n },\n required: ['errors'],\n },\n },\n },\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [],\n requestBody: {\n required: true,\n content: {\n 'application/json': {\n schema: {\n type: 'object',\n properties: {\n location: {\n type: 'string',\n },\n entity: {\n type: 'object',\n additionalProperties: {},\n },\n },\n required: ['location', 'entity'],\n },\n },\n },\n },\n },\n },\n },\n} as const;\nexport const createOpenApiRouter = async (\n options?: Parameters<\n typeof createValidatedOpenApiRouterFromGeneratedEndpointMap\n >['1'],\n) =>\n createValidatedOpenApiRouterFromGeneratedEndpointMap<EndpointMap>(\n spec,\n options,\n );\n"],"names":["createValidatedOpenApiRouterFromGeneratedEndpointMap"],"mappings":";;;;AAsBO,MAAM,IAAO,GAAA;AAAA,EAClB,OAAS,EAAA,OAAA;AAAA,EACT,IAAM,EAAA;AAAA,IACJ,KAAO,EAAA,SAAA;AAAA,IACP,OAAS,EAAA,GAAA;AAAA,IACT,WACE,EAAA,6+BAAA;AAAA,IACF,OAAS,EAA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,OAAS,EAAA;AAAA,YACP,kBAAoB,EAAA;AAAA,cAClB,MAAQ,EAAA;AAAA,gBACN,IAAM,EAAA,QAAA;AAAA,gBACN,UAAY,EAAA;AAAA,kBACV,QAAU,EAAA;AAAA,oBACR,IAAM,EAAA;AAAA,mBACR;AAAA,kBACA,MAAQ,EAAA;AAAA,oBACN,IAAM,EAAA,QAAA;AAAA,oBACN,sBAAsB;AAAC;AACzB,iBACF;AAAA,gBACA,QAAA,EAAU,CAAC,UAAA,EAAY,QAAQ;AAAA;AACjC;AACF;AACF;AACF;AACF;AACF;AAEJ;AACa,MAAA,mBAAA,GAAsB,OACjC,OAIA,KAAAA,wEAAA;AAAA,EACE,IAAA;AAAA,EACA;AACF;;;;;"}
|
|
@@ -19,6 +19,7 @@ var LocationAnalyzer = require('../ingestion/LocationAnalyzer.cjs.js');
|
|
|
19
19
|
var index = require('../permissions/rules/index.cjs.js');
|
|
20
20
|
var refresh = require('../processing/refresh.cjs.js');
|
|
21
21
|
var connectEntityProviders = require('../processing/connectEntityProviders.cjs.js');
|
|
22
|
+
var evictEntitiesFromOrphanedProviders = require('../processing/evictEntitiesFromOrphanedProviders.cjs.js');
|
|
22
23
|
var DefaultCatalogProcessingEngine = require('../processing/DefaultCatalogProcessingEngine.cjs.js');
|
|
23
24
|
var DefaultCatalogProcessingOrchestrator = require('../processing/DefaultCatalogProcessingOrchestrator.cjs.js');
|
|
24
25
|
var AnnotateLocationEntityProcessor = require('../processors/AnnotateLocationEntityProcessor.cjs.js');
|
|
@@ -229,7 +230,7 @@ class CatalogBuilder {
|
|
|
229
230
|
const integrations = integration.ScmIntegrations.fromConfig(config);
|
|
230
231
|
return [
|
|
231
232
|
new FileReaderProcessor.FileReaderProcessor(),
|
|
232
|
-
new UrlReaderProcessor.UrlReaderProcessor({ reader, logger }),
|
|
233
|
+
new UrlReaderProcessor.UrlReaderProcessor({ reader, logger, config }),
|
|
233
234
|
CodeOwnersProcessor.CodeOwnersProcessor.fromConfig(config, { logger, reader }),
|
|
234
235
|
new AnnotateLocationEntityProcessor.AnnotateLocationEntityProcessor({ integrations })
|
|
235
236
|
];
|
|
@@ -455,6 +456,13 @@ class CatalogBuilder {
|
|
|
455
456
|
auditor,
|
|
456
457
|
disableRelationsCompatibility
|
|
457
458
|
});
|
|
459
|
+
if (config.getOptionalString("catalog.orphanProviderStrategy") === "delete") {
|
|
460
|
+
await evictEntitiesFromOrphanedProviders.evictEntitiesFromOrphanedProviders({
|
|
461
|
+
db: providerDatabase,
|
|
462
|
+
providers: entityProviders,
|
|
463
|
+
logger
|
|
464
|
+
});
|
|
465
|
+
}
|
|
458
466
|
await connectEntityProviders.connectEntityProviders(providerDatabase, entityProviders);
|
|
459
467
|
return {
|
|
460
468
|
processingEngine: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CatalogBuilder.cjs.js","sources":["../../src/service/CatalogBuilder.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n createLegacyAuthAdapters,\n HostDiscovery,\n} from '@backstage/backend-common';\nimport {\n DefaultNamespaceEntityPolicy,\n Entity,\n EntityPolicies,\n EntityPolicy,\n FieldFormatEntityPolicy,\n makeValidator,\n NoForeignRootFieldsEntityPolicy,\n SchemaValidEntityPolicy,\n Validators,\n} from '@backstage/catalog-model';\nimport { ScmIntegrations } from '@backstage/integration';\nimport { createHash } from 'crypto';\nimport { Router } from 'express';\nimport lodash from 'lodash';\n\nimport {\n AuditorService,\n AuthService,\n DatabaseService,\n DiscoveryService,\n HttpAuthService,\n LoggerService,\n PermissionsRegistryService,\n PermissionsService,\n RootConfigService,\n SchedulerService,\n UrlReaderService,\n} from '@backstage/backend-plugin-api';\nimport { Config, readDurationFromConfig } from '@backstage/config';\nimport {\n catalogPermissions,\n RESOURCE_TYPE_CATALOG_ENTITY,\n} from '@backstage/plugin-catalog-common/alpha';\nimport {\n CatalogProcessor,\n CatalogProcessorParser,\n EntitiesSearchFilter,\n EntityProvider,\n LocationAnalyzer,\n PlaceholderResolver,\n ScmLocationAnalyzer,\n} from '@backstage/plugin-catalog-node';\nimport { EventBroker, EventsService } from '@backstage/plugin-events-node';\nimport {\n Permission,\n PermissionAuthorizer,\n PermissionRuleParams,\n toPermissionEvaluator,\n} from '@backstage/plugin-permission-common';\nimport {\n createConditionTransformer,\n createPermissionIntegrationRouter,\n PermissionRule,\n} from '@backstage/plugin-permission-node';\nimport { durationToMilliseconds } from '@backstage/types';\nimport { DefaultCatalogDatabase } from '../database/DefaultCatalogDatabase';\nimport { DefaultProcessingDatabase } from '../database/DefaultProcessingDatabase';\nimport { DefaultProviderDatabase } from '../database/DefaultProviderDatabase';\nimport { applyDatabaseMigrations } from '../database/migrations';\nimport { DefaultCatalogRulesEnforcer } from '../ingestion/CatalogRules';\nimport { RepoLocationAnalyzer } from '../ingestion/LocationAnalyzer';\nimport { permissionRules as catalogPermissionRules } from '../permissions/rules';\nimport {\n CatalogProcessingEngine,\n createRandomProcessingInterval,\n ProcessingIntervalFunction,\n} from '../processing';\nimport { connectEntityProviders } from '../processing/connectEntityProviders';\nimport { DefaultCatalogProcessingEngine } from '../processing/DefaultCatalogProcessingEngine';\nimport { DefaultCatalogProcessingOrchestrator } from '../processing/DefaultCatalogProcessingOrchestrator';\nimport {\n AnnotateLocationEntityProcessor,\n BuiltinKindsEntityProcessor,\n CodeOwnersProcessor,\n FileReaderProcessor,\n PlaceholderProcessor,\n UrlReaderProcessor,\n} from '../processors';\nimport {\n jsonPlaceholderResolver,\n textPlaceholderResolver,\n yamlPlaceholderResolver,\n} from '../processors/PlaceholderProcessor';\nimport { ConfigLocationEntityProvider } from '../providers/ConfigLocationEntityProvider';\nimport { DefaultLocationStore } from '../providers/DefaultLocationStore';\nimport { DefaultStitcher } from '../stitching/DefaultStitcher';\nimport { defaultEntityDataParser } from '../util/parse';\nimport { AuthorizedEntitiesCatalog } from './AuthorizedEntitiesCatalog';\nimport { AuthorizedLocationAnalyzer } from './AuthorizedLocationAnalyzer';\nimport { AuthorizedLocationService } from './AuthorizedLocationService';\nimport { AuthorizedRefreshService } from './AuthorizedRefreshService';\nimport { createRouter } from './createRouter';\nimport { DefaultEntitiesCatalog } from './DefaultEntitiesCatalog';\nimport { DefaultLocationService } from './DefaultLocationService';\nimport { DefaultRefreshService } from './DefaultRefreshService';\nimport { entitiesResponseToObjects } from './response';\nimport { catalogEntityPermissionResourceRef } from '@backstage/plugin-catalog-node/alpha';\n\n/**\n * This is a duplicate of the alpha `CatalogPermissionRule` type, for use in the stable API.\n *\n * @public\n */\nexport type CatalogPermissionRuleInput<\n TParams extends PermissionRuleParams = PermissionRuleParams,\n> = PermissionRule<Entity, EntitiesSearchFilter, 'catalog-entity', TParams>;\n\n/**\n * @deprecated Please migrate to the new backend system as this will be removed in the future.\n * @public\n */\nexport type CatalogEnvironment = {\n logger: LoggerService;\n database: DatabaseService;\n config: RootConfigService;\n reader: UrlReaderService;\n permissions: PermissionsService | PermissionAuthorizer;\n permissionsRegistry?: PermissionsRegistryService;\n scheduler?: SchedulerService;\n discovery?: DiscoveryService;\n auth?: AuthService;\n httpAuth?: HttpAuthService;\n auditor?: AuditorService;\n};\n\n/**\n * A builder that helps wire up all of the component parts of the catalog.\n *\n * The touch points where you can replace or extend behavior are as follows:\n *\n * - Entity policies can be added or replaced. These are automatically run\n * after the processors' pre-processing steps. All policies are given the\n * chance to inspect the entity, and all of them have to pass in order for\n * the entity to be considered valid from an overall point of view.\n * - Location analyzers can be added. These are responsible for analyzing\n * repositories when onboarding them into the catalog, by finding\n * catalog-info.yaml files and other artifacts that can help automatically\n * register or create catalog data on the user's behalf.\n * - Placeholder resolvers can be replaced or added. These run on the raw\n * structured data between the parsing and pre-processing steps, to replace\n * dollar-prefixed entries with their actual values (like $file).\n * - Field format validators can be replaced. These check the format of\n * individual core fields such as metadata.name, to ensure that they adhere\n * to certain rules.\n * - Processors can be added or replaced. These implement the functionality of\n * reading, parsing, validating, and processing the entity data before it is\n * persisted in the catalog.\n *\n * @public\n * @deprecated Please migrate to the new backend system as this will be removed in the future.\n */\nexport class CatalogBuilder {\n private readonly env: CatalogEnvironment;\n private entityPolicies: EntityPolicy[];\n private entityPoliciesReplace: boolean;\n private placeholderResolvers: Record<string, PlaceholderResolver>;\n private fieldFormatValidators: Partial<Validators>;\n private entityProviders: EntityProvider[];\n private processors: CatalogProcessor[];\n private locationAnalyzers: ScmLocationAnalyzer[];\n private processorsReplace: boolean;\n private parser: CatalogProcessorParser | undefined;\n private onProcessingError?: (event: {\n unprocessedEntity: Entity;\n errors: Error[];\n }) => Promise<void> | void;\n private processingInterval: ProcessingIntervalFunction;\n private locationAnalyzer: LocationAnalyzer | undefined = undefined;\n private readonly permissions: Permission[];\n private readonly permissionRules: CatalogPermissionRuleInput[];\n private allowedLocationType: string[];\n private legacySingleProcessorValidation = false;\n private eventBroker?: EventBroker | EventsService;\n\n /**\n * Creates a catalog builder.\n */\n static create(env: CatalogEnvironment): CatalogBuilder {\n return new CatalogBuilder(env);\n }\n\n private constructor(env: CatalogEnvironment) {\n this.env = env;\n this.entityPolicies = [];\n this.entityPoliciesReplace = false;\n this.placeholderResolvers = {};\n this.fieldFormatValidators = {};\n this.entityProviders = [];\n this.processors = [];\n this.locationAnalyzers = [];\n this.processorsReplace = false;\n this.parser = undefined;\n this.permissions = [...catalogPermissions];\n this.permissionRules = Object.values(catalogPermissionRules);\n this.allowedLocationType = ['url'];\n\n this.processingInterval = CatalogBuilder.getDefaultProcessingInterval(\n env.config,\n );\n }\n\n /**\n * Adds policies that are used to validate entities between the pre-\n * processing and post-processing stages. All such policies must pass for the\n * entity to be considered valid.\n *\n * If what you want to do is to replace the rules for what format is allowed\n * in various core entity fields (such as metadata.name), you may want to use\n * {@link CatalogBuilder#setFieldFormatValidators} instead.\n *\n * @param policies - One or more policies\n */\n addEntityPolicy(\n ...policies: Array<EntityPolicy | Array<EntityPolicy>>\n ): CatalogBuilder {\n this.entityPolicies.push(...policies.flat());\n return this;\n }\n\n /**\n * Processing interval determines how often entities should be processed.\n * Seconds provided will be multiplied by 1.5\n * The default processing interval is 100-150 seconds.\n * setting this too low will potentially deplete request quotas to upstream services.\n */\n setProcessingIntervalSeconds(seconds: number): CatalogBuilder {\n this.processingInterval = createRandomProcessingInterval({\n minSeconds: seconds,\n maxSeconds: seconds * 1.5,\n });\n return this;\n }\n\n /**\n * Overwrites the default processing interval function used to spread\n * entity updates in the catalog.\n */\n setProcessingInterval(\n processingInterval: ProcessingIntervalFunction,\n ): CatalogBuilder {\n this.processingInterval = processingInterval;\n return this;\n }\n\n /**\n * Overwrites the default location analyzer.\n */\n setLocationAnalyzer(locationAnalyzer: LocationAnalyzer): CatalogBuilder {\n this.locationAnalyzer = locationAnalyzer;\n return this;\n }\n\n /**\n * Sets what policies to use for validation of entities between the pre-\n * processing and post-processing stages. All such policies must pass for the\n * entity to be considered valid.\n *\n * If what you want to do is to replace the rules for what format is allowed\n * in various core entity fields (such as metadata.name), you may want to use\n * {@link CatalogBuilder#setFieldFormatValidators} instead.\n *\n * This function replaces the default set of policies; use with care.\n *\n * @param policies - One or more policies\n */\n replaceEntityPolicies(policies: EntityPolicy[]): CatalogBuilder {\n this.entityPolicies = [...policies];\n this.entityPoliciesReplace = true;\n return this;\n }\n\n /**\n * Adds, or overwrites, a handler for placeholders (e.g. $file) in entity\n * definition files.\n *\n * @param key - The key that identifies the placeholder, e.g. \"file\"\n * @param resolver - The resolver that gets values for this placeholder\n */\n setPlaceholderResolver(\n key: string,\n resolver: PlaceholderResolver,\n ): CatalogBuilder {\n this.placeholderResolvers[key] = resolver;\n return this;\n }\n\n /**\n * Sets the validator function to use for one or more special fields of an\n * entity. This is useful if the default rules for formatting of fields are\n * not sufficient.\n *\n * This function has no effect if used together with\n * {@link CatalogBuilder#replaceEntityPolicies}.\n *\n * @param validators - The (subset of) validators to set\n */\n setFieldFormatValidators(validators: Partial<Validators>): CatalogBuilder {\n lodash.merge(this.fieldFormatValidators, validators);\n return this;\n }\n\n /**\n * Adds or replaces entity providers. These are responsible for bootstrapping\n * the list of entities out of original data sources. For example, there is\n * one entity source for the config locations, and one for the database\n * stored locations. If you ingest entities out of a third party system, you\n * may want to implement that in terms of an entity provider as well.\n *\n * @param providers - One or more entity providers\n */\n addEntityProvider(\n ...providers: Array<EntityProvider | Array<EntityProvider>>\n ): CatalogBuilder {\n this.entityProviders.push(...providers.flat());\n return this;\n }\n\n /**\n * Adds entity processors. These are responsible for reading, parsing, and\n * processing entities before they are persisted in the catalog.\n *\n * @param processors - One or more processors\n */\n addProcessor(\n ...processors: Array<CatalogProcessor | Array<CatalogProcessor>>\n ): CatalogBuilder {\n this.processors.push(...processors.flat());\n return this;\n }\n\n /**\n * Sets what entity processors to use. These are responsible for reading,\n * parsing, and processing entities before they are persisted in the catalog.\n *\n * This function replaces the default set of processors, consider using with\n * {@link CatalogBuilder#getDefaultProcessors}; use with care.\n *\n * @param processors - One or more processors\n */\n replaceProcessors(processors: CatalogProcessor[]): CatalogBuilder {\n this.processors = [...processors];\n this.processorsReplace = true;\n return this;\n }\n\n /**\n * Returns the default list of entity processors. These are responsible for reading,\n * parsing, and processing entities before they are persisted in the catalog. Changing\n * the order of processing can give more control to custom processors.\n *\n * Consider using with {@link CatalogBuilder#replaceProcessors}\n *\n */\n getDefaultProcessors(): CatalogProcessor[] {\n const { config, logger, reader } = this.env;\n const integrations = ScmIntegrations.fromConfig(config);\n\n return [\n new FileReaderProcessor(),\n new UrlReaderProcessor({ reader, logger }),\n CodeOwnersProcessor.fromConfig(config, { logger, reader }),\n new AnnotateLocationEntityProcessor({ integrations }),\n ];\n }\n\n /**\n * Adds Location Analyzers. These are responsible for analyzing\n * repositories when onboarding them into the catalog, by finding\n * catalog-info.yaml files and other artifacts that can help automatically\n * register or create catalog data on the user's behalf.\n *\n * @param locationAnalyzers - One or more location analyzers\n */\n addLocationAnalyzers(\n ...analyzers: Array<ScmLocationAnalyzer | Array<ScmLocationAnalyzer>>\n ): CatalogBuilder {\n this.locationAnalyzers.push(...analyzers.flat());\n return this;\n }\n\n /**\n * Sets up the catalog to use a custom parser for entity data.\n *\n * This is the function that gets called immediately after some raw entity\n * specification data has been read from a remote source, and needs to be\n * parsed and emitted as structured data.\n *\n * @param parser - The custom parser\n */\n setEntityDataParser(parser: CatalogProcessorParser): CatalogBuilder {\n this.parser = parser;\n return this;\n }\n\n /**\n * Adds additional permissions. See\n * {@link @backstage/plugin-permission-node#Permission}.\n *\n * @param permissions - Additional permissions\n */\n addPermissions(...permissions: Array<Permission | Array<Permission>>) {\n this.permissions.push(...permissions.flat());\n return this;\n }\n\n /**\n * Adds additional permission rules. Permission rules are used to evaluate\n * catalog resources against queries. See\n * {@link @backstage/plugin-permission-node#PermissionRule}.\n *\n * @param permissionRules - Additional permission rules\n */\n addPermissionRules(\n ...permissionRules: Array<\n CatalogPermissionRuleInput | Array<CatalogPermissionRuleInput>\n >\n ) {\n this.permissionRules.push(...permissionRules.flat());\n return this;\n }\n\n /**\n * Sets up the allowed location types from being registered via the location service.\n *\n * @param allowedLocationTypes - the allowed location types\n */\n setAllowedLocationTypes(allowedLocationTypes: string[]): CatalogBuilder {\n this.allowedLocationType = allowedLocationTypes;\n return this;\n }\n\n /**\n * Enables the legacy behaviour of canceling validation early whenever only a\n * single processor declares an entity kind to be valid.\n */\n useLegacySingleProcessorValidation(): this {\n this.legacySingleProcessorValidation = true;\n return this;\n }\n\n /**\n * Enables the publishing of events for conflicts in the DefaultProcessingDatabase\n */\n setEventBroker(broker: EventBroker | EventsService): CatalogBuilder {\n this.eventBroker = broker;\n return this;\n }\n\n /**\n * Wires up and returns all of the component parts of the catalog\n */\n async build(): Promise<{\n processingEngine: CatalogProcessingEngine;\n router: Router;\n }> {\n const {\n config,\n database,\n logger,\n permissions,\n scheduler,\n permissionsRegistry,\n discovery = HostDiscovery.fromConfig(config),\n auditor,\n } = this.env;\n\n const { auth, httpAuth } = createLegacyAuthAdapters({\n ...this.env,\n discovery,\n });\n\n const disableRelationsCompatibility = config.getOptionalBoolean(\n 'catalog.disableRelationsCompatibility',\n );\n\n const policy = this.buildEntityPolicy();\n const processors = this.buildProcessors();\n const parser = this.parser || defaultEntityDataParser;\n\n const dbClient = await database.getClient();\n if (!database.migrations?.skip) {\n logger.info('Performing database migration');\n await applyDatabaseMigrations(dbClient);\n }\n\n const stitcher = DefaultStitcher.fromConfig(config, {\n knex: dbClient,\n logger,\n });\n\n const processingDatabase = new DefaultProcessingDatabase({\n database: dbClient,\n logger,\n refreshInterval: this.processingInterval,\n eventBroker: this.eventBroker,\n });\n const providerDatabase = new DefaultProviderDatabase({\n database: dbClient,\n logger,\n });\n const catalogDatabase = new DefaultCatalogDatabase({\n database: dbClient,\n logger,\n });\n const integrations = ScmIntegrations.fromConfig(config);\n const rulesEnforcer = DefaultCatalogRulesEnforcer.fromConfig(config);\n\n const unauthorizedEntitiesCatalog = new DefaultEntitiesCatalog({\n database: dbClient,\n logger,\n stitcher,\n disableRelationsCompatibility,\n });\n\n let permissionsService: PermissionsService;\n if ('authorizeConditional' in permissions) {\n permissionsService = permissions as PermissionsService;\n } else {\n logger.warn(\n 'PermissionAuthorizer is deprecated. Please use an instance of PermissionEvaluator instead of PermissionAuthorizer in PluginEnvironment#permissions',\n );\n permissionsService = toPermissionEvaluator(permissions);\n }\n\n const orchestrator = new DefaultCatalogProcessingOrchestrator({\n processors,\n integrations,\n rulesEnforcer,\n logger,\n parser,\n policy,\n legacySingleProcessorValidation: this.legacySingleProcessorValidation,\n });\n\n const entitiesCatalog = new AuthorizedEntitiesCatalog(\n unauthorizedEntitiesCatalog,\n permissionsService,\n createConditionTransformer(this.permissionRules),\n );\n\n const getResources = async (resourceRefs: string[]) => {\n const { items } = await unauthorizedEntitiesCatalog.entitiesBatch({\n credentials: await auth.getOwnServiceCredentials(),\n entityRefs: resourceRefs,\n });\n\n return entitiesResponseToObjects(items).map(e => e || undefined);\n };\n\n let permissionIntegrationRouter:\n | ReturnType<typeof createPermissionIntegrationRouter>\n | undefined;\n if (permissionsRegistry) {\n permissionsRegistry.addResourceType({\n resourceRef: catalogEntityPermissionResourceRef,\n getResources,\n permissions: this.permissions,\n rules: this.permissionRules,\n });\n } else {\n permissionIntegrationRouter = createPermissionIntegrationRouter({\n resourceType: RESOURCE_TYPE_CATALOG_ENTITY,\n getResources,\n permissions: this.permissions,\n rules: this.permissionRules,\n });\n }\n\n const locationStore = new DefaultLocationStore(dbClient);\n const configLocationProvider = new ConfigLocationEntityProvider(config);\n const entityProviders = lodash.uniqBy(\n [...this.entityProviders, locationStore, configLocationProvider],\n provider => provider.getProviderName(),\n );\n\n const processingEngine = new DefaultCatalogProcessingEngine({\n config,\n scheduler,\n logger,\n knex: dbClient,\n processingDatabase,\n orchestrator,\n stitcher,\n createHash: () => createHash('sha1'),\n pollingIntervalMs: 1000,\n onProcessingError: event => {\n this.onProcessingError?.(event);\n },\n eventBroker: this.eventBroker,\n });\n\n const locationAnalyzer =\n this.locationAnalyzer ??\n new AuthorizedLocationAnalyzer(\n new RepoLocationAnalyzer(logger, integrations, this.locationAnalyzers),\n permissionsService,\n );\n const locationService = new AuthorizedLocationService(\n new DefaultLocationService(locationStore, orchestrator, {\n allowedLocationTypes: this.allowedLocationType,\n }),\n permissionsService,\n );\n const refreshService = new AuthorizedRefreshService(\n new DefaultRefreshService({ database: catalogDatabase }),\n permissionsService,\n );\n\n const router = await createRouter({\n entitiesCatalog,\n locationAnalyzer,\n locationService,\n orchestrator,\n refreshService,\n logger,\n config,\n permissionIntegrationRouter,\n auth,\n httpAuth,\n permissionsService,\n auditor,\n disableRelationsCompatibility,\n });\n\n await connectEntityProviders(providerDatabase, entityProviders);\n\n return {\n processingEngine: {\n async start() {\n await processingEngine.start();\n await stitcher.start();\n },\n async stop() {\n await processingEngine.stop();\n await stitcher.stop();\n },\n },\n router,\n };\n }\n\n subscribe(options: {\n onProcessingError: (event: {\n unprocessedEntity: Entity;\n errors: Error[];\n }) => Promise<void> | void;\n }) {\n this.onProcessingError = options.onProcessingError;\n }\n\n private buildEntityPolicy(): EntityPolicy {\n const entityPolicies: EntityPolicy[] = this.entityPoliciesReplace\n ? [new SchemaValidEntityPolicy(), ...this.entityPolicies]\n : [\n new SchemaValidEntityPolicy(),\n new DefaultNamespaceEntityPolicy(),\n new NoForeignRootFieldsEntityPolicy(),\n new FieldFormatEntityPolicy(\n makeValidator(this.fieldFormatValidators),\n ),\n ...this.entityPolicies,\n ];\n\n return EntityPolicies.allOf(entityPolicies);\n }\n\n private buildProcessors(): CatalogProcessor[] {\n const { config, reader } = this.env;\n const integrations = ScmIntegrations.fromConfig(config);\n\n this.checkDeprecatedReaderProcessors();\n\n const placeholderResolvers: Record<string, PlaceholderResolver> = {\n json: jsonPlaceholderResolver,\n yaml: yamlPlaceholderResolver,\n text: textPlaceholderResolver,\n ...this.placeholderResolvers,\n };\n\n // The placeholder is always there no matter what\n const processors: CatalogProcessor[] = [\n new PlaceholderProcessor({\n resolvers: placeholderResolvers,\n reader,\n integrations,\n }),\n ];\n\n const builtinKindsEntityProcessor = new BuiltinKindsEntityProcessor();\n // If the user adds a processor named 'BuiltinKindsEntityProcessor',\n // skip inclusion of the catalog-backend version.\n if (\n !this.processors.some(\n processor =>\n processor.getProcessorName() ===\n builtinKindsEntityProcessor.getProcessorName(),\n )\n ) {\n processors.push(builtinKindsEntityProcessor);\n }\n\n // These are only added unless the user replaced them all\n if (!this.processorsReplace) {\n processors.push(...this.getDefaultProcessors());\n }\n\n // Add the ones (if any) that the user added\n processors.push(...this.processors);\n\n this.checkMissingExternalProcessors(processors);\n\n return processors;\n }\n\n // TODO(Rugvip): These old processors are removed, for a while we'll be throwing\n // errors here to make sure people know where to move the config\n private checkDeprecatedReaderProcessors() {\n const pc = this.env.config.getOptionalConfig('catalog.processors');\n if (pc?.has('github')) {\n throw new Error(\n `Using deprecated configuration for catalog.processors.github, move to using integrations.github instead`,\n );\n }\n if (pc?.has('gitlabApi')) {\n throw new Error(\n `Using deprecated configuration for catalog.processors.gitlabApi, move to using integrations.gitlab instead`,\n );\n }\n if (pc?.has('bitbucketApi')) {\n throw new Error(\n `Using deprecated configuration for catalog.processors.bitbucketApi, move to using integrations.bitbucket instead`,\n );\n }\n if (pc?.has('azureApi')) {\n throw new Error(\n `Using deprecated configuration for catalog.processors.azureApi, move to using integrations.azure instead`,\n );\n }\n }\n\n // TODO(freben): This can be removed no sooner than June 2022, after adopters have had some time to adapt to the new package structure\n private checkMissingExternalProcessors(processors: CatalogProcessor[]) {\n const skipCheckVarName = 'BACKSTAGE_CATALOG_SKIP_MISSING_PROCESSORS_CHECK';\n if (process.env[skipCheckVarName]) {\n return;\n }\n\n const locationTypes = new Set(\n this.env.config\n .getOptionalConfigArray('catalog.locations')\n ?.map(l => l.getString('type')) ?? [],\n );\n const processorNames = new Set(processors.map(p => p.getProcessorName()));\n\n function check(\n locationType: string,\n processorName: string,\n installationUrl: string,\n ) {\n if (\n locationTypes.has(locationType) &&\n !processorNames.has(processorName)\n ) {\n throw new Error(\n [\n `Your config contains a \"catalog.locations\" entry of type ${locationType},`,\n `but does not have the corresponding catalog processor ${processorName} installed.`,\n `This processor used to be built into the catalog itself, but is now moved to an`,\n `external module that has to be installed manually. Please follow the installation`,\n `instructions at ${installationUrl} if you are using this ability, or remove the`,\n `location from your app config if you do not. You can also silence this check entirely`,\n `by setting the environment variable ${skipCheckVarName} to 'true'.`,\n ].join(' '),\n );\n }\n }\n\n check(\n 'aws-cloud-accounts',\n 'AwsOrganizationCloudAccountProcessor',\n 'https://backstage.io/docs/integrations',\n );\n check(\n 's3-discovery',\n 'AwsS3DiscoveryProcessor',\n 'https://backstage.io/docs/integrations/aws-s3/discovery',\n );\n check(\n 'azure-discovery',\n 'AzureDevOpsDiscoveryProcessor',\n 'https://backstage.io/docs/integrations/azure/discovery',\n );\n check(\n 'bitbucket-discovery',\n 'BitbucketDiscoveryProcessor',\n 'https://backstage.io/docs/integrations/bitbucket/discovery',\n );\n check(\n 'github-discovery',\n 'GithubDiscoveryProcessor',\n 'https://backstage.io/docs/integrations/github/discovery',\n );\n check(\n 'github-org',\n 'GithubOrgReaderProcessor',\n 'https://backstage.io/docs/integrations/github/org',\n );\n check(\n 'gitlab-discovery',\n 'GitLabDiscoveryProcessor',\n 'https://backstage.io/docs/integrations/gitlab/discovery',\n );\n check(\n 'ldap-org',\n 'LdapOrgReaderProcessor',\n 'https://backstage.io/docs/integrations/ldap/org',\n );\n check(\n 'microsoft-graph-org',\n 'MicrosoftGraphOrgReaderProcessor',\n 'https://backstage.io/docs/integrations/azure/org',\n );\n }\n\n private static getDefaultProcessingInterval(\n config: Config,\n ): ProcessingIntervalFunction {\n const processingIntervalKey = 'catalog.processingInterval';\n\n if (!config.has(processingIntervalKey)) {\n return createRandomProcessingInterval({\n minSeconds: 100,\n maxSeconds: 150,\n });\n }\n\n if (!Boolean(config.get('catalog.processingInterval'))) {\n return () => {\n throw new Error(\n 'catalog.processingInterval is set to false, processing is disabled.',\n );\n };\n }\n\n const duration = readDurationFromConfig(config, {\n key: processingIntervalKey,\n });\n\n const seconds = Math.max(\n 1,\n Math.round(durationToMilliseconds(duration) / 1000),\n );\n\n return createRandomProcessingInterval({\n minSeconds: seconds,\n maxSeconds: seconds * 1.5,\n });\n }\n}\n"],"names":["catalogPermissions","catalogPermissionRules","createRandomProcessingInterval","lodash","ScmIntegrations","FileReaderProcessor","UrlReaderProcessor","CodeOwnersProcessor","AnnotateLocationEntityProcessor","HostDiscovery","createLegacyAuthAdapters","defaultEntityDataParser","applyDatabaseMigrations","DefaultStitcher","DefaultProcessingDatabase","DefaultProviderDatabase","DefaultCatalogDatabase","DefaultCatalogRulesEnforcer","DefaultEntitiesCatalog","toPermissionEvaluator","DefaultCatalogProcessingOrchestrator","AuthorizedEntitiesCatalog","createConditionTransformer","entitiesResponseToObjects","catalogEntityPermissionResourceRef","createPermissionIntegrationRouter","RESOURCE_TYPE_CATALOG_ENTITY","DefaultLocationStore","ConfigLocationEntityProvider","DefaultCatalogProcessingEngine","createHash","AuthorizedLocationAnalyzer","RepoLocationAnalyzer","AuthorizedLocationService","DefaultLocationService","AuthorizedRefreshService","DefaultRefreshService","createRouter","connectEntityProviders","SchemaValidEntityPolicy","DefaultNamespaceEntityPolicy","NoForeignRootFieldsEntityPolicy","FieldFormatEntityPolicy","makeValidator","EntityPolicies","jsonPlaceholderResolver","yamlPlaceholderResolver","textPlaceholderResolver","PlaceholderProcessor","BuiltinKindsEntityProcessor","config","readDurationFromConfig","durationToMilliseconds"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4KO,MAAM,cAAe,CAAA;AAAA,EACT,GAAA;AAAA,EACT,cAAA;AAAA,EACA,qBAAA;AAAA,EACA,oBAAA;AAAA,EACA,qBAAA;AAAA,EACA,eAAA;AAAA,EACA,UAAA;AAAA,EACA,iBAAA;AAAA,EACA,iBAAA;AAAA,EACA,MAAA;AAAA,EACA,iBAAA;AAAA,EAIA,kBAAA;AAAA,EACA,gBAAiD,GAAA,KAAA,CAAA;AAAA,EACxC,WAAA;AAAA,EACA,eAAA;AAAA,EACT,mBAAA;AAAA,EACA,+BAAkC,GAAA,KAAA;AAAA,EAClC,WAAA;AAAA;AAAA;AAAA;AAAA,EAKR,OAAO,OAAO,GAAyC,EAAA;AACrD,IAAO,OAAA,IAAI,eAAe,GAAG,CAAA;AAAA;AAC/B,EAEQ,YAAY,GAAyB,EAAA;AAC3C,IAAA,IAAA,CAAK,GAAM,GAAA,GAAA;AACX,IAAA,IAAA,CAAK,iBAAiB,EAAC;AACvB,IAAA,IAAA,CAAK,qBAAwB,GAAA,KAAA;AAC7B,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CAAA;AAAA;AAEL;;;;"}
|
|
1
|
+
{"version":3,"file":"CatalogBuilder.cjs.js","sources":["../../src/service/CatalogBuilder.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n createLegacyAuthAdapters,\n HostDiscovery,\n} from '@backstage/backend-common';\nimport {\n DefaultNamespaceEntityPolicy,\n Entity,\n EntityPolicies,\n EntityPolicy,\n FieldFormatEntityPolicy,\n makeValidator,\n NoForeignRootFieldsEntityPolicy,\n SchemaValidEntityPolicy,\n Validators,\n} from '@backstage/catalog-model';\nimport { ScmIntegrations } from '@backstage/integration';\nimport { createHash } from 'crypto';\nimport { Router } from 'express';\nimport lodash from 'lodash';\n\nimport {\n AuditorService,\n AuthService,\n DatabaseService,\n DiscoveryService,\n HttpAuthService,\n LoggerService,\n PermissionsRegistryService,\n PermissionsService,\n RootConfigService,\n SchedulerService,\n UrlReaderService,\n} from '@backstage/backend-plugin-api';\nimport { Config, readDurationFromConfig } from '@backstage/config';\nimport {\n catalogPermissions,\n RESOURCE_TYPE_CATALOG_ENTITY,\n} from '@backstage/plugin-catalog-common/alpha';\nimport {\n CatalogProcessor,\n CatalogProcessorParser,\n EntitiesSearchFilter,\n EntityProvider,\n LocationAnalyzer,\n PlaceholderResolver,\n ScmLocationAnalyzer,\n} from '@backstage/plugin-catalog-node';\nimport { EventBroker, EventsService } from '@backstage/plugin-events-node';\nimport {\n Permission,\n PermissionAuthorizer,\n PermissionRuleParams,\n toPermissionEvaluator,\n} from '@backstage/plugin-permission-common';\nimport {\n createConditionTransformer,\n createPermissionIntegrationRouter,\n PermissionRule,\n} from '@backstage/plugin-permission-node';\nimport { durationToMilliseconds } from '@backstage/types';\nimport { DefaultCatalogDatabase } from '../database/DefaultCatalogDatabase';\nimport { DefaultProcessingDatabase } from '../database/DefaultProcessingDatabase';\nimport { DefaultProviderDatabase } from '../database/DefaultProviderDatabase';\nimport { applyDatabaseMigrations } from '../database/migrations';\nimport { DefaultCatalogRulesEnforcer } from '../ingestion/CatalogRules';\nimport { RepoLocationAnalyzer } from '../ingestion/LocationAnalyzer';\nimport { permissionRules as catalogPermissionRules } from '../permissions/rules';\nimport {\n CatalogProcessingEngine,\n createRandomProcessingInterval,\n ProcessingIntervalFunction,\n} from '../processing';\nimport { connectEntityProviders } from '../processing/connectEntityProviders';\nimport { evictEntitiesFromOrphanedProviders } from '../processing/evictEntitiesFromOrphanedProviders';\nimport { DefaultCatalogProcessingEngine } from '../processing/DefaultCatalogProcessingEngine';\nimport { DefaultCatalogProcessingOrchestrator } from '../processing/DefaultCatalogProcessingOrchestrator';\nimport {\n AnnotateLocationEntityProcessor,\n BuiltinKindsEntityProcessor,\n CodeOwnersProcessor,\n FileReaderProcessor,\n PlaceholderProcessor,\n UrlReaderProcessor,\n} from '../processors';\nimport {\n jsonPlaceholderResolver,\n textPlaceholderResolver,\n yamlPlaceholderResolver,\n} from '../processors/PlaceholderProcessor';\nimport { ConfigLocationEntityProvider } from '../providers/ConfigLocationEntityProvider';\nimport { DefaultLocationStore } from '../providers/DefaultLocationStore';\nimport { DefaultStitcher } from '../stitching/DefaultStitcher';\nimport { defaultEntityDataParser } from '../util/parse';\nimport { AuthorizedEntitiesCatalog } from './AuthorizedEntitiesCatalog';\nimport { AuthorizedLocationAnalyzer } from './AuthorizedLocationAnalyzer';\nimport { AuthorizedLocationService } from './AuthorizedLocationService';\nimport { AuthorizedRefreshService } from './AuthorizedRefreshService';\nimport { createRouter } from './createRouter';\nimport { DefaultEntitiesCatalog } from './DefaultEntitiesCatalog';\nimport { DefaultLocationService } from './DefaultLocationService';\nimport { DefaultRefreshService } from './DefaultRefreshService';\nimport { entitiesResponseToObjects } from './response';\nimport { catalogEntityPermissionResourceRef } from '@backstage/plugin-catalog-node/alpha';\n\n/**\n * This is a duplicate of the alpha `CatalogPermissionRule` type, for use in the stable API.\n *\n * @public\n */\nexport type CatalogPermissionRuleInput<\n TParams extends PermissionRuleParams = PermissionRuleParams,\n> = PermissionRule<Entity, EntitiesSearchFilter, 'catalog-entity', TParams>;\n\n/**\n * @deprecated Please migrate to the new backend system as this will be removed in the future.\n * @public\n */\nexport type CatalogEnvironment = {\n logger: LoggerService;\n database: DatabaseService;\n config: RootConfigService;\n reader: UrlReaderService;\n permissions: PermissionsService | PermissionAuthorizer;\n permissionsRegistry?: PermissionsRegistryService;\n scheduler?: SchedulerService;\n discovery?: DiscoveryService;\n auth?: AuthService;\n httpAuth?: HttpAuthService;\n auditor?: AuditorService;\n};\n\n/**\n * A builder that helps wire up all of the component parts of the catalog.\n *\n * The touch points where you can replace or extend behavior are as follows:\n *\n * - Entity policies can be added or replaced. These are automatically run\n * after the processors' pre-processing steps. All policies are given the\n * chance to inspect the entity, and all of them have to pass in order for\n * the entity to be considered valid from an overall point of view.\n * - Location analyzers can be added. These are responsible for analyzing\n * repositories when onboarding them into the catalog, by finding\n * catalog-info.yaml files and other artifacts that can help automatically\n * register or create catalog data on the user's behalf.\n * - Placeholder resolvers can be replaced or added. These run on the raw\n * structured data between the parsing and pre-processing steps, to replace\n * dollar-prefixed entries with their actual values (like $file).\n * - Field format validators can be replaced. These check the format of\n * individual core fields such as metadata.name, to ensure that they adhere\n * to certain rules.\n * - Processors can be added or replaced. These implement the functionality of\n * reading, parsing, validating, and processing the entity data before it is\n * persisted in the catalog.\n *\n * @public\n * @deprecated Please migrate to the new backend system as this will be removed in the future.\n */\nexport class CatalogBuilder {\n private readonly env: CatalogEnvironment;\n private entityPolicies: EntityPolicy[];\n private entityPoliciesReplace: boolean;\n private placeholderResolvers: Record<string, PlaceholderResolver>;\n private fieldFormatValidators: Partial<Validators>;\n private entityProviders: EntityProvider[];\n private processors: CatalogProcessor[];\n private locationAnalyzers: ScmLocationAnalyzer[];\n private processorsReplace: boolean;\n private parser: CatalogProcessorParser | undefined;\n private onProcessingError?: (event: {\n unprocessedEntity: Entity;\n errors: Error[];\n }) => Promise<void> | void;\n private processingInterval: ProcessingIntervalFunction;\n private locationAnalyzer: LocationAnalyzer | undefined = undefined;\n private readonly permissions: Permission[];\n private readonly permissionRules: CatalogPermissionRuleInput[];\n private allowedLocationType: string[];\n private legacySingleProcessorValidation = false;\n private eventBroker?: EventBroker | EventsService;\n\n /**\n * Creates a catalog builder.\n */\n static create(env: CatalogEnvironment): CatalogBuilder {\n return new CatalogBuilder(env);\n }\n\n private constructor(env: CatalogEnvironment) {\n this.env = env;\n this.entityPolicies = [];\n this.entityPoliciesReplace = false;\n this.placeholderResolvers = {};\n this.fieldFormatValidators = {};\n this.entityProviders = [];\n this.processors = [];\n this.locationAnalyzers = [];\n this.processorsReplace = false;\n this.parser = undefined;\n this.permissions = [...catalogPermissions];\n this.permissionRules = Object.values(catalogPermissionRules);\n this.allowedLocationType = ['url'];\n\n this.processingInterval = CatalogBuilder.getDefaultProcessingInterval(\n env.config,\n );\n }\n\n /**\n * Adds policies that are used to validate entities between the pre-\n * processing and post-processing stages. All such policies must pass for the\n * entity to be considered valid.\n *\n * If what you want to do is to replace the rules for what format is allowed\n * in various core entity fields (such as metadata.name), you may want to use\n * {@link CatalogBuilder#setFieldFormatValidators} instead.\n *\n * @param policies - One or more policies\n */\n addEntityPolicy(\n ...policies: Array<EntityPolicy | Array<EntityPolicy>>\n ): CatalogBuilder {\n this.entityPolicies.push(...policies.flat());\n return this;\n }\n\n /**\n * Processing interval determines how often entities should be processed.\n * Seconds provided will be multiplied by 1.5\n * The default processing interval is 100-150 seconds.\n * setting this too low will potentially deplete request quotas to upstream services.\n */\n setProcessingIntervalSeconds(seconds: number): CatalogBuilder {\n this.processingInterval = createRandomProcessingInterval({\n minSeconds: seconds,\n maxSeconds: seconds * 1.5,\n });\n return this;\n }\n\n /**\n * Overwrites the default processing interval function used to spread\n * entity updates in the catalog.\n */\n setProcessingInterval(\n processingInterval: ProcessingIntervalFunction,\n ): CatalogBuilder {\n this.processingInterval = processingInterval;\n return this;\n }\n\n /**\n * Overwrites the default location analyzer.\n */\n setLocationAnalyzer(locationAnalyzer: LocationAnalyzer): CatalogBuilder {\n this.locationAnalyzer = locationAnalyzer;\n return this;\n }\n\n /**\n * Sets what policies to use for validation of entities between the pre-\n * processing and post-processing stages. All such policies must pass for the\n * entity to be considered valid.\n *\n * If what you want to do is to replace the rules for what format is allowed\n * in various core entity fields (such as metadata.name), you may want to use\n * {@link CatalogBuilder#setFieldFormatValidators} instead.\n *\n * This function replaces the default set of policies; use with care.\n *\n * @param policies - One or more policies\n */\n replaceEntityPolicies(policies: EntityPolicy[]): CatalogBuilder {\n this.entityPolicies = [...policies];\n this.entityPoliciesReplace = true;\n return this;\n }\n\n /**\n * Adds, or overwrites, a handler for placeholders (e.g. $file) in entity\n * definition files.\n *\n * @param key - The key that identifies the placeholder, e.g. \"file\"\n * @param resolver - The resolver that gets values for this placeholder\n */\n setPlaceholderResolver(\n key: string,\n resolver: PlaceholderResolver,\n ): CatalogBuilder {\n this.placeholderResolvers[key] = resolver;\n return this;\n }\n\n /**\n * Sets the validator function to use for one or more special fields of an\n * entity. This is useful if the default rules for formatting of fields are\n * not sufficient.\n *\n * This function has no effect if used together with\n * {@link CatalogBuilder#replaceEntityPolicies}.\n *\n * @param validators - The (subset of) validators to set\n */\n setFieldFormatValidators(validators: Partial<Validators>): CatalogBuilder {\n lodash.merge(this.fieldFormatValidators, validators);\n return this;\n }\n\n /**\n * Adds or replaces entity providers. These are responsible for bootstrapping\n * the list of entities out of original data sources. For example, there is\n * one entity source for the config locations, and one for the database\n * stored locations. If you ingest entities out of a third party system, you\n * may want to implement that in terms of an entity provider as well.\n *\n * @param providers - One or more entity providers\n */\n addEntityProvider(\n ...providers: Array<EntityProvider | Array<EntityProvider>>\n ): CatalogBuilder {\n this.entityProviders.push(...providers.flat());\n return this;\n }\n\n /**\n * Adds entity processors. These are responsible for reading, parsing, and\n * processing entities before they are persisted in the catalog.\n *\n * @param processors - One or more processors\n */\n addProcessor(\n ...processors: Array<CatalogProcessor | Array<CatalogProcessor>>\n ): CatalogBuilder {\n this.processors.push(...processors.flat());\n return this;\n }\n\n /**\n * Sets what entity processors to use. These are responsible for reading,\n * parsing, and processing entities before they are persisted in the catalog.\n *\n * This function replaces the default set of processors, consider using with\n * {@link CatalogBuilder#getDefaultProcessors}; use with care.\n *\n * @param processors - One or more processors\n */\n replaceProcessors(processors: CatalogProcessor[]): CatalogBuilder {\n this.processors = [...processors];\n this.processorsReplace = true;\n return this;\n }\n\n /**\n * Returns the default list of entity processors. These are responsible for reading,\n * parsing, and processing entities before they are persisted in the catalog. Changing\n * the order of processing can give more control to custom processors.\n *\n * Consider using with {@link CatalogBuilder#replaceProcessors}\n *\n */\n getDefaultProcessors(): CatalogProcessor[] {\n const { config, logger, reader } = this.env;\n const integrations = ScmIntegrations.fromConfig(config);\n\n return [\n new FileReaderProcessor(),\n new UrlReaderProcessor({ reader, logger, config }),\n CodeOwnersProcessor.fromConfig(config, { logger, reader }),\n new AnnotateLocationEntityProcessor({ integrations }),\n ];\n }\n\n /**\n * Adds Location Analyzers. These are responsible for analyzing\n * repositories when onboarding them into the catalog, by finding\n * catalog-info.yaml files and other artifacts that can help automatically\n * register or create catalog data on the user's behalf.\n *\n * @param locationAnalyzers - One or more location analyzers\n */\n addLocationAnalyzers(\n ...analyzers: Array<ScmLocationAnalyzer | Array<ScmLocationAnalyzer>>\n ): CatalogBuilder {\n this.locationAnalyzers.push(...analyzers.flat());\n return this;\n }\n\n /**\n * Sets up the catalog to use a custom parser for entity data.\n *\n * This is the function that gets called immediately after some raw entity\n * specification data has been read from a remote source, and needs to be\n * parsed and emitted as structured data.\n *\n * @param parser - The custom parser\n */\n setEntityDataParser(parser: CatalogProcessorParser): CatalogBuilder {\n this.parser = parser;\n return this;\n }\n\n /**\n * Adds additional permissions. See\n * {@link @backstage/plugin-permission-node#Permission}.\n *\n * @param permissions - Additional permissions\n */\n addPermissions(...permissions: Array<Permission | Array<Permission>>) {\n this.permissions.push(...permissions.flat());\n return this;\n }\n\n /**\n * Adds additional permission rules. Permission rules are used to evaluate\n * catalog resources against queries. See\n * {@link @backstage/plugin-permission-node#PermissionRule}.\n *\n * @param permissionRules - Additional permission rules\n */\n addPermissionRules(\n ...permissionRules: Array<\n CatalogPermissionRuleInput | Array<CatalogPermissionRuleInput>\n >\n ) {\n this.permissionRules.push(...permissionRules.flat());\n return this;\n }\n\n /**\n * Sets up the allowed location types from being registered via the location service.\n *\n * @param allowedLocationTypes - the allowed location types\n */\n setAllowedLocationTypes(allowedLocationTypes: string[]): CatalogBuilder {\n this.allowedLocationType = allowedLocationTypes;\n return this;\n }\n\n /**\n * Enables the legacy behaviour of canceling validation early whenever only a\n * single processor declares an entity kind to be valid.\n */\n useLegacySingleProcessorValidation(): this {\n this.legacySingleProcessorValidation = true;\n return this;\n }\n\n /**\n * Enables the publishing of events for conflicts in the DefaultProcessingDatabase\n */\n setEventBroker(broker: EventBroker | EventsService): CatalogBuilder {\n this.eventBroker = broker;\n return this;\n }\n\n /**\n * Wires up and returns all of the component parts of the catalog\n */\n async build(): Promise<{\n processingEngine: CatalogProcessingEngine;\n router: Router;\n }> {\n const {\n config,\n database,\n logger,\n permissions,\n scheduler,\n permissionsRegistry,\n discovery = HostDiscovery.fromConfig(config),\n auditor,\n } = this.env;\n\n const { auth, httpAuth } = createLegacyAuthAdapters({\n ...this.env,\n discovery,\n });\n\n const disableRelationsCompatibility = config.getOptionalBoolean(\n 'catalog.disableRelationsCompatibility',\n );\n\n const policy = this.buildEntityPolicy();\n const processors = this.buildProcessors();\n const parser = this.parser || defaultEntityDataParser;\n\n const dbClient = await database.getClient();\n if (!database.migrations?.skip) {\n logger.info('Performing database migration');\n await applyDatabaseMigrations(dbClient);\n }\n\n const stitcher = DefaultStitcher.fromConfig(config, {\n knex: dbClient,\n logger,\n });\n\n const processingDatabase = new DefaultProcessingDatabase({\n database: dbClient,\n logger,\n refreshInterval: this.processingInterval,\n eventBroker: this.eventBroker,\n });\n const providerDatabase = new DefaultProviderDatabase({\n database: dbClient,\n logger,\n });\n const catalogDatabase = new DefaultCatalogDatabase({\n database: dbClient,\n logger,\n });\n const integrations = ScmIntegrations.fromConfig(config);\n const rulesEnforcer = DefaultCatalogRulesEnforcer.fromConfig(config);\n\n const unauthorizedEntitiesCatalog = new DefaultEntitiesCatalog({\n database: dbClient,\n logger,\n stitcher,\n disableRelationsCompatibility,\n });\n\n let permissionsService: PermissionsService;\n if ('authorizeConditional' in permissions) {\n permissionsService = permissions as PermissionsService;\n } else {\n logger.warn(\n 'PermissionAuthorizer is deprecated. Please use an instance of PermissionEvaluator instead of PermissionAuthorizer in PluginEnvironment#permissions',\n );\n permissionsService = toPermissionEvaluator(permissions);\n }\n\n const orchestrator = new DefaultCatalogProcessingOrchestrator({\n processors,\n integrations,\n rulesEnforcer,\n logger,\n parser,\n policy,\n legacySingleProcessorValidation: this.legacySingleProcessorValidation,\n });\n\n const entitiesCatalog = new AuthorizedEntitiesCatalog(\n unauthorizedEntitiesCatalog,\n permissionsService,\n createConditionTransformer(this.permissionRules),\n );\n\n const getResources = async (resourceRefs: string[]) => {\n const { items } = await unauthorizedEntitiesCatalog.entitiesBatch({\n credentials: await auth.getOwnServiceCredentials(),\n entityRefs: resourceRefs,\n });\n\n return entitiesResponseToObjects(items).map(e => e || undefined);\n };\n\n let permissionIntegrationRouter:\n | ReturnType<typeof createPermissionIntegrationRouter>\n | undefined;\n if (permissionsRegistry) {\n permissionsRegistry.addResourceType({\n resourceRef: catalogEntityPermissionResourceRef,\n getResources,\n permissions: this.permissions,\n rules: this.permissionRules,\n });\n } else {\n permissionIntegrationRouter = createPermissionIntegrationRouter({\n resourceType: RESOURCE_TYPE_CATALOG_ENTITY,\n getResources,\n permissions: this.permissions,\n rules: this.permissionRules,\n });\n }\n\n const locationStore = new DefaultLocationStore(dbClient);\n const configLocationProvider = new ConfigLocationEntityProvider(config);\n const entityProviders = lodash.uniqBy(\n [...this.entityProviders, locationStore, configLocationProvider],\n provider => provider.getProviderName(),\n );\n\n const processingEngine = new DefaultCatalogProcessingEngine({\n config,\n scheduler,\n logger,\n knex: dbClient,\n processingDatabase,\n orchestrator,\n stitcher,\n createHash: () => createHash('sha1'),\n pollingIntervalMs: 1000,\n onProcessingError: event => {\n this.onProcessingError?.(event);\n },\n eventBroker: this.eventBroker,\n });\n\n const locationAnalyzer =\n this.locationAnalyzer ??\n new AuthorizedLocationAnalyzer(\n new RepoLocationAnalyzer(logger, integrations, this.locationAnalyzers),\n permissionsService,\n );\n const locationService = new AuthorizedLocationService(\n new DefaultLocationService(locationStore, orchestrator, {\n allowedLocationTypes: this.allowedLocationType,\n }),\n permissionsService,\n );\n const refreshService = new AuthorizedRefreshService(\n new DefaultRefreshService({ database: catalogDatabase }),\n permissionsService,\n );\n\n const router = await createRouter({\n entitiesCatalog,\n locationAnalyzer,\n locationService,\n orchestrator,\n refreshService,\n logger,\n config,\n permissionIntegrationRouter,\n auth,\n httpAuth,\n permissionsService,\n auditor,\n disableRelationsCompatibility,\n });\n\n if (\n config.getOptionalString('catalog.orphanProviderStrategy') === 'delete'\n ) {\n await evictEntitiesFromOrphanedProviders({\n db: providerDatabase,\n providers: entityProviders,\n logger,\n });\n }\n await connectEntityProviders(providerDatabase, entityProviders);\n\n return {\n processingEngine: {\n async start() {\n await processingEngine.start();\n await stitcher.start();\n },\n async stop() {\n await processingEngine.stop();\n await stitcher.stop();\n },\n },\n router,\n };\n }\n\n subscribe(options: {\n onProcessingError: (event: {\n unprocessedEntity: Entity;\n errors: Error[];\n }) => Promise<void> | void;\n }) {\n this.onProcessingError = options.onProcessingError;\n }\n\n private buildEntityPolicy(): EntityPolicy {\n const entityPolicies: EntityPolicy[] = this.entityPoliciesReplace\n ? [new SchemaValidEntityPolicy(), ...this.entityPolicies]\n : [\n new SchemaValidEntityPolicy(),\n new DefaultNamespaceEntityPolicy(),\n new NoForeignRootFieldsEntityPolicy(),\n new FieldFormatEntityPolicy(\n makeValidator(this.fieldFormatValidators),\n ),\n ...this.entityPolicies,\n ];\n\n return EntityPolicies.allOf(entityPolicies);\n }\n\n private buildProcessors(): CatalogProcessor[] {\n const { config, reader } = this.env;\n const integrations = ScmIntegrations.fromConfig(config);\n\n this.checkDeprecatedReaderProcessors();\n\n const placeholderResolvers: Record<string, PlaceholderResolver> = {\n json: jsonPlaceholderResolver,\n yaml: yamlPlaceholderResolver,\n text: textPlaceholderResolver,\n ...this.placeholderResolvers,\n };\n\n // The placeholder is always there no matter what\n const processors: CatalogProcessor[] = [\n new PlaceholderProcessor({\n resolvers: placeholderResolvers,\n reader,\n integrations,\n }),\n ];\n\n const builtinKindsEntityProcessor = new BuiltinKindsEntityProcessor();\n // If the user adds a processor named 'BuiltinKindsEntityProcessor',\n // skip inclusion of the catalog-backend version.\n if (\n !this.processors.some(\n processor =>\n processor.getProcessorName() ===\n builtinKindsEntityProcessor.getProcessorName(),\n )\n ) {\n processors.push(builtinKindsEntityProcessor);\n }\n\n // These are only added unless the user replaced them all\n if (!this.processorsReplace) {\n processors.push(...this.getDefaultProcessors());\n }\n\n // Add the ones (if any) that the user added\n processors.push(...this.processors);\n\n this.checkMissingExternalProcessors(processors);\n\n return processors;\n }\n\n // TODO(Rugvip): These old processors are removed, for a while we'll be throwing\n // errors here to make sure people know where to move the config\n private checkDeprecatedReaderProcessors() {\n const pc = this.env.config.getOptionalConfig('catalog.processors');\n if (pc?.has('github')) {\n throw new Error(\n `Using deprecated configuration for catalog.processors.github, move to using integrations.github instead`,\n );\n }\n if (pc?.has('gitlabApi')) {\n throw new Error(\n `Using deprecated configuration for catalog.processors.gitlabApi, move to using integrations.gitlab instead`,\n );\n }\n if (pc?.has('bitbucketApi')) {\n throw new Error(\n `Using deprecated configuration for catalog.processors.bitbucketApi, move to using integrations.bitbucket instead`,\n );\n }\n if (pc?.has('azureApi')) {\n throw new Error(\n `Using deprecated configuration for catalog.processors.azureApi, move to using integrations.azure instead`,\n );\n }\n }\n\n // TODO(freben): This can be removed no sooner than June 2022, after adopters have had some time to adapt to the new package structure\n private checkMissingExternalProcessors(processors: CatalogProcessor[]) {\n const skipCheckVarName = 'BACKSTAGE_CATALOG_SKIP_MISSING_PROCESSORS_CHECK';\n if (process.env[skipCheckVarName]) {\n return;\n }\n\n const locationTypes = new Set(\n this.env.config\n .getOptionalConfigArray('catalog.locations')\n ?.map(l => l.getString('type')) ?? [],\n );\n const processorNames = new Set(processors.map(p => p.getProcessorName()));\n\n function check(\n locationType: string,\n processorName: string,\n installationUrl: string,\n ) {\n if (\n locationTypes.has(locationType) &&\n !processorNames.has(processorName)\n ) {\n throw new Error(\n [\n `Your config contains a \"catalog.locations\" entry of type ${locationType},`,\n `but does not have the corresponding catalog processor ${processorName} installed.`,\n `This processor used to be built into the catalog itself, but is now moved to an`,\n `external module that has to be installed manually. Please follow the installation`,\n `instructions at ${installationUrl} if you are using this ability, or remove the`,\n `location from your app config if you do not. You can also silence this check entirely`,\n `by setting the environment variable ${skipCheckVarName} to 'true'.`,\n ].join(' '),\n );\n }\n }\n\n check(\n 'aws-cloud-accounts',\n 'AwsOrganizationCloudAccountProcessor',\n 'https://backstage.io/docs/integrations',\n );\n check(\n 's3-discovery',\n 'AwsS3DiscoveryProcessor',\n 'https://backstage.io/docs/integrations/aws-s3/discovery',\n );\n check(\n 'azure-discovery',\n 'AzureDevOpsDiscoveryProcessor',\n 'https://backstage.io/docs/integrations/azure/discovery',\n );\n check(\n 'bitbucket-discovery',\n 'BitbucketDiscoveryProcessor',\n 'https://backstage.io/docs/integrations/bitbucket/discovery',\n );\n check(\n 'github-discovery',\n 'GithubDiscoveryProcessor',\n 'https://backstage.io/docs/integrations/github/discovery',\n );\n check(\n 'github-org',\n 'GithubOrgReaderProcessor',\n 'https://backstage.io/docs/integrations/github/org',\n );\n check(\n 'gitlab-discovery',\n 'GitLabDiscoveryProcessor',\n 'https://backstage.io/docs/integrations/gitlab/discovery',\n );\n check(\n 'ldap-org',\n 'LdapOrgReaderProcessor',\n 'https://backstage.io/docs/integrations/ldap/org',\n );\n check(\n 'microsoft-graph-org',\n 'MicrosoftGraphOrgReaderProcessor',\n 'https://backstage.io/docs/integrations/azure/org',\n );\n }\n\n private static getDefaultProcessingInterval(\n config: Config,\n ): ProcessingIntervalFunction {\n const processingIntervalKey = 'catalog.processingInterval';\n\n if (!config.has(processingIntervalKey)) {\n return createRandomProcessingInterval({\n minSeconds: 100,\n maxSeconds: 150,\n });\n }\n\n if (!Boolean(config.get('catalog.processingInterval'))) {\n return () => {\n throw new Error(\n 'catalog.processingInterval is set to false, processing is disabled.',\n );\n };\n }\n\n const duration = readDurationFromConfig(config, {\n key: processingIntervalKey,\n });\n\n const seconds = Math.max(\n 1,\n Math.round(durationToMilliseconds(duration) / 1000),\n );\n\n return createRandomProcessingInterval({\n minSeconds: seconds,\n maxSeconds: seconds * 1.5,\n });\n }\n}\n"],"names":["catalogPermissions","catalogPermissionRules","createRandomProcessingInterval","lodash","ScmIntegrations","FileReaderProcessor","UrlReaderProcessor","CodeOwnersProcessor","AnnotateLocationEntityProcessor","HostDiscovery","createLegacyAuthAdapters","defaultEntityDataParser","applyDatabaseMigrations","DefaultStitcher","DefaultProcessingDatabase","DefaultProviderDatabase","DefaultCatalogDatabase","DefaultCatalogRulesEnforcer","DefaultEntitiesCatalog","toPermissionEvaluator","DefaultCatalogProcessingOrchestrator","AuthorizedEntitiesCatalog","createConditionTransformer","entitiesResponseToObjects","catalogEntityPermissionResourceRef","createPermissionIntegrationRouter","RESOURCE_TYPE_CATALOG_ENTITY","DefaultLocationStore","ConfigLocationEntityProvider","DefaultCatalogProcessingEngine","createHash","AuthorizedLocationAnalyzer","RepoLocationAnalyzer","AuthorizedLocationService","DefaultLocationService","AuthorizedRefreshService","DefaultRefreshService","createRouter","evictEntitiesFromOrphanedProviders","connectEntityProviders","SchemaValidEntityPolicy","DefaultNamespaceEntityPolicy","NoForeignRootFieldsEntityPolicy","FieldFormatEntityPolicy","makeValidator","EntityPolicies","jsonPlaceholderResolver","yamlPlaceholderResolver","textPlaceholderResolver","PlaceholderProcessor","BuiltinKindsEntityProcessor","config","readDurationFromConfig","durationToMilliseconds"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6KO,MAAM,cAAe,CAAA;AAAA,EACT,GAAA;AAAA,EACT,cAAA;AAAA,EACA,qBAAA;AAAA,EACA,oBAAA;AAAA,EACA,qBAAA;AAAA,EACA,eAAA;AAAA,EACA,UAAA;AAAA,EACA,iBAAA;AAAA,EACA,iBAAA;AAAA,EACA,MAAA;AAAA,EACA,iBAAA;AAAA,EAIA,kBAAA;AAAA,EACA,gBAAiD,GAAA,KAAA,CAAA;AAAA,EACxC,WAAA;AAAA,EACA,eAAA;AAAA,EACT,mBAAA;AAAA,EACA,+BAAkC,GAAA,KAAA;AAAA,EAClC,WAAA;AAAA;AAAA;AAAA;AAAA,EAKR,OAAO,OAAO,GAAyC,EAAA;AACrD,IAAO,OAAA,IAAI,eAAe,GAAG,CAAA;AAAA;AAC/B,EAEQ,YAAY,GAAyB,EAAA;AAC3C,IAAA,IAAA,CAAK,GAAM,GAAA,GAAA;AACX,IAAA,IAAA,CAAK,iBAAiB,EAAC;AACvB,IAAA,IAAA,CAAK,qBAAwB,GAAA,KAAA;AAC7B,IAAA,IAAA,CAAK,uBAAuB,EAAC;AAC7B,IAAA,IAAA,CAAK,wBAAwB,EAAC;AAC9B,IAAA,IAAA,CAAK,kBAAkB,EAAC;AACxB,IAAA,IAAA,CAAK,aAAa,EAAC;AACnB,IAAA,IAAA,CAAK,oBAAoB,EAAC;AAC1B,IAAA,IAAA,CAAK,iBAAoB,GAAA,KAAA;AACzB,IAAA,IAAA,CAAK,MAAS,GAAA,KA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 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-catalog-backend",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.32.0-next.1",
|
|
4
4
|
"description": "The Backstage backend plugin that provides the Backstage catalog",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "backend-plugin",
|
|
@@ -76,21 +76,21 @@
|
|
|
76
76
|
},
|
|
77
77
|
"dependencies": {
|
|
78
78
|
"@backstage/backend-common": "^0.25.0",
|
|
79
|
-
"@backstage/backend-openapi-utils": "
|
|
80
|
-
"@backstage/backend-plugin-api": "
|
|
81
|
-
"@backstage/catalog-client": "
|
|
82
|
-
"@backstage/catalog-model": "
|
|
83
|
-
"@backstage/config": "
|
|
84
|
-
"@backstage/errors": "
|
|
85
|
-
"@backstage/integration": "
|
|
86
|
-
"@backstage/plugin-catalog-common": "
|
|
87
|
-
"@backstage/plugin-catalog-node": "
|
|
88
|
-
"@backstage/plugin-events-node": "
|
|
89
|
-
"@backstage/plugin-permission-common": "
|
|
90
|
-
"@backstage/plugin-permission-node": "
|
|
91
|
-
"@backstage/plugin-search-backend-module-catalog": "
|
|
92
|
-
"@backstage/plugin-search-common": "
|
|
93
|
-
"@backstage/types": "
|
|
79
|
+
"@backstage/backend-openapi-utils": "0.5.1-next.1",
|
|
80
|
+
"@backstage/backend-plugin-api": "1.2.1-next.1",
|
|
81
|
+
"@backstage/catalog-client": "1.9.1",
|
|
82
|
+
"@backstage/catalog-model": "1.7.3",
|
|
83
|
+
"@backstage/config": "1.3.2",
|
|
84
|
+
"@backstage/errors": "1.2.7",
|
|
85
|
+
"@backstage/integration": "1.16.1",
|
|
86
|
+
"@backstage/plugin-catalog-common": "1.1.3",
|
|
87
|
+
"@backstage/plugin-catalog-node": "1.16.1-next.1",
|
|
88
|
+
"@backstage/plugin-events-node": "0.4.9-next.1",
|
|
89
|
+
"@backstage/plugin-permission-common": "0.8.4",
|
|
90
|
+
"@backstage/plugin-permission-node": "0.8.9-next.1",
|
|
91
|
+
"@backstage/plugin-search-backend-module-catalog": "0.3.2-next.1",
|
|
92
|
+
"@backstage/plugin-search-common": "1.2.17",
|
|
93
|
+
"@backstage/types": "1.2.1",
|
|
94
94
|
"@opentelemetry/api": "^1.9.0",
|
|
95
95
|
"@types/express": "^4.17.6",
|
|
96
96
|
"codeowners-utils": "^1.0.2",
|
|
@@ -112,12 +112,12 @@
|
|
|
112
112
|
"zod": "^3.22.4"
|
|
113
113
|
},
|
|
114
114
|
"devDependencies": {
|
|
115
|
-
"@backstage/backend-defaults": "
|
|
116
|
-
"@backstage/backend-test-utils": "
|
|
117
|
-
"@backstage/cli": "
|
|
118
|
-
"@backstage/plugin-permission-common": "
|
|
119
|
-
"@backstage/repo-tools": "
|
|
120
|
-
"@backstage/test-utils": "
|
|
115
|
+
"@backstage/backend-defaults": "0.8.2-next.1",
|
|
116
|
+
"@backstage/backend-test-utils": "1.3.1-next.1",
|
|
117
|
+
"@backstage/cli": "0.30.1-next.0",
|
|
118
|
+
"@backstage/plugin-permission-common": "0.8.4",
|
|
119
|
+
"@backstage/repo-tools": "0.13.1-next.1",
|
|
120
|
+
"@backstage/test-utils": "1.7.5",
|
|
121
121
|
"@types/core-js": "^2.5.4",
|
|
122
122
|
"@types/git-url-parse": "^9.0.0",
|
|
123
123
|
"@types/glob": "^8.0.0",
|