@anyshift/backstage-plugin-anyshift 0.1.0-beta.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.
Files changed (37) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/LICENSE +176 -0
  3. package/README.md +9 -0
  4. package/dist/api/AnyshiftApi.esm.js +80 -0
  5. package/dist/api/AnyshiftApi.esm.js.map +1 -0
  6. package/dist/components/AnyshiftPermissionBoundary.esm.js +25 -0
  7. package/dist/components/AnyshiftPermissionBoundary.esm.js.map +1 -0
  8. package/dist/components/entity/AnyshiftEntityContent.esm.js +213 -0
  9. package/dist/components/entity/AnyshiftEntityContent.esm.js.map +1 -0
  10. package/dist/components/entity/BriefSections.esm.js +218 -0
  11. package/dist/components/entity/BriefSections.esm.js.map +1 -0
  12. package/dist/components/entity/DatadogLiveSignal.esm.js +190 -0
  13. package/dist/components/entity/DatadogLiveSignal.esm.js.map +1 -0
  14. package/dist/components/entity/EvidenceDisclosure.esm.js +20 -0
  15. package/dist/components/entity/EvidenceDisclosure.esm.js.map +1 -0
  16. package/dist/components/entity/MermaidArchitecture.esm.js +89 -0
  17. package/dist/components/entity/MermaidArchitecture.esm.js.map +1 -0
  18. package/dist/components/entity/SectionPresenters.esm.js +341 -0
  19. package/dist/components/entity/SectionPresenters.esm.js.map +1 -0
  20. package/dist/components/entity/architectureDiagram.esm.js +236 -0
  21. package/dist/components/entity/architectureDiagram.esm.js.map +1 -0
  22. package/dist/components/entity/sectionData.esm.js +127 -0
  23. package/dist/components/entity/sectionData.esm.js.map +1 -0
  24. package/dist/components/explorer/AnyshiftExplorerPage.esm.js +193 -0
  25. package/dist/components/explorer/AnyshiftExplorerPage.esm.js.map +1 -0
  26. package/dist/components/explorer/DatadogOperationsRadar.esm.js +294 -0
  27. package/dist/components/explorer/DatadogOperationsRadar.esm.js.map +1 -0
  28. package/dist/index.d.ts +127 -0
  29. package/dist/index.esm.js +4 -0
  30. package/dist/index.esm.js.map +1 -0
  31. package/dist/package.json.esm.js +96 -0
  32. package/dist/package.json.esm.js.map +1 -0
  33. package/dist/plugin.esm.js +49 -0
  34. package/dist/plugin.esm.js.map +1 -0
  35. package/dist/routes.esm.js +6 -0
  36. package/dist/routes.esm.js.map +1 -0
  37. package/package.json +84 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,6 @@
1
+ # Changelog
2
+
3
+ ## 0.1.0-beta.1
4
+
5
+ - Add discoverable dashboard, navigation, API, and entity-content extensions.
6
+ - Add permission-aware rendering for estate data and deterministic queries.
package/LICENSE ADDED
@@ -0,0 +1,176 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction, and
10
+ distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by the
13
+ copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all other
16
+ entities that control, are controlled by, or are under common control with
17
+ that entity. For the purposes of this definition, "control" means (i) the
18
+ power, direct or indirect, to cause the direction or management of such
19
+ entity, whether by contract or otherwise, or (ii) ownership of fifty percent
20
+ (50%) or more of the outstanding shares, or (iii) beneficial ownership of
21
+ such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity exercising
24
+ permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation source, and
28
+ configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical transformation
31
+ or translation of a Source form, including but not limited to compiled object
32
+ code, generated documentation, and conversions to other media types.
33
+
34
+ "Work" shall mean the work of authorship, whether in Source or Object form,
35
+ made available under the License, as indicated by a copyright notice that is
36
+ included in or attached to the work (an example is provided in the Appendix
37
+ below).
38
+
39
+ "Derivative Works" shall mean any work, whether in Source or Object form,
40
+ that is based on (or derived from) the Work and for which the editorial
41
+ revisions, annotations, elaborations, or other modifications represent, as a
42
+ whole, an original work of authorship. For the purposes of this License,
43
+ Derivative Works shall not include works that remain separable from, or
44
+ merely link (or bind by name) to the interfaces of, the Work and Derivative
45
+ Works thereof.
46
+
47
+ "Contribution" shall mean any work of authorship, including the original
48
+ version of the Work and any modifications or additions to that Work or
49
+ Derivative Works thereof, that is intentionally submitted to Licensor for
50
+ inclusion in the Work by the copyright owner or by an individual or Legal
51
+ Entity authorized to submit on behalf of the copyright owner. For the
52
+ purposes of this definition, "submitted" means any form of electronic,
53
+ verbal, or written communication sent to the Licensor or its representatives,
54
+ including but not limited to communication on electronic mailing lists,
55
+ source code control systems, and issue tracking systems that are managed by,
56
+ or on behalf of, the Licensor for the purpose of discussing and improving the
57
+ Work, but excluding communication that is conspicuously marked or otherwise
58
+ designated in writing by the copyright owner as "Not a Contribution."
59
+
60
+ "Contributor" shall mean Licensor and any individual or Legal Entity on
61
+ behalf of whom a Contribution has been received by Licensor and subsequently
62
+ incorporated within the Work.
63
+
64
+ 2. Grant of Copyright License. Subject to the terms and conditions of this
65
+ License, each Contributor hereby grants to You a perpetual, worldwide,
66
+ non-exclusive, no-charge, royalty-free, irrevocable copyright license to
67
+ reproduce, prepare Derivative Works of, publicly display, publicly perform,
68
+ sublicense, and distribute the Work and such Derivative Works in Source or
69
+ Object form.
70
+
71
+ 3. Grant of Patent License. Subject to the terms and conditions of this
72
+ License, each Contributor hereby grants to You a perpetual, worldwide,
73
+ non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this
74
+ section) patent license to make, have made, use, offer to sell, sell, import,
75
+ and otherwise transfer the Work, where such license applies only to those
76
+ patent claims licensable by such Contributor that are necessarily infringed
77
+ by their Contribution(s) alone or by combination of their Contribution(s)
78
+ with the Work to which such Contribution(s) was submitted. If You institute
79
+ patent litigation against any entity (including a cross-claim or counterclaim
80
+ in a lawsuit) alleging that the Work or a Contribution incorporated within
81
+ the Work constitutes direct or contributory patent infringement, then any
82
+ patent licenses granted to You under this License for that Work shall
83
+ terminate as of the date such litigation is filed.
84
+
85
+ 4. Redistribution. You may reproduce and distribute copies of the Work or
86
+ Derivative Works thereof in any medium, with or without modifications, and in
87
+ Source or Object form, provided that You meet the following conditions:
88
+
89
+ (a) You must give any other recipients of the Work or Derivative Works a copy
90
+ of this License; and
91
+
92
+ (b) You must cause any modified files to carry prominent notices stating that
93
+ You changed the files; and
94
+
95
+ (c) You must retain, in the Source form of any Derivative Works that You
96
+ distribute, all copyright, patent, trademark, and attribution notices from the
97
+ Source form of the Work, excluding those notices that do not pertain to any
98
+ part of the Derivative Works; and
99
+
100
+ (d) If the Work includes a "NOTICE" text file as part of its distribution,
101
+ then any Derivative Works that You distribute must include a readable copy of
102
+ the attribution notices contained within such NOTICE file, excluding those
103
+ notices that do not pertain to any part of the Derivative Works, in at least
104
+ one of the following places: within a NOTICE text file distributed as part of
105
+ the Derivative Works; within the Source form or documentation, if provided
106
+ along with the Derivative Works; or, within a display generated by the
107
+ Derivative Works, if and wherever such third-party notices normally appear.
108
+ The contents of the NOTICE file are for informational purposes only and do
109
+ not modify the License. You may add Your own attribution notices within
110
+ Derivative Works that You distribute, alongside or as an addendum to the
111
+ NOTICE text from the Work, provided that such additional attribution notices
112
+ cannot be construed as modifying the License.
113
+
114
+ You may add Your own copyright statement to Your modifications and may
115
+ provide additional or different license terms and conditions for use,
116
+ reproduction, or distribution of Your modifications, or for any such
117
+ Derivative Works as a whole, provided Your use, reproduction, and distribution
118
+ of the Work otherwise complies with the conditions stated in this License.
119
+
120
+ 5. Submission of Contributions. Unless You explicitly state otherwise, any
121
+ Contribution intentionally submitted for inclusion in the Work by You to the
122
+ Licensor shall be under the terms and conditions of this License, without any
123
+ additional terms or conditions. Notwithstanding the above, nothing herein
124
+ shall supersede or modify the terms of any separate license agreement you may
125
+ have executed with Licensor regarding such Contributions.
126
+
127
+ 6. Trademarks. This License does not grant permission to use the trade names,
128
+ trademarks, service marks, or product names of the Licensor, except as required
129
+ for reasonable and customary use in describing the origin of the Work and
130
+ reproducing the content of the NOTICE file.
131
+
132
+ 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in
133
+ writing, Licensor provides the Work (and each Contributor provides its
134
+ Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
135
+ KIND, either express or implied, including, without limitation, any warranties
136
+ or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
137
+ PARTICULAR PURPOSE. You are solely responsible for determining the
138
+ appropriateness of using or redistributing the Work and assume any risks
139
+ associated with Your exercise of permissions under this License.
140
+
141
+ 8. Limitation of Liability. In no event and under no legal theory, whether in
142
+ tort (including negligence), contract, or otherwise, unless required by
143
+ applicable law (such as deliberate and grossly negligent acts) or agreed to in
144
+ writing, shall any Contributor be liable to You for damages, including any
145
+ direct, indirect, special, incidental, or consequential damages of any
146
+ character arising as a result of this License or out of the use or inability
147
+ to use the Work (including but not limited to damages for loss of goodwill,
148
+ work stoppage, computer failure or malfunction, or any and all other
149
+ commercial damages or losses), even if such Contributor has been advised of
150
+ the possibility of such damages.
151
+
152
+ 9. Accepting Warranty or Additional Liability. While redistributing the Work
153
+ or Derivative Works thereof, You may choose to offer, and charge a fee for,
154
+ acceptance of support, warranty, indemnity, or other liability obligations
155
+ and/or rights consistent with this License. However, in accepting such
156
+ obligations, You may act only on Your own behalf and on Your sole
157
+ responsibility, not on behalf of any other Contributor, and only if You agree
158
+ to indemnify, defend, and hold each Contributor harmless for any liability
159
+ incurred by, or claims asserted against, such Contributor by reason of your
160
+ accepting any such warranty or additional liability.
161
+
162
+ END OF TERMS AND CONDITIONS
163
+
164
+ Copyright 2026 Anyshift Inc.
165
+
166
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
167
+ this file except in compliance with the License. You may obtain a copy of the
168
+ License at
169
+
170
+ http://www.apache.org/licenses/LICENSE-2.0
171
+
172
+ Unless required by applicable law or agreed to in writing, software
173
+ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
174
+ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
175
+ License for the specific language governing permissions and limitations under
176
+ the License.
package/README.md ADDED
@@ -0,0 +1,9 @@
1
+ # `@anyshift/backstage-plugin-anyshift`
2
+
3
+ New-frontend-system plugin for the Anyshift infrastructure graph. Installing the package in an app
4
+ created with `@backstage/frontend-defaults` and configured with `app.packages: all` discovers its
5
+ dashboard, navigation item, API factory, and entity content automatically.
6
+
7
+ The package has no legacy frontend entry point. Add the corresponding
8
+ `@anyshift/backstage-plugin-anyshift-backend` package to the Backstage backend and configure one
9
+ Anyshift project. See the [integration guide](../../README.md) for the complete setup.
@@ -0,0 +1,80 @@
1
+ import { createApiRef } from '@backstage/frontend-plugin-api';
2
+
3
+ const anyshiftApiRef = createApiRef({
4
+ id: "plugin.anyshift.service"
5
+ });
6
+ class AnyshiftClient {
7
+ discoveryApi;
8
+ fetchApi;
9
+ constructor(options) {
10
+ this.discoveryApi = options.discoveryApi;
11
+ this.fetchApi = options.fetchApi;
12
+ }
13
+ async capabilities() {
14
+ return this.get("/capabilities");
15
+ }
16
+ async brief(kind, target, options = {}) {
17
+ return this.get(
18
+ `/brief/${encodeURIComponent(kind)}/${encodeURIComponent(
19
+ target
20
+ )}${briefQuery(options)}`
21
+ );
22
+ }
23
+ async briefSection(kind, target, section, options = {}) {
24
+ return this.get(
25
+ `/brief/${encodeURIComponent(kind)}/${encodeURIComponent(
26
+ target
27
+ )}/sections/${encodeURIComponent(section)}${briefQuery(options)}`
28
+ );
29
+ }
30
+ async insights() {
31
+ return this.get("/insights");
32
+ }
33
+ async datadogSignals(options = {}) {
34
+ return this.get(`/signals/datadog${options.refresh ? "?refresh=1" : ""}`);
35
+ }
36
+ async inventory(type, options = {}) {
37
+ const params = new URLSearchParams({ type });
38
+ if (options.limit !== void 0) params.set("limit", String(options.limit));
39
+ if (options.offset !== void 0)
40
+ params.set("offset", String(options.offset));
41
+ return this.get(`/inventory?${params}`);
42
+ }
43
+ async query(sql) {
44
+ return this.request("/query", {
45
+ method: "POST",
46
+ headers: { "content-type": "application/json" },
47
+ body: JSON.stringify({ sql })
48
+ });
49
+ }
50
+ async get(path) {
51
+ return this.request(path, { method: "GET" });
52
+ }
53
+ async request(path, init) {
54
+ const baseUrl = await this.discoveryApi.getBaseUrl("anyshift");
55
+ const response = await this.fetchApi.fetch(`${baseUrl}${path}`, init);
56
+ const text = await response.text();
57
+ let payload;
58
+ try {
59
+ payload = text ? JSON.parse(text) : {};
60
+ } catch {
61
+ payload = {};
62
+ }
63
+ if (!response.ok) {
64
+ throw new Error(
65
+ payload?.error?.message || `Anyshift request failed (${response.status})`
66
+ );
67
+ }
68
+ return payload;
69
+ }
70
+ }
71
+ function briefQuery(options) {
72
+ const params = new URLSearchParams();
73
+ if (options.namespace) params.set("namespace", options.namespace);
74
+ if (options.refresh) params.set("refresh", "1");
75
+ const query = params.toString();
76
+ return query ? `?${query}` : "";
77
+ }
78
+
79
+ export { AnyshiftClient, anyshiftApiRef };
80
+ //# sourceMappingURL=AnyshiftApi.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AnyshiftApi.esm.js","sources":["../../src/api/AnyshiftApi.ts"],"sourcesContent":["import {\n createApiRef,\n type DiscoveryApi,\n type FetchApi,\n} from '@backstage/frontend-plugin-api';\nimport type {\n BriefSectionName,\n BriefSectionResponse,\n AnyshiftCapabilities,\n CatalogSummary,\n DatadogSignals,\n EstateInsights,\n QueryResult,\n ServiceBrief,\n} from './types';\n\nexport interface AnyshiftApi {\n capabilities(): Promise<AnyshiftCapabilities>;\n brief(\n kind: string,\n target: string,\n options?: BriefRequestOptions,\n ): Promise<ServiceBrief>;\n briefSection(\n kind: string,\n target: string,\n section: BriefSectionName,\n options?: BriefRequestOptions,\n ): Promise<BriefSectionResponse>;\n insights(): Promise<EstateInsights>;\n datadogSignals(options?: { refresh?: boolean }): Promise<DatadogSignals>;\n inventory(\n type: string,\n options?: { limit?: number; offset?: number },\n ): Promise<CatalogSummary>;\n query(sql: string): Promise<QueryResult>;\n}\n\nexport interface BriefRequestOptions {\n namespace?: string;\n refresh?: boolean;\n}\n\nexport const anyshiftApiRef = createApiRef<AnyshiftApi>({\n id: 'plugin.anyshift.service',\n});\n\nexport class AnyshiftClient implements AnyshiftApi {\n private readonly discoveryApi: DiscoveryApi;\n private readonly fetchApi: FetchApi;\n\n constructor(options: { discoveryApi: DiscoveryApi; fetchApi: FetchApi }) {\n this.discoveryApi = options.discoveryApi;\n this.fetchApi = options.fetchApi;\n }\n\n async capabilities(): Promise<AnyshiftCapabilities> {\n return this.get('/capabilities');\n }\n\n async brief(\n kind: string,\n target: string,\n options: BriefRequestOptions = {},\n ): Promise<ServiceBrief> {\n return this.get(\n `/brief/${encodeURIComponent(kind)}/${encodeURIComponent(\n target,\n )}${briefQuery(options)}`,\n );\n }\n\n async briefSection(\n kind: string,\n target: string,\n section: BriefSectionName,\n options: BriefRequestOptions = {},\n ): Promise<BriefSectionResponse> {\n return this.get(\n `/brief/${encodeURIComponent(kind)}/${encodeURIComponent(\n target,\n )}/sections/${encodeURIComponent(section)}${briefQuery(options)}`,\n );\n }\n\n async insights(): Promise<EstateInsights> {\n return this.get('/insights');\n }\n\n async datadogSignals(\n options: { refresh?: boolean } = {},\n ): Promise<DatadogSignals> {\n return this.get(`/signals/datadog${options.refresh ? '?refresh=1' : ''}`);\n }\n\n async inventory(\n type: string,\n options: { limit?: number; offset?: number } = {},\n ): Promise<CatalogSummary> {\n const params = new URLSearchParams({ type });\n if (options.limit !== undefined) params.set('limit', String(options.limit));\n if (options.offset !== undefined)\n params.set('offset', String(options.offset));\n return this.get(`/inventory?${params}`);\n }\n\n async query(sql: string): Promise<QueryResult> {\n return this.request('/query', {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify({ sql }),\n });\n }\n\n private async get<T>(path: string): Promise<T> {\n return this.request(path, { method: 'GET' });\n }\n\n private async request<T>(path: string, init: RequestInit): Promise<T> {\n const baseUrl = await this.discoveryApi.getBaseUrl('anyshift');\n const response = await this.fetchApi.fetch(`${baseUrl}${path}`, init);\n const text = await response.text();\n let payload: any;\n try {\n payload = text ? JSON.parse(text) : {};\n } catch {\n payload = {};\n }\n if (!response.ok) {\n throw new Error(\n payload?.error?.message ||\n `Anyshift request failed (${response.status})`,\n );\n }\n return payload as T;\n }\n}\n\nfunction briefQuery(options: BriefRequestOptions): string {\n const params = new URLSearchParams();\n if (options.namespace) params.set('namespace', options.namespace);\n if (options.refresh) params.set('refresh', '1');\n const query = params.toString();\n return query ? `?${query}` : '';\n}\n"],"names":[],"mappings":";;AA2CO,MAAM,iBAAiB,YAAA,CAA0B;AAAA,EACtD,EAAA,EAAI;AACN,CAAC;AAEM,MAAM,cAAA,CAAsC;AAAA,EAChC,YAAA;AAAA,EACA,QAAA;AAAA,EAEjB,YAAY,OAAA,EAA6D;AACvE,IAAA,IAAA,CAAK,eAAe,OAAA,CAAQ,YAAA;AAC5B,IAAA,IAAA,CAAK,WAAW,OAAA,CAAQ,QAAA;AAAA,EAC1B;AAAA,EAEA,MAAM,YAAA,GAA8C;AAClD,IAAA,OAAO,IAAA,CAAK,IAAI,eAAe,CAAA;AAAA,EACjC;AAAA,EAEA,MAAM,KAAA,CACJ,IAAA,EACA,MAAA,EACA,OAAA,GAA+B,EAAC,EACT;AACvB,IAAA,OAAO,IAAA,CAAK,GAAA;AAAA,MACV,CAAA,OAAA,EAAU,kBAAA,CAAmB,IAAI,CAAC,CAAA,CAAA,EAAI,kBAAA;AAAA,QACpC;AAAA,OACD,CAAA,EAAG,UAAA,CAAW,OAAO,CAAC,CAAA;AAAA,KACzB;AAAA,EACF;AAAA,EAEA,MAAM,YAAA,CACJ,IAAA,EACA,QACA,OAAA,EACA,OAAA,GAA+B,EAAC,EACD;AAC/B,IAAA,OAAO,IAAA,CAAK,GAAA;AAAA,MACV,CAAA,OAAA,EAAU,kBAAA,CAAmB,IAAI,CAAC,CAAA,CAAA,EAAI,kBAA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fragment } from 'react/jsx-runtime';
2
+ import { Progress, EmptyState } from '@backstage/core-components';
3
+ import { usePermission } from '@backstage/plugin-permission-react';
4
+
5
+ function AnyshiftPermissionBoundary({
6
+ children,
7
+ permission
8
+ }) {
9
+ const decision = usePermission({ permission });
10
+ if (decision.loading) return /* @__PURE__ */ jsx(Progress, {});
11
+ if (!decision.allowed) {
12
+ return /* @__PURE__ */ jsx(
13
+ EmptyState,
14
+ {
15
+ missing: "info",
16
+ title: "Anyshift access is restricted",
17
+ description: `Your Backstage permission policy does not grant ${permission.name}.`
18
+ }
19
+ );
20
+ }
21
+ return /* @__PURE__ */ jsx(Fragment, { children });
22
+ }
23
+
24
+ export { AnyshiftPermissionBoundary };
25
+ //# sourceMappingURL=AnyshiftPermissionBoundary.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AnyshiftPermissionBoundary.esm.js","sources":["../../src/components/AnyshiftPermissionBoundary.tsx"],"sourcesContent":["import type { PropsWithChildren } from 'react';\nimport { EmptyState, Progress } from '@backstage/core-components';\nimport type { BasicPermission } from '@backstage/plugin-permission-common';\nimport { usePermission } from '@backstage/plugin-permission-react';\n\nexport function AnyshiftPermissionBoundary({\n children,\n permission,\n}: PropsWithChildren<{ permission: BasicPermission }>) {\n const decision = usePermission({ permission });\n if (decision.loading) return <Progress />;\n if (!decision.allowed) {\n return (\n <EmptyState\n missing=\"info\"\n title=\"Anyshift access is restricted\"\n description={`Your Backstage permission policy does not grant ${permission.name}.`}\n />\n );\n }\n return <>{children}</>;\n}\n"],"names":[],"mappings":";;;;AAKO,SAAS,0BAAA,CAA2B;AAAA,EACzC,QAAA;AAAA,EACA;AACF,CAAA,EAAuD;AACrD,EAAA,MAAM,QAAA,GAAW,aAAA,CAAc,EAAE,UAAA,EAAY,CAAA;AAC7C,EAAA,IAAI,QAAA,CAAS,OAAA,EAAS,uBAAO,GAAA,CAAC,QAAA,EAAA,EAAS,CAAA;AACvC,EAAA,IAAI,CAAC,SAAS,OAAA,EAAS;AACrB,IAAA,uBACE,GAAA;AAAA,MAAC,UAAA;AAAA,MAAA;AAAA,QACC,OAAA,EAAQ,MAAA;AAAA,QACR,KAAA,EAAM,+BAAA;AAAA,QACN,WAAA,EAAa,CAAA,gDAAA,EAAmD,UAAA,CAAW,IAAI,CAAA,CAAA;AAAA;AAAA,KACjF;AAAA,EAEJ;AACA,EAAA,uCAAU,QAAA,EAAS,CAAA;AACrB;;;;"}
@@ -0,0 +1,213 @@
1
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
+ import { useState, useRef, useCallback, useEffect } from 'react';
3
+ import { Typography, Box, Chip, Button, CircularProgress, Grid } from '@material-ui/core';
4
+ import { Progress } from '@backstage/core-components';
5
+ import { useApi } from '@backstage/frontend-plugin-api';
6
+ import { ANYSHIFT_KIND_ANNOTATION, ANYSHIFT_TARGET_ANNOTATION, GITHUB_PROJECT_SLUG_ANNOTATION } from '@anyshift/backstage-plugin-anyshift-common';
7
+ import { useEntity } from '@backstage/plugin-catalog-react';
8
+ import { anyshiftApiRef } from '../../api/AnyshiftApi.esm.js';
9
+ import { OverviewSection, DatadogSignalSection, ArchitectureSection, DependencySection, BriefRail, TimelineSection } from './BriefSections.esm.js';
10
+
11
+ const AnyshiftEntityContent = () => {
12
+ const { entity } = useEntity();
13
+ const api = useApi(anyshiftApiRef);
14
+ const annotations = entity.metadata.annotations ?? {};
15
+ const target = entityTarget(entity);
16
+ const kind = annotations[ANYSHIFT_KIND_ANNOTATION] || "workload";
17
+ const namespace = entity.metadata.namespace;
18
+ const [brief, setBrief] = useState();
19
+ const [error, setError] = useState();
20
+ const [refreshingAll, setRefreshingAll] = useState(false);
21
+ const [refreshing, setRefreshing] = useState(
22
+ /* @__PURE__ */ new Set()
23
+ );
24
+ const active = useRef(true);
25
+ const load = useCallback(
26
+ async (refresh = false) => {
27
+ setError(void 0);
28
+ if (refresh) setRefreshingAll(true);
29
+ try {
30
+ const next = await api.brief(kind, target, { namespace, refresh });
31
+ if (active.current) setBrief(next);
32
+ } catch (cause) {
33
+ if (active.current)
34
+ setError(cause instanceof Error ? cause.message : String(cause));
35
+ } finally {
36
+ if (active.current) setRefreshingAll(false);
37
+ }
38
+ },
39
+ [api, kind, namespace, target]
40
+ );
41
+ const retrySection = useCallback(
42
+ async (section) => {
43
+ setRefreshing((current) => new Set(current).add(section));
44
+ try {
45
+ const response = await api.briefSection(kind, target, section, {
46
+ namespace,
47
+ refresh: true
48
+ });
49
+ if (active.current) {
50
+ setBrief(
51
+ (current) => current ? {
52
+ ...current,
53
+ [section]: response.value,
54
+ refreshedAt: response.refreshedAt,
55
+ ...response.observedService ? { observedService: response.observedService } : {}
56
+ } : current
57
+ );
58
+ }
59
+ } finally {
60
+ if (active.current) {
61
+ setRefreshing((current) => {
62
+ const next = new Set(current);
63
+ next.delete(section);
64
+ return next;
65
+ });
66
+ }
67
+ }
68
+ },
69
+ [api, kind, namespace, target]
70
+ );
71
+ useEffect(() => {
72
+ active.current = true;
73
+ void load();
74
+ return () => {
75
+ active.current = false;
76
+ };
77
+ }, [load]);
78
+ if (error && !brief) return /* @__PURE__ */ jsx(Typography, { color: "error", children: error });
79
+ if (!brief) return /* @__PURE__ */ jsx(Progress, {});
80
+ return /* @__PURE__ */ jsx(
81
+ ServiceBriefView,
82
+ {
83
+ brief,
84
+ onRetry: retrySection,
85
+ refreshing,
86
+ onRefresh: () => void load(true),
87
+ refreshingAll,
88
+ refreshError: error
89
+ }
90
+ );
91
+ };
92
+ function entityTarget(entity) {
93
+ const annotations = entity.metadata.annotations ?? {};
94
+ const explicit = annotations[ANYSHIFT_TARGET_ANNOTATION]?.trim();
95
+ if (explicit) return explicit;
96
+ const slug = annotations[GITHUB_PROJECT_SLUG_ANNOTATION]?.trim();
97
+ const repository = slug?.split("/").filter(Boolean).at(-1);
98
+ return repository || entity.metadata.name;
99
+ }
100
+ const ServiceBriefView = ({
101
+ brief,
102
+ onRetry,
103
+ refreshing = /* @__PURE__ */ new Set(),
104
+ onRefresh = () => {
105
+ },
106
+ refreshingAll = false,
107
+ refreshError
108
+ }) => /* @__PURE__ */ jsxs(Fragment, { children: [
109
+ /* @__PURE__ */ jsxs(
110
+ Box,
111
+ {
112
+ mb: 3,
113
+ px: 2.5,
114
+ py: 2,
115
+ borderLeft: 4,
116
+ borderColor: "primary.main",
117
+ bgcolor: "background.paper",
118
+ children: [
119
+ /* @__PURE__ */ jsxs(Box, { display: "flex", justifyContent: "space-between", gridGap: 16, children: [
120
+ /* @__PURE__ */ jsxs(Box, { children: [
121
+ /* @__PURE__ */ jsx(Typography, { variant: "overline", color: "textSecondary", children: "Anyshift evidence trace" }),
122
+ /* @__PURE__ */ jsxs(Box, { display: "flex", flexWrap: "wrap", alignItems: "center", gridGap: 8, children: [
123
+ /* @__PURE__ */ jsx(Chip, { size: "small", label: `Workload \xB7 ${brief.target}` }),
124
+ /* @__PURE__ */ jsx(Typography, { "aria-hidden": "true", color: "primary", children: "\u2192" }),
125
+ /* @__PURE__ */ jsx(
126
+ Chip,
127
+ {
128
+ size: "small",
129
+ color: "primary",
130
+ label: `Observed service \xB7 ${brief.observedService || "Not resolved"}`
131
+ }
132
+ )
133
+ ] }),
134
+ /* @__PURE__ */ jsxs(Typography, { variant: "caption", color: "textSecondary", children: [
135
+ "Runtime namespace: ",
136
+ brief.namespace || "Not set",
137
+ " \xB7 Refreshed",
138
+ " ",
139
+ formatTimestamp(brief.refreshedAt)
140
+ ] })
141
+ ] }),
142
+ /* @__PURE__ */ jsx(
143
+ Button,
144
+ {
145
+ type: "button",
146
+ variant: "outlined",
147
+ size: "small",
148
+ onClick: onRefresh,
149
+ disabled: refreshingAll,
150
+ startIcon: refreshingAll ? /* @__PURE__ */ jsx(CircularProgress, { size: 14 }) : void 0,
151
+ children: refreshingAll ? "Refreshing\u2026" : "Refresh brief"
152
+ }
153
+ )
154
+ ] }),
155
+ refreshError && /* @__PURE__ */ jsxs(Typography, { color: "error", variant: "caption", children: [
156
+ "Refresh failed: ",
157
+ refreshError,
158
+ ". Existing evidence is still shown."
159
+ ] })
160
+ ]
161
+ }
162
+ ),
163
+ /* @__PURE__ */ jsxs(Grid, { container: true, spacing: 3, alignItems: "stretch", children: [
164
+ /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(
165
+ OverviewSection,
166
+ {
167
+ section: brief.overview,
168
+ onRetry,
169
+ refreshing: refreshing.has("overview")
170
+ }
171
+ ) }),
172
+ /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(
173
+ DatadogSignalSection,
174
+ {
175
+ section: brief.observability,
176
+ onRetry,
177
+ refreshing: refreshing.has("observability")
178
+ }
179
+ ) }),
180
+ /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(
181
+ ArchitectureSection,
182
+ {
183
+ section: brief.architecture,
184
+ onRetry,
185
+ refreshing: refreshing.has("architecture")
186
+ }
187
+ ) }),
188
+ /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, md: 8, children: /* @__PURE__ */ jsx(
189
+ DependencySection,
190
+ {
191
+ section: brief.topology,
192
+ onRetry,
193
+ refreshing: refreshing.has("topology")
194
+ }
195
+ ) }),
196
+ /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, md: 4, children: /* @__PURE__ */ jsx(BriefRail, { brief, onRetry, refreshing }) }),
197
+ /* @__PURE__ */ jsx(Grid, { item: true, xs: 12, children: /* @__PURE__ */ jsx(
198
+ TimelineSection,
199
+ {
200
+ section: brief.timeline,
201
+ onRetry,
202
+ refreshing: refreshing.has("timeline")
203
+ }
204
+ ) })
205
+ ] })
206
+ ] });
207
+ function formatTimestamp(value) {
208
+ const parsed = Date.parse(value);
209
+ return Number.isNaN(parsed) ? value : new Date(parsed).toLocaleString();
210
+ }
211
+
212
+ export { AnyshiftEntityContent, ServiceBriefView, entityTarget };
213
+ //# sourceMappingURL=AnyshiftEntityContent.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AnyshiftEntityContent.esm.js","sources":["../../../src/components/entity/AnyshiftEntityContent.tsx"],"sourcesContent":["import { useCallback, useEffect, useRef, useState } from 'react';\nimport {\n Box,\n Button,\n Chip,\n CircularProgress,\n Grid,\n Typography,\n} from '@material-ui/core';\nimport { Progress } from '@backstage/core-components';\nimport { useApi } from '@backstage/frontend-plugin-api';\nimport {\n ANYSHIFT_KIND_ANNOTATION,\n ANYSHIFT_TARGET_ANNOTATION,\n GITHUB_PROJECT_SLUG_ANNOTATION,\n} from '@anyshift/backstage-plugin-anyshift-common';\nimport type { Entity } from '@backstage/catalog-model';\nimport { useEntity } from '@backstage/plugin-catalog-react';\nimport { anyshiftApiRef } from '../../api/AnyshiftApi';\nimport type { BriefSectionName, ServiceBrief } from '../../api/types';\nimport {\n ArchitectureSection,\n BriefRail,\n DatadogSignalSection,\n DependencySection,\n OverviewSection,\n TimelineSection,\n} from './BriefSections';\n\nexport const AnyshiftEntityContent = () => {\n const { entity } = useEntity();\n const api = useApi(anyshiftApiRef);\n const annotations = entity.metadata.annotations ?? {};\n const target = entityTarget(entity);\n const kind = annotations[ANYSHIFT_KIND_ANNOTATION] || 'workload';\n const namespace = entity.metadata.namespace;\n const [brief, setBrief] = useState<ServiceBrief>();\n const [error, setError] = useState<string>();\n const [refreshingAll, setRefreshingAll] = useState(false);\n const [refreshing, setRefreshing] = useState<Set<BriefSectionName>>(\n new Set(),\n );\n const active = useRef(true);\n\n const load = useCallback(\n async (refresh = false) => {\n setError(undefined);\n if (refresh) setRefreshingAll(true);\n try {\n const next = await api.brief(kind, target, { namespace, refresh });\n if (active.current) setBrief(next);\n } catch (cause) {\n if (active.current)\n setError(cause instanceof Error ? cause.message : String(cause));\n } finally {\n if (active.current) setRefreshingAll(false);\n }\n },\n [api, kind, namespace, target],\n );\n\n const retrySection = useCallback(\n async (section: BriefSectionName) => {\n setRefreshing(current => new Set(current).add(section));\n try {\n const response = await api.briefSection(kind, target, section, {\n namespace,\n refresh: true,\n });\n if (active.current) {\n setBrief(current =>\n current\n ? {\n ...current,\n [section]: response.value,\n refreshedAt: response.refreshedAt,\n ...(response.observedService\n ? { observedService: response.observedService }\n : {}),\n }\n : current,\n );\n }\n } finally {\n if (active.current) {\n setRefreshing(current => {\n const next = new Set(current);\n next.delete(section);\n return next;\n });\n }\n }\n },\n [api, kind, namespace, target],\n );\n\n useEffect(() => {\n active.current = true;\n void load();\n return () => {\n active.current = false;\n };\n }, [load]);\n\n if (error && !brief) return <Typography color=\"error\">{error}</Typography>;\n if (!brief) return <Progress />;\n return (\n <ServiceBriefView\n brief={brief}\n onRetry={retrySection}\n refreshing={refreshing}\n onRefresh={() => void load(true)}\n refreshingAll={refreshingAll}\n refreshError={error}\n />\n );\n};\n\nexport function entityTarget(entity: Entity): string {\n const annotations = entity.metadata.annotations ?? {};\n const explicit = annotations[ANYSHIFT_TARGET_ANNOTATION]?.trim();\n if (explicit) return explicit;\n\n const slug = annotations[GITHUB_PROJECT_SLUG_ANNOTATION]?.trim();\n const repository = slug?.split('/').filter(Boolean).at(-1);\n return repository || entity.metadata.name;\n}\n\nexport const ServiceBriefView = ({\n brief,\n onRetry,\n refreshing = new Set(),\n onRefresh = () => {},\n refreshingAll = false,\n refreshError,\n}: {\n brief: ServiceBrief;\n onRetry: (section: BriefSectionName) => void;\n refreshing?: ReadonlySet<BriefSectionName>;\n onRefresh?: () => void;\n refreshingAll?: boolean;\n refreshError?: string;\n}) => (\n <>\n <Box\n mb={3}\n px={2.5}\n py={2}\n borderLeft={4}\n borderColor=\"primary.main\"\n bgcolor=\"background.paper\"\n >\n <Box display=\"flex\" justifyContent=\"space-between\" gridGap={16}>\n <Box>\n <Typography variant=\"overline\" color=\"textSecondary\">\n Anyshift evidence trace\n </Typography>\n <Box display=\"flex\" flexWrap=\"wrap\" alignItems=\"center\" gridGap={8}>\n <Chip size=\"small\" label={`Workload · ${brief.target}`} />\n <Typography aria-hidden=\"true\" color=\"primary\">\n →\n </Typography>\n <Chip\n size=\"small\"\n color=\"primary\"\n label={`Observed service · ${\n brief.observedService || 'Not resolved'\n }`}\n />\n </Box>\n <Typography variant=\"caption\" color=\"textSecondary\">\n Runtime namespace: {brief.namespace || 'Not set'} · Refreshed{' '}\n {formatTimestamp(brief.refreshedAt)}\n </Typography>\n </Box>\n <Button\n type=\"button\"\n variant=\"outlined\"\n size=\"small\"\n onClick={onRefresh}\n disabled={refreshingAll}\n startIcon={refreshingAll ? <CircularProgress size={14} /> : undefined}\n >\n {refreshingAll ? 'Refreshing…' : 'Refresh brief'}\n </Button>\n </Box>\n {refreshError && (\n <Typography color=\"error\" variant=\"caption\">\n Refresh failed: {refreshError}. Existing evidence is still shown.\n </Typography>\n )}\n </Box>\n\n <Grid container spacing={3} alignItems=\"stretch\">\n <Grid item xs={12}>\n <OverviewSection\n section={brief.overview}\n onRetry={onRetry}\n refreshing={refreshing.has('overview')}\n />\n </Grid>\n <Grid item xs={12}>\n <DatadogSignalSection\n section={brief.observability}\n onRetry={onRetry}\n refreshing={refreshing.has('observability')}\n />\n </Grid>\n <Grid item xs={12}>\n <ArchitectureSection\n section={brief.architecture}\n onRetry={onRetry}\n refreshing={refreshing.has('architecture')}\n />\n </Grid>\n <Grid item xs={12} md={8}>\n <DependencySection\n section={brief.topology}\n onRetry={onRetry}\n refreshing={refreshing.has('topology')}\n />\n </Grid>\n <Grid item xs={12} md={4}>\n <BriefRail brief={brief} onRetry={onRetry} refreshing={refreshing} />\n </Grid>\n <Grid item xs={12}>\n <TimelineSection\n section={brief.timeline}\n onRetry={onRetry}\n refreshing={refreshing.has('timeline')}\n />\n </Grid>\n </Grid>\n </>\n);\n\nfunction formatTimestamp(value: string): string {\n const parsed = Date.parse(value);\n return Number.isNaN(parsed) ? value : new Date(parsed).toLocaleString();\n}\n"],"names":[],"mappings":";;;;;;;;;;AA6BO,MAAM,wBAAwB,MAAM;AACzC,EAAA,MAAM,EAAE,MAAA,EAAO,GAAI,SAAA,EAAU;AAC7B,EAAA,MAAM,GAAA,GAAM,OAAO,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