@gravitee/gamma-lib-observability 2.2.4 → 3.0.0

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 (29) hide show
  1. package/INTEGRATION.md +28 -9
  2. package/dist/dashboard-access-provider.js +166 -0
  3. package/dist/dashboards/editor/testing/vanishing-dashboard-harness.d.ts +2 -0
  4. package/dist/dashboards/editor/testing/vanishing-dashboard-harness.d.ts.map +1 -1
  5. package/dist/dashboards/editor/use-dashboard-save.d.ts +8 -4
  6. package/dist/dashboards/editor/use-dashboard-save.d.ts.map +1 -1
  7. package/dist/data-sources/dashboard-errors.d.ts +13 -0
  8. package/dist/data-sources/dashboard-errors.d.ts.map +1 -1
  9. package/dist/data-sources/dashboard-persistence.d.ts +16 -0
  10. package/dist/data-sources/dashboard-persistence.d.ts.map +1 -1
  11. package/dist/data-sources/index.d.ts +1 -1
  12. package/dist/data-sources/index.d.ts.map +1 -1
  13. package/dist/hooks/use-custom-dashboards.d.ts.map +1 -1
  14. package/dist/hooks/use-dashboard-authoring.d.ts +19 -0
  15. package/dist/hooks/use-dashboard-authoring.d.ts.map +1 -0
  16. package/dist/index.d.ts +1 -1
  17. package/dist/index.d.ts.map +1 -1
  18. package/dist/index.js +3043 -2986
  19. package/dist/providers/dashboard-access-provider.d.ts +38 -0
  20. package/dist/providers/dashboard-access-provider.d.ts.map +1 -0
  21. package/dist/routing/DashboardListPage.d.ts.map +1 -1
  22. package/dist/routing/ObservabilityDashboardPage.d.ts.map +1 -1
  23. package/dist/routing/ObservabilityRoutes.d.ts.map +1 -1
  24. package/dist/routing/dashboard-write-errors.d.ts +12 -0
  25. package/dist/routing/dashboard-write-errors.d.ts.map +1 -0
  26. package/dist/testing/index.d.ts.map +1 -1
  27. package/dist/testing.js +10 -10
  28. package/package.json +1 -1
  29. package/dist/filter-providers-context.js +0 -125
@@ -0,0 +1,38 @@
1
+ import { ReactNode } from 'react';
2
+ /** The two rights a backend refusal can speak about, one per verb family. */
3
+ export type DashboardAccessVerb = 'read' | 'write';
4
+ /**
5
+ * What the dashboards section has learned about this user's rights from the
6
+ * backend's own answers.
7
+ *
8
+ * The declared capabilities say what the host *believes* the user may do; the
9
+ * backend's ACLs decide. The lib cannot ask about them, only be refused, so
10
+ * this is a memory of refusals: sticky, because the affordances a 403 just
11
+ * proved unusable should not come back on the next render, and cleared by a
12
+ * later success on the same verb, because permissions can be granted back
13
+ * mid-session. It deliberately says nothing about any other failure — a server
14
+ * that did not answer has refused nothing.
15
+ */
16
+ export interface DashboardAccess {
17
+ /** A read was answered 403: custom dashboards are not for this user. */
18
+ readonly readRefused: boolean;
19
+ /** A write was answered 403: authoring is not for this user. */
20
+ readonly writeRefused: boolean;
21
+ /** A request on this verb came back 403. */
22
+ readonly reportRefused: (verb: DashboardAccessVerb) => void;
23
+ /** A request on this verb succeeded, so any remembered refusal is stale. */
24
+ readonly reportGranted: (verb: DashboardAccessVerb) => void;
25
+ }
26
+ export interface DashboardAccessProviderProps {
27
+ children: ReactNode;
28
+ }
29
+ /**
30
+ * One memory per mounted observability section, above the routes, so the
31
+ * refusal an editor's save just met is already known to the list the author
32
+ * lands back on. It lives in React state rather than the query cache because
33
+ * mutations leave no shared trace there, and a second copy of the flag would
34
+ * have let the two disagree.
35
+ */
36
+ export declare function DashboardAccessProvider({ children }: DashboardAccessProviderProps): import("react/jsx-runtime").JSX.Element;
37
+ export declare function useDashboardAccess(): DashboardAccess;
38
+ //# sourceMappingURL=dashboard-access-provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dashboard-access-provider.d.ts","sourceRoot":"","sources":["../../src/providers/dashboard-access-provider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA6D,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAElG,6EAA6E;AAC7E,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,OAAO,CAAC;AAEnD;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,eAAe;IAC9B,wEAAwE;IACxE,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,gEAAgE;IAChE,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC/B,4CAA4C;IAC5C,QAAQ,CAAC,aAAa,EAAE,CAAC,IAAI,EAAE,mBAAmB,KAAK,IAAI,CAAC;IAC5D,4EAA4E;IAC5E,QAAQ,CAAC,aAAa,EAAE,CAAC,IAAI,EAAE,mBAAmB,KAAK,IAAI,CAAC;CAC7D;AAgBD,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,EAAE,QAAQ,EAAE,EAAE,4BAA4B,2CAiBjF;AAED,wBAAgB,kBAAkB,IAAI,eAAe,CAEpD"}
@@ -1 +1 @@
1
- {"version":3,"file":"DashboardListPage.d.ts","sourceRoot":"","sources":["../../src/routing/DashboardListPage.tsx"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AAUpF,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE,SAAS,iBAAiB,EAAE,CAAC;CACzC;AAqBD,wBAAgB,iBAAiB,CAAC,EAAE,SAAS,EAAE,EAAE,sBAAsB,2CAiGtE"}
1
+ {"version":3,"file":"DashboardListPage.d.ts","sourceRoot":"","sources":["../../src/routing/DashboardListPage.tsx"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AAYpF,MAAM,WAAW,sBAAsB;IACrC,SAAS,EAAE,SAAS,iBAAiB,EAAE,CAAC;CACzC;AAqBD,wBAAgB,iBAAiB,CAAC,EAAE,SAAS,EAAE,EAAE,sBAAsB,2CA4GtE"}
@@ -1 +1 @@
1
- {"version":3,"file":"ObservabilityDashboardPage.d.ts","sourceRoot":"","sources":["../../src/routing/ObservabilityDashboardPage.tsx"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AAmBpF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAKrD,MAAM,WAAW,+BAA+B;IAC9C,SAAS,EAAE,SAAS,iBAAiB,EAAE,CAAC;IACxC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,aAAa,CAAC,EAAE,SAAS,qBAAqB,EAAE,CAAC;CAClD;AAED,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,+BAA+B,2CAgBhF"}
1
+ {"version":3,"file":"ObservabilityDashboardPage.d.ts","sourceRoot":"","sources":["../../src/routing/ObservabilityDashboardPage.tsx"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AAsBpF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAKrD,MAAM,WAAW,+BAA+B;IAC9C,SAAS,EAAE,SAAS,iBAAiB,EAAE,CAAC;IACxC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,aAAa,CAAC,EAAE,SAAS,qBAAqB,EAAE,CAAC;CAClD;AAED,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,+BAA+B,2CAgBhF"}
@@ -1 +1 @@
1
- {"version":3,"file":"ObservabilityRoutes.d.ts","sourceRoot":"","sources":["../../src/routing/ObservabilityRoutes.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAcjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAO9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,C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C,MAAM,EAAE,2BAA2B,CAAC;CACrC;AAkJD,wBAAgB,mBAAmB,CAAC,EAClC,OAAO,EACP,aAAa,EACb,IAAI,EACJ,UAAU,EACV,eAAe,EACf,QAAQ,EACR,cAAc,EACd,WAAW,EACX,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,MAAM,GACP,EAAE,gCAAgC,2CAmUlC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * The sentence a failed dashboard write earns on the list and view screens,
3
+ * refusals told apart from failures in one place. Four hand-written handlers
4
+ * each sniffing the 403 themselves is how a wording or rule change ends up
5
+ * applied to three of them — the same drift the editor's outcome union exists
6
+ * to prevent on its own writes.
7
+ *
8
+ * A refusal is named as an account problem; anything else keeps the message
9
+ * the server gave, because that is the only lead the user has.
10
+ */
11
+ export declare function describeDashboardWriteError(error: Error, action: 'duplicate' | 'delete'): string;
12
+ //# sourceMappingURL=dashboard-write-errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dashboard-write-errors.d.ts","sourceRoot":"","sources":["../../src/routing/dashboard-write-errors.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,GAAG,QAAQ,GAAG,MAAM,CAShG"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/testing/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAuB,MAAM,uBAAuB,CAAC;AACzE,OAAO,EAAU,KAAK,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAE,KAAK,YAAY,EAAkB,MAAM,OAAO,CAAC;AAC1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAClF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,KAAK,EA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7E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AASjE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAE7D,MAAM,WAAW,8BAA+B,SAAQ,IAAI,CAAC,aAAa,EAAE,SAAS,CAAC;IACpF,WAAW,CAAC,EAAE;QACZ,OAAO,CAAC,EAAE,iBAAiB,CAAC;QAC5B,IAAI,CAAC,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC;QAC/B,MAAM,CAAC,EAAE,gBAAgB,CAAC;QAC1B,WAAW,CAAC,EAAE,oBAAoB,CAAC;KACpC,CAAC;IACF,eAAe,CAAC,EAAE,SAAS,cAAc,EAAE,CAAC;IAC5C,YAAY,CAAC,EAAE,qBAAqB,CAAC;IACrC,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B;AAaD,wBAAgB,uBAAuB,CAAC,EAAE,EAAE,YAAY,EAAE,OAAO,GAAE,8BAAmC;;;;uBA7BzF,CAAC,yJAEd,CAAA,6BAAkC,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2EjC"}
package/dist/testing.js CHANGED
@@ -1,5 +1,5 @@
1
- import { g as e, i as t, p as n, s as r, t as i, u as a, y as o } from "./filter-providers-context.js";
2
- import { Fragment as s, jsx as c } from "react/jsx-runtime";
1
+ import { f as e, h as t, l as n, o as r, r as i, t as a, v as o, x as s } from "./dashboard-access-provider.js";
2
+ import { jsx as c } from "react/jsx-runtime";
3
3
  import { QueryClient as l, QueryClientProvider as u } from "@tanstack/react-query";
4
4
  import { render as d } from "@testing-library/react";
5
5
  //#region src/testing/index.tsx
@@ -10,19 +10,19 @@ function f() {
10
10
  } } });
11
11
  }
12
12
  function p(l, p = {}) {
13
- let { dataSources: m = {}, filterProviders: h, capabilities: g = o, queryClient: _ = f(), ...v } = p;
14
- function y({ children: o }) {
15
- let l = /* @__PURE__ */ c(s, { children: o });
16
- return m.persistence && (l = /* @__PURE__ */ c(n, {
13
+ let { dataSources: m = {}, filterProviders: h, capabilities: g = s, queryClient: _ = f(), ...v } = p;
14
+ function y({ children: s }) {
15
+ let l = /* @__PURE__ */ c(a, { children: s });
16
+ return m.persistence && (l = /* @__PURE__ */ c(t, {
17
17
  persistence: m.persistence,
18
18
  children: l
19
- })), m.traces && (l = /* @__PURE__ */ c(t, {
19
+ })), m.traces && (l = /* @__PURE__ */ c(r, {
20
20
  dataSource: m.traces,
21
21
  children: l
22
- })), m.logs && (l = /* @__PURE__ */ c(a, {
22
+ })), m.logs && (l = /* @__PURE__ */ c(e, {
23
23
  dataSource: m.logs,
24
24
  children: l
25
- })), m.metrics && (l = /* @__PURE__ */ c(r, {
25
+ })), m.metrics && (l = /* @__PURE__ */ c(n, {
26
26
  dataSource: m.metrics,
27
27
  children: l
28
28
  })), h && (l = /* @__PURE__ */ c(i, {
@@ -30,7 +30,7 @@ function p(l, p = {}) {
30
30
  children: l
31
31
  })), /* @__PURE__ */ c(u, {
32
32
  client: _,
33
- children: /* @__PURE__ */ c(e, {
33
+ children: /* @__PURE__ */ c(o, {
34
34
  capabilities: g,
35
35
  children: l
36
36
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravitee/gamma-lib-observability",
3
- "version": "2.2.4",
3
+ "version": "3.0.0",
4
4
  "description": "Shared observability library for Gamma modules — dashboards, logs, tracing UI components and integration with business rules.",
5
5
  "type": "module",
6
6
  "packageManager": "yarn@4.14.1",
@@ -1,125 +0,0 @@
1
- import { createContext as e, useContext as t, useMemo as n } from "react";
2
- import { jsx as r } from "react/jsx-runtime";
3
- //#region src/types/domain.ts
4
- var i = [
5
- "eq",
6
- "neq",
7
- "contains",
8
- "not_contains",
9
- "starts_with",
10
- "ends_with",
11
- "gt",
12
- "gte",
13
- "lt",
14
- "lte",
15
- "in",
16
- "not_in",
17
- "exists",
18
- "not_exists"
19
- ], a = {
20
- "observability.dashboards.read": !1,
21
- "observability.dashboards.write": !1,
22
- "observability.logs.read": !1,
23
- "observability.traces.read": !1
24
- }, o = e(null);
25
- function s({ capabilities: e, children: t }) {
26
- return /* @__PURE__ */ r(o.Provider, {
27
- value: e,
28
- children: t
29
- });
30
- }
31
- function c() {
32
- return t(o) || a;
33
- }
34
- function l(e) {
35
- return c()[e];
36
- }
37
- //#endregion
38
- //#region src/providers/dashboard-persistence-provider.tsx
39
- var u = e(null);
40
- function d({ persistence: e, children: t }) {
41
- return /* @__PURE__ */ r(u.Provider, {
42
- value: e,
43
- children: t
44
- });
45
- }
46
- function f() {
47
- return t(u);
48
- }
49
- function p() {
50
- let e = t(u);
51
- if (!e) throw Error("[gamma-lib-observability] useDashboardPersistence must be used within a <DashboardPersistenceProvider>. Wrap your component tree with <DashboardPersistenceProvider persistence={yourImpl}>.");
52
- return e;
53
- }
54
- //#endregion
55
- //#region src/providers/logs-data-source-provider.tsx
56
- var m = e(null);
57
- function h({ dataSource: e, children: t }) {
58
- return /* @__PURE__ */ r(m.Provider, {
59
- value: e,
60
- children: t
61
- });
62
- }
63
- function g() {
64
- let e = t(m);
65
- if (!e) throw Error("[gamma-lib-observability] useLogsDataSource must be used within a <LogsDataSourceProvider>. Wrap your component tree with <LogsDataSourceProvider dataSource={yourImpl}>.");
66
- return e;
67
- }
68
- function _() {
69
- return t(m);
70
- }
71
- //#endregion
72
- //#region src/providers/metrics-data-source-provider.tsx
73
- var v = e(null);
74
- function y({ dataSource: e, children: t }) {
75
- return /* @__PURE__ */ r(v.Provider, {
76
- value: e,
77
- children: t
78
- });
79
- }
80
- function b() {
81
- let e = t(v);
82
- if (!e) throw Error("[gamma-lib-observability] useMetricsDataSource must be used within a <MetricsDataSourceProvider>. Wrap your component tree with <MetricsDataSourceProvider dataSource={yourImpl}>.");
83
- return e;
84
- }
85
- function x() {
86
- return t(v);
87
- }
88
- //#endregion
89
- //#region src/providers/traces-data-source-provider.tsx
90
- var S = e(null);
91
- function C({ dataSource: e, children: t }) {
92
- return /* @__PURE__ */ r(S.Provider, {
93
- value: e,
94
- children: t
95
- });
96
- }
97
- function w() {
98
- let e = t(S);
99
- if (!e) throw Error("[gamma-lib-observability] useTracesDataSource must be used within a <TracesDataSourceProvider>. Wrap your component tree with <TracesDataSourceProvider dataSource={yourImpl}>.");
100
- return e;
101
- }
102
- function T() {
103
- return t(S);
104
- }
105
- //#endregion
106
- //#region src/filters/filter-providers-context.tsx
107
- var E = e(null);
108
- function D({ providers: e, children: t }) {
109
- let i = n(() => e, [e]);
110
- return /* @__PURE__ */ r(E.Provider, {
111
- value: i,
112
- children: t
113
- });
114
- }
115
- function O() {
116
- let e = t(E);
117
- if (!e) throw Error("[gamma-lib-observability] useFilterProviders must be used within a <FilterProvidersProvider>. Wrap your component tree with <FilterProvidersProvider providers={[...]}>.");
118
- return e;
119
- }
120
- function k(e) {
121
- let t = O();
122
- if (e) return t.find((t) => t.field === e);
123
- }
124
- //#endregion
125
- export { c as _, T as a, i as b, b as c, g as d, _ as f, s as g, f as h, C as i, x as l, p as m, k as n, w as o, d as p, O as r, y as s, D as t, h as u, l as v, a as y };