@burdenoff/microfe-adaptercloud 2026.629.1 → 2026.706.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/dist/adaptercloud/AdapterCloudRoot.js +39 -33
  2. package/dist/adaptercloud/AdapterCloudRoot.js.map +1 -1
  3. package/dist/adaptercloud/AdapterCloudRoutes.js +5 -1
  4. package/dist/adaptercloud/AdapterCloudRoutes.js.map +1 -1
  5. package/dist/adaptercloud/components/ConfirmDialog.js +27 -0
  6. package/dist/adaptercloud/components/ConfirmDialog.js.map +1 -0
  7. package/dist/adaptercloud/components/DataState.js +1 -1
  8. package/dist/adaptercloud/components/DataState.js.map +1 -1
  9. package/dist/adaptercloud/hooks/useAdapterCloudApi.js +246 -220
  10. package/dist/adaptercloud/hooks/useAdapterCloudApi.js.map +1 -1
  11. package/dist/adaptercloud/lib/toast.js +36 -0
  12. package/dist/adaptercloud/lib/toast.js.map +1 -0
  13. package/dist/adaptercloud/pages/OverviewPage.js +159 -156
  14. package/dist/adaptercloud/pages/OverviewPage.js.map +1 -1
  15. package/dist/adaptercloud/pages/adapters/AdapterDetailPage.js +102 -89
  16. package/dist/adaptercloud/pages/adapters/AdapterDetailPage.js.map +1 -1
  17. package/dist/adaptercloud/pages/adapters/AdapterFormPage.js +2 -0
  18. package/dist/adaptercloud/pages/adapters/AdapterFormPage.js.map +1 -1
  19. package/dist/adaptercloud/pages/adapters/AdaptersListPage.js +2 -0
  20. package/dist/adaptercloud/pages/adapters/AdaptersListPage.js.map +1 -1
  21. package/dist/adaptercloud/pages/connections/ConnectionDetailPage.js +141 -124
  22. package/dist/adaptercloud/pages/connections/ConnectionDetailPage.js.map +1 -1
  23. package/dist/adaptercloud/pages/connections/ConnectionFormPage.js +2 -0
  24. package/dist/adaptercloud/pages/connections/ConnectionFormPage.js.map +1 -1
  25. package/dist/adaptercloud/pages/connections/ConnectionsListPage.js +1 -0
  26. package/dist/adaptercloud/pages/connections/ConnectionsListPage.js.map +1 -1
  27. package/dist/adaptercloud/pages/costs/CostsPage.js +112 -87
  28. package/dist/adaptercloud/pages/costs/CostsPage.js.map +1 -1
  29. package/dist/adaptercloud/pages/drift/DriftListPage.js +81 -59
  30. package/dist/adaptercloud/pages/drift/DriftListPage.js.map +1 -1
  31. package/dist/adaptercloud/pages/policies/PoliciesListPage.js +2 -0
  32. package/dist/adaptercloud/pages/policies/PoliciesListPage.js.map +1 -1
  33. package/dist/adaptercloud/pages/policies/PolicyDetailPage.js +109 -91
  34. package/dist/adaptercloud/pages/policies/PolicyDetailPage.js.map +1 -1
  35. package/dist/adaptercloud/pages/policies/PolicyFormPage.js +211 -184
  36. package/dist/adaptercloud/pages/policies/PolicyFormPage.js.map +1 -1
  37. package/dist/adaptercloud/pages/resources/ResourceDetailPage.js +153 -111
  38. package/dist/adaptercloud/pages/resources/ResourceDetailPage.js.map +1 -1
  39. package/dist/adaptercloud/pages/resources/ResourcesListPage.js +111 -83
  40. package/dist/adaptercloud/pages/resources/ResourcesListPage.js.map +1 -1
  41. package/dist/adaptercloud/pages/sync-runs/SyncRunsListPage.js +108 -86
  42. package/dist/adaptercloud/pages/sync-runs/SyncRunsListPage.js.map +1 -1
  43. package/dist/adaptercloud/pages/violations/ViolationsListPage.js +11 -3
  44. package/dist/adaptercloud/pages/violations/ViolationsListPage.js.map +1 -1
  45. package/dist/adaptercloud/utils/domain.js +1 -0
  46. package/dist/adaptercloud/utils/domain.js.map +1 -1
  47. package/dist/adaptercloud/utils/formatters.js +3 -15
  48. package/dist/adaptercloud/utils/formatters.js.map +1 -1
  49. package/dist/index.js +4 -4
  50. package/package.json +2 -1
@@ -1,83 +1,85 @@
1
1
  import { useAdapterCloud as e } from "../context/AdapterCloudContext.js";
2
2
  import "../context/index.js";
3
- import { useMutation as t, useQuery as n, useQueryClient as r } from "@tanstack/react-query";
4
- import { graphqlFetch as i } from "@burdenoff/fe-libs/shared/graphql";
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";
5
7
  //#region src/adaptercloud/hooks/useAdapterCloudApi.ts
6
- var a = {
8
+ var s = {
7
9
  all: ["adaptercloud"],
8
- health: () => [...a.all, "health"],
10
+ health: () => [...s.all, "health"],
9
11
  costSummary: (e) => [
10
- ...a.all,
12
+ ...s.all,
11
13
  "cost-summary",
12
14
  e ?? null
13
15
  ],
14
16
  costRecords: (e) => [
15
- ...a.all,
17
+ ...s.all,
16
18
  "cost-records",
17
19
  e
18
20
  ],
19
21
  adapters: (e) => [
20
- ...a.all,
22
+ ...s.all,
21
23
  "adapters",
22
24
  e
23
25
  ],
24
26
  adapter: (e) => [
25
- ...a.all,
27
+ ...s.all,
26
28
  "adapter",
27
29
  e
28
30
  ],
29
31
  connections: (e) => [
30
- ...a.all,
32
+ ...s.all,
31
33
  "connections",
32
34
  e
33
35
  ],
34
36
  connection: (e) => [
35
- ...a.all,
37
+ ...s.all,
36
38
  "connection",
37
39
  e
38
40
  ],
39
41
  resources: (e) => [
40
- ...a.all,
42
+ ...s.all,
41
43
  "resources",
42
44
  e
43
45
  ],
44
46
  resource: (e) => [
45
- ...a.all,
47
+ ...s.all,
46
48
  "resource",
47
49
  e
48
50
  ],
49
51
  policies: (e) => [
50
- ...a.all,
52
+ ...s.all,
51
53
  "policies",
52
54
  e
53
55
  ],
54
56
  policy: (e) => [
55
- ...a.all,
57
+ ...s.all,
56
58
  "policy",
57
59
  e
58
60
  ],
59
61
  violations: (e) => [
60
- ...a.all,
62
+ ...s.all,
61
63
  "violations",
62
64
  e
63
65
  ],
64
66
  drift: (e) => [
65
- ...a.all,
67
+ ...s.all,
66
68
  "drift",
67
69
  e
68
70
  ],
69
71
  syncRuns: (e) => [
70
- ...a.all,
72
+ ...s.all,
71
73
  "sync-runs",
72
74
  e
73
75
  ],
74
76
  syncRun: (e) => [
75
- ...a.all,
77
+ ...s.all,
76
78
  "sync-run",
77
79
  e
78
80
  ]
79
- }, o = async (e, t, n) => {
80
- let r = await i({
81
+ }, c = async (e, t, n) => {
82
+ let r = await a({
81
83
  gateway: "workspace",
82
84
  baseUrl: n,
83
85
  query: e,
@@ -86,341 +88,365 @@ var a = {
86
88
  });
87
89
  if (r.errors?.length) throw Error(r.errors[0]?.message ?? "GraphQL request failed");
88
90
  if (!r.data) throw Error("GraphQL response did not include data");
89
- return r.data;
90
- }, s = 30 * 1e3, c = "\n id name slug kind status vendor version description capabilities tags\n configSchema workspaceId createdAt updatedAt\n", l = "\n id name adapterId authMethod status environment region resourceCount\n secretRef targetRef config tags lastError lastSyncedAt workspaceId createdAt updatedAt\n", u = "\n id connectionId externalId resourceType name region state monthlyCost\n providerTags attributes tags lastSeenAt workspaceId createdAt updatedAt\n", d = "\n id name description kind enforcement severity expression appliesTo isActive\n tags workspaceId createdAt updatedAt\n", f = "\n id policyId resourceId message status severity evidence waiverReason\n detectedAt resolvedAt resolvedById workspaceId createdAt updatedAt\n", p = "\n id resourceId attributePath expectedValue observedValue severity status\n detectedAt remediatedAt workspaceId createdAt updatedAt\n", m = "\n id connectionId kind status discoveredCount reconciledCount driftCount\n violationCount error summary startedAt finishedAt workspaceId createdAt updatedAt\n", h = (t = {}) => {
91
- let { apiGatewayUrl: r } = e();
92
- return n({
93
- queryKey: a.adapters(t),
94
- queryFn: async () => (await o(`query AdaListAdapters($kind: AdaAdapterKind, $status: AdaAdapterStatus, $pagination: PaginationInput) {
91
+ return /^\s*mutation\b/.test(e) && o(), r.data;
92
+ }, 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 = {}) => {
93
+ let { apiGatewayUrl: n } = e();
94
+ return r({
95
+ queryKey: s.adapters(t),
96
+ queryFn: async () => (await c(`query AdaListAdapters($kind: AdaAdapterKind, $status: AdaAdapterStatus, $pagination: PaginationInput) {
95
97
  adaListAdapters(kind: $kind, status: $status, pagination: $pagination) {
96
- items { ${c} }
97
- pageInfo { cursor hasMore }
98
+ items { ${u} }
99
+ pageInfo { ${_} }
98
100
  }
99
101
  }`, {
100
102
  kind: t.kind,
101
103
  status: t.status,
102
104
  pagination: t.pagination
103
- }, r)).adaListAdapters,
104
- staleTime: s
105
+ }, n)).adaListAdapters,
106
+ placeholderData: (e) => e,
107
+ staleTime: l
105
108
  });
106
- }, g = (t) => {
107
- let { apiGatewayUrl: r } = e();
108
- return n({
109
- queryKey: a.adapter(t ?? ""),
110
- queryFn: async () => (await o(`query AdaAdapter($id: ID!) {
109
+ }, y = (t) => {
110
+ let { apiGatewayUrl: n } = e();
111
+ return r({
112
+ queryKey: s.adapter(t ?? ""),
113
+ queryFn: async () => (await c(`query AdaAdapter($id: ID!) {
111
114
  adaAdapter(id: $id) {
112
- ${c}
113
- connections { ${l} }
115
+ ${u}
116
+ connections { ${d} }
114
117
  }
115
- }`, { id: t }, r)).adaAdapter,
118
+ }`, { id: t }, n)).adaAdapter,
116
119
  enabled: !!t,
117
- staleTime: s
120
+ staleTime: l
118
121
  });
119
- }, _ = () => {
120
- let n = r(), { apiGatewayUrl: i } = e();
121
- return t({
122
- mutationFn: async (e) => (await o(`mutation AdaCreateAdapter($input: AdaCreateAdapterInput!) {
123
- adaCreateAdapter(input: $input) { ${c} }
124
- }`, { input: e }, i)).adaCreateAdapter,
122
+ }, b = () => {
123
+ let t = i(), { apiGatewayUrl: r } = e();
124
+ return n({
125
+ mutationFn: async (e) => (await c(`mutation AdaCreateAdapter($input: AdaCreateAdapterInput!) {
126
+ adaCreateAdapter(input: $input) { ${u} }
127
+ }`, { input: e }, r)).adaCreateAdapter,
125
128
  onSuccess: () => {
126
- n.invalidateQueries({ queryKey: [...a.all, "adapters"] });
129
+ t.invalidateQueries({ queryKey: [...s.all, "adapters"] });
127
130
  }
128
131
  });
129
- }, v = () => {
130
- let n = r(), { apiGatewayUrl: i } = e();
131
- return t({
132
- mutationFn: async ({ id: e, input: t }) => (await o(`mutation AdaUpdateAdapter($id: ID!, $input: AdaUpdateAdapterInput!) {
133
- adaUpdateAdapter(id: $id, input: $input) { ${c} }
132
+ }, x = () => {
133
+ let t = i(), { apiGatewayUrl: r } = e();
134
+ return n({
135
+ mutationFn: async ({ id: e, input: t }) => (await c(`mutation AdaUpdateAdapter($id: ID!, $input: AdaUpdateAdapterInput!) {
136
+ adaUpdateAdapter(id: $id, input: $input) { ${u} }
134
137
  }`, {
135
138
  id: e,
136
139
  input: t
137
- }, i)).adaUpdateAdapter,
140
+ }, r)).adaUpdateAdapter,
138
141
  onSuccess: (e) => {
139
- n.invalidateQueries({ queryKey: [...a.all, "adapters"] }), n.invalidateQueries({ queryKey: a.adapter(e.id) });
142
+ t.invalidateQueries({ queryKey: [...s.all, "adapters"] }), t.invalidateQueries({ queryKey: s.adapter(e.id) });
140
143
  }
141
144
  });
142
- }, y = () => {
143
- let n = r(), { apiGatewayUrl: i } = e();
144
- return t({
145
- mutationFn: async (e) => (await o("mutation AdaArchiveAdapter($id: ID!) { adaArchiveAdapter(id: $id) }", { id: e }, i)).adaArchiveAdapter,
145
+ }, S = () => {
146
+ let t = i(), { apiGatewayUrl: r } = e();
147
+ return n({
148
+ mutationFn: async (e) => (await c("mutation AdaArchiveAdapter($id: ID!) { adaArchiveAdapter(id: $id) }", { id: e }, r)).adaArchiveAdapter,
146
149
  onSuccess: () => {
147
- n.invalidateQueries({ queryKey: [...a.all, "adapters"] });
150
+ t.invalidateQueries({ queryKey: [...s.all, "adapters"] });
148
151
  }
149
152
  });
150
- }, b = (t = {}) => {
151
- let { apiGatewayUrl: r } = e();
152
- return n({
153
- queryKey: a.connections(t),
154
- queryFn: async () => (await o(`query AdaListConnections($adapterId: ID, $status: AdaConnectionStatus, $pagination: PaginationInput) {
153
+ }, C = (t = {}) => {
154
+ let { apiGatewayUrl: n } = e();
155
+ return r({
156
+ queryKey: s.connections(t),
157
+ queryFn: async () => (await c(`query AdaListConnections($adapterId: ID, $status: AdaConnectionStatus, $pagination: PaginationInput) {
155
158
  adaListConnections(adapterId: $adapterId, status: $status, pagination: $pagination) {
156
159
  items {
157
- ${l}
160
+ ${d}
158
161
  adapter { id name slug kind }
159
162
  }
160
- pageInfo { cursor hasMore }
163
+ pageInfo { ${_} }
161
164
  }
162
165
  }`, {
163
166
  adapterId: t.adapterId,
164
167
  status: t.status,
165
168
  pagination: t.pagination
166
- }, r)).adaListConnections,
167
- staleTime: s
169
+ }, n)).adaListConnections,
170
+ placeholderData: (e) => e,
171
+ staleTime: l
168
172
  });
169
- }, x = (t) => {
170
- let { apiGatewayUrl: r } = e();
171
- return n({
172
- queryKey: a.connection(t ?? ""),
173
- queryFn: async () => (await o(`query AdaConnection($id: ID!) {
173
+ }, w = (t) => {
174
+ let { apiGatewayUrl: n } = e();
175
+ return r({
176
+ queryKey: s.connection(t ?? ""),
177
+ queryFn: async () => (await c(`query AdaConnection($id: ID!) {
174
178
  adaConnection(id: $id) {
175
- ${l}
176
- adapter { ${c} }
177
- resources { ${u} }
179
+ ${d}
180
+ adapter { ${u} }
181
+ resources { ${f} }
178
182
  }
179
- }`, { id: t }, r)).adaConnection,
183
+ }`, { id: t }, n)).adaConnection,
180
184
  enabled: !!t,
181
- staleTime: s
185
+ staleTime: l
182
186
  });
183
- }, S = () => {
184
- let n = r(), { apiGatewayUrl: i } = e();
185
- return t({
186
- mutationFn: async (e) => (await o(`mutation AdaCreateConnection($input: AdaCreateConnectionInput!) {
187
- adaCreateConnection(input: $input) { ${l} }
188
- }`, { input: e }, i)).adaCreateConnection,
187
+ }, T = () => {
188
+ let t = i(), { apiGatewayUrl: r } = e();
189
+ return n({
190
+ mutationFn: async (e) => (await c(`mutation AdaCreateConnection($input: AdaCreateConnectionInput!) {
191
+ adaCreateConnection(input: $input) { ${d} }
192
+ }`, { input: e }, r)).adaCreateConnection,
189
193
  onSuccess: () => {
190
- n.invalidateQueries({ queryKey: [...a.all, "connections"] });
194
+ t.invalidateQueries({ queryKey: [...s.all, "connections"] });
191
195
  }
192
196
  });
193
- }, C = () => {
194
- let n = r(), { apiGatewayUrl: i } = e();
195
- return t({
196
- mutationFn: async ({ id: e, input: t }) => (await o(`mutation AdaUpdateConnection($id: ID!, $input: AdaUpdateConnectionInput!) {
197
- adaUpdateConnection(id: $id, input: $input) { ${l} }
197
+ }, E = () => {
198
+ let t = i(), { apiGatewayUrl: r } = e();
199
+ return n({
200
+ mutationFn: async ({ id: e, input: t }) => (await c(`mutation AdaUpdateConnection($id: ID!, $input: AdaUpdateConnectionInput!) {
201
+ adaUpdateConnection(id: $id, input: $input) { ${d} }
198
202
  }`, {
199
203
  id: e,
200
204
  input: t
201
- }, i)).adaUpdateConnection,
205
+ }, r)).adaUpdateConnection,
202
206
  onSuccess: (e) => {
203
- n.invalidateQueries({ queryKey: [...a.all, "connections"] }), n.invalidateQueries({ queryKey: a.connection(e.id) });
207
+ t.invalidateQueries({ queryKey: [...s.all, "connections"] }), t.invalidateQueries({ queryKey: s.connection(e.id) });
204
208
  }
205
209
  });
206
- }, w = () => {
207
- let n = r(), { apiGatewayUrl: i } = e();
208
- return t({
209
- mutationFn: async ({ id: e, status: t }) => (await o(`mutation AdaSetConnectionStatus($id: ID!, $status: AdaConnectionStatus!) {
210
- adaSetConnectionStatus(id: $id, status: $status) { ${l} }
210
+ }, D = () => {
211
+ let r = i(), { apiGatewayUrl: a } = e();
212
+ return n({
213
+ mutationFn: async ({ id: e, status: t }) => (await c(`mutation AdaSetConnectionStatus($id: ID!, $status: AdaConnectionStatus!) {
214
+ adaSetConnectionStatus(id: $id, status: $status) { ${d} }
211
215
  }`, {
212
216
  id: e,
213
217
  status: t
214
- }, i)).adaSetConnectionStatus,
218
+ }, a)).adaSetConnectionStatus,
215
219
  onSuccess: (e) => {
216
- n.invalidateQueries({ queryKey: [...a.all, "connections"] }), n.invalidateQueries({ queryKey: a.connection(e.id) });
220
+ t.success("Connection health updated"), r.invalidateQueries({ queryKey: [...s.all, "connections"] }), r.invalidateQueries({ queryKey: s.connection(e.id) });
217
221
  }
218
222
  });
219
- }, T = () => {
220
- let n = r(), { apiGatewayUrl: i } = e();
221
- return t({
222
- mutationFn: async (e) => (await o(`mutation AdaDisableConnection($id: ID!) {
223
- adaDisableConnection(id: $id) { ${l} }
224
- }`, { id: e }, i)).adaDisableConnection,
223
+ }, O = () => {
224
+ let r = i(), { apiGatewayUrl: a } = e();
225
+ return n({
226
+ mutationFn: async (e) => (await c(`mutation AdaDisableConnection($id: ID!) {
227
+ adaDisableConnection(id: $id) { ${d} }
228
+ }`, { id: e }, a)).adaDisableConnection,
225
229
  onSuccess: (e) => {
226
- n.invalidateQueries({ queryKey: [...a.all, "connections"] }), n.invalidateQueries({ queryKey: a.connection(e.id) });
230
+ t.success("Connection disabled"), r.invalidateQueries({ queryKey: [...s.all, "connections"] }), r.invalidateQueries({ queryKey: s.connection(e.id) });
227
231
  }
228
232
  });
229
- }, E = (t = {}) => {
230
- let { apiGatewayUrl: r } = e();
231
- return n({
232
- queryKey: a.resources(t),
233
- queryFn: async () => (await o(`query AdaListResources($connectionId: ID, $resourceType: String, $state: AdaResourceState, $pagination: PaginationInput) {
233
+ }, k = (t = {}) => {
234
+ let { apiGatewayUrl: n } = e();
235
+ return r({
236
+ queryKey: s.resources(t),
237
+ queryFn: async () => (await c(`query AdaListResources($connectionId: ID, $resourceType: String, $state: AdaResourceState, $pagination: PaginationInput) {
234
238
  adaListResources(connectionId: $connectionId, resourceType: $resourceType, state: $state, pagination: $pagination) {
235
239
  items {
236
- ${u}
240
+ ${f}
237
241
  connection { id name }
238
242
  }
239
- pageInfo { cursor hasMore }
243
+ pageInfo { ${_} }
240
244
  }
241
245
  }`, {
242
246
  connectionId: t.connectionId,
243
247
  resourceType: t.resourceType,
244
248
  state: t.state,
245
249
  pagination: t.pagination
246
- }, r)).adaListResources,
247
- staleTime: s
250
+ }, n)).adaListResources,
251
+ placeholderData: (e) => e,
252
+ staleTime: l
248
253
  });
249
- }, D = (t) => {
250
- let { apiGatewayUrl: r } = e();
251
- return n({
252
- queryKey: a.resource(t ?? ""),
253
- queryFn: async () => (await o(`query AdaResource($id: ID!) {
254
+ }, A = (t) => {
255
+ let { apiGatewayUrl: n } = e();
256
+ return r({
257
+ queryKey: s.resource(t ?? ""),
258
+ queryFn: async () => (await c(`query AdaResource($id: ID!) {
254
259
  adaResource(id: $id) {
255
- ${u}
256
- connection { ${l} adapter { id name slug kind } }
260
+ ${f}
261
+ connection { ${d} adapter { id name slug kind } }
257
262
  dependsOn { id name resourceType region state monthlyCost }
258
263
  }
259
- }`, { id: t }, r)).adaResource,
264
+ }`, { id: t }, n)).adaResource,
260
265
  enabled: !!t,
261
- staleTime: s
266
+ staleTime: l
262
267
  });
263
- }, O = (t = {}) => {
264
- let { apiGatewayUrl: r } = e();
265
- return n({
266
- queryKey: a.policies(t),
267
- queryFn: async () => (await o(`query AdaListPolicies($isActive: Boolean, $kind: AdaPolicyKind, $pagination: PaginationInput) {
268
+ }, j = (t = {}) => {
269
+ let { apiGatewayUrl: n } = e();
270
+ return r({
271
+ queryKey: s.policies(t),
272
+ queryFn: async () => (await c(`query AdaListPolicies($isActive: Boolean, $kind: AdaPolicyKind, $pagination: PaginationInput) {
268
273
  adaListPolicies(isActive: $isActive, kind: $kind, pagination: $pagination) {
269
- items { ${d} }
274
+ items { ${p} }
270
275
  pageInfo { cursor hasMore }
271
276
  }
272
277
  }`, {
273
278
  isActive: t.isActive,
274
279
  kind: t.kind,
275
280
  pagination: t.pagination
276
- }, r)).adaListPolicies,
277
- staleTime: s
281
+ }, n)).adaListPolicies,
282
+ placeholderData: (e) => e,
283
+ staleTime: l
278
284
  });
279
- }, k = (t) => {
280
- let { apiGatewayUrl: r } = e();
281
- return n({
282
- queryKey: a.policy(t ?? ""),
283
- queryFn: async () => (await o(`query AdaPolicy($id: ID!) {
285
+ }, M = (t) => {
286
+ let { apiGatewayUrl: n } = e();
287
+ return r({
288
+ queryKey: s.policy(t ?? ""),
289
+ queryFn: async () => (await c(`query AdaPolicy($id: ID!) {
284
290
  adaPolicy(id: $id) {
285
- ${d}
286
- violations { ${f} }
291
+ ${p}
292
+ violations { ${m} }
287
293
  }
288
- }`, { id: t }, r)).adaPolicy,
294
+ }`, { id: t }, n)).adaPolicy,
289
295
  enabled: !!t,
290
- staleTime: s
296
+ staleTime: l
291
297
  });
292
- }, A = () => {
293
- let n = r(), { apiGatewayUrl: i } = e();
294
- return t({
295
- mutationFn: async (e) => (await o(`mutation AdaCreatePolicy($input: AdaCreatePolicyInput!) {
296
- adaCreatePolicy(input: $input) { ${d} }
297
- }`, { input: e }, i)).adaCreatePolicy,
298
+ }, N = () => {
299
+ let t = i(), { apiGatewayUrl: r } = e();
300
+ return n({
301
+ mutationFn: async (e) => (await c(`mutation AdaCreatePolicy($input: AdaCreatePolicyInput!) {
302
+ adaCreatePolicy(input: $input) { ${p} }
303
+ }`, { input: e }, r)).adaCreatePolicy,
298
304
  onSuccess: () => {
299
- n.invalidateQueries({ queryKey: [...a.all, "policies"] });
305
+ t.invalidateQueries({ queryKey: [...s.all, "policies"] });
300
306
  }
301
307
  });
302
- }, j = () => {
303
- let n = r(), { apiGatewayUrl: i } = e();
304
- return t({
305
- mutationFn: async (e) => (await o("mutation AdaArchivePolicy($id: ID!) { adaArchivePolicy(id: $id) }", { id: e }, i)).adaArchivePolicy,
306
- onSuccess: () => {
307
- n.invalidateQueries({ queryKey: [...a.all, "policies"] });
308
+ }, P = () => {
309
+ let r = i(), { apiGatewayUrl: a } = e();
310
+ return n({
311
+ mutationFn: async ({ id: e, input: t }) => (await c(`mutation AdaUpdatePolicy($id: ID!, $input: AdaUpdatePolicyInput!) {
312
+ adaUpdatePolicy(id: $id, input: $input) { ${p} }
313
+ }`, {
314
+ id: e,
315
+ input: t
316
+ }, a)).adaUpdatePolicy,
317
+ onSuccess: (e) => {
318
+ t.success("Policy updated"), r.invalidateQueries({ queryKey: [...s.all, "policies"] }), r.invalidateQueries({ queryKey: s.policy(e.id) });
308
319
  }
309
320
  });
310
- }, M = (t = {}) => {
311
- let { apiGatewayUrl: r } = e();
321
+ }, F = () => {
322
+ let t = i(), { apiGatewayUrl: r } = e();
312
323
  return n({
313
- queryKey: a.violations(t),
314
- queryFn: async () => (await o(`query AdaListViolations($policyId: ID, $resourceId: ID, $status: AdaViolationStatus, $pagination: PaginationInput) {
324
+ mutationFn: async (e) => (await c("mutation AdaArchivePolicy($id: ID!) { adaArchivePolicy(id: $id) }", { id: e }, r)).adaArchivePolicy,
325
+ onSuccess: () => {
326
+ t.invalidateQueries({ queryKey: [...s.all, "policies"] });
327
+ }
328
+ });
329
+ }, I = (t = {}) => {
330
+ let { apiGatewayUrl: n } = e();
331
+ return r({
332
+ queryKey: s.violations(t),
333
+ queryFn: async () => (await c(`query AdaListViolations($policyId: ID, $resourceId: ID, $status: AdaViolationStatus, $pagination: PaginationInput) {
315
334
  adaListViolations(policyId: $policyId, resourceId: $resourceId, status: $status, pagination: $pagination) {
316
335
  items {
317
- ${f}
336
+ ${m}
318
337
  policy { id name kind severity }
319
338
  }
320
- pageInfo { cursor hasMore }
339
+ pageInfo { ${_} }
321
340
  }
322
341
  }`, {
323
342
  policyId: t.policyId,
324
343
  resourceId: t.resourceId,
325
344
  status: t.status,
326
345
  pagination: t.pagination
327
- }, r)).adaListViolations,
328
- staleTime: s
346
+ }, n)).adaListViolations,
347
+ placeholderData: (e) => e,
348
+ staleTime: l
329
349
  });
330
- }, N = () => {
331
- let n = r(), { apiGatewayUrl: i } = e();
332
- return t({
333
- mutationFn: async ({ id: e, status: t, waiverReason: n }) => (await o(`mutation AdaResolveViolation($id: ID!, $status: AdaViolationStatus!, $waiverReason: String) {
350
+ }, L = () => {
351
+ let r = i(), { apiGatewayUrl: a } = e();
352
+ return n({
353
+ mutationFn: async ({ id: e, status: t, waiverReason: n }) => (await c(`mutation AdaResolveViolation($id: ID!, $status: AdaViolationStatus!, $waiverReason: String) {
334
354
  adaResolveViolation(id: $id, status: $status, waiverReason: $waiverReason) {
335
- ${f}
355
+ ${m}
336
356
  }
337
357
  }`, {
338
358
  id: e,
339
359
  status: t,
340
360
  waiverReason: n
341
- }, i)).adaResolveViolation,
342
- onSuccess: () => {
343
- n.invalidateQueries({ queryKey: [...a.all, "violations"] });
361
+ }, a)).adaResolveViolation,
362
+ onSuccess: (e) => {
363
+ t.success({
364
+ ACKNOWLEDGED: "Violation acknowledged",
365
+ RESOLVED: "Violation resolved",
366
+ WAIVED: "Violation waived",
367
+ OPEN: "Violation reopened"
368
+ }[e.status] ?? "Violation updated"), r.invalidateQueries({ queryKey: [...s.all, "violations"] });
344
369
  }
345
370
  });
346
- }, P = (t = {}) => {
347
- let { apiGatewayUrl: r } = e();
348
- return n({
349
- queryKey: a.drift(t),
350
- queryFn: async () => (await o(`query AdaListDriftRecords($resourceId: ID, $status: AdaDriftStatus) {
351
- adaListDriftRecords(resourceId: $resourceId, status: $status) { ${p} }
371
+ }, R = (t = {}) => {
372
+ let { apiGatewayUrl: n } = e();
373
+ return r({
374
+ queryKey: s.drift(t),
375
+ queryFn: async () => (await c(`query AdaListDriftRecords($resourceId: ID, $status: AdaDriftStatus) {
376
+ adaListDriftRecords(resourceId: $resourceId, status: $status) { ${h} }
352
377
  }`, {
353
378
  resourceId: t.resourceId,
354
379
  status: t.status
355
- }, r)).adaListDriftRecords,
356
- staleTime: s
380
+ }, n)).adaListDriftRecords,
381
+ staleTime: l
357
382
  });
358
- }, F = () => {
359
- let n = r(), { apiGatewayUrl: i } = e();
360
- return t({
361
- mutationFn: async (e) => (await o(`mutation AdaRemediateDrift($id: ID!) {
362
- adaRemediateDrift(id: $id) { ${p} }
363
- }`, { id: e }, i)).adaRemediateDrift,
383
+ }, z = () => {
384
+ let r = i(), { apiGatewayUrl: a } = e();
385
+ return n({
386
+ mutationFn: async (e) => (await c(`mutation AdaRemediateDrift($id: ID!) {
387
+ adaRemediateDrift(id: $id) { ${h} }
388
+ }`, { id: e }, a)).adaRemediateDrift,
364
389
  onSuccess: () => {
365
- n.invalidateQueries({ queryKey: [...a.all, "drift"] });
390
+ t.success("Drift marked remediated"), r.invalidateQueries({ queryKey: [...s.all, "drift"] }), r.invalidateQueries({ queryKey: [...s.all, "resources"] });
366
391
  }
367
392
  });
368
- }, I = (t = {}) => {
369
- let { apiGatewayUrl: r } = e();
370
- return n({
371
- queryKey: a.syncRuns(t),
372
- queryFn: async () => (await o(`query AdaListSyncRuns($connectionId: ID, $status: AdaSyncStatus, $pagination: PaginationInput) {
393
+ }, B = (t = {}) => {
394
+ let { apiGatewayUrl: n } = e();
395
+ return r({
396
+ queryKey: s.syncRuns(t),
397
+ queryFn: async () => (await c(`query AdaListSyncRuns($connectionId: ID, $status: AdaSyncStatus, $pagination: PaginationInput) {
373
398
  adaListSyncRuns(connectionId: $connectionId, status: $status, pagination: $pagination) {
374
- items { ${m} }
399
+ items { ${g} }
375
400
  pageInfo { cursor hasMore }
376
401
  }
377
402
  }`, {
378
403
  connectionId: t.connectionId,
379
404
  status: t.status,
380
405
  pagination: t.pagination
381
- }, r)).adaListSyncRuns,
382
- staleTime: s
406
+ }, n)).adaListSyncRuns,
407
+ placeholderData: (e) => e,
408
+ staleTime: l
383
409
  });
384
- }, L = () => {
385
- let n = r(), { apiGatewayUrl: i } = e();
386
- return t({
387
- mutationFn: async (e) => (await o(`mutation AdaStartSyncRun($input: AdaStartSyncRunInput!) {
388
- adaStartSyncRun(input: $input) { ${m} }
389
- }`, { input: e }, i)).adaStartSyncRun,
410
+ }, V = () => {
411
+ let r = i(), { apiGatewayUrl: a } = e();
412
+ return n({
413
+ mutationFn: async (e) => (await c(`mutation AdaStartSyncRun($input: AdaStartSyncRunInput!) {
414
+ adaStartSyncRun(input: $input) { ${g} }
415
+ }`, { input: e }, a)).adaStartSyncRun,
390
416
  onSuccess: () => {
391
- n.invalidateQueries({ queryKey: [...a.all, "sync-runs"] });
417
+ t.success("Sync run started"), r.invalidateQueries({ queryKey: [...s.all, "sync-runs"] }), r.invalidateQueries({ queryKey: [...s.all, "connections"] });
392
418
  }
393
419
  });
394
- }, R = () => {
395
- let n = r(), { apiGatewayUrl: i } = e();
396
- return t({
397
- mutationFn: async (e) => (await o(`mutation AdaCancelSyncRun($id: ID!) {
398
- adaCancelSyncRun(id: $id) { ${m} }
399
- }`, { id: e }, i)).adaCancelSyncRun,
420
+ }, H = () => {
421
+ let r = i(), { apiGatewayUrl: a } = e();
422
+ return n({
423
+ mutationFn: async (e) => (await c(`mutation AdaCancelSyncRun($id: ID!) {
424
+ adaCancelSyncRun(id: $id) { ${g} }
425
+ }`, { id: e }, a)).adaCancelSyncRun,
400
426
  onSuccess: () => {
401
- n.invalidateQueries({ queryKey: [...a.all, "sync-runs"] });
427
+ t.success("Sync run cancelled"), r.invalidateQueries({ queryKey: [...s.all, "sync-runs"] });
402
428
  }
403
429
  });
404
- }, z = (t) => {
405
- let { apiGatewayUrl: r } = e();
406
- return n({
407
- queryKey: a.costSummary(t),
408
- queryFn: async () => (await o("query AdaCostSummary($connectionId: ID) {\n adaCostSummary(connectionId: $connectionId) {\n currency total\n lines { service total }\n }\n }", { connectionId: t }, r)).adaCostSummary,
409
- staleTime: s
430
+ }, U = (t) => {
431
+ let { apiGatewayUrl: n } = e();
432
+ return r({
433
+ queryKey: s.costSummary(t),
434
+ 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,
435
+ staleTime: l
410
436
  });
411
- }, B = (t = {}) => {
412
- let { apiGatewayUrl: r } = e();
413
- return n({
414
- queryKey: a.costRecords(t),
415
- queryFn: async () => (await o("query AdaListCostRecords($connectionId: ID, $resourceId: ID, $service: String) {\n adaListCostRecords(connectionId: $connectionId, resourceId: $resourceId, service: $service) {\n id service amount currency periodStart periodEnd breakdown\n connectionId resourceId workspaceId createdAt updatedAt\n }\n }", {
437
+ }, W = (t = {}) => {
438
+ let { apiGatewayUrl: n } = e();
439
+ return r({
440
+ queryKey: s.costRecords(t),
441
+ queryFn: async () => (await c("query AdaListCostRecords($connectionId: ID, $resourceId: ID, $service: String) {\n adaListCostRecords(connectionId: $connectionId, resourceId: $resourceId, service: $service) {\n id service amount currency periodStart periodEnd breakdown\n connectionId resourceId workspaceId createdAt updatedAt\n }\n }", {
416
442
  connectionId: t.connectionId,
417
443
  resourceId: t.resourceId,
418
444
  service: t.service
419
- }, r)).adaListCostRecords,
420
- staleTime: s
445
+ }, n)).adaListCostRecords,
446
+ staleTime: l
421
447
  });
422
448
  };
423
449
  //#endregion
424
- export { g as useAdapter, h as useAdapters, y as useArchiveAdapter, j as useArchivePolicy, R as useCancelSyncRun, x as useConnection, b as useConnections, B as useCostRecords, z as useCostSummary, _ as useCreateAdapter, S as useCreateConnection, A as useCreatePolicy, T as useDisableConnection, P as useDriftRecords, O as usePolicies, k as usePolicy, F as useRemediateDrift, N as useResolveViolation, D as useResource, E as useResources, w as useSetConnectionStatus, L as useStartSyncRun, I as useSyncRuns, v as useUpdateAdapter, C as useUpdateConnection, M as useViolations };
450
+ export { y as useAdapter, v as useAdapters, S as useArchiveAdapter, F as useArchivePolicy, H as useCancelSyncRun, w as useConnection, C as useConnections, W 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, x as useUpdateAdapter, E as useUpdateConnection, P as useUpdatePolicy, I as useViolations };
425
451
 
426
452
  //# sourceMappingURL=useAdapterCloudApi.js.map