@burdenoff/microfe-adaptercloud 2026.825.4 → 2026.829.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 (57) hide show
  1. package/dist/adaptercloud/AdapterCloudRoot.d.ts.map +1 -1
  2. package/dist/adaptercloud/AdapterCloudRoot.js +52 -55
  3. package/dist/adaptercloud/AdapterCloudRoot.js.map +1 -1
  4. package/dist/adaptercloud/components/ActiveSwitch.d.ts +17 -0
  5. package/dist/adaptercloud/components/ActiveSwitch.d.ts.map +1 -0
  6. package/dist/adaptercloud/components/ActiveSwitch.js +28 -0
  7. package/dist/adaptercloud/components/ActiveSwitch.js.map +1 -0
  8. package/dist/adaptercloud/components/index.d.ts +1 -0
  9. package/dist/adaptercloud/components/index.d.ts.map +1 -1
  10. package/dist/adaptercloud/hooks/index.d.ts +1 -0
  11. package/dist/adaptercloud/hooks/index.d.ts.map +1 -1
  12. package/dist/adaptercloud/hooks/useAdapterCloudApi.d.ts +28 -2
  13. package/dist/adaptercloud/hooks/useAdapterCloudApi.d.ts.map +1 -1
  14. package/dist/adaptercloud/hooks/useAdapterCloudApi.js +318 -291
  15. package/dist/adaptercloud/hooks/useAdapterCloudApi.js.map +1 -1
  16. package/dist/adaptercloud/hooks/useTr.d.ts +2 -0
  17. package/dist/adaptercloud/hooks/useTr.d.ts.map +1 -0
  18. package/dist/adaptercloud/hooks/useTr.js +14 -0
  19. package/dist/adaptercloud/hooks/useTr.js.map +1 -0
  20. package/dist/adaptercloud/pages/OverviewPage.d.ts.map +1 -1
  21. package/dist/adaptercloud/pages/OverviewPage.js +117 -120
  22. package/dist/adaptercloud/pages/OverviewPage.js.map +1 -1
  23. package/dist/adaptercloud/pages/adapters/AdaptersListPage.d.ts.map +1 -1
  24. package/dist/adaptercloud/pages/adapters/AdaptersListPage.js +6 -5
  25. package/dist/adaptercloud/pages/adapters/AdaptersListPage.js.map +1 -1
  26. package/dist/adaptercloud/pages/connections/ConnectionDetailPage.d.ts.map +1 -1
  27. package/dist/adaptercloud/pages/connections/ConnectionDetailPage.js +217 -104
  28. package/dist/adaptercloud/pages/connections/ConnectionDetailPage.js.map +1 -1
  29. package/dist/adaptercloud/pages/connections/ConnectionsListPage.d.ts.map +1 -1
  30. package/dist/adaptercloud/pages/connections/ConnectionsListPage.js +6 -5
  31. package/dist/adaptercloud/pages/connections/ConnectionsListPage.js.map +1 -1
  32. package/dist/adaptercloud/pages/costs/CostsPage.d.ts.map +1 -1
  33. package/dist/adaptercloud/pages/costs/CostsPage.js +183 -156
  34. package/dist/adaptercloud/pages/costs/CostsPage.js.map +1 -1
  35. package/dist/adaptercloud/pages/drift/DriftListPage.d.ts.map +1 -1
  36. package/dist/adaptercloud/pages/drift/DriftListPage.js +108 -107
  37. package/dist/adaptercloud/pages/drift/DriftListPage.js.map +1 -1
  38. package/dist/adaptercloud/pages/policies/PoliciesListPage.d.ts.map +1 -1
  39. package/dist/adaptercloud/pages/policies/PoliciesListPage.js +141 -131
  40. package/dist/adaptercloud/pages/policies/PoliciesListPage.js.map +1 -1
  41. package/dist/adaptercloud/pages/policies/PolicyDetailPage.d.ts.map +1 -1
  42. package/dist/adaptercloud/pages/policies/PolicyDetailPage.js +171 -117
  43. package/dist/adaptercloud/pages/policies/PolicyDetailPage.js.map +1 -1
  44. package/dist/adaptercloud/pages/resources/ResourcesListPage.d.ts.map +1 -1
  45. package/dist/adaptercloud/pages/resources/ResourcesListPage.js +85 -66
  46. package/dist/adaptercloud/pages/resources/ResourcesListPage.js.map +1 -1
  47. package/dist/adaptercloud/pages/sync-runs/SyncRunsListPage.d.ts.map +1 -1
  48. package/dist/adaptercloud/pages/sync-runs/SyncRunsListPage.js +148 -121
  49. package/dist/adaptercloud/pages/sync-runs/SyncRunsListPage.js.map +1 -1
  50. package/dist/adaptercloud/pages/violations/ViolationsListPage.d.ts.map +1 -1
  51. package/dist/adaptercloud/pages/violations/ViolationsListPage.js +145 -144
  52. package/dist/adaptercloud/pages/violations/ViolationsListPage.js.map +1 -1
  53. package/dist/utils/pageContext.d.ts +0 -2
  54. package/dist/utils/pageContext.d.ts.map +1 -1
  55. package/dist/utils/pageContext.js +1 -3
  56. package/dist/utils/pageContext.js.map +1 -1
  57. package/package.json +1 -1
@@ -1,91 +1,98 @@
1
- import { useAdapterCloud as e } from "../context/AdapterCloudContext.js";
1
+ import { useTr as e } from "./useTr.js";
2
+ import { useAdapterCloud as t } from "../context/AdapterCloudContext.js";
2
3
  import "../context/index.js";
3
- import { notify as t } from "../lib/toast.js";
4
- import { useMutation as n, useQuery as r, useQueryClient as i } from "@tanstack/react-query";
5
- import { graphqlFetch as a } from "@burdenoff/fe-libs/shared/graphql";
6
- import { clearGraphqlFetchResponseCache as o } from "@burdenoff/fe-libs/shared/graphql/fetch";
4
+ import { notify as n } from "../lib/toast.js";
5
+ import { useMutation as r, useQuery as i, useQueryClient as a } from "@tanstack/react-query";
6
+ import { graphqlFetch as o } from "@burdenoff/fe-libs/shared/graphql";
7
+ import { clearGraphqlFetchResponseCache as s } from "@burdenoff/fe-libs/shared/graphql/fetch";
7
8
  //#region src/adaptercloud/hooks/useAdapterCloudApi.ts
8
- var s = {
9
+ var c = {
9
10
  all: ["adaptercloud"],
10
- health: () => [...s.all, "health"],
11
+ health: () => [...c.all, "health"],
11
12
  costSummary: (e) => [
12
- ...s.all,
13
+ ...c.all,
13
14
  "cost-summary",
14
15
  e ?? null
15
16
  ],
16
17
  costRecords: (e) => [
17
- ...s.all,
18
+ ...c.all,
18
19
  "cost-records",
19
20
  e
20
21
  ],
21
22
  adapters: (e) => [
22
- ...s.all,
23
+ ...c.all,
23
24
  "adapters",
24
25
  e
25
26
  ],
26
27
  adapter: (e) => [
27
- ...s.all,
28
+ ...c.all,
28
29
  "adapter",
29
30
  e
30
31
  ],
31
32
  connections: (e) => [
32
- ...s.all,
33
+ ...c.all,
33
34
  "connections",
34
35
  e
35
36
  ],
36
37
  connection: (e) => [
37
- ...s.all,
38
+ ...c.all,
38
39
  "connection",
39
40
  e
40
41
  ],
41
42
  resources: (e) => [
42
- ...s.all,
43
+ ...c.all,
43
44
  "resources",
44
45
  e
45
46
  ],
46
47
  resource: (e) => [
47
- ...s.all,
48
+ ...c.all,
48
49
  "resource",
49
50
  e
50
51
  ],
51
52
  policies: (e) => [
52
- ...s.all,
53
+ ...c.all,
53
54
  "policies",
54
55
  e
55
56
  ],
56
57
  policy: (e) => [
57
- ...s.all,
58
+ ...c.all,
58
59
  "policy",
59
60
  e
60
61
  ],
61
62
  violations: (e) => [
62
- ...s.all,
63
+ ...c.all,
63
64
  "violations",
64
65
  e
65
66
  ],
66
67
  drift: (e) => [
67
- ...s.all,
68
+ ...c.all,
68
69
  "drift",
69
70
  e
70
71
  ],
72
+ driftCount: (e) => [
73
+ ...c.all,
74
+ "drift",
75
+ "count",
76
+ e ?? null
77
+ ],
71
78
  syncRuns: (e) => [
72
- ...s.all,
79
+ ...c.all,
73
80
  "sync-runs",
74
81
  e
75
82
  ],
76
83
  syncRun: (e) => [
77
- ...s.all,
84
+ ...c.all,
78
85
  "sync-run",
79
86
  e
80
87
  ],
81
88
  topology: (e) => [
82
- ...s.all,
89
+ ...c.all,
83
90
  "topology",
84
91
  e
85
92
  ],
86
- topologyResources: () => [...s.all, "topology-resources"]
87
- }, c = async (e, t, n) => {
88
- let r = await a({
93
+ topologyResources: () => [...c.all, "topology-resources"]
94
+ }, l = async (e, t, n) => {
95
+ let r = await o({
89
96
  gateway: "workspace",
90
97
  baseUrl: n,
91
98
  query: e,
@@ -94,360 +101,380 @@ var s = {
94
101
  });
95
102
  if (r.errors?.length) throw Error(r.errors[0]?.message ?? "GraphQL request failed");
96
103
  if (!r.data) throw Error("GraphQL response did not include data");
97
- return /^\s*mutation\b/.test(e) && o(), r.data;
98
- }, l = 30 * 1e3, u = "\n id name slug kind status vendor version description capabilities tags\n configSchema workspaceId createdAt updatedAt\n", d = "\n id name adapterId authMethod status environment region resourceCount\n secretRef targetRef config tags lastError lastSyncedAt workspaceId createdAt updatedAt\n", f = "\n id connectionId externalId resourceType name region state monthlyCost\n providerTags attributes tags lastSeenAt workspaceId createdAt updatedAt\n", p = "\n id name description kind enforcement severity expression appliesTo isActive\n tags workspaceId createdAt updatedAt\n", m = "\n id policyId resourceId message status severity evidence waiverReason\n detectedAt resolvedAt resolvedById workspaceId createdAt updatedAt\n", h = "\n id resourceId attributePath expectedValue observedValue severity status\n detectedAt remediatedAt workspaceId createdAt updatedAt\n", g = "\n id connectionId kind status discoveredCount reconciledCount driftCount\n violationCount error summary startedAt finishedAt workspaceId createdAt updatedAt\n", _ = "cursor hasMore totalCount", v = (t = {}) => {
99
- let { apiGatewayUrl: n } = e();
100
- return r({
101
- queryKey: s.adapters(t),
102
- queryFn: async () => (await c(`query AdaListAdapters($kind: AdaAdapterKind, $status: AdaAdapterStatus, $pagination: PaginationInput) {
104
+ return /^\s*mutation\b/.test(e) && s(), r.data;
105
+ }, u = 30 * 1e3, d = "\n id name slug kind status vendor version description capabilities tags\n configSchema workspaceId createdAt updatedAt\n", f = "\n id name adapterId authMethod status environment region resourceCount\n secretRef targetRef config tags lastError lastSyncedAt workspaceId createdAt updatedAt\n", p = "\n id connectionId externalId resourceType name region state monthlyCost\n providerTags attributes tags lastSeenAt workspaceId createdAt updatedAt\n", m = "\n id name description kind enforcement severity expression appliesTo isActive\n tags workspaceId createdAt updatedAt\n", h = "\n id policyId resourceId message status severity evidence waiverReason\n detectedAt resolvedAt resolvedById workspaceId createdAt updatedAt\n", g = "\n id resourceId attributePath expectedValue observedValue severity status\n detectedAt remediatedAt workspaceId createdAt updatedAt\n", _ = "\n id connectionId kind status discoveredCount reconciledCount driftCount\n violationCount error summary startedAt finishedAt workspaceId createdAt updatedAt\n", v = "cursor hasMore totalCount", y = (e = {}) => {
106
+ let { apiGatewayUrl: n } = t();
107
+ return i({
108
+ queryKey: c.adapters(e),
109
+ queryFn: async () => (await l(`query AdaListAdapters($kind: AdaAdapterKind, $status: AdaAdapterStatus, $pagination: PaginationInput) {
103
110
  adaListAdapters(kind: $kind, status: $status, pagination: $pagination) {
104
- items { ${u} }
105
- pageInfo { ${_} }
111
+ items { ${d} }
112
+ pageInfo { ${v} }
106
113
  }
107
114
  }`, {
108
- kind: t.kind,
109
- status: t.status,
110
- pagination: t.pagination
115
+ kind: e.kind,
116
+ status: e.status,
117
+ pagination: e.pagination
111
118
  }, n)).adaListAdapters,
112
119
  placeholderData: (e) => e,
113
- staleTime: l
120
+ staleTime: u
114
121
  });
115
- }, y = (t) => {
116
- let { apiGatewayUrl: n } = e();
117
- return r({
118
- queryKey: s.adapter(t ?? ""),
119
- queryFn: async () => (await c(`query AdaAdapter($id: ID!) {
122
+ }, b = (e) => {
123
+ let { apiGatewayUrl: n } = t();
124
+ return i({
125
+ queryKey: c.adapter(e ?? ""),
126
+ queryFn: async () => (await l(`query AdaAdapter($id: ID!) {
120
127
  adaAdapter(id: $id) {
121
- ${u}
122
- connections { ${d} }
128
+ ${d}
129
+ connections { ${f} }
123
130
  }
124
- }`, { id: t }, n)).adaAdapter,
125
- enabled: !!t,
126
- staleTime: l
131
+ }`, { id: e }, n)).adaAdapter,
132
+ enabled: !!e,
133
+ staleTime: u
127
134
  });
128
- }, b = () => {
129
- let t = i(), { apiGatewayUrl: r } = e();
130
- return n({
131
- mutationFn: async (e) => (await c(`mutation AdaCreateAdapter($input: AdaCreateAdapterInput!) {
132
- adaCreateAdapter(input: $input) { ${u} }
133
- }`, { input: e }, r)).adaCreateAdapter,
135
+ }, x = () => {
136
+ let e = a(), { apiGatewayUrl: n } = t();
137
+ return r({
138
+ mutationFn: async (e) => (await l(`mutation AdaCreateAdapter($input: AdaCreateAdapterInput!) {
139
+ adaCreateAdapter(input: $input) { ${d} }
140
+ }`, { input: e }, n)).adaCreateAdapter,
134
141
  onSuccess: () => {
135
- t.invalidateQueries({ queryKey: [...s.all, "adapters"] });
142
+ e.invalidateQueries({ queryKey: [...c.all, "adapters"] });
136
143
  }
137
144
  });
138
- }, x = () => {
139
- let t = i(), { apiGatewayUrl: r } = e();
140
- return n({
141
- mutationFn: async ({ id: e, input: t }) => (await c(`mutation AdaUpdateAdapter($id: ID!, $input: AdaUpdateAdapterInput!) {
142
- adaUpdateAdapter(id: $id, input: $input) { ${u} }
145
+ }, S = () => {
146
+ let e = a(), { apiGatewayUrl: n } = t();
147
+ return r({
148
+ mutationFn: async ({ id: e, input: t }) => (await l(`mutation AdaUpdateAdapter($id: ID!, $input: AdaUpdateAdapterInput!) {
149
+ adaUpdateAdapter(id: $id, input: $input) { ${d} }
143
150
  }`, {
144
151
  id: e,
145
152
  input: t
146
- }, r)).adaUpdateAdapter,
147
- onSuccess: (e) => {
148
- t.invalidateQueries({ queryKey: [...s.all, "adapters"] }), t.invalidateQueries({ queryKey: s.adapter(e.id) });
153
+ }, n)).adaUpdateAdapter,
154
+ onSuccess: (t) => {
155
+ e.invalidateQueries({ queryKey: [...c.all, "adapters"] }), e.invalidateQueries({ queryKey: c.adapter(t.id) });
149
156
  }
150
157
  });
151
- }, S = () => {
152
- let t = i(), { apiGatewayUrl: r } = e();
153
- return n({
154
- mutationFn: async (e) => (await c("mutation AdaArchiveAdapter($id: ID!) { adaArchiveAdapter(id: $id) }", { id: e }, r)).adaArchiveAdapter,
158
+ }, C = () => {
159
+ let e = a(), { apiGatewayUrl: n } = t();
160
+ return r({
161
+ mutationFn: async (e) => (await l("mutation AdaArchiveAdapter($id: ID!) { adaArchiveAdapter(id: $id) }", { id: e }, n)).adaArchiveAdapter,
155
162
  onSuccess: () => {
156
- t.invalidateQueries({ queryKey: [...s.all, "adapters"] });
163
+ e.invalidateQueries({ queryKey: [...c.all, "adapters"] });
157
164
  }
158
165
  });
159
- }, C = (t = {}) => {
160
- let { apiGatewayUrl: n } = e();
161
- return r({
162
- queryKey: s.connections(t),
163
- queryFn: async () => (await c(`query AdaListConnections($adapterId: ID, $status: AdaConnectionStatus, $pagination: PaginationInput) {
166
+ }, w = (e = {}) => {
167
+ let { apiGatewayUrl: n } = t();
168
+ return i({
169
+ queryKey: c.connections(e),
170
+ queryFn: async () => (await l(`query AdaListConnections($adapterId: ID, $status: AdaConnectionStatus, $pagination: PaginationInput) {
164
171
  adaListConnections(adapterId: $adapterId, status: $status, pagination: $pagination) {
165
172
  items {
166
- ${d}
173
+ ${f}
167
174
  adapter { id name slug kind }
168
175
  }
169
- pageInfo { ${_} }
176
+ pageInfo { ${v} }
170
177
  }
171
178
  }`, {
172
- adapterId: t.adapterId,
173
- status: t.status,
174
- pagination: t.pagination
179
+ adapterId: e.adapterId,
180
+ status: e.status,
181
+ pagination: e.pagination
175
182
  }, n)).adaListConnections,
176
183
  placeholderData: (e) => e,
177
- staleTime: l
184
+ staleTime: u
178
185
  });
179
- }, w = (t) => {
180
- let { apiGatewayUrl: n } = e();
181
- return r({
182
- queryKey: s.connection(t ?? ""),
183
- queryFn: async () => (await c(`query AdaConnection($id: ID!) {
186
+ }, T = (e) => {
187
+ let { apiGatewayUrl: n } = t();
188
+ return i({
189
+ queryKey: c.connection(e ?? ""),
190
+ queryFn: async () => (await l(`query AdaConnection($id: ID!) {
184
191
  adaConnection(id: $id) {
185
- ${d}
186
- adapter { ${u} }
187
- resources { ${f} }
192
+ ${f}
193
+ adapter { ${d} }
194
+ resources { ${p} }
188
195
  }
189
- }`, { id: t }, n)).adaConnection,
190
- enabled: !!t,
191
- staleTime: l
196
+ }`, { id: e }, n)).adaConnection,
197
+ enabled: !!e,
198
+ staleTime: u
192
199
  });
193
- }, T = () => {
194
- let t = i(), { apiGatewayUrl: r } = e();
195
- return n({
196
- mutationFn: async (e) => (await c(`mutation AdaCreateConnection($input: AdaCreateConnectionInput!) {
197
- adaCreateConnection(input: $input) { ${d} }
198
- }`, { input: e }, r)).adaCreateConnection,
200
+ }, E = () => {
201
+ let e = a(), { apiGatewayUrl: n } = t();
202
+ return r({
203
+ mutationFn: async (e) => (await l(`mutation AdaCreateConnection($input: AdaCreateConnectionInput!) {
204
+ adaCreateConnection(input: $input) { ${f} }
205
+ }`, { input: e }, n)).adaCreateConnection,
199
206
  onSuccess: () => {
200
- t.invalidateQueries({ queryKey: [...s.all, "connections"] });
207
+ e.invalidateQueries({ queryKey: [...c.all, "connections"] });
201
208
  }
202
209
  });
203
- }, E = () => {
204
- let t = i(), { apiGatewayUrl: r } = e();
205
- return n({
206
- mutationFn: async ({ id: e, input: t }) => (await c(`mutation AdaUpdateConnection($id: ID!, $input: AdaUpdateConnectionInput!) {
207
- adaUpdateConnection(id: $id, input: $input) { ${d} }
210
+ }, D = () => {
211
+ let e = a(), { apiGatewayUrl: n } = t();
212
+ return r({
213
+ mutationFn: async ({ id: e, input: t }) => (await l(`mutation AdaUpdateConnection($id: ID!, $input: AdaUpdateConnectionInput!) {
214
+ adaUpdateConnection(id: $id, input: $input) { ${f} }
208
215
  }`, {
209
216
  id: e,
210
217
  input: t
211
- }, r)).adaUpdateConnection,
212
- onSuccess: (e) => {
213
- t.invalidateQueries({ queryKey: [...s.all, "connections"] }), t.invalidateQueries({ queryKey: s.connection(e.id) });
218
+ }, n)).adaUpdateConnection,
219
+ onSuccess: (t) => {
220
+ e.invalidateQueries({ queryKey: [...c.all, "connections"] }), e.invalidateQueries({ queryKey: c.connection(t.id) });
214
221
  }
215
222
  });
216
- }, D = () => {
217
- let r = i(), { apiGatewayUrl: a } = e();
218
- return n({
219
- mutationFn: async ({ id: e, status: t }) => (await c(`mutation AdaSetConnectionStatus($id: ID!, $status: AdaConnectionStatus!) {
220
- adaSetConnectionStatus(id: $id, status: $status) { ${d} }
223
+ }, O = () => {
224
+ let i = a(), { apiGatewayUrl: o } = t(), s = e();
225
+ return r({
226
+ mutationFn: async ({ id: e, status: t }) => (await l(`mutation AdaSetConnectionStatus($id: ID!, $status: AdaConnectionStatus!) {
227
+ adaSetConnectionStatus(id: $id, status: $status) { ${f} }
221
228
  }`, {
222
229
  id: e,
223
230
  status: t
224
- }, a)).adaSetConnectionStatus,
231
+ }, o)).adaSetConnectionStatus,
225
232
  onSuccess: (e) => {
226
- t.success("Connection health updated"), r.invalidateQueries({ queryKey: [...s.all, "connections"] }), r.invalidateQueries({ queryKey: s.connection(e.id) });
233
+ n.success(s("adaptercloud.toast.connectionHealthUpdated", "Connection health updated")), i.invalidateQueries({ queryKey: [...c.all, "connections"] }), i.invalidateQueries({ queryKey: c.connection(e.id) });
227
234
  }
228
235
  });
229
- }, O = () => {
230
- let r = i(), { apiGatewayUrl: a } = e();
231
- return n({
232
- mutationFn: async (e) => (await c(`mutation AdaDisableConnection($id: ID!) {
233
- adaDisableConnection(id: $id) { ${d} }
234
- }`, { id: e }, a)).adaDisableConnection,
236
+ }, k = () => {
237
+ let i = a(), { apiGatewayUrl: o } = t(), s = e();
238
+ return r({
239
+ mutationFn: async (e) => (await l(`mutation AdaDisableConnection($id: ID!) {
240
+ adaDisableConnection(id: $id) { ${f} }
241
+ }`, { id: e }, o)).adaDisableConnection,
235
242
  onSuccess: (e) => {
236
- t.success("Connection disabled"), r.invalidateQueries({ queryKey: [...s.all, "connections"] }), r.invalidateQueries({ queryKey: s.connection(e.id) });
243
+ n.success(s("adaptercloud.toast.connectionDisabled", "Connection disabled")), i.invalidateQueries({ queryKey: [...c.all, "connections"] }), i.invalidateQueries({ queryKey: c.connection(e.id) });
237
244
  }
238
245
  });
239
- }, k = (t = {}) => {
240
- let { apiGatewayUrl: n } = e();
241
- return r({
242
- queryKey: s.resources(t),
243
- queryFn: async () => (await c(`query AdaListResources($connectionId: ID, $resourceType: String, $state: AdaResourceState, $pagination: PaginationInput) {
246
+ }, A = (e = {}) => {
247
+ let { apiGatewayUrl: n } = t();
248
+ return i({
249
+ queryKey: c.resources(e),
250
+ queryFn: async () => (await l(`query AdaListResources($connectionId: ID, $resourceType: String, $state: AdaResourceState, $pagination: PaginationInput) {
244
251
  adaListResources(connectionId: $connectionId, resourceType: $resourceType, state: $state, pagination: $pagination) {
245
252
  items {
246
- ${f}
253
+ ${p}
247
254
  connection { id name }
248
255
  }
249
- pageInfo { ${_} }
256
+ pageInfo { ${v} }
250
257
  }
251
258
  }`, {
252
- connectionId: t.connectionId,
253
- resourceType: t.resourceType,
254
- state: t.state,
255
- pagination: t.pagination
259
+ connectionId: e.connectionId,
260
+ resourceType: e.resourceType,
261
+ state: e.state,
262
+ pagination: e.pagination
256
263
  }, n)).adaListResources,
257
264
  placeholderData: (e) => e,
258
- staleTime: l
265
+ staleTime: u
259
266
  });
260
- }, A = (t) => {
261
- let { apiGatewayUrl: n } = e();
262
- return r({
263
- queryKey: s.resource(t ?? ""),
264
- queryFn: async () => (await c(`query AdaResource($id: ID!) {
267
+ }, j = (e) => {
268
+ let { apiGatewayUrl: n } = t();
269
+ return i({
270
+ queryKey: c.resource(e ?? ""),
271
+ queryFn: async () => (await l(`query AdaResource($id: ID!) {
265
272
  adaResource(id: $id) {
266
- ${f}
267
- connection { ${d} adapter { id name slug kind } }
273
+ ${p}
274
+ connection { ${f} adapter { id name slug kind } }
268
275
  dependsOn { id name resourceType region state monthlyCost }
269
276
  }
270
- }`, { id: t }, n)).adaResource,
271
- enabled: !!t,
272
- staleTime: l
277
+ }`, { id: e }, n)).adaResource,
278
+ enabled: !!e,
279
+ staleTime: u
273
280
  });
274
- }, j = (t = {}) => {
275
- let { apiGatewayUrl: n } = e();
276
- return r({
277
- queryKey: s.policies(t),
278
- queryFn: async () => (await c(`query AdaListPolicies($isActive: Boolean, $kind: AdaPolicyKind, $pagination: PaginationInput) {
281
+ }, M = (e = {}) => {
282
+ let { apiGatewayUrl: n } = t();
283
+ return i({
284
+ queryKey: c.policies(e),
285
+ queryFn: async () => (await l(`query AdaListPolicies($isActive: Boolean, $kind: AdaPolicyKind, $pagination: PaginationInput) {
279
286
  adaListPolicies(isActive: $isActive, kind: $kind, pagination: $pagination) {
280
- items { ${p} }
287
+ items { ${m} }
281
288
  pageInfo { cursor hasMore }
282
289
  }
283
290
  }`, {
284
- isActive: t.isActive,
285
- kind: t.kind,
286
- pagination: t.pagination
291
+ isActive: e.isActive,
292
+ kind: e.kind,
293
+ pagination: e.pagination
287
294
  }, n)).adaListPolicies,
288
295
  placeholderData: (e) => e,
289
- staleTime: l
296
+ staleTime: u
290
297
  });
291
- }, M = (t) => {
292
- let { apiGatewayUrl: n } = e();
293
- return r({
294
- queryKey: s.policy(t ?? ""),
295
- queryFn: async () => (await c(`query AdaPolicy($id: ID!) {
298
+ }, N = (e) => {
299
+ let { apiGatewayUrl: n } = t();
300
+ return i({
301
+ queryKey: c.policy(e ?? ""),
302
+ queryFn: async () => (await l(`query AdaPolicy($id: ID!) {
296
303
  adaPolicy(id: $id) {
297
- ${p}
298
- violations { ${m} }
304
+ ${m}
305
+ violations { ${h} }
299
306
  }
300
- }`, { id: t }, n)).adaPolicy,
301
- enabled: !!t,
302
- staleTime: l
307
+ }`, { id: e }, n)).adaPolicy,
308
+ enabled: !!e,
309
+ staleTime: u
303
310
  });
304
- }, N = () => {
305
- let t = i(), { apiGatewayUrl: r } = e();
306
- return n({
307
- mutationFn: async (e) => (await c(`mutation AdaCreatePolicy($input: AdaCreatePolicyInput!) {
308
- adaCreatePolicy(input: $input) { ${p} }
309
- }`, { input: e }, r)).adaCreatePolicy,
311
+ }, P = () => {
312
+ let e = a(), { apiGatewayUrl: n } = t();
313
+ return r({
314
+ mutationFn: async (e) => (await l(`mutation AdaCreatePolicy($input: AdaCreatePolicyInput!) {
315
+ adaCreatePolicy(input: $input) { ${m} }
316
+ }`, { input: e }, n)).adaCreatePolicy,
310
317
  onSuccess: () => {
311
- t.invalidateQueries({ queryKey: [...s.all, "policies"] });
318
+ e.invalidateQueries({ queryKey: [...c.all, "policies"] });
312
319
  }
313
320
  });
314
- }, P = () => {
315
- let r = i(), { apiGatewayUrl: a } = e();
316
- return n({
317
- mutationFn: async ({ id: e, input: t }) => (await c(`mutation AdaUpdatePolicy($id: ID!, $input: AdaUpdatePolicyInput!) {
318
- adaUpdatePolicy(id: $id, input: $input) { ${p} }
321
+ }, F = () => {
322
+ let i = a(), { apiGatewayUrl: o } = t(), s = e();
323
+ return r({
324
+ mutationFn: async ({ id: e, input: t }) => (await l(`mutation AdaUpdatePolicy($id: ID!, $input: AdaUpdatePolicyInput!) {
325
+ adaUpdatePolicy(id: $id, input: $input) { ${m} }
319
326
  }`, {
320
327
  id: e,
321
328
  input: t
322
- }, a)).adaUpdatePolicy,
329
+ }, o)).adaUpdatePolicy,
323
330
  onSuccess: (e) => {
324
- t.success("Policy updated"), r.invalidateQueries({ queryKey: [...s.all, "policies"] }), r.invalidateQueries({ queryKey: s.policy(e.id) });
331
+ n.success(s("adaptercloud.toast.policyUpdated", "Policy updated")), i.invalidateQueries({ queryKey: [...c.all, "policies"] }), i.invalidateQueries({ queryKey: c.policy(e.id) });
325
332
  }
326
333
  });
327
- }, F = () => {
328
- let t = i(), { apiGatewayUrl: r } = e();
329
- return n({
330
- mutationFn: async (e) => (await c("mutation AdaArchivePolicy($id: ID!) { adaArchivePolicy(id: $id) }", { id: e }, r)).adaArchivePolicy,
334
+ }, I = () => {
335
+ let e = a(), { apiGatewayUrl: n } = t();
336
+ return r({
337
+ mutationFn: async (e) => (await l("mutation AdaArchivePolicy($id: ID!) { adaArchivePolicy(id: $id) }", { id: e }, n)).adaArchivePolicy,
331
338
  onSuccess: () => {
332
- t.invalidateQueries({ queryKey: [...s.all, "policies"] });
339
+ e.invalidateQueries({ queryKey: [...c.all, "policies"] });
333
340
  }
334
341
  });
335
- }, I = (t = {}) => {
336
- let { apiGatewayUrl: n } = e();
337
- return r({
338
- queryKey: s.violations(t),
339
- queryFn: async () => (await c(`query AdaListViolations($policyId: ID, $resourceId: ID, $status: AdaViolationStatus, $pagination: PaginationInput) {
342
+ }, L = (e = {}, n = {}) => {
343
+ let { apiGatewayUrl: r } = t();
344
+ return i({
345
+ enabled: n.enabled ?? !0,
346
+ queryKey: c.violations(e),
347
+ queryFn: async () => (await l(`query AdaListViolations($policyId: ID, $resourceId: ID, $status: AdaViolationStatus, $pagination: PaginationInput) {
340
348
  adaListViolations(policyId: $policyId, resourceId: $resourceId, status: $status, pagination: $pagination) {
341
349
  items {
342
- ${m}
350
+ ${h}
343
351
  policy { id name kind severity }
344
352
  }
345
- pageInfo { ${_} }
353
+ pageInfo { ${v} }
346
354
  }
347
355
  }`, {
348
- policyId: t.policyId,
349
- resourceId: t.resourceId,
350
- status: t.status,
351
- pagination: t.pagination
352
- }, n)).adaListViolations,
356
+ policyId: e.policyId,
357
+ resourceId: e.resourceId,
358
+ status: e.status,
359
+ pagination: e.pagination
360
+ }, r)).adaListViolations,
353
361
  placeholderData: (e) => e,
354
- staleTime: l
362
+ staleTime: u
355
363
  });
356
- }, L = () => {
357
- let r = i(), { apiGatewayUrl: a } = e();
358
- return n({
359
- mutationFn: async ({ id: e, status: t, waiverReason: n }) => (await c(`mutation AdaResolveViolation($id: ID!, $status: AdaViolationStatus!, $waiverReason: String) {
364
+ }, R = () => {
365
+ let i = a(), { apiGatewayUrl: o } = t(), s = e();
366
+ return r({
367
+ mutationFn: async ({ id: e, status: t, waiverReason: n }) => (await l(`mutation AdaResolveViolation($id: ID!, $status: AdaViolationStatus!, $waiverReason: String) {
360
368
  adaResolveViolation(id: $id, status: $status, waiverReason: $waiverReason) {
361
- ${m}
369
+ ${h}
362
370
  }
363
371
  }`, {
364
372
  id: e,
365
373
  status: t,
366
374
  waiverReason: n
367
- }, a)).adaResolveViolation,
375
+ }, o)).adaResolveViolation,
368
376
  onSuccess: (e) => {
369
- t.success({
370
- ACKNOWLEDGED: "Violation acknowledged",
371
- RESOLVED: "Violation resolved",
372
- WAIVED: "Violation waived",
373
- OPEN: "Violation reopened"
374
- }[e.status] ?? "Violation updated"), r.invalidateQueries({ queryKey: [...s.all, "violations"] });
377
+ let t = {
378
+ ACKNOWLEDGED: s("adaptercloud.toast.violationAcknowledged", "Violation acknowledged"),
379
+ RESOLVED: s("adaptercloud.toast.violationResolved", "Violation resolved"),
380
+ WAIVED: s("adaptercloud.toast.violationWaived", "Violation waived"),
381
+ OPEN: s("adaptercloud.toast.violationReopened", "Violation reopened")
382
+ };
383
+ n.success(t[e.status] ?? s("adaptercloud.toast.violationUpdated", "Violation updated")), i.invalidateQueries({ queryKey: [...c.all, "violations"] });
375
384
  }
376
385
  });
377
- }, R = (t = {}) => {
378
- let { apiGatewayUrl: n } = e();
379
- return r({
380
- queryKey: s.drift(t),
381
- queryFn: async () => (await c(`query AdaListDriftRecords($resourceId: ID, $status: AdaDriftStatus, $pagination: PaginationInput) {
386
+ }, z = (e = {}) => {
387
+ let { apiGatewayUrl: n } = t();
388
+ return i({
389
+ queryKey: c.drift(e),
390
+ queryFn: async () => (await l(`query AdaListDriftRecords($resourceId: ID, $status: AdaDriftStatus, $pagination: PaginationInput) {
382
391
  adaListDriftRecords(resourceId: $resourceId, status: $status, pagination: $pagination) {
383
- items { ${h} }
384
- pageInfo { ${_} }
392
+ items { ${g} }
393
+ pageInfo { ${v} }
385
394
  }
386
395
  }`, {
387
- resourceId: t.resourceId,
388
- status: t.status,
396
+ resourceId: e.resourceId,
397
+ status: e.status,
389
398
  pagination: { limit: 100 }
390
399
  }, n)).adaListDriftRecords.items,
391
- staleTime: l
400
+ staleTime: u
401
+ });
402
+ }, B = (e) => {
403
+ let { apiGatewayUrl: n } = t();
404
+ return i({
405
+ queryKey: c.driftCount(e),
406
+ queryFn: async () => (await l(`query AdaCountDriftRecords($status: AdaDriftStatus, $pagination: PaginationInput) {
407
+ adaListDriftRecords(status: $status, pagination: $pagination) {
408
+ pageInfo { ${v} }
409
+ }
410
+ }`, {
411
+ status: e,
412
+ pagination: {
413
+ limit: 1,
414
+ offset: 0
415
+ }
416
+ }, n)).adaListDriftRecords.pageInfo.totalCount ?? null,
417
+ staleTime: u
392
418
  });
393
- }, z = () => {
394
- let r = i(), { apiGatewayUrl: a } = e();
395
- return n({
396
- mutationFn: async (e) => (await c(`mutation AdaRemediateDrift($id: ID!) {
397
- adaRemediateDrift(id: $id) { ${h} }
398
- }`, { id: e }, a)).adaRemediateDrift,
419
+ }, V = () => {
420
+ let i = a(), { apiGatewayUrl: o } = t(), s = e();
421
+ return r({
422
+ mutationFn: async (e) => (await l(`mutation AdaRemediateDrift($id: ID!) {
423
+ adaRemediateDrift(id: $id) { ${g} }
424
+ }`, { id: e }, o)).adaRemediateDrift,
399
425
  onSuccess: () => {
400
- t.success("Drift marked remediated"), r.invalidateQueries({ queryKey: [...s.all, "drift"] }), r.invalidateQueries({ queryKey: [...s.all, "resources"] });
426
+ n.success(s("adaptercloud.toast.driftRemediated", "Drift marked remediated")), i.invalidateQueries({ queryKey: [...c.all, "drift"] }), i.invalidateQueries({ queryKey: [...c.all, "resources"] });
401
427
  }
402
428
  });
403
- }, B = (t = {}) => {
404
- let { apiGatewayUrl: n } = e();
405
- return r({
406
- queryKey: s.syncRuns(t),
407
- queryFn: async () => (await c(`query AdaListSyncRuns($connectionId: ID, $status: AdaSyncStatus, $pagination: PaginationInput) {
429
+ }, H = (e = {}, n = {}) => {
430
+ let { apiGatewayUrl: r } = t();
431
+ return i({
432
+ enabled: n.enabled ?? !0,
433
+ queryKey: c.syncRuns(e),
434
+ queryFn: async () => (await l(`query AdaListSyncRuns($connectionId: ID, $status: AdaSyncStatus, $pagination: PaginationInput) {
408
435
  adaListSyncRuns(connectionId: $connectionId, status: $status, pagination: $pagination) {
409
436
  items {
410
- ${g}
437
+ ${_}
411
438
  connection { id name adapter { id kind } }
412
439
  }
413
- pageInfo { ${_} }
440
+ pageInfo { ${v} }
414
441
  }
415
442
  }`, {
416
- connectionId: t.connectionId,
417
- status: t.status,
418
- pagination: t.pagination
419
- }, n)).adaListSyncRuns,
443
+ connectionId: e.connectionId,
444
+ status: e.status,
445
+ pagination: e.pagination
446
+ }, r)).adaListSyncRuns,
420
447
  placeholderData: (e) => e,
421
- staleTime: l
448
+ staleTime: u
422
449
  });
423
- }, V = () => {
424
- let r = i(), { apiGatewayUrl: a } = e();
425
- return n({
426
- mutationFn: async (e) => (await c(`mutation AdaStartSyncRun($input: AdaStartSyncRunInput!) {
427
- adaStartSyncRun(input: $input) { ${g} }
428
- }`, { input: e }, a)).adaStartSyncRun,
450
+ }, U = () => {
451
+ let i = a(), { apiGatewayUrl: o } = t(), s = e();
452
+ return r({
453
+ mutationFn: async (e) => (await l(`mutation AdaStartSyncRun($input: AdaStartSyncRunInput!) {
454
+ adaStartSyncRun(input: $input) { ${_} }
455
+ }`, { input: e }, o)).adaStartSyncRun,
429
456
  onSuccess: () => {
430
- t.success("Sync run started"), r.invalidateQueries({ queryKey: [...s.all, "sync-runs"] }), r.invalidateQueries({ queryKey: [...s.all, "connections"] });
457
+ n.success(s("adaptercloud.toast.syncRunStarted", "Sync run started")), i.invalidateQueries({ queryKey: [...c.all, "sync-runs"] }), i.invalidateQueries({ queryKey: [...c.all, "connections"] });
431
458
  }
432
459
  });
433
- }, H = () => {
434
- let r = i(), { apiGatewayUrl: a } = e();
435
- return n({
436
- mutationFn: async (e) => (await c(`mutation AdaCancelSyncRun($id: ID!) {
437
- adaCancelSyncRun(id: $id) { ${g} }
438
- }`, { id: e }, a)).adaCancelSyncRun,
460
+ }, W = () => {
461
+ let i = a(), { apiGatewayUrl: o } = t(), s = e();
462
+ return r({
463
+ mutationFn: async (e) => (await l(`mutation AdaCancelSyncRun($id: ID!) {
464
+ adaCancelSyncRun(id: $id) { ${_} }
465
+ }`, { id: e }, o)).adaCancelSyncRun,
439
466
  onSuccess: () => {
440
- t.success("Sync run cancelled"), r.invalidateQueries({ queryKey: [...s.all, "sync-runs"] });
467
+ n.success(s("adaptercloud.toast.syncRunCancelled", "Sync run cancelled")), i.invalidateQueries({ queryKey: [...c.all, "sync-runs"] });
441
468
  }
442
469
  });
443
- }, U = (t) => {
444
- let { apiGatewayUrl: n } = e();
445
- return r({
446
- queryKey: s.costSummary(t),
447
- queryFn: async () => (await c("query AdaCostSummary($connectionId: ID) {\n adaCostSummary(connectionId: $connectionId) {\n currency total\n lines { service total }\n }\n }", { connectionId: t }, n)).adaCostSummary,
448
- staleTime: l
470
+ }, G = (e) => {
471
+ let { apiGatewayUrl: n } = t();
472
+ return i({
473
+ queryKey: c.costSummary(e),
474
+ queryFn: async () => (await l("query AdaCostSummary($connectionId: ID) {\n adaCostSummary(connectionId: $connectionId) {\n currency total\n lines { service total }\n }\n }", { connectionId: e }, n)).adaCostSummary,
475
+ staleTime: u
449
476
  });
450
- }, W = `query AdaListCostRecords($connectionId: ID, $resourceId: ID, $service: String, $pagination: PaginationInput) {
477
+ }, K = `query AdaListCostRecords($connectionId: ID, $resourceId: ID, $service: String, $pagination: PaginationInput) {
451
478
  adaListCostRecords(connectionId: $connectionId, resourceId: $resourceId, service: $service, pagination: $pagination) {
452
479
  items {
453
480
  id service amount currency periodStart periodEnd breakdown
@@ -455,86 +482,86 @@ var s = {
455
482
  resource { id name }
456
483
  connection { id name }
457
484
  }
458
- pageInfo { ${_} }
485
+ pageInfo { ${v} }
459
486
  }
460
- }`, G = (t = {}) => {
461
- let { apiGatewayUrl: n } = e();
462
- return r({
463
- queryKey: s.costRecords(t),
487
+ }`, q = (e = {}) => {
488
+ let { apiGatewayUrl: n } = t();
489
+ return i({
490
+ queryKey: c.costRecords(e),
464
491
  queryFn: async () => {
465
- let e = [], r = 0;
492
+ let t = [], r = 0;
466
493
  for (;;) {
467
- let i = (await c(W, {
468
- connectionId: t.connectionId,
469
- resourceId: t.resourceId,
470
- service: t.service,
494
+ let i = (await l(K, {
495
+ connectionId: e.connectionId,
496
+ resourceId: e.resourceId,
497
+ service: e.service,
471
498
  pagination: {
472
499
  limit: 100,
473
500
  offset: r
474
501
  }
475
502
  }, n)).adaListCostRecords;
476
- if (e.push(...i.items), !i.pageInfo.hasMore || i.items.length === 0) return e;
503
+ if (t.push(...i.items), !i.pageInfo.hasMore || i.items.length === 0) return t;
477
504
  r += i.items.length;
478
505
  }
479
506
  },
480
- staleTime: l
507
+ staleTime: u
481
508
  });
482
- }, K = 100, q = () => {
483
- let { apiGatewayUrl: t } = e();
484
- return r({
485
- queryKey: s.topologyResources(),
509
+ }, J = 100, Y = () => {
510
+ let { apiGatewayUrl: e } = t();
511
+ return i({
512
+ queryKey: c.topologyResources(),
486
513
  queryFn: async () => {
487
- let e = [], n = 0;
514
+ let t = [], n = 0;
488
515
  for (;;) {
489
- let r = (await c(`query AdaTopologyResources($pagination: PaginationInput) {
516
+ let r = (await l(`query AdaTopologyResources($pagination: PaginationInput) {
490
517
  adaListResources(pagination: $pagination) {
491
518
  items {
492
- ${f}
519
+ ${p}
493
520
  connection { id name }
494
521
  }
495
- pageInfo { ${_} }
522
+ pageInfo { ${v} }
496
523
  }
497
524
  }`, { pagination: {
498
- limit: K,
525
+ limit: J,
499
526
  offset: n
500
- } }, t)).adaListResources;
501
- if (e.push(...r.items), !r.pageInfo.hasMore || r.items.length === 0) return e;
527
+ } }, e)).adaListResources;
528
+ if (t.push(...r.items), !r.pageInfo.hasMore || r.items.length === 0) return t;
502
529
  n += r.items.length;
503
530
  }
504
531
  },
505
- staleTime: l
532
+ staleTime: u
506
533
  });
507
- }, J = (t = {}) => {
508
- let { apiGatewayUrl: n } = e();
509
- return r({
510
- queryKey: s.topology(t),
534
+ }, X = (e = {}) => {
535
+ let { apiGatewayUrl: n } = t();
536
+ return i({
537
+ queryKey: c.topology(e),
511
538
  queryFn: async () => {
512
- let e = [], r = 0;
539
+ let t = [], r = 0;
513
540
  for (;;) {
514
- let i = (await c(`query AdaListTopologyEdges($resourceId: ID, $kind: AdaEdgeKind, $pagination: PaginationInput) {
541
+ let i = (await l(`query AdaListTopologyEdges($resourceId: ID, $kind: AdaEdgeKind, $pagination: PaginationInput) {
515
542
  adaListTopologyEdges(resourceId: $resourceId, kind: $kind, pagination: $pagination) {
516
543
  items {
517
544
  id fromResourceId toResourceId kind bidirectional weight attributes
518
545
  workspaceId createdAt updatedAt
519
546
  }
520
- pageInfo { ${_} }
547
+ pageInfo { ${v} }
521
548
  }
522
549
  }`, {
523
- resourceId: t.resourceId,
524
- kind: t.kind,
550
+ resourceId: e.resourceId,
551
+ kind: e.kind,
525
552
  pagination: {
526
- limit: K,
553
+ limit: J,
527
554
  offset: r
528
555
  }
529
556
  }, n)).adaListTopologyEdges;
530
- if (e.push(...i.items), !i.pageInfo.hasMore || i.items.length === 0) return e;
557
+ if (t.push(...i.items), !i.pageInfo.hasMore || i.items.length === 0) return t;
531
558
  r += i.items.length;
532
559
  }
533
560
  },
534
- staleTime: l
561
+ staleTime: u
535
562
  });
536
563
  };
537
564
  //#endregion
538
- export { y as useAdapter, v as useAdapters, S as useArchiveAdapter, F as useArchivePolicy, H as useCancelSyncRun, w as useConnection, C as useConnections, G as useCostRecords, U as useCostSummary, b as useCreateAdapter, T as useCreateConnection, N as useCreatePolicy, O as useDisableConnection, R as useDriftRecords, j as usePolicies, M as usePolicy, z as useRemediateDrift, L as useResolveViolation, A as useResource, k as useResources, D as useSetConnectionStatus, V as useStartSyncRun, B as useSyncRuns, J as useTopology, q as useTopologyResources, x as useUpdateAdapter, E as useUpdateConnection, P as useUpdatePolicy, I as useViolations };
565
+ export { b as useAdapter, y as useAdapters, C as useArchiveAdapter, I as useArchivePolicy, W as useCancelSyncRun, T as useConnection, w as useConnections, q as useCostRecords, G as useCostSummary, x as useCreateAdapter, E as useCreateConnection, P as useCreatePolicy, k as useDisableConnection, B as useDriftCount, z as useDriftRecords, M as usePolicies, N as usePolicy, V as useRemediateDrift, R as useResolveViolation, j as useResource, A as useResources, O as useSetConnectionStatus, U as useStartSyncRun, H as useSyncRuns, X as useTopology, Y as useTopologyResources, S as useUpdateAdapter, D as useUpdateConnection, F as useUpdatePolicy, L as useViolations };
539
566
 
540
567
  //# sourceMappingURL=useAdapterCloudApi.js.map