@burdenoff/microfe-adaptercloud 2026.628.1 → 2026.706.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.
@@ -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,75 +88,75 @@ 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", _ = (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} }
98
+ items { ${u} }
97
99
  pageInfo { cursor hasMore }
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
+ staleTime: l
105
107
  });
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!) {
108
+ }, v = (t) => {
109
+ let { apiGatewayUrl: n } = e();
110
+ return r({
111
+ queryKey: s.adapter(t ?? ""),
112
+ queryFn: async () => (await c(`query AdaAdapter($id: ID!) {
111
113
  adaAdapter(id: $id) {
112
- ${c}
113
- connections { ${l} }
114
+ ${u}
115
+ connections { ${d} }
114
116
  }
115
- }`, { id: t }, r)).adaAdapter,
117
+ }`, { id: t }, n)).adaAdapter,
116
118
  enabled: !!t,
117
- staleTime: s
119
+ staleTime: l
118
120
  });
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,
121
+ }, y = () => {
122
+ let t = i(), { apiGatewayUrl: r } = e();
123
+ return n({
124
+ mutationFn: async (e) => (await c(`mutation AdaCreateAdapter($input: AdaCreateAdapterInput!) {
125
+ adaCreateAdapter(input: $input) { ${u} }
126
+ }`, { input: e }, r)).adaCreateAdapter,
125
127
  onSuccess: () => {
126
- n.invalidateQueries({ queryKey: [...a.all, "adapters"] });
128
+ t.invalidateQueries({ queryKey: [...s.all, "adapters"] });
127
129
  }
128
130
  });
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} }
131
+ }, b = () => {
132
+ let t = i(), { apiGatewayUrl: r } = e();
133
+ return n({
134
+ mutationFn: async ({ id: e, input: t }) => (await c(`mutation AdaUpdateAdapter($id: ID!, $input: AdaUpdateAdapterInput!) {
135
+ adaUpdateAdapter(id: $id, input: $input) { ${u} }
134
136
  }`, {
135
137
  id: e,
136
138
  input: t
137
- }, i)).adaUpdateAdapter,
139
+ }, r)).adaUpdateAdapter,
138
140
  onSuccess: (e) => {
139
- n.invalidateQueries({ queryKey: [...a.all, "adapters"] }), n.invalidateQueries({ queryKey: a.adapter(e.id) });
141
+ t.invalidateQueries({ queryKey: [...s.all, "adapters"] }), t.invalidateQueries({ queryKey: s.adapter(e.id) });
140
142
  }
141
143
  });
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,
144
+ }, x = () => {
145
+ let t = i(), { apiGatewayUrl: r } = e();
146
+ return n({
147
+ mutationFn: async (e) => (await c("mutation AdaArchiveAdapter($id: ID!) { adaArchiveAdapter(id: $id) }", { id: e }, r)).adaArchiveAdapter,
146
148
  onSuccess: () => {
147
- n.invalidateQueries({ queryKey: [...a.all, "adapters"] });
149
+ t.invalidateQueries({ queryKey: [...s.all, "adapters"] });
148
150
  }
149
151
  });
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) {
152
+ }, S = (t = {}) => {
153
+ let { apiGatewayUrl: n } = e();
154
+ return r({
155
+ queryKey: s.connections(t),
156
+ queryFn: async () => (await c(`query AdaListConnections($adapterId: ID, $status: AdaConnectionStatus, $pagination: PaginationInput) {
155
157
  adaListConnections(adapterId: $adapterId, status: $status, pagination: $pagination) {
156
158
  items {
157
- ${l}
159
+ ${d}
158
160
  adapter { id name slug kind }
159
161
  }
160
162
  pageInfo { cursor hasMore }
@@ -163,77 +165,77 @@ var a = {
163
165
  adapterId: t.adapterId,
164
166
  status: t.status,
165
167
  pagination: t.pagination
166
- }, r)).adaListConnections,
167
- staleTime: s
168
+ }, n)).adaListConnections,
169
+ staleTime: l
168
170
  });
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!) {
171
+ }, C = (t) => {
172
+ let { apiGatewayUrl: n } = e();
173
+ return r({
174
+ queryKey: s.connection(t ?? ""),
175
+ queryFn: async () => (await c(`query AdaConnection($id: ID!) {
174
176
  adaConnection(id: $id) {
175
- ${l}
176
- adapter { ${c} }
177
- resources { ${u} }
177
+ ${d}
178
+ adapter { ${u} }
179
+ resources { ${f} }
178
180
  }
179
- }`, { id: t }, r)).adaConnection,
181
+ }`, { id: t }, n)).adaConnection,
180
182
  enabled: !!t,
181
- staleTime: s
183
+ staleTime: l
182
184
  });
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,
185
+ }, w = () => {
186
+ let t = i(), { apiGatewayUrl: r } = e();
187
+ return n({
188
+ mutationFn: async (e) => (await c(`mutation AdaCreateConnection($input: AdaCreateConnectionInput!) {
189
+ adaCreateConnection(input: $input) { ${d} }
190
+ }`, { input: e }, r)).adaCreateConnection,
189
191
  onSuccess: () => {
190
- n.invalidateQueries({ queryKey: [...a.all, "connections"] });
192
+ t.invalidateQueries({ queryKey: [...s.all, "connections"] });
191
193
  }
192
194
  });
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} }
195
+ }, T = () => {
196
+ let t = i(), { apiGatewayUrl: r } = e();
197
+ return n({
198
+ mutationFn: async ({ id: e, input: t }) => (await c(`mutation AdaUpdateConnection($id: ID!, $input: AdaUpdateConnectionInput!) {
199
+ adaUpdateConnection(id: $id, input: $input) { ${d} }
198
200
  }`, {
199
201
  id: e,
200
202
  input: t
201
- }, i)).adaUpdateConnection,
203
+ }, r)).adaUpdateConnection,
202
204
  onSuccess: (e) => {
203
- n.invalidateQueries({ queryKey: [...a.all, "connections"] }), n.invalidateQueries({ queryKey: a.connection(e.id) });
205
+ t.invalidateQueries({ queryKey: [...s.all, "connections"] }), t.invalidateQueries({ queryKey: s.connection(e.id) });
204
206
  }
205
207
  });
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} }
208
+ }, E = () => {
209
+ let r = i(), { apiGatewayUrl: a } = e();
210
+ return n({
211
+ mutationFn: async ({ id: e, status: t }) => (await c(`mutation AdaSetConnectionStatus($id: ID!, $status: AdaConnectionStatus!) {
212
+ adaSetConnectionStatus(id: $id, status: $status) { ${d} }
211
213
  }`, {
212
214
  id: e,
213
215
  status: t
214
- }, i)).adaSetConnectionStatus,
216
+ }, a)).adaSetConnectionStatus,
215
217
  onSuccess: (e) => {
216
- n.invalidateQueries({ queryKey: [...a.all, "connections"] }), n.invalidateQueries({ queryKey: a.connection(e.id) });
218
+ t.success("Connection health updated"), r.invalidateQueries({ queryKey: [...s.all, "connections"] }), r.invalidateQueries({ queryKey: s.connection(e.id) });
217
219
  }
218
220
  });
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,
221
+ }, D = () => {
222
+ let r = i(), { apiGatewayUrl: a } = e();
223
+ return n({
224
+ mutationFn: async (e) => (await c(`mutation AdaDisableConnection($id: ID!) {
225
+ adaDisableConnection(id: $id) { ${d} }
226
+ }`, { id: e }, a)).adaDisableConnection,
225
227
  onSuccess: (e) => {
226
- n.invalidateQueries({ queryKey: [...a.all, "connections"] }), n.invalidateQueries({ queryKey: a.connection(e.id) });
228
+ t.success("Connection disabled"), r.invalidateQueries({ queryKey: [...s.all, "connections"] }), r.invalidateQueries({ queryKey: s.connection(e.id) });
227
229
  }
228
230
  });
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) {
231
+ }, O = (t = {}) => {
232
+ let { apiGatewayUrl: n } = e();
233
+ return r({
234
+ queryKey: s.resources(t),
235
+ queryFn: async () => (await c(`query AdaListResources($connectionId: ID, $resourceType: String, $state: AdaResourceState, $pagination: PaginationInput) {
234
236
  adaListResources(connectionId: $connectionId, resourceType: $resourceType, state: $state, pagination: $pagination) {
235
237
  items {
236
- ${u}
238
+ ${f}
237
239
  connection { id name }
238
240
  }
239
241
  pageInfo { cursor hasMore }
@@ -243,78 +245,78 @@ var a = {
243
245
  resourceType: t.resourceType,
244
246
  state: t.state,
245
247
  pagination: t.pagination
246
- }, r)).adaListResources,
247
- staleTime: s
248
+ }, n)).adaListResources,
249
+ staleTime: l
248
250
  });
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!) {
251
+ }, k = (t) => {
252
+ let { apiGatewayUrl: n } = e();
253
+ return r({
254
+ queryKey: s.resource(t ?? ""),
255
+ queryFn: async () => (await c(`query AdaResource($id: ID!) {
254
256
  adaResource(id: $id) {
255
- ${u}
256
- connection { ${l} adapter { id name slug kind } }
257
+ ${f}
258
+ connection { ${d} adapter { id name slug kind } }
257
259
  dependsOn { id name resourceType region state monthlyCost }
258
260
  }
259
- }`, { id: t }, r)).adaResource,
261
+ }`, { id: t }, n)).adaResource,
260
262
  enabled: !!t,
261
- staleTime: s
263
+ staleTime: l
262
264
  });
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) {
265
+ }, A = (t = {}) => {
266
+ let { apiGatewayUrl: n } = e();
267
+ return r({
268
+ queryKey: s.policies(t),
269
+ queryFn: async () => (await c(`query AdaListPolicies($isActive: Boolean, $kind: AdaPolicyKind, $pagination: PaginationInput) {
268
270
  adaListPolicies(isActive: $isActive, kind: $kind, pagination: $pagination) {
269
- items { ${d} }
271
+ items { ${p} }
270
272
  pageInfo { cursor hasMore }
271
273
  }
272
274
  }`, {
273
275
  isActive: t.isActive,
274
276
  kind: t.kind,
275
277
  pagination: t.pagination
276
- }, r)).adaListPolicies,
277
- staleTime: s
278
+ }, n)).adaListPolicies,
279
+ staleTime: l
278
280
  });
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!) {
281
+ }, j = (t) => {
282
+ let { apiGatewayUrl: n } = e();
283
+ return r({
284
+ queryKey: s.policy(t ?? ""),
285
+ queryFn: async () => (await c(`query AdaPolicy($id: ID!) {
284
286
  adaPolicy(id: $id) {
285
- ${d}
286
- violations { ${f} }
287
+ ${p}
288
+ violations { ${m} }
287
289
  }
288
- }`, { id: t }, r)).adaPolicy,
290
+ }`, { id: t }, n)).adaPolicy,
289
291
  enabled: !!t,
290
- staleTime: s
292
+ staleTime: l
291
293
  });
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,
294
+ }, M = () => {
295
+ let t = i(), { apiGatewayUrl: r } = e();
296
+ return n({
297
+ mutationFn: async (e) => (await c(`mutation AdaCreatePolicy($input: AdaCreatePolicyInput!) {
298
+ adaCreatePolicy(input: $input) { ${p} }
299
+ }`, { input: e }, r)).adaCreatePolicy,
298
300
  onSuccess: () => {
299
- n.invalidateQueries({ queryKey: [...a.all, "policies"] });
301
+ t.invalidateQueries({ queryKey: [...s.all, "policies"] });
300
302
  }
301
303
  });
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,
304
+ }, N = () => {
305
+ let t = i(), { apiGatewayUrl: r } = e();
306
+ return n({
307
+ mutationFn: async (e) => (await c("mutation AdaArchivePolicy($id: ID!) { adaArchivePolicy(id: $id) }", { id: e }, r)).adaArchivePolicy,
306
308
  onSuccess: () => {
307
- n.invalidateQueries({ queryKey: [...a.all, "policies"] });
309
+ t.invalidateQueries({ queryKey: [...s.all, "policies"] });
308
310
  }
309
311
  });
310
- }, M = (t = {}) => {
311
- let { apiGatewayUrl: r } = e();
312
- return n({
313
- queryKey: a.violations(t),
314
- queryFn: async () => (await o(`query AdaListViolations($policyId: ID, $resourceId: ID, $status: AdaViolationStatus, $pagination: PaginationInput) {
312
+ }, P = (t = {}) => {
313
+ let { apiGatewayUrl: n } = e();
314
+ return r({
315
+ queryKey: s.violations(t),
316
+ queryFn: async () => (await c(`query AdaListViolations($policyId: ID, $resourceId: ID, $status: AdaViolationStatus, $pagination: PaginationInput) {
315
317
  adaListViolations(policyId: $policyId, resourceId: $resourceId, status: $status, pagination: $pagination) {
316
318
  items {
317
- ${f}
319
+ ${m}
318
320
  policy { id name kind severity }
319
321
  }
320
322
  pageInfo { cursor hasMore }
@@ -324,103 +326,108 @@ var a = {
324
326
  resourceId: t.resourceId,
325
327
  status: t.status,
326
328
  pagination: t.pagination
327
- }, r)).adaListViolations,
328
- staleTime: s
329
+ }, n)).adaListViolations,
330
+ staleTime: l
329
331
  });
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) {
332
+ }, F = () => {
333
+ let r = i(), { apiGatewayUrl: a } = e();
334
+ return n({
335
+ mutationFn: async ({ id: e, status: t, waiverReason: n }) => (await c(`mutation AdaResolveViolation($id: ID!, $status: AdaViolationStatus!, $waiverReason: String) {
334
336
  adaResolveViolation(id: $id, status: $status, waiverReason: $waiverReason) {
335
- ${f}
337
+ ${m}
336
338
  }
337
339
  }`, {
338
340
  id: e,
339
341
  status: t,
340
342
  waiverReason: n
341
- }, i)).adaResolveViolation,
342
- onSuccess: () => {
343
- n.invalidateQueries({ queryKey: [...a.all, "violations"] });
343
+ }, a)).adaResolveViolation,
344
+ onSuccess: (e) => {
345
+ t.success({
346
+ ACKNOWLEDGED: "Violation acknowledged",
347
+ RESOLVED: "Violation resolved",
348
+ WAIVED: "Violation waived",
349
+ OPEN: "Violation reopened"
350
+ }[e.status] ?? "Violation updated"), r.invalidateQueries({ queryKey: [...s.all, "violations"] });
344
351
  }
345
352
  });
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} }
353
+ }, I = (t = {}) => {
354
+ let { apiGatewayUrl: n } = e();
355
+ return r({
356
+ queryKey: s.drift(t),
357
+ queryFn: async () => (await c(`query AdaListDriftRecords($resourceId: ID, $status: AdaDriftStatus) {
358
+ adaListDriftRecords(resourceId: $resourceId, status: $status) { ${h} }
352
359
  }`, {
353
360
  resourceId: t.resourceId,
354
361
  status: t.status
355
- }, r)).adaListDriftRecords,
356
- staleTime: s
362
+ }, n)).adaListDriftRecords,
363
+ staleTime: l
357
364
  });
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,
365
+ }, L = () => {
366
+ let r = i(), { apiGatewayUrl: a } = e();
367
+ return n({
368
+ mutationFn: async (e) => (await c(`mutation AdaRemediateDrift($id: ID!) {
369
+ adaRemediateDrift(id: $id) { ${h} }
370
+ }`, { id: e }, a)).adaRemediateDrift,
364
371
  onSuccess: () => {
365
- n.invalidateQueries({ queryKey: [...a.all, "drift"] });
372
+ t.success("Drift marked remediated"), r.invalidateQueries({ queryKey: [...s.all, "drift"] }), r.invalidateQueries({ queryKey: [...s.all, "resources"] });
366
373
  }
367
374
  });
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) {
375
+ }, R = (t = {}) => {
376
+ let { apiGatewayUrl: n } = e();
377
+ return r({
378
+ queryKey: s.syncRuns(t),
379
+ queryFn: async () => (await c(`query AdaListSyncRuns($connectionId: ID, $status: AdaSyncStatus, $pagination: PaginationInput) {
373
380
  adaListSyncRuns(connectionId: $connectionId, status: $status, pagination: $pagination) {
374
- items { ${m} }
381
+ items { ${g} }
375
382
  pageInfo { cursor hasMore }
376
383
  }
377
384
  }`, {
378
385
  connectionId: t.connectionId,
379
386
  status: t.status,
380
387
  pagination: t.pagination
381
- }, r)).adaListSyncRuns,
382
- staleTime: s
388
+ }, n)).adaListSyncRuns,
389
+ staleTime: l
383
390
  });
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,
391
+ }, z = () => {
392
+ let r = i(), { apiGatewayUrl: a } = e();
393
+ return n({
394
+ mutationFn: async (e) => (await c(`mutation AdaStartSyncRun($input: AdaStartSyncRunInput!) {
395
+ adaStartSyncRun(input: $input) { ${g} }
396
+ }`, { input: e }, a)).adaStartSyncRun,
390
397
  onSuccess: () => {
391
- n.invalidateQueries({ queryKey: [...a.all, "sync-runs"] });
398
+ t.success("Sync run started"), r.invalidateQueries({ queryKey: [...s.all, "sync-runs"] }), r.invalidateQueries({ queryKey: [...s.all, "connections"] });
392
399
  }
393
400
  });
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,
401
+ }, B = () => {
402
+ let r = i(), { apiGatewayUrl: a } = e();
403
+ return n({
404
+ mutationFn: async (e) => (await c(`mutation AdaCancelSyncRun($id: ID!) {
405
+ adaCancelSyncRun(id: $id) { ${g} }
406
+ }`, { id: e }, a)).adaCancelSyncRun,
400
407
  onSuccess: () => {
401
- n.invalidateQueries({ queryKey: [...a.all, "sync-runs"] });
408
+ t.success("Sync run cancelled"), r.invalidateQueries({ queryKey: [...s.all, "sync-runs"] });
402
409
  }
403
410
  });
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
411
+ }, V = (t) => {
412
+ let { apiGatewayUrl: n } = e();
413
+ return r({
414
+ queryKey: s.costSummary(t),
415
+ 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,
416
+ staleTime: l
410
417
  });
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 }", {
418
+ }, H = (t = {}) => {
419
+ let { apiGatewayUrl: n } = e();
420
+ return r({
421
+ queryKey: s.costRecords(t),
422
+ 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
423
  connectionId: t.connectionId,
417
424
  resourceId: t.resourceId,
418
425
  service: t.service
419
- }, r)).adaListCostRecords,
420
- staleTime: s
426
+ }, n)).adaListCostRecords,
427
+ staleTime: l
421
428
  });
422
429
  };
423
430
  //#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 };
431
+ export { v as useAdapter, _ as useAdapters, x as useArchiveAdapter, N as useArchivePolicy, B as useCancelSyncRun, C as useConnection, S as useConnections, H as useCostRecords, V as useCostSummary, y as useCreateAdapter, w as useCreateConnection, M as useCreatePolicy, D as useDisableConnection, I as useDriftRecords, A as usePolicies, j as usePolicy, L as useRemediateDrift, F as useResolveViolation, k as useResource, O as useResources, E as useSetConnectionStatus, z as useStartSyncRun, R as useSyncRuns, b as useUpdateAdapter, T as useUpdateConnection, P as useViolations };
425
432
 
426
433
  //# sourceMappingURL=useAdapterCloudApi.js.map