@burdenoff/microfe-adaptercloud 2026.827.1 → 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.
@@ -1,97 +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
  ],
71
72
  driftCount: (e) => [
72
- ...s.all,
73
+ ...c.all,
73
74
  "drift",
74
75
  "count",
75
76
  e ?? null
76
77
  ],
77
78
  syncRuns: (e) => [
78
- ...s.all,
79
+ ...c.all,
79
80
  "sync-runs",
80
81
  e
81
82
  ],
82
83
  syncRun: (e) => [
83
- ...s.all,
84
+ ...c.all,
84
85
  "sync-run",
85
86
  e
86
87
  ],
87
88
  topology: (e) => [
88
- ...s.all,
89
+ ...c.all,
89
90
  "topology",
90
91
  e
91
92
  ],
92
- topologyResources: () => [...s.all, "topology-resources"]
93
- }, c = async (e, t, n) => {
94
- let r = await a({
93
+ topologyResources: () => [...c.all, "topology-resources"]
94
+ }, l = async (e, t, n) => {
95
+ let r = await o({
95
96
  gateway: "workspace",
96
97
  baseUrl: n,
97
98
  query: e,
@@ -100,379 +101,380 @@ var s = {
100
101
  });
101
102
  if (r.errors?.length) throw Error(r.errors[0]?.message ?? "GraphQL request failed");
102
103
  if (!r.data) throw Error("GraphQL response did not include data");
103
- return /^\s*mutation\b/.test(e) && o(), r.data;
104
- }, 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 = {}) => {
105
- let { apiGatewayUrl: n } = e();
106
- return r({
107
- queryKey: s.adapters(t),
108
- 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) {
109
110
  adaListAdapters(kind: $kind, status: $status, pagination: $pagination) {
110
- items { ${u} }
111
- pageInfo { ${_} }
111
+ items { ${d} }
112
+ pageInfo { ${v} }
112
113
  }
113
114
  }`, {
114
- kind: t.kind,
115
- status: t.status,
116
- pagination: t.pagination
115
+ kind: e.kind,
116
+ status: e.status,
117
+ pagination: e.pagination
117
118
  }, n)).adaListAdapters,
118
119
  placeholderData: (e) => e,
119
- staleTime: l
120
+ staleTime: u
120
121
  });
121
- }, y = (t) => {
122
- let { apiGatewayUrl: n } = e();
123
- return r({
124
- queryKey: s.adapter(t ?? ""),
125
- 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!) {
126
127
  adaAdapter(id: $id) {
127
- ${u}
128
- connections { ${d} }
128
+ ${d}
129
+ connections { ${f} }
129
130
  }
130
- }`, { id: t }, n)).adaAdapter,
131
- enabled: !!t,
132
- staleTime: l
131
+ }`, { id: e }, n)).adaAdapter,
132
+ enabled: !!e,
133
+ staleTime: u
133
134
  });
134
- }, b = () => {
135
- let t = i(), { apiGatewayUrl: r } = e();
136
- return n({
137
- mutationFn: async (e) => (await c(`mutation AdaCreateAdapter($input: AdaCreateAdapterInput!) {
138
- adaCreateAdapter(input: $input) { ${u} }
139
- }`, { 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,
140
141
  onSuccess: () => {
141
- t.invalidateQueries({ queryKey: [...s.all, "adapters"] });
142
+ e.invalidateQueries({ queryKey: [...c.all, "adapters"] });
142
143
  }
143
144
  });
144
- }, x = () => {
145
- let t = i(), { apiGatewayUrl: r } = e();
146
- return n({
147
- mutationFn: async ({ id: e, input: t }) => (await c(`mutation AdaUpdateAdapter($id: ID!, $input: AdaUpdateAdapterInput!) {
148
- 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} }
149
150
  }`, {
150
151
  id: e,
151
152
  input: t
152
- }, r)).adaUpdateAdapter,
153
- onSuccess: (e) => {
154
- 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) });
155
156
  }
156
157
  });
157
- }, S = () => {
158
- let t = i(), { apiGatewayUrl: r } = e();
159
- return n({
160
- 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,
161
162
  onSuccess: () => {
162
- t.invalidateQueries({ queryKey: [...s.all, "adapters"] });
163
+ e.invalidateQueries({ queryKey: [...c.all, "adapters"] });
163
164
  }
164
165
  });
165
- }, C = (t = {}) => {
166
- let { apiGatewayUrl: n } = e();
167
- return r({
168
- queryKey: s.connections(t),
169
- 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) {
170
171
  adaListConnections(adapterId: $adapterId, status: $status, pagination: $pagination) {
171
172
  items {
172
- ${d}
173
+ ${f}
173
174
  adapter { id name slug kind }
174
175
  }
175
- pageInfo { ${_} }
176
+ pageInfo { ${v} }
176
177
  }
177
178
  }`, {
178
- adapterId: t.adapterId,
179
- status: t.status,
180
- pagination: t.pagination
179
+ adapterId: e.adapterId,
180
+ status: e.status,
181
+ pagination: e.pagination
181
182
  }, n)).adaListConnections,
182
183
  placeholderData: (e) => e,
183
- staleTime: l
184
+ staleTime: u
184
185
  });
185
- }, w = (t) => {
186
- let { apiGatewayUrl: n } = e();
187
- return r({
188
- queryKey: s.connection(t ?? ""),
189
- 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!) {
190
191
  adaConnection(id: $id) {
191
- ${d}
192
- adapter { ${u} }
193
- resources { ${f} }
192
+ ${f}
193
+ adapter { ${d} }
194
+ resources { ${p} }
194
195
  }
195
- }`, { id: t }, n)).adaConnection,
196
- enabled: !!t,
197
- staleTime: l
196
+ }`, { id: e }, n)).adaConnection,
197
+ enabled: !!e,
198
+ staleTime: u
198
199
  });
199
- }, T = () => {
200
- let t = i(), { apiGatewayUrl: r } = e();
201
- return n({
202
- mutationFn: async (e) => (await c(`mutation AdaCreateConnection($input: AdaCreateConnectionInput!) {
203
- adaCreateConnection(input: $input) { ${d} }
204
- }`, { 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,
205
206
  onSuccess: () => {
206
- t.invalidateQueries({ queryKey: [...s.all, "connections"] });
207
+ e.invalidateQueries({ queryKey: [...c.all, "connections"] });
207
208
  }
208
209
  });
209
- }, E = () => {
210
- let t = i(), { apiGatewayUrl: r } = e();
211
- return n({
212
- mutationFn: async ({ id: e, input: t }) => (await c(`mutation AdaUpdateConnection($id: ID!, $input: AdaUpdateConnectionInput!) {
213
- 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} }
214
215
  }`, {
215
216
  id: e,
216
217
  input: t
217
- }, r)).adaUpdateConnection,
218
- onSuccess: (e) => {
219
- 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) });
220
221
  }
221
222
  });
222
- }, D = () => {
223
- let r = i(), { apiGatewayUrl: a } = e();
224
- return n({
225
- mutationFn: async ({ id: e, status: t }) => (await c(`mutation AdaSetConnectionStatus($id: ID!, $status: AdaConnectionStatus!) {
226
- 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} }
227
228
  }`, {
228
229
  id: e,
229
230
  status: t
230
- }, a)).adaSetConnectionStatus,
231
+ }, o)).adaSetConnectionStatus,
231
232
  onSuccess: (e) => {
232
- 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) });
233
234
  }
234
235
  });
235
- }, O = () => {
236
- let r = i(), { apiGatewayUrl: a } = e();
237
- return n({
238
- mutationFn: async (e) => (await c(`mutation AdaDisableConnection($id: ID!) {
239
- adaDisableConnection(id: $id) { ${d} }
240
- }`, { 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,
241
242
  onSuccess: (e) => {
242
- 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) });
243
244
  }
244
245
  });
245
- }, k = (t = {}) => {
246
- let { apiGatewayUrl: n } = e();
247
- return r({
248
- queryKey: s.resources(t),
249
- 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) {
250
251
  adaListResources(connectionId: $connectionId, resourceType: $resourceType, state: $state, pagination: $pagination) {
251
252
  items {
252
- ${f}
253
+ ${p}
253
254
  connection { id name }
254
255
  }
255
- pageInfo { ${_} }
256
+ pageInfo { ${v} }
256
257
  }
257
258
  }`, {
258
- connectionId: t.connectionId,
259
- resourceType: t.resourceType,
260
- state: t.state,
261
- pagination: t.pagination
259
+ connectionId: e.connectionId,
260
+ resourceType: e.resourceType,
261
+ state: e.state,
262
+ pagination: e.pagination
262
263
  }, n)).adaListResources,
263
264
  placeholderData: (e) => e,
264
- staleTime: l
265
+ staleTime: u
265
266
  });
266
- }, A = (t) => {
267
- let { apiGatewayUrl: n } = e();
268
- return r({
269
- queryKey: s.resource(t ?? ""),
270
- 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!) {
271
272
  adaResource(id: $id) {
272
- ${f}
273
- connection { ${d} adapter { id name slug kind } }
273
+ ${p}
274
+ connection { ${f} adapter { id name slug kind } }
274
275
  dependsOn { id name resourceType region state monthlyCost }
275
276
  }
276
- }`, { id: t }, n)).adaResource,
277
- enabled: !!t,
278
- staleTime: l
277
+ }`, { id: e }, n)).adaResource,
278
+ enabled: !!e,
279
+ staleTime: u
279
280
  });
280
- }, j = (t = {}) => {
281
- let { apiGatewayUrl: n } = e();
282
- return r({
283
- queryKey: s.policies(t),
284
- 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) {
285
286
  adaListPolicies(isActive: $isActive, kind: $kind, pagination: $pagination) {
286
- items { ${p} }
287
+ items { ${m} }
287
288
  pageInfo { cursor hasMore }
288
289
  }
289
290
  }`, {
290
- isActive: t.isActive,
291
- kind: t.kind,
292
- pagination: t.pagination
291
+ isActive: e.isActive,
292
+ kind: e.kind,
293
+ pagination: e.pagination
293
294
  }, n)).adaListPolicies,
294
295
  placeholderData: (e) => e,
295
- staleTime: l
296
+ staleTime: u
296
297
  });
297
- }, M = (t) => {
298
- let { apiGatewayUrl: n } = e();
299
- return r({
300
- queryKey: s.policy(t ?? ""),
301
- 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!) {
302
303
  adaPolicy(id: $id) {
303
- ${p}
304
- violations { ${m} }
304
+ ${m}
305
+ violations { ${h} }
305
306
  }
306
- }`, { id: t }, n)).adaPolicy,
307
- enabled: !!t,
308
- staleTime: l
307
+ }`, { id: e }, n)).adaPolicy,
308
+ enabled: !!e,
309
+ staleTime: u
309
310
  });
310
- }, N = () => {
311
- let t = i(), { apiGatewayUrl: r } = e();
312
- return n({
313
- mutationFn: async (e) => (await c(`mutation AdaCreatePolicy($input: AdaCreatePolicyInput!) {
314
- adaCreatePolicy(input: $input) { ${p} }
315
- }`, { 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,
316
317
  onSuccess: () => {
317
- t.invalidateQueries({ queryKey: [...s.all, "policies"] });
318
+ e.invalidateQueries({ queryKey: [...c.all, "policies"] });
318
319
  }
319
320
  });
320
- }, P = () => {
321
- let r = i(), { apiGatewayUrl: a } = e();
322
- return n({
323
- mutationFn: async ({ id: e, input: t }) => (await c(`mutation AdaUpdatePolicy($id: ID!, $input: AdaUpdatePolicyInput!) {
324
- 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} }
325
326
  }`, {
326
327
  id: e,
327
328
  input: t
328
- }, a)).adaUpdatePolicy,
329
+ }, o)).adaUpdatePolicy,
329
330
  onSuccess: (e) => {
330
- 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) });
331
332
  }
332
333
  });
333
- }, F = () => {
334
- let t = i(), { apiGatewayUrl: r } = e();
335
- return n({
336
- 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,
337
338
  onSuccess: () => {
338
- t.invalidateQueries({ queryKey: [...s.all, "policies"] });
339
+ e.invalidateQueries({ queryKey: [...c.all, "policies"] });
339
340
  }
340
341
  });
341
- }, I = (t = {}, n = {}) => {
342
- let { apiGatewayUrl: i } = e();
343
- return r({
342
+ }, L = (e = {}, n = {}) => {
343
+ let { apiGatewayUrl: r } = t();
344
+ return i({
344
345
  enabled: n.enabled ?? !0,
345
- queryKey: s.violations(t),
346
- queryFn: async () => (await c(`query AdaListViolations($policyId: ID, $resourceId: ID, $status: AdaViolationStatus, $pagination: PaginationInput) {
346
+ queryKey: c.violations(e),
347
+ queryFn: async () => (await l(`query AdaListViolations($policyId: ID, $resourceId: ID, $status: AdaViolationStatus, $pagination: PaginationInput) {
347
348
  adaListViolations(policyId: $policyId, resourceId: $resourceId, status: $status, pagination: $pagination) {
348
349
  items {
349
- ${m}
350
+ ${h}
350
351
  policy { id name kind severity }
351
352
  }
352
- pageInfo { ${_} }
353
+ pageInfo { ${v} }
353
354
  }
354
355
  }`, {
355
- policyId: t.policyId,
356
- resourceId: t.resourceId,
357
- status: t.status,
358
- pagination: t.pagination
359
- }, i)).adaListViolations,
356
+ policyId: e.policyId,
357
+ resourceId: e.resourceId,
358
+ status: e.status,
359
+ pagination: e.pagination
360
+ }, r)).adaListViolations,
360
361
  placeholderData: (e) => e,
361
- staleTime: l
362
+ staleTime: u
362
363
  });
363
- }, L = () => {
364
- let r = i(), { apiGatewayUrl: a } = e();
365
- return n({
366
- 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) {
367
368
  adaResolveViolation(id: $id, status: $status, waiverReason: $waiverReason) {
368
- ${m}
369
+ ${h}
369
370
  }
370
371
  }`, {
371
372
  id: e,
372
373
  status: t,
373
374
  waiverReason: n
374
- }, a)).adaResolveViolation,
375
+ }, o)).adaResolveViolation,
375
376
  onSuccess: (e) => {
376
- t.success({
377
- ACKNOWLEDGED: "Violation acknowledged",
378
- RESOLVED: "Violation resolved",
379
- WAIVED: "Violation waived",
380
- OPEN: "Violation reopened"
381
- }[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"] });
382
384
  }
383
385
  });
384
- }, R = (t = {}) => {
385
- let { apiGatewayUrl: n } = e();
386
- return r({
387
- queryKey: s.drift(t),
388
- 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) {
389
391
  adaListDriftRecords(resourceId: $resourceId, status: $status, pagination: $pagination) {
390
- items { ${h} }
391
- pageInfo { ${_} }
392
+ items { ${g} }
393
+ pageInfo { ${v} }
392
394
  }
393
395
  }`, {
394
- resourceId: t.resourceId,
395
- status: t.status,
396
+ resourceId: e.resourceId,
397
+ status: e.status,
396
398
  pagination: { limit: 100 }
397
399
  }, n)).adaListDriftRecords.items,
398
- staleTime: l
400
+ staleTime: u
399
401
  });
400
- }, z = (t) => {
401
- let { apiGatewayUrl: n } = e();
402
- return r({
403
- queryKey: s.driftCount(t),
404
- queryFn: async () => (await c(`query AdaCountDriftRecords($status: AdaDriftStatus, $pagination: PaginationInput) {
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) {
405
407
  adaListDriftRecords(status: $status, pagination: $pagination) {
406
- pageInfo { ${_} }
408
+ pageInfo { ${v} }
407
409
  }
408
410
  }`, {
409
- status: t,
411
+ status: e,
410
412
  pagination: {
411
413
  limit: 1,
412
414
  offset: 0
413
415
  }
414
416
  }, n)).adaListDriftRecords.pageInfo.totalCount ?? null,
415
- staleTime: l
417
+ staleTime: u
416
418
  });
417
- }, B = () => {
418
- let r = i(), { apiGatewayUrl: a } = e();
419
- return n({
420
- mutationFn: async (e) => (await c(`mutation AdaRemediateDrift($id: ID!) {
421
- adaRemediateDrift(id: $id) { ${h} }
422
- }`, { 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,
423
425
  onSuccess: () => {
424
- 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"] });
425
427
  }
426
428
  });
427
- }, V = (t = {}, n = {}) => {
428
- let { apiGatewayUrl: i } = e();
429
- return r({
429
+ }, H = (e = {}, n = {}) => {
430
+ let { apiGatewayUrl: r } = t();
431
+ return i({
430
432
  enabled: n.enabled ?? !0,
431
- queryKey: s.syncRuns(t),
432
- queryFn: async () => (await c(`query AdaListSyncRuns($connectionId: ID, $status: AdaSyncStatus, $pagination: PaginationInput) {
433
+ queryKey: c.syncRuns(e),
434
+ queryFn: async () => (await l(`query AdaListSyncRuns($connectionId: ID, $status: AdaSyncStatus, $pagination: PaginationInput) {
433
435
  adaListSyncRuns(connectionId: $connectionId, status: $status, pagination: $pagination) {
434
436
  items {
435
- ${g}
437
+ ${_}
436
438
  connection { id name adapter { id kind } }
437
439
  }
438
- pageInfo { ${_} }
440
+ pageInfo { ${v} }
439
441
  }
440
442
  }`, {
441
- connectionId: t.connectionId,
442
- status: t.status,
443
- pagination: t.pagination
444
- }, i)).adaListSyncRuns,
443
+ connectionId: e.connectionId,
444
+ status: e.status,
445
+ pagination: e.pagination
446
+ }, r)).adaListSyncRuns,
445
447
  placeholderData: (e) => e,
446
- staleTime: l
448
+ staleTime: u
447
449
  });
448
- }, H = () => {
449
- let r = i(), { apiGatewayUrl: a } = e();
450
- return n({
451
- mutationFn: async (e) => (await c(`mutation AdaStartSyncRun($input: AdaStartSyncRunInput!) {
452
- adaStartSyncRun(input: $input) { ${g} }
453
- }`, { 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,
454
456
  onSuccess: () => {
455
- 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"] });
456
458
  }
457
459
  });
458
- }, U = () => {
459
- let r = i(), { apiGatewayUrl: a } = e();
460
- return n({
461
- mutationFn: async (e) => (await c(`mutation AdaCancelSyncRun($id: ID!) {
462
- adaCancelSyncRun(id: $id) { ${g} }
463
- }`, { 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,
464
466
  onSuccess: () => {
465
- 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"] });
466
468
  }
467
469
  });
468
- }, W = (t) => {
469
- let { apiGatewayUrl: n } = e();
470
- return r({
471
- queryKey: s.costSummary(t),
472
- 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,
473
- 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
474
476
  });
475
- }, G = `query AdaListCostRecords($connectionId: ID, $resourceId: ID, $service: String, $pagination: PaginationInput) {
477
+ }, K = `query AdaListCostRecords($connectionId: ID, $resourceId: ID, $service: String, $pagination: PaginationInput) {
476
478
  adaListCostRecords(connectionId: $connectionId, resourceId: $resourceId, service: $service, pagination: $pagination) {
477
479
  items {
478
480
  id service amount currency periodStart periodEnd breakdown
@@ -480,86 +482,86 @@ var s = {
480
482
  resource { id name }
481
483
  connection { id name }
482
484
  }
483
- pageInfo { ${_} }
485
+ pageInfo { ${v} }
484
486
  }
485
- }`, K = (t = {}) => {
486
- let { apiGatewayUrl: n } = e();
487
- return r({
488
- queryKey: s.costRecords(t),
487
+ }`, q = (e = {}) => {
488
+ let { apiGatewayUrl: n } = t();
489
+ return i({
490
+ queryKey: c.costRecords(e),
489
491
  queryFn: async () => {
490
- let e = [], r = 0;
492
+ let t = [], r = 0;
491
493
  for (;;) {
492
- let i = (await c(G, {
493
- connectionId: t.connectionId,
494
- resourceId: t.resourceId,
495
- service: t.service,
494
+ let i = (await l(K, {
495
+ connectionId: e.connectionId,
496
+ resourceId: e.resourceId,
497
+ service: e.service,
496
498
  pagination: {
497
499
  limit: 100,
498
500
  offset: r
499
501
  }
500
502
  }, n)).adaListCostRecords;
501
- 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;
502
504
  r += i.items.length;
503
505
  }
504
506
  },
505
- staleTime: l
507
+ staleTime: u
506
508
  });
507
- }, q = 100, J = () => {
508
- let { apiGatewayUrl: t } = e();
509
- return r({
510
- queryKey: s.topologyResources(),
509
+ }, J = 100, Y = () => {
510
+ let { apiGatewayUrl: e } = t();
511
+ return i({
512
+ queryKey: c.topologyResources(),
511
513
  queryFn: async () => {
512
- let e = [], n = 0;
514
+ let t = [], n = 0;
513
515
  for (;;) {
514
- let r = (await c(`query AdaTopologyResources($pagination: PaginationInput) {
516
+ let r = (await l(`query AdaTopologyResources($pagination: PaginationInput) {
515
517
  adaListResources(pagination: $pagination) {
516
518
  items {
517
- ${f}
519
+ ${p}
518
520
  connection { id name }
519
521
  }
520
- pageInfo { ${_} }
522
+ pageInfo { ${v} }
521
523
  }
522
524
  }`, { pagination: {
523
- limit: q,
525
+ limit: J,
524
526
  offset: n
525
- } }, t)).adaListResources;
526
- 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;
527
529
  n += r.items.length;
528
530
  }
529
531
  },
530
- staleTime: l
532
+ staleTime: u
531
533
  });
532
- }, Y = (t = {}) => {
533
- let { apiGatewayUrl: n } = e();
534
- return r({
535
- queryKey: s.topology(t),
534
+ }, X = (e = {}) => {
535
+ let { apiGatewayUrl: n } = t();
536
+ return i({
537
+ queryKey: c.topology(e),
536
538
  queryFn: async () => {
537
- let e = [], r = 0;
539
+ let t = [], r = 0;
538
540
  for (;;) {
539
- 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) {
540
542
  adaListTopologyEdges(resourceId: $resourceId, kind: $kind, pagination: $pagination) {
541
543
  items {
542
544
  id fromResourceId toResourceId kind bidirectional weight attributes
543
545
  workspaceId createdAt updatedAt
544
546
  }
545
- pageInfo { ${_} }
547
+ pageInfo { ${v} }
546
548
  }
547
549
  }`, {
548
- resourceId: t.resourceId,
549
- kind: t.kind,
550
+ resourceId: e.resourceId,
551
+ kind: e.kind,
550
552
  pagination: {
551
- limit: q,
553
+ limit: J,
552
554
  offset: r
553
555
  }
554
556
  }, n)).adaListTopologyEdges;
555
- 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;
556
558
  r += i.items.length;
557
559
  }
558
560
  },
559
- staleTime: l
561
+ staleTime: u
560
562
  });
561
563
  };
562
564
  //#endregion
563
- export { y as useAdapter, v as useAdapters, S as useArchiveAdapter, F as useArchivePolicy, U as useCancelSyncRun, w as useConnection, C as useConnections, K as useCostRecords, W as useCostSummary, b as useCreateAdapter, T as useCreateConnection, N as useCreatePolicy, O as useDisableConnection, z as useDriftCount, R as useDriftRecords, j as usePolicies, M as usePolicy, B as useRemediateDrift, L as useResolveViolation, A as useResource, k as useResources, D as useSetConnectionStatus, H as useStartSyncRun, V as useSyncRuns, Y as useTopology, J 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 };
564
566
 
565
567
  //# sourceMappingURL=useAdapterCloudApi.js.map