@backstage/plugin-catalog-unprocessed-entities 0.2.24-next.0 → 0.2.24

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,46 @@
1
1
  # @backstage/plugin-catalog-unprocessed-entities
2
2
 
3
+ ## 0.2.24
4
+
5
+ ### Patch Changes
6
+
7
+ - d02db50: Remove unnecessary use of `compatWrapper` and `convertLegacyRouteRef`(s) for the new frontend system.
8
+ - df4d646: Moved types, API and client to the common package, allowing both frontend and
9
+ backend plugins to use the `CatalogUnprocessedEntitiesClient`.
10
+
11
+ The following types, clients and interfaces have been deprecated and should be
12
+ imported from the `@backstage/plugin-catalog-unprocessed-entities-common` instead:
13
+ `CatalogUnprocessedEntitiesApi`, `CatalogUnprocessedEntitiesApiResponse`, `UnprocessedEntity`,
14
+ `UnprocessedEntityCache`, `UnprocessedEntityError`, `CatalogUnprocessedEntitiesClient`.
15
+
16
+ All those types, clients and interfaces are re-exported temporarily in the
17
+ `@backstage/plugin-catalog-unprocessed-entities` package until cleaned up.
18
+
19
+ - Updated dependencies
20
+ - @backstage/frontend-plugin-api@0.13.2
21
+ - @backstage/core-components@0.18.4
22
+ - @backstage/core-plugin-api@1.12.1
23
+ - @backstage/plugin-catalog-unprocessed-entities-common@0.0.12
24
+
25
+ ## 0.2.24-next.1
26
+
27
+ ### Patch Changes
28
+
29
+ - df4d646: Moved types, API and client to the common package, allowing both frontend and
30
+ backend plugins to use the `CatalogUnprocessedEntitiesClient`.
31
+
32
+ The following types, clients and interfaces have been deprecated and should be
33
+ imported from the `@backstage/plugin-catalog-unprocessed-entities-common` instead:
34
+ `CatalogUnprocessedEntitiesApi`, `CatalogUnprocessedEntitiesApiResponse`, `UnprocessedEntity`,
35
+ `UnprocessedEntityCache`, `UnprocessedEntityError`, `CatalogUnprocessedEntitiesClient`.
36
+
37
+ All those types, clients and interfaces are re-exported temporarily in the
38
+ `@backstage/plugin-catalog-unprocessed-entities` package until cleaned up.
39
+
40
+ - Updated dependencies
41
+ - @backstage/core-components@0.18.4-next.1
42
+ - @backstage/plugin-catalog-unprocessed-entities-common@0.0.12-next.0
43
+
3
44
  ## 0.2.24-next.0
4
45
 
5
46
  ### Patch Changes
@@ -1,35 +1,10 @@
1
1
  import { createApiRef } from '@backstage/core-plugin-api';
2
- import { ResponseError } from '@backstage/errors';
2
+ import { CatalogUnprocessedEntitiesClient as CatalogUnprocessedEntitiesClient$1 } from '@backstage/plugin-catalog-unprocessed-entities-common';
3
3
 
4
4
  const catalogUnprocessedEntitiesApiRef = createApiRef({
5
5
  id: "plugin.catalog-unprocessed-entities.service"
6
6
  });
7
- class CatalogUnprocessedEntitiesClient {
8
- discovery;
9
- fetchApi;
10
- constructor(discovery, fetchApi) {
11
- this.discovery = discovery;
12
- this.fetchApi = fetchApi;
13
- }
14
- async fetch(path, init) {
15
- const url = await this.discovery.getBaseUrl("catalog");
16
- const resp = await this.fetchApi.fetch(`${url}/${path}`, init);
17
- if (!resp.ok) {
18
- throw await ResponseError.fromResponse(resp);
19
- }
20
- return resp.status === 204 ? resp : await resp.json();
21
- }
22
- async pending() {
23
- return await this.fetch("entities/unprocessed/pending");
24
- }
25
- async failed() {
26
- return await this.fetch("entities/unprocessed/failed");
27
- }
28
- async delete(entityId) {
29
- await this.fetch(`entities/unprocessed/delete/${entityId}`, {
30
- method: "DELETE"
31
- });
32
- }
7
+ class CatalogUnprocessedEntitiesClient extends CatalogUnprocessedEntitiesClient$1 {
33
8
  }
34
9
 
35
10
  export { CatalogUnprocessedEntitiesClient, catalogUnprocessedEntitiesApiRef };
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":["../../src/api/index.ts"],"sourcesContent":["/*\n * Copyright 2023 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 {\n DiscoveryApi,\n createApiRef,\n FetchApi,\n} from '@backstage/core-plugin-api';\nimport { ResponseError } from '@backstage/errors';\nimport { UnprocessedEntity } from '../types';\n\n/**\n * {@link @backstage/core-plugin-api#ApiRef} for the {@link CatalogUnprocessedEntitiesApi}\n *\n * @public\n */\nexport const catalogUnprocessedEntitiesApiRef =\n createApiRef<CatalogUnprocessedEntitiesApi>({\n id: 'plugin.catalog-unprocessed-entities.service',\n });\n\n/**\n * Response expected by the {@link CatalogUnprocessedEntitiesApi}\n *\n * @public\n */\nexport type CatalogUnprocessedEntitiesApiResponse = {\n entities: UnprocessedEntity[];\n};\n\n/**\n * Interface for the CatalogUnprocessedEntitiesApi.\n *\n * @public\n */\nexport interface CatalogUnprocessedEntitiesApi {\n /**\n * Returns a list of entities with state 'pending'\n */\n pending(): Promise<CatalogUnprocessedEntitiesApiResponse>;\n /**\n * Returns a list of entities with state 'failed'\n */\n failed(): Promise<CatalogUnprocessedEntitiesApiResponse>;\n /**\n * Deletes an entity from the refresh_state table\n */\n delete(entityId: string): Promise<void>;\n}\n\n/**\n * Default API implementation for the Catalog Unprocessed Entities plugin\n *\n * @public\n */\nexport class CatalogUnprocessedEntitiesClient\n implements CatalogUnprocessedEntitiesApi\n{\n public discovery: DiscoveryApi;\n public fetchApi: FetchApi;\n\n constructor(discovery: DiscoveryApi, fetchApi: FetchApi) {\n this.discovery = discovery;\n this.fetchApi = fetchApi;\n }\n\n private async fetch<T>(path: string, init?: RequestInit): Promise<T> {\n const url = await this.discovery.getBaseUrl('catalog');\n const resp = await this.fetchApi.fetch(`${url}/${path}`, init);\n\n if (!resp.ok) {\n throw await ResponseError.fromResponse(resp);\n }\n\n return resp.status === 204 ? (resp as T) : await resp.json();\n }\n\n async pending(): Promise<CatalogUnprocessedEntitiesApiResponse> {\n return await this.fetch('entities/unprocessed/pending');\n }\n\n async failed(): Promise<CatalogUnprocessedEntitiesApiResponse> {\n return await this.fetch('entities/unprocessed/failed');\n }\n\n async delete(entityId: string): Promise<void> {\n await this.fetch(`entities/unprocessed/delete/${entityId}`, {\n method: 'DELETE',\n });\n }\n}\n"],"names":[],"mappings":";;;AA4BO,MAAM,mCACX,YAAA,CAA4C;AAAA,EAC1C,EAAA,EAAI;AACN,CAAC;AAoCI,MAAM,gCAAA,CAEb;AAAA,EACS,SAAA;AAAA,EACA,QAAA;AAAA,EAEP,WAAA,CAAY,WAAyB,QAAA,EAAoB;AACvD,IAAA,IAAA,CAAK,SAAA,GAAY,SAAA;AACjB,IAAA,IAAA,CAAK,QAAA,GAAW,QAAA;AAAA,EAClB;AAAA,EAEA,MAAc,KAAA,CAAS,IAAA,EAAc,IAAA,EAAgC;AACnE,IAAA,MAAM,GAAA,GAAM,MAAM,IAAA,CAAK,SAAA,CAAU,WAAW,SAAS,CAAA;AACrD,IAAA,MAAM,IAAA,GAAO,MAAM,IAAA,CAAK,QAAA,CAAS,KAAA,CAAM,GAAG,GAAG,CAAA,CAAA,EAAI,IAAI,CAAA,CAAA,EAAI,IAAI,CAAA;AAE7D,IAAA,IAAI,CAAC,KAAK,EAAA,EAAI;AACZ,MAAA,MAAM,MAAM,aAAA,CAAc,YAAA,CAAa,IAAI,CAAA;AAAA,IAC7C;AAEA,IAAA,OAAO,KAAK,MAAA,KAAW,GAAA,GAAO,IAAA,GAAa,MAAM,KAAK,IAAA,EAAK;AAAA,EAC7D;AAAA,EAEA,MAAM,OAAA,GAA0D;AAC9D,IAAA,OAAO,MAAM,IAAA,CAAK,KAAA,CAAM,8BAA8B,CAAA;AAAA,EACxD;AAAA,EAEA,MAAM,MAAA,GAAyD;AAC7D,IAAA,OAAO,MAAM,IAAA,CAAK,KAAA,CAAM,6BAA6B,CAAA;AAAA,EACvD;AAAA,EAEA,MAAM,OAAO,QAAA,EAAiC;AAC5C,IAAA,MAAM,IAAA,CAAK,KAAA,CAAM,CAAA,4BAAA,EAA+B,QAAQ,CAAA,CAAA,EAAI;AAAA,MAC1D,MAAA,EAAQ;AAAA,KACT,CAAA;AAAA,EACH;AACF;;;;"}
1
+ {"version":3,"file":"index.esm.js","sources":["../../src/api/index.ts"],"sourcesContent":["/*\n * Copyright 2023 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 { createApiRef } from '@backstage/core-plugin-api';\nimport {\n CatalogUnprocessedEntitiesApiResponse as CommonCatalogUnprocessedEntitiesApiResponse,\n CatalogUnprocessedEntitiesApi as CommonCatalogUnprocessedEntitiesApi,\n CatalogUnprocessedEntitiesClient as CommonCatalogUnprocessedEntitiesClient,\n} from '@backstage/plugin-catalog-unprocessed-entities-common';\n\n/**\n * {@link @backstage/core-plugin-api#ApiRef} for the {@link CatalogUnprocessedEntitiesApi}\n *\n * @public\n */\nexport const catalogUnprocessedEntitiesApiRef =\n createApiRef<CatalogUnprocessedEntitiesApi>({\n id: 'plugin.catalog-unprocessed-entities.service',\n });\n\n/**\n * Response expected by the {@link CatalogUnprocessedEntitiesApi}\n *\n * @public\n * @deprecated Use the type imported from `@backstage/plugin-catalog-unprocessed-entities-common` instead.\n */\nexport type CatalogUnprocessedEntitiesApiResponse =\n CommonCatalogUnprocessedEntitiesApiResponse;\n\n/**\n * Interface for the CatalogUnprocessedEntitiesApi.\n *\n * @public\n * @deprecated Use the type imported from `@backstage/plugin-catalog-unprocessed-entities-common` instead.\n */\nexport interface CatalogUnprocessedEntitiesApi\n extends CommonCatalogUnprocessedEntitiesApi {}\n\n/**\n * Default API implementation for the Catalog Unprocessed Entities plugin\n *\n * @public\n * @deprecated Use the client imported from `@backstage/plugin-catalog-unprocessed-entities-common` instead.\n */\nexport class CatalogUnprocessedEntitiesClient extends CommonCatalogUnprocessedEntitiesClient {}\n"],"names":["CommonCatalogUnprocessedEntitiesClient"],"mappings":";;;AA2BO,MAAM,mCACX,YAAA,CAA4C;AAAA,EAC1C,EAAA,EAAI;AACN,CAAC;AA0BI,MAAM,yCAAyCA,kCAAA,CAAuC;AAAC;;;;"}
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
3
- import { Entity } from '@backstage/catalog-model';
3
+ import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api';
4
+ import { CatalogUnprocessedEntitiesApiResponse as CatalogUnprocessedEntitiesApiResponse$1, CatalogUnprocessedEntitiesApi as CatalogUnprocessedEntitiesApi$1, UnprocessedEntity as UnprocessedEntity$1, UnprocessedEntityCache as UnprocessedEntityCache$1, UnprocessedEntityError as UnprocessedEntityError$1 } from '@backstage/plugin-catalog-unprocessed-entities-common';
4
5
 
5
6
  /**
6
7
  * Plugin entry point
@@ -21,76 +22,45 @@ declare const CatalogUnprocessedEntitiesPage: () => react_jsx_runtime.JSX.Elemen
21
22
  declare const UnprocessedEntitiesContent: () => react_jsx_runtime.JSX.Element;
22
23
 
23
24
  /**
24
- * Unprocessed entity data stored in the database.
25
+ * {@link @backstage/core-plugin-api#ApiRef} for the {@link CatalogUnprocessedEntitiesApi}
26
+ *
25
27
  * @public
26
28
  */
27
- type UnprocessedEntity = {
28
- entity_id: string;
29
- entity_ref: string;
30
- unprocessed_entity: Entity;
31
- unprocessed_hash?: string;
32
- processed_entity?: Entity;
33
- result_hash?: string;
34
- cache?: UnprocessedEntityCache;
35
- next_update_at: string | Date;
36
- last_discovery_at: string | Date;
37
- errors?: UnprocessedEntityError[];
38
- location_key?: string;
39
- };
29
+ declare const catalogUnprocessedEntitiesApiRef: _backstage_frontend_plugin_api.ApiRef<CatalogUnprocessedEntitiesApi>;
40
30
  /**
41
- * Unprocessed entity cache stored in the database.
31
+ * Response expected by the {@link CatalogUnprocessedEntitiesApi}
32
+ *
42
33
  * @public
34
+ * @deprecated Use the type imported from `@backstage/plugin-catalog-unprocessed-entities-common` instead.
43
35
  */
44
- type UnprocessedEntityCache = {
45
- ttl: number;
46
- cache: object;
47
- };
36
+ type CatalogUnprocessedEntitiesApiResponse = CatalogUnprocessedEntitiesApiResponse$1;
48
37
  /**
49
- * Unprocessed entity error information stored in the database.
38
+ * Interface for the CatalogUnprocessedEntitiesApi.
39
+ *
50
40
  * @public
41
+ * @deprecated Use the type imported from `@backstage/plugin-catalog-unprocessed-entities-common` instead.
51
42
  */
52
- type UnprocessedEntityError = {
53
- name: string;
54
- message: string;
55
- cause: {
56
- name: string;
57
- message: string;
58
- stack: string;
59
- };
60
- };
43
+ interface CatalogUnprocessedEntitiesApi extends CatalogUnprocessedEntitiesApi$1 {
44
+ }
61
45
 
62
46
  /**
63
- * {@link @backstage/core-plugin-api#ApiRef} for the {@link CatalogUnprocessedEntitiesApi}
64
- *
47
+ * Unprocessed entity data stored in the database.
65
48
  * @public
49
+ * @deprecated Use the type imported from `@backstage/plugin-catalog-unprocessed-entities-common` instead.
66
50
  */
67
- declare const catalogUnprocessedEntitiesApiRef: _backstage_core_plugin_api.ApiRef<CatalogUnprocessedEntitiesApi>;
51
+ type UnprocessedEntity = UnprocessedEntity$1;
68
52
  /**
69
- * Response expected by the {@link CatalogUnprocessedEntitiesApi}
70
- *
53
+ * Unprocessed entity cache stored in the database.
71
54
  * @public
55
+ * @deprecated Use the type imported from `@backstage/plugin-catalog-unprocessed-entities-common` instead.
72
56
  */
73
- type CatalogUnprocessedEntitiesApiResponse = {
74
- entities: UnprocessedEntity[];
75
- };
57
+ type UnprocessedEntityCache = UnprocessedEntityCache$1;
76
58
  /**
77
- * Interface for the CatalogUnprocessedEntitiesApi.
78
- *
59
+ * Unprocessed entity error information stored in the database.
79
60
  * @public
61
+ * @deprecated Use the type imported from `@backstage/plugin-catalog-unprocessed-entities-common` instead.
80
62
  */
81
- interface CatalogUnprocessedEntitiesApi {
82
- /**
83
- * Returns a list of entities with state 'pending'
84
- */
85
- pending(): Promise<CatalogUnprocessedEntitiesApiResponse>;
86
- /**
87
- * Returns a list of entities with state 'failed'
88
- */
89
- failed(): Promise<CatalogUnprocessedEntitiesApiResponse>;
90
- /**
91
- * Deletes an entity from the refresh_state table
92
- */
93
- delete(entityId: string): Promise<void>;
94
- }
63
+ type UnprocessedEntityError = UnprocessedEntityError$1;
95
64
 
96
- export { type CatalogUnprocessedEntitiesApi, type CatalogUnprocessedEntitiesApiResponse, CatalogUnprocessedEntitiesPage, UnprocessedEntitiesContent, type UnprocessedEntity, type UnprocessedEntityCache, type UnprocessedEntityError, catalogUnprocessedEntitiesApiRef, catalogUnprocessedEntitiesPlugin };
65
+ export { CatalogUnprocessedEntitiesPage, UnprocessedEntitiesContent, catalogUnprocessedEntitiesApiRef, catalogUnprocessedEntitiesPlugin };
66
+ export type { CatalogUnprocessedEntitiesApi, CatalogUnprocessedEntitiesApiResponse, UnprocessedEntity, UnprocessedEntityCache, UnprocessedEntityError };
@@ -1,5 +1,5 @@
1
1
  var name = "@backstage/plugin-catalog-unprocessed-entities";
2
- var version = "0.2.24-next.0";
2
+ var version = "0.2.24";
3
3
  var backstage = {
4
4
  role: "frontend-plugin",
5
5
  pluginId: "catalog-unprocessed-entities",
@@ -19,7 +19,7 @@ var repository = {
19
19
  };
20
20
  var license = "Apache-2.0";
21
21
  var sideEffects = false;
22
- var exports = {
22
+ var exports$1 = {
23
23
  ".": "./src/index.ts",
24
24
  "./alpha": "./src/alpha.ts",
25
25
  "./package.json": "./package.json"
@@ -49,11 +49,11 @@ var scripts = {
49
49
  test: "backstage-cli package test"
50
50
  };
51
51
  var dependencies = {
52
- "@backstage/catalog-model": "workspace:^",
53
52
  "@backstage/core-components": "workspace:^",
54
53
  "@backstage/core-plugin-api": "workspace:^",
55
54
  "@backstage/errors": "workspace:^",
56
55
  "@backstage/frontend-plugin-api": "workspace:^",
56
+ "@backstage/plugin-catalog-unprocessed-entities-common": "workspace:^",
57
57
  "@material-ui/core": "^4.9.13",
58
58
  "@material-ui/icons": "^4.9.1",
59
59
  "@material-ui/lab": "^4.0.0-alpha.60",
@@ -90,7 +90,7 @@ var _package = {
90
90
  repository: repository,
91
91
  license: license,
92
92
  sideEffects: sideEffects,
93
- exports: exports,
93
+ exports: exports$1,
94
94
  main: main,
95
95
  types: types,
96
96
  typesVersions: typesVersions,
@@ -102,5 +102,5 @@ var _package = {
102
102
  peerDependenciesMeta: peerDependenciesMeta
103
103
  };
104
104
 
105
- export { backstage, _package as default, dependencies, devDependencies, exports, files, homepage, license, main, name, peerDependencies, peerDependenciesMeta, publishConfig, repository, scripts, sideEffects, types, typesVersions, version };
105
+ export { backstage, _package as default, dependencies, devDependencies, exports$1 as exports, files, homepage, license, main, name, peerDependencies, peerDependenciesMeta, publishConfig, repository, scripts, sideEffects, types, typesVersions, version };
106
106
  //# sourceMappingURL=package.json.esm.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-catalog-unprocessed-entities",
3
- "version": "0.2.24-next.0",
3
+ "version": "0.2.24",
4
4
  "backstage": {
5
5
  "role": "frontend-plugin",
6
6
  "pluginId": "catalog-unprocessed-entities",
@@ -62,11 +62,11 @@
62
62
  "test": "backstage-cli package test"
63
63
  },
64
64
  "dependencies": {
65
- "@backstage/catalog-model": "1.7.6",
66
- "@backstage/core-components": "0.18.4-next.0",
67
- "@backstage/core-plugin-api": "1.12.1-next.0",
68
- "@backstage/errors": "1.2.7",
69
- "@backstage/frontend-plugin-api": "0.13.2-next.0",
65
+ "@backstage/core-components": "^0.18.4",
66
+ "@backstage/core-plugin-api": "^1.12.1",
67
+ "@backstage/errors": "^1.2.7",
68
+ "@backstage/frontend-plugin-api": "^0.13.2",
69
+ "@backstage/plugin-catalog-unprocessed-entities-common": "^0.0.12",
70
70
  "@material-ui/core": "^4.9.13",
71
71
  "@material-ui/icons": "^4.9.1",
72
72
  "@material-ui/lab": "^4.0.0-alpha.60",
@@ -74,8 +74,8 @@
74
74
  "react-use": "^17.2.4"
75
75
  },
76
76
  "devDependencies": {
77
- "@backstage/cli": "0.34.6-next.0",
78
- "@backstage/dev-utils": "1.1.18-next.0",
77
+ "@backstage/cli": "^0.35.0",
78
+ "@backstage/dev-utils": "^1.1.18",
79
79
  "@testing-library/jest-dom": "^6.0.0",
80
80
  "@testing-library/react": "^16.0.0",
81
81
  "@types/react": "^18.0.0",