@backstage/plugin-catalog-node 1.2.2-next.0 → 1.3.0-next.2

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 CHANGED
@@ -1,5 +1,34 @@
1
1
  # @backstage/plugin-catalog-node
2
2
 
3
+ ## 1.3.0-next.2
4
+
5
+ ### Minor Changes
6
+
7
+ - eacc8e2b55: Make it possible for entity providers to supply only entity refs, instead of full entities, in `delta` mutation deletions.
8
+
9
+ ### Patch Changes
10
+
11
+ - 884d749b14: Refactored to use `coreServices` from `@backstage/backend-plugin-api`.
12
+ - Updated dependencies
13
+ - @backstage/backend-plugin-api@0.2.0-next.2
14
+ - @backstage/catalog-client@1.2.0-next.1
15
+ - @backstage/catalog-model@1.1.4-next.1
16
+ - @backstage/errors@1.1.4-next.1
17
+ - @backstage/types@1.0.2-next.1
18
+ - @backstage/plugin-catalog-common@1.0.9-next.2
19
+
20
+ ## 1.2.2-next.1
21
+
22
+ ### Patch Changes
23
+
24
+ - Updated dependencies
25
+ - @backstage/types@1.0.2-next.1
26
+ - @backstage/backend-plugin-api@0.1.5-next.1
27
+ - @backstage/catalog-client@1.2.0-next.1
28
+ - @backstage/catalog-model@1.1.4-next.1
29
+ - @backstage/errors@1.1.4-next.1
30
+ - @backstage/plugin-catalog-common@1.0.9-next.1
31
+
3
32
  ## 1.2.2-next.0
4
33
 
5
34
  ### Patch Changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-catalog-node",
3
- "version": "1.2.2-next.0",
3
+ "version": "1.3.0-next.2",
4
4
  "main": "../dist/index.cjs.js",
5
5
  "types": "../dist/index.alpha.d.ts"
6
6
  }
@@ -181,38 +181,47 @@ export declare type DeferredEntity = {
181
181
  };
182
182
 
183
183
  /**
184
- * An EntityProvider is able to provide entities to the catalog.
184
+ * An entity provider is able to provide entities to the catalog.
185
185
  * See https://backstage.io/docs/features/software-catalog/life-of-an-entity for more details.
186
+ *
186
187
  * @public
187
188
  */
188
189
  export declare interface EntityProvider {
189
- /** Unique provider name used internally for caching. */
190
+ /**
191
+ * The name of the provider, which must be unique for all providers that are
192
+ * active in a catalog, and stable over time since emitted entities are
193
+ * related to the provider by this name.
194
+ */
190
195
  getProviderName(): string;
191
- /** Connect is called upon initialization by the catalog engine. */
196
+ /**
197
+ * Called upon initialization by the catalog engine.
198
+ */
192
199
  connect(connection: EntityProviderConnection): Promise<void>;
193
200
  }
194
201
 
195
202
  /**
196
- * The EntityProviderConnection is the connection between the catalog and the entity provider.
197
- * The EntityProvider use this connection to add and remove entities from the catalog.
203
+ * The connection between the catalog and the entity provider.
204
+ * Entity providers use this connection to add and remove entities from the catalog.
205
+ *
198
206
  * @public
199
207
  */
200
208
  export declare interface EntityProviderConnection {
201
209
  /**
202
- * Applies either a full or delta update to the catalog engine.
210
+ * Applies either a full or a delta update to the catalog engine.
203
211
  */
204
212
  applyMutation(mutation: EntityProviderMutation): Promise<void>;
205
213
  /**
206
- * Schedules a refresh on all of the entities that has a matching refresh key associated with the provided keys.
214
+ * Schedules a refresh on all of the entities that have a matching refresh key associated with the provided keys.
207
215
  */
208
216
  refresh(options: EntityProviderRefreshOptions): Promise<void>;
209
217
  }
210
218
 
211
219
  /**
212
- * @public
213
220
  * A 'full' mutation replaces all existing entities created by this entity provider with new ones.
214
221
  * A 'delta' mutation can both add and remove entities provided by this provider. Previously provided
215
222
  * entities from a 'full' mutation are not removed.
223
+ *
224
+ * @public
216
225
  */
217
226
  export declare type EntityProviderMutation = {
218
227
  type: 'full';
@@ -220,10 +229,15 @@ export declare type EntityProviderMutation = {
220
229
  } | {
221
230
  type: 'delta';
222
231
  added: DeferredEntity[];
223
- removed: DeferredEntity[];
232
+ removed: (DeferredEntity | {
233
+ entityRef: string;
234
+ locationKey?: string;
235
+ })[];
224
236
  };
225
237
 
226
238
  /**
239
+ * The options given to an entity refresh operation.
240
+ *
227
241
  * @public
228
242
  */
229
243
  export declare type EntityProviderRefreshOptions = {
@@ -168,38 +168,47 @@ export declare type DeferredEntity = {
168
168
  };
169
169
 
170
170
  /**
171
- * An EntityProvider is able to provide entities to the catalog.
171
+ * An entity provider is able to provide entities to the catalog.
172
172
  * See https://backstage.io/docs/features/software-catalog/life-of-an-entity for more details.
173
+ *
173
174
  * @public
174
175
  */
175
176
  export declare interface EntityProvider {
176
- /** Unique provider name used internally for caching. */
177
+ /**
178
+ * The name of the provider, which must be unique for all providers that are
179
+ * active in a catalog, and stable over time since emitted entities are
180
+ * related to the provider by this name.
181
+ */
177
182
  getProviderName(): string;
178
- /** Connect is called upon initialization by the catalog engine. */
183
+ /**
184
+ * Called upon initialization by the catalog engine.
185
+ */
179
186
  connect(connection: EntityProviderConnection): Promise<void>;
180
187
  }
181
188
 
182
189
  /**
183
- * The EntityProviderConnection is the connection between the catalog and the entity provider.
184
- * The EntityProvider use this connection to add and remove entities from the catalog.
190
+ * The connection between the catalog and the entity provider.
191
+ * Entity providers use this connection to add and remove entities from the catalog.
192
+ *
185
193
  * @public
186
194
  */
187
195
  export declare interface EntityProviderConnection {
188
196
  /**
189
- * Applies either a full or delta update to the catalog engine.
197
+ * Applies either a full or a delta update to the catalog engine.
190
198
  */
191
199
  applyMutation(mutation: EntityProviderMutation): Promise<void>;
192
200
  /**
193
- * Schedules a refresh on all of the entities that has a matching refresh key associated with the provided keys.
201
+ * Schedules a refresh on all of the entities that have a matching refresh key associated with the provided keys.
194
202
  */
195
203
  refresh(options: EntityProviderRefreshOptions): Promise<void>;
196
204
  }
197
205
 
198
206
  /**
199
- * @public
200
207
  * A 'full' mutation replaces all existing entities created by this entity provider with new ones.
201
208
  * A 'delta' mutation can both add and remove entities provided by this provider. Previously provided
202
209
  * entities from a 'full' mutation are not removed.
210
+ *
211
+ * @public
203
212
  */
204
213
  export declare type EntityProviderMutation = {
205
214
  type: 'full';
@@ -207,10 +216,15 @@ export declare type EntityProviderMutation = {
207
216
  } | {
208
217
  type: 'delta';
209
218
  added: DeferredEntity[];
210
- removed: DeferredEntity[];
219
+ removed: (DeferredEntity | {
220
+ entityRef: string;
221
+ locationKey?: string;
222
+ })[];
211
223
  };
212
224
 
213
225
  /**
226
+ * The options given to an entity refresh operation.
227
+ *
214
228
  * @public
215
229
  */
216
230
  export declare type EntityProviderRefreshOptions = {
package/dist/index.cjs.js CHANGED
@@ -15,7 +15,7 @@ const catalogServiceRef = backendPluginApi.createServiceRef({
15
15
  defaultFactory: async (service) => backendPluginApi.createServiceFactory({
16
16
  service,
17
17
  deps: {
18
- discoveryApi: backendPluginApi.discoveryServiceRef
18
+ discoveryApi: backendPluginApi.coreServices.discovery
19
19
  },
20
20
  async factory() {
21
21
  return async ({ discoveryApi }) => {
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","sources":["../src/extensions.ts","../src/catalogService.ts","../src/api/processingResult.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 */\nimport { createExtensionPoint } from '@backstage/backend-plugin-api';\nimport { EntityProvider } from './api';\nimport { CatalogProcessor } from './api/processor';\n\n/**\n * @alpha\n */\nexport interface CatalogProcessingExtensionPoint {\n addProcessor(\n ...processors: Array<CatalogProcessor | Array<CatalogProcessor>>\n ): void;\n addEntityProvider(\n ...providers: Array<EntityProvider | Array<EntityProvider>>\n ): void;\n}\n\n/**\n * @alpha\n */\nexport const catalogProcessingExtensionPoint =\n createExtensionPoint<CatalogProcessingExtensionPoint>({\n id: 'catalog.processing',\n });\n","/*\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 {\n createServiceFactory,\n createServiceRef,\n discoveryServiceRef,\n} from '@backstage/backend-plugin-api';\nimport { CatalogApi, CatalogClient } from '@backstage/catalog-client';\n\n/**\n * The catalogService provides the catalog API.\n * @alpha\n */\nexport const catalogServiceRef = createServiceRef<CatalogApi>({\n id: 'catalog-client',\n defaultFactory: async service =>\n createServiceFactory({\n service,\n deps: {\n discoveryApi: discoveryServiceRef,\n },\n async factory() {\n return async ({ discoveryApi }) => {\n return new CatalogClient({ discoveryApi });\n };\n },\n }),\n});\n","/*\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 { InputError, NotFoundError } from '@backstage/errors';\nimport { Entity } from '@backstage/catalog-model';\nimport { CatalogProcessorResult } from './processor';\nimport { EntityRelationSpec } from './common';\nimport { LocationSpec } from '@backstage/plugin-catalog-common';\n\n/**\n * Factory functions for the standard processing result types.\n *\n * @public\n */\nexport const processingResult = Object.freeze({\n notFoundError(\n atLocation: LocationSpec,\n message: string,\n ): CatalogProcessorResult {\n return {\n type: 'error',\n location: atLocation,\n error: new NotFoundError(message),\n };\n },\n\n inputError(\n atLocation: LocationSpec,\n message: string,\n ): CatalogProcessorResult {\n return {\n type: 'error',\n location: atLocation,\n error: new InputError(message),\n };\n },\n\n generalError(\n atLocation: LocationSpec,\n message: string,\n ): CatalogProcessorResult {\n return { type: 'error', location: atLocation, error: new Error(message) };\n },\n\n location(newLocation: LocationSpec): CatalogProcessorResult {\n return { type: 'location', location: newLocation };\n },\n\n entity(atLocation: LocationSpec, newEntity: Entity): CatalogProcessorResult {\n return { type: 'entity', location: atLocation, entity: newEntity };\n },\n\n relation(spec: EntityRelationSpec): CatalogProcessorResult {\n return { type: 'relation', relation: spec };\n },\n\n refresh(key: string): CatalogProcessorResult {\n return { type: 'refresh', key };\n },\n} as const);\n"],"names":["createExtensionPoint","createServiceRef","createServiceFactory","discoveryServiceRef","CatalogClient","NotFoundError","InputError"],"mappings":";;;;;;;;AAkCO,MAAM,kCACXA,qCAAsD,CAAA;AAAA,EACpD,EAAI,EAAA,oBAAA;AACN,CAAC;;ACVI,MAAM,oBAAoBC,iCAA6B,CAAA;AAAA,EAC5D,EAAI,EAAA,gBAAA;AAAA,EACJ,cAAA,EAAgB,OAAM,OAAA,KACpBC,qCAAqB,CAAA;AAAA,IACnB,OAAA;AAAA,IACA,IAAM,EAAA;AAAA,MACJ,YAAc,EAAAC,oCAAA;AAAA,KAChB;AAAA,IACA,MAAM,OAAU,GAAA;AACd,MAAO,OAAA,OAAO,EAAE,YAAA,EAAmB,KAAA;AACjC,QAAA,OAAO,IAAIC,2BAAA,CAAc,EAAE,YAAA,EAAc,CAAA,CAAA;AAAA,OAC3C,CAAA;AAAA,KACF;AAAA,GACD,CAAA;AACL,CAAC;;ACdY,MAAA,gBAAA,GAAmB,OAAO,MAAO,CAAA;AAAA,EAC5C,aAAA,CACE,YACA,OACwB,EAAA;AACxB,IAAO,OAAA;AAAA,MACL,IAAM,EAAA,OAAA;AAAA,MACN,QAAU,EAAA,UAAA;AAAA,MACV,KAAA,EAAO,IAAIC,oBAAA,CAAc,OAAO,CAAA;AAAA,KAClC,CAAA;AAAA,GACF;AAAA,EAEA,UAAA,CACE,YACA,OACwB,EAAA;AACxB,IAAO,OAAA;AAAA,MACL,IAAM,EAAA,OAAA;AAAA,MACN,QAAU,EAAA,UAAA;AAAA,MACV,KAAA,EAAO,IAAIC,iBAAA,CAAW,OAAO,CAAA;AAAA,KAC/B,CAAA;AAAA,GACF;AAAA,EAEA,YAAA,CACE,YACA,OACwB,EAAA;AACxB,IAAO,OAAA,EAAE,MAAM,OAAS,EAAA,QAAA,EAAU,YAAY,KAAO,EAAA,IAAI,KAAM,CAAA,OAAO,CAAE,EAAA,CAAA;AAAA,GAC1E;AAAA,EAEA,SAAS,WAAmD,EAAA;AAC1D,IAAA,OAAO,EAAE,IAAA,EAAM,UAAY,EAAA,QAAA,EAAU,WAAY,EAAA,CAAA;AAAA,GACnD;AAAA,EAEA,MAAA,CAAO,YAA0B,SAA2C,EAAA;AAC1E,IAAA,OAAO,EAAE,IAAM,EAAA,QAAA,EAAU,QAAU,EAAA,UAAA,EAAY,QAAQ,SAAU,EAAA,CAAA;AAAA,GACnE;AAAA,EAEA,SAAS,IAAkD,EAAA;AACzD,IAAA,OAAO,EAAE,IAAA,EAAM,UAAY,EAAA,QAAA,EAAU,IAAK,EAAA,CAAA;AAAA,GAC5C;AAAA,EAEA,QAAQ,GAAqC,EAAA;AAC3C,IAAO,OAAA,EAAE,IAAM,EAAA,SAAA,EAAW,GAAI,EAAA,CAAA;AAAA,GAChC;AACF,CAAU;;;;;;"}
1
+ {"version":3,"file":"index.cjs.js","sources":["../src/extensions.ts","../src/catalogService.ts","../src/api/processingResult.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 */\nimport { createExtensionPoint } from '@backstage/backend-plugin-api';\nimport { EntityProvider } from './api';\nimport { CatalogProcessor } from './api/processor';\n\n/**\n * @alpha\n */\nexport interface CatalogProcessingExtensionPoint {\n addProcessor(\n ...processors: Array<CatalogProcessor | Array<CatalogProcessor>>\n ): void;\n addEntityProvider(\n ...providers: Array<EntityProvider | Array<EntityProvider>>\n ): void;\n}\n\n/**\n * @alpha\n */\nexport const catalogProcessingExtensionPoint =\n createExtensionPoint<CatalogProcessingExtensionPoint>({\n id: 'catalog.processing',\n });\n","/*\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 {\n createServiceFactory,\n createServiceRef,\n coreServices,\n} from '@backstage/backend-plugin-api';\nimport { CatalogApi, CatalogClient } from '@backstage/catalog-client';\n\n/**\n * The catalogService provides the catalog API.\n * @alpha\n */\nexport const catalogServiceRef = createServiceRef<CatalogApi>({\n id: 'catalog-client',\n defaultFactory: async service =>\n createServiceFactory({\n service,\n deps: {\n discoveryApi: coreServices.discovery,\n },\n async factory() {\n return async ({ discoveryApi }) => {\n return new CatalogClient({ discoveryApi });\n };\n },\n }),\n});\n","/*\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 { InputError, NotFoundError } from '@backstage/errors';\nimport { Entity } from '@backstage/catalog-model';\nimport { CatalogProcessorResult } from './processor';\nimport { EntityRelationSpec } from './common';\nimport { LocationSpec } from '@backstage/plugin-catalog-common';\n\n/**\n * Factory functions for the standard processing result types.\n *\n * @public\n */\nexport const processingResult = Object.freeze({\n notFoundError(\n atLocation: LocationSpec,\n message: string,\n ): CatalogProcessorResult {\n return {\n type: 'error',\n location: atLocation,\n error: new NotFoundError(message),\n };\n },\n\n inputError(\n atLocation: LocationSpec,\n message: string,\n ): CatalogProcessorResult {\n return {\n type: 'error',\n location: atLocation,\n error: new InputError(message),\n };\n },\n\n generalError(\n atLocation: LocationSpec,\n message: string,\n ): CatalogProcessorResult {\n return { type: 'error', location: atLocation, error: new Error(message) };\n },\n\n location(newLocation: LocationSpec): CatalogProcessorResult {\n return { type: 'location', location: newLocation };\n },\n\n entity(atLocation: LocationSpec, newEntity: Entity): CatalogProcessorResult {\n return { type: 'entity', location: atLocation, entity: newEntity };\n },\n\n relation(spec: EntityRelationSpec): CatalogProcessorResult {\n return { type: 'relation', relation: spec };\n },\n\n refresh(key: string): CatalogProcessorResult {\n return { type: 'refresh', key };\n },\n} as const);\n"],"names":["createExtensionPoint","createServiceRef","createServiceFactory","coreServices","CatalogClient","NotFoundError","InputError"],"mappings":";;;;;;;;AAkCO,MAAM,kCACXA,qCAAsD,CAAA;AAAA,EACpD,EAAI,EAAA,oBAAA;AACN,CAAC;;ACVI,MAAM,oBAAoBC,iCAA6B,CAAA;AAAA,EAC5D,EAAI,EAAA,gBAAA;AAAA,EACJ,cAAA,EAAgB,OAAM,OAAA,KACpBC,qCAAqB,CAAA;AAAA,IACnB,OAAA;AAAA,IACA,IAAM,EAAA;AAAA,MACJ,cAAcC,6BAAa,CAAA,SAAA;AAAA,KAC7B;AAAA,IACA,MAAM,OAAU,GAAA;AACd,MAAO,OAAA,OAAO,EAAE,YAAA,EAAmB,KAAA;AACjC,QAAA,OAAO,IAAIC,2BAAA,CAAc,EAAE,YAAA,EAAc,CAAA,CAAA;AAAA,OAC3C,CAAA;AAAA,KACF;AAAA,GACD,CAAA;AACL,CAAC;;ACdY,MAAA,gBAAA,GAAmB,OAAO,MAAO,CAAA;AAAA,EAC5C,aAAA,CACE,YACA,OACwB,EAAA;AACxB,IAAO,OAAA;AAAA,MACL,IAAM,EAAA,OAAA;AAAA,MACN,QAAU,EAAA,UAAA;AAAA,MACV,KAAA,EAAO,IAAIC,oBAAA,CAAc,OAAO,CAAA;AAAA,KAClC,CAAA;AAAA,GACF;AAAA,EAEA,UAAA,CACE,YACA,OACwB,EAAA;AACxB,IAAO,OAAA;AAAA,MACL,IAAM,EAAA,OAAA;AAAA,MACN,QAAU,EAAA,UAAA;AAAA,MACV,KAAA,EAAO,IAAIC,iBAAA,CAAW,OAAO,CAAA;AAAA,KAC/B,CAAA;AAAA,GACF;AAAA,EAEA,YAAA,CACE,YACA,OACwB,EAAA;AACxB,IAAO,OAAA,EAAE,MAAM,OAAS,EAAA,QAAA,EAAU,YAAY,KAAO,EAAA,IAAI,KAAM,CAAA,OAAO,CAAE,EAAA,CAAA;AAAA,GAC1E;AAAA,EAEA,SAAS,WAAmD,EAAA;AAC1D,IAAA,OAAO,EAAE,IAAA,EAAM,UAAY,EAAA,QAAA,EAAU,WAAY,EAAA,CAAA;AAAA,GACnD;AAAA,EAEA,MAAA,CAAO,YAA0B,SAA2C,EAAA;AAC1E,IAAA,OAAO,EAAE,IAAM,EAAA,QAAA,EAAU,QAAU,EAAA,UAAA,EAAY,QAAQ,SAAU,EAAA,CAAA;AAAA,GACnE;AAAA,EAEA,SAAS,IAAkD,EAAA;AACzD,IAAA,OAAO,EAAE,IAAA,EAAM,UAAY,EAAA,QAAA,EAAU,IAAK,EAAA,CAAA;AAAA,GAC5C;AAAA,EAEA,QAAQ,GAAqC,EAAA;AAC3C,IAAO,OAAA,EAAE,IAAM,EAAA,SAAA,EAAW,GAAI,EAAA,CAAA;AAAA,GAChC;AACF,CAAU;;;;;;"}
package/dist/index.d.ts CHANGED
@@ -168,38 +168,47 @@ export declare type DeferredEntity = {
168
168
  };
169
169
 
170
170
  /**
171
- * An EntityProvider is able to provide entities to the catalog.
171
+ * An entity provider is able to provide entities to the catalog.
172
172
  * See https://backstage.io/docs/features/software-catalog/life-of-an-entity for more details.
173
+ *
173
174
  * @public
174
175
  */
175
176
  export declare interface EntityProvider {
176
- /** Unique provider name used internally for caching. */
177
+ /**
178
+ * The name of the provider, which must be unique for all providers that are
179
+ * active in a catalog, and stable over time since emitted entities are
180
+ * related to the provider by this name.
181
+ */
177
182
  getProviderName(): string;
178
- /** Connect is called upon initialization by the catalog engine. */
183
+ /**
184
+ * Called upon initialization by the catalog engine.
185
+ */
179
186
  connect(connection: EntityProviderConnection): Promise<void>;
180
187
  }
181
188
 
182
189
  /**
183
- * The EntityProviderConnection is the connection between the catalog and the entity provider.
184
- * The EntityProvider use this connection to add and remove entities from the catalog.
190
+ * The connection between the catalog and the entity provider.
191
+ * Entity providers use this connection to add and remove entities from the catalog.
192
+ *
185
193
  * @public
186
194
  */
187
195
  export declare interface EntityProviderConnection {
188
196
  /**
189
- * Applies either a full or delta update to the catalog engine.
197
+ * Applies either a full or a delta update to the catalog engine.
190
198
  */
191
199
  applyMutation(mutation: EntityProviderMutation): Promise<void>;
192
200
  /**
193
- * Schedules a refresh on all of the entities that has a matching refresh key associated with the provided keys.
201
+ * Schedules a refresh on all of the entities that have a matching refresh key associated with the provided keys.
194
202
  */
195
203
  refresh(options: EntityProviderRefreshOptions): Promise<void>;
196
204
  }
197
205
 
198
206
  /**
199
- * @public
200
207
  * A 'full' mutation replaces all existing entities created by this entity provider with new ones.
201
208
  * A 'delta' mutation can both add and remove entities provided by this provider. Previously provided
202
209
  * entities from a 'full' mutation are not removed.
210
+ *
211
+ * @public
203
212
  */
204
213
  export declare type EntityProviderMutation = {
205
214
  type: 'full';
@@ -207,10 +216,15 @@ export declare type EntityProviderMutation = {
207
216
  } | {
208
217
  type: 'delta';
209
218
  added: DeferredEntity[];
210
- removed: DeferredEntity[];
219
+ removed: (DeferredEntity | {
220
+ entityRef: string;
221
+ locationKey?: string;
222
+ })[];
211
223
  };
212
224
 
213
225
  /**
226
+ * The options given to an entity refresh operation.
227
+ *
214
228
  * @public
215
229
  */
216
230
  export declare type EntityProviderRefreshOptions = {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@backstage/plugin-catalog-node",
3
3
  "description": "The plugin-catalog-node module for @backstage/plugin-catalog-backend",
4
- "version": "1.2.2-next.0",
4
+ "version": "1.3.0-next.2",
5
5
  "main": "dist/index.cjs.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "license": "Apache-2.0",
@@ -24,17 +24,17 @@
24
24
  "postpack": "backstage-cli package postpack"
25
25
  },
26
26
  "dependencies": {
27
- "@backstage/backend-plugin-api": "^0.1.5-next.0",
28
- "@backstage/catalog-client": "^1.2.0-next.0",
29
- "@backstage/catalog-model": "^1.1.4-next.0",
30
- "@backstage/errors": "^1.1.4-next.0",
31
- "@backstage/plugin-catalog-common": "^1.0.9-next.0",
32
- "@backstage/types": "^1.0.2-next.0"
27
+ "@backstage/backend-plugin-api": "^0.2.0-next.2",
28
+ "@backstage/catalog-client": "^1.2.0-next.1",
29
+ "@backstage/catalog-model": "^1.1.4-next.1",
30
+ "@backstage/errors": "^1.1.4-next.1",
31
+ "@backstage/plugin-catalog-common": "^1.0.9-next.2",
32
+ "@backstage/types": "^1.0.2-next.1"
33
33
  },
34
34
  "devDependencies": {
35
- "@backstage/backend-common": "^0.16.1-next.0",
36
- "@backstage/backend-test-utils": "^0.1.31-next.0",
37
- "@backstage/cli": "^0.21.2-next.0"
35
+ "@backstage/backend-common": "^0.17.0-next.2",
36
+ "@backstage/backend-test-utils": "^0.1.31-next.2",
37
+ "@backstage/cli": "^0.21.2-next.2"
38
38
  },
39
39
  "files": [
40
40
  "dist",