@burdenoff/microfe-adaptercloud 2026.629.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.
- package/dist/adaptercloud/AdapterCloudRoot.js +39 -33
- package/dist/adaptercloud/AdapterCloudRoot.js.map +1 -1
- package/dist/adaptercloud/hooks/useAdapterCloudApi.js +223 -216
- package/dist/adaptercloud/hooks/useAdapterCloudApi.js.map +1 -1
- package/dist/adaptercloud/lib/toast.js +36 -0
- package/dist/adaptercloud/lib/toast.js.map +1 -0
- package/dist/adaptercloud/pages/OverviewPage.js +1 -1
- package/dist/adaptercloud/pages/OverviewPage.js.map +1 -1
- package/dist/adaptercloud/utils/domain.js +1 -0
- package/dist/adaptercloud/utils/domain.js.map +1 -1
- package/dist/adaptercloud/utils/formatters.js +3 -15
- package/dist/adaptercloud/utils/formatters.js.map +1 -1
- package/dist/index.js +4 -4
- 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 {
|
|
4
|
-
import {
|
|
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
|
|
8
|
+
var s = {
|
|
7
9
|
all: ["adaptercloud"],
|
|
8
|
-
health: () => [...
|
|
10
|
+
health: () => [...s.all, "health"],
|
|
9
11
|
costSummary: (e) => [
|
|
10
|
-
...
|
|
12
|
+
...s.all,
|
|
11
13
|
"cost-summary",
|
|
12
14
|
e ?? null
|
|
13
15
|
],
|
|
14
16
|
costRecords: (e) => [
|
|
15
|
-
...
|
|
17
|
+
...s.all,
|
|
16
18
|
"cost-records",
|
|
17
19
|
e
|
|
18
20
|
],
|
|
19
21
|
adapters: (e) => [
|
|
20
|
-
...
|
|
22
|
+
...s.all,
|
|
21
23
|
"adapters",
|
|
22
24
|
e
|
|
23
25
|
],
|
|
24
26
|
adapter: (e) => [
|
|
25
|
-
...
|
|
27
|
+
...s.all,
|
|
26
28
|
"adapter",
|
|
27
29
|
e
|
|
28
30
|
],
|
|
29
31
|
connections: (e) => [
|
|
30
|
-
...
|
|
32
|
+
...s.all,
|
|
31
33
|
"connections",
|
|
32
34
|
e
|
|
33
35
|
],
|
|
34
36
|
connection: (e) => [
|
|
35
|
-
...
|
|
37
|
+
...s.all,
|
|
36
38
|
"connection",
|
|
37
39
|
e
|
|
38
40
|
],
|
|
39
41
|
resources: (e) => [
|
|
40
|
-
...
|
|
42
|
+
...s.all,
|
|
41
43
|
"resources",
|
|
42
44
|
e
|
|
43
45
|
],
|
|
44
46
|
resource: (e) => [
|
|
45
|
-
...
|
|
47
|
+
...s.all,
|
|
46
48
|
"resource",
|
|
47
49
|
e
|
|
48
50
|
],
|
|
49
51
|
policies: (e) => [
|
|
50
|
-
...
|
|
52
|
+
...s.all,
|
|
51
53
|
"policies",
|
|
52
54
|
e
|
|
53
55
|
],
|
|
54
56
|
policy: (e) => [
|
|
55
|
-
...
|
|
57
|
+
...s.all,
|
|
56
58
|
"policy",
|
|
57
59
|
e
|
|
58
60
|
],
|
|
59
61
|
violations: (e) => [
|
|
60
|
-
...
|
|
62
|
+
...s.all,
|
|
61
63
|
"violations",
|
|
62
64
|
e
|
|
63
65
|
],
|
|
64
66
|
drift: (e) => [
|
|
65
|
-
...
|
|
67
|
+
...s.all,
|
|
66
68
|
"drift",
|
|
67
69
|
e
|
|
68
70
|
],
|
|
69
71
|
syncRuns: (e) => [
|
|
70
|
-
...
|
|
72
|
+
...s.all,
|
|
71
73
|
"sync-runs",
|
|
72
74
|
e
|
|
73
75
|
],
|
|
74
76
|
syncRun: (e) => [
|
|
75
|
-
...
|
|
77
|
+
...s.all,
|
|
76
78
|
"sync-run",
|
|
77
79
|
e
|
|
78
80
|
]
|
|
79
|
-
},
|
|
80
|
-
let r = await
|
|
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
|
-
},
|
|
91
|
-
let { apiGatewayUrl:
|
|
92
|
-
return
|
|
93
|
-
queryKey:
|
|
94
|
-
queryFn: async () => (await
|
|
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 { ${
|
|
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
|
-
},
|
|
104
|
-
staleTime:
|
|
105
|
+
}, n)).adaListAdapters,
|
|
106
|
+
staleTime: l
|
|
105
107
|
});
|
|
106
|
-
},
|
|
107
|
-
let { apiGatewayUrl:
|
|
108
|
-
return
|
|
109
|
-
queryKey:
|
|
110
|
-
queryFn: async () => (await
|
|
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
|
-
${
|
|
113
|
-
connections { ${
|
|
114
|
+
${u}
|
|
115
|
+
connections { ${d} }
|
|
114
116
|
}
|
|
115
|
-
}`, { id: t },
|
|
117
|
+
}`, { id: t }, n)).adaAdapter,
|
|
116
118
|
enabled: !!t,
|
|
117
|
-
staleTime:
|
|
119
|
+
staleTime: l
|
|
118
120
|
});
|
|
119
|
-
},
|
|
120
|
-
let
|
|
121
|
-
return
|
|
122
|
-
mutationFn: async (e) => (await
|
|
123
|
-
adaCreateAdapter(input: $input) { ${
|
|
124
|
-
}`, { input: e },
|
|
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
|
-
|
|
128
|
+
t.invalidateQueries({ queryKey: [...s.all, "adapters"] });
|
|
127
129
|
}
|
|
128
130
|
});
|
|
129
|
-
},
|
|
130
|
-
let
|
|
131
|
-
return
|
|
132
|
-
mutationFn: async ({ id: e, input: t }) => (await
|
|
133
|
-
adaUpdateAdapter(id: $id, input: $input) { ${
|
|
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
|
-
},
|
|
139
|
+
}, r)).adaUpdateAdapter,
|
|
138
140
|
onSuccess: (e) => {
|
|
139
|
-
|
|
141
|
+
t.invalidateQueries({ queryKey: [...s.all, "adapters"] }), t.invalidateQueries({ queryKey: s.adapter(e.id) });
|
|
140
142
|
}
|
|
141
143
|
});
|
|
142
|
-
},
|
|
143
|
-
let
|
|
144
|
-
return
|
|
145
|
-
mutationFn: async (e) => (await
|
|
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
|
-
|
|
149
|
+
t.invalidateQueries({ queryKey: [...s.all, "adapters"] });
|
|
148
150
|
}
|
|
149
151
|
});
|
|
150
|
-
},
|
|
151
|
-
let { apiGatewayUrl:
|
|
152
|
-
return
|
|
153
|
-
queryKey:
|
|
154
|
-
queryFn: async () => (await
|
|
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
|
-
${
|
|
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
|
-
},
|
|
167
|
-
staleTime:
|
|
168
|
+
}, n)).adaListConnections,
|
|
169
|
+
staleTime: l
|
|
168
170
|
});
|
|
169
|
-
},
|
|
170
|
-
let { apiGatewayUrl:
|
|
171
|
-
return
|
|
172
|
-
queryKey:
|
|
173
|
-
queryFn: async () => (await
|
|
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
|
-
${
|
|
176
|
-
adapter { ${
|
|
177
|
-
resources { ${
|
|
177
|
+
${d}
|
|
178
|
+
adapter { ${u} }
|
|
179
|
+
resources { ${f} }
|
|
178
180
|
}
|
|
179
|
-
}`, { id: t },
|
|
181
|
+
}`, { id: t }, n)).adaConnection,
|
|
180
182
|
enabled: !!t,
|
|
181
|
-
staleTime:
|
|
183
|
+
staleTime: l
|
|
182
184
|
});
|
|
183
|
-
},
|
|
184
|
-
let
|
|
185
|
-
return
|
|
186
|
-
mutationFn: async (e) => (await
|
|
187
|
-
adaCreateConnection(input: $input) { ${
|
|
188
|
-
}`, { input: e },
|
|
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
|
-
|
|
192
|
+
t.invalidateQueries({ queryKey: [...s.all, "connections"] });
|
|
191
193
|
}
|
|
192
194
|
});
|
|
193
|
-
},
|
|
194
|
-
let
|
|
195
|
-
return
|
|
196
|
-
mutationFn: async ({ id: e, input: t }) => (await
|
|
197
|
-
adaUpdateConnection(id: $id, input: $input) { ${
|
|
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
|
-
},
|
|
203
|
+
}, r)).adaUpdateConnection,
|
|
202
204
|
onSuccess: (e) => {
|
|
203
|
-
|
|
205
|
+
t.invalidateQueries({ queryKey: [...s.all, "connections"] }), t.invalidateQueries({ queryKey: s.connection(e.id) });
|
|
204
206
|
}
|
|
205
207
|
});
|
|
206
|
-
},
|
|
207
|
-
let
|
|
208
|
-
return
|
|
209
|
-
mutationFn: async ({ id: e, status: t }) => (await
|
|
210
|
-
adaSetConnectionStatus(id: $id, status: $status) { ${
|
|
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
|
-
},
|
|
216
|
+
}, a)).adaSetConnectionStatus,
|
|
215
217
|
onSuccess: (e) => {
|
|
216
|
-
|
|
218
|
+
t.success("Connection health updated"), r.invalidateQueries({ queryKey: [...s.all, "connections"] }), r.invalidateQueries({ queryKey: s.connection(e.id) });
|
|
217
219
|
}
|
|
218
220
|
});
|
|
219
|
-
},
|
|
220
|
-
let
|
|
221
|
-
return
|
|
222
|
-
mutationFn: async (e) => (await
|
|
223
|
-
adaDisableConnection(id: $id) { ${
|
|
224
|
-
}`, { id: e },
|
|
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
|
-
|
|
228
|
+
t.success("Connection disabled"), r.invalidateQueries({ queryKey: [...s.all, "connections"] }), r.invalidateQueries({ queryKey: s.connection(e.id) });
|
|
227
229
|
}
|
|
228
230
|
});
|
|
229
|
-
},
|
|
230
|
-
let { apiGatewayUrl:
|
|
231
|
-
return
|
|
232
|
-
queryKey:
|
|
233
|
-
queryFn: async () => (await
|
|
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
|
-
${
|
|
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
|
-
},
|
|
247
|
-
staleTime:
|
|
248
|
+
}, n)).adaListResources,
|
|
249
|
+
staleTime: l
|
|
248
250
|
});
|
|
249
|
-
},
|
|
250
|
-
let { apiGatewayUrl:
|
|
251
|
-
return
|
|
252
|
-
queryKey:
|
|
253
|
-
queryFn: async () => (await
|
|
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
|
-
${
|
|
256
|
-
connection { ${
|
|
257
|
+
${f}
|
|
258
|
+
connection { ${d} adapter { id name slug kind } }
|
|
257
259
|
dependsOn { id name resourceType region state monthlyCost }
|
|
258
260
|
}
|
|
259
|
-
}`, { id: t },
|
|
261
|
+
}`, { id: t }, n)).adaResource,
|
|
260
262
|
enabled: !!t,
|
|
261
|
-
staleTime:
|
|
263
|
+
staleTime: l
|
|
262
264
|
});
|
|
263
|
-
},
|
|
264
|
-
let { apiGatewayUrl:
|
|
265
|
-
return
|
|
266
|
-
queryKey:
|
|
267
|
-
queryFn: async () => (await
|
|
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 { ${
|
|
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
|
-
},
|
|
277
|
-
staleTime:
|
|
278
|
+
}, n)).adaListPolicies,
|
|
279
|
+
staleTime: l
|
|
278
280
|
});
|
|
279
|
-
},
|
|
280
|
-
let { apiGatewayUrl:
|
|
281
|
-
return
|
|
282
|
-
queryKey:
|
|
283
|
-
queryFn: async () => (await
|
|
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
|
-
${
|
|
286
|
-
violations { ${
|
|
287
|
+
${p}
|
|
288
|
+
violations { ${m} }
|
|
287
289
|
}
|
|
288
|
-
}`, { id: t },
|
|
290
|
+
}`, { id: t }, n)).adaPolicy,
|
|
289
291
|
enabled: !!t,
|
|
290
|
-
staleTime:
|
|
292
|
+
staleTime: l
|
|
291
293
|
});
|
|
292
|
-
},
|
|
293
|
-
let
|
|
294
|
-
return
|
|
295
|
-
mutationFn: async (e) => (await
|
|
296
|
-
adaCreatePolicy(input: $input) { ${
|
|
297
|
-
}`, { input: e },
|
|
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
|
-
|
|
301
|
+
t.invalidateQueries({ queryKey: [...s.all, "policies"] });
|
|
300
302
|
}
|
|
301
303
|
});
|
|
302
|
-
},
|
|
303
|
-
let
|
|
304
|
-
return
|
|
305
|
-
mutationFn: async (e) => (await
|
|
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
|
-
|
|
309
|
+
t.invalidateQueries({ queryKey: [...s.all, "policies"] });
|
|
308
310
|
}
|
|
309
311
|
});
|
|
310
|
-
},
|
|
311
|
-
let { apiGatewayUrl:
|
|
312
|
-
return
|
|
313
|
-
queryKey:
|
|
314
|
-
queryFn: async () => (await
|
|
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
|
-
${
|
|
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
|
-
},
|
|
328
|
-
staleTime:
|
|
329
|
+
}, n)).adaListViolations,
|
|
330
|
+
staleTime: l
|
|
329
331
|
});
|
|
330
|
-
},
|
|
331
|
-
let
|
|
332
|
-
return
|
|
333
|
-
mutationFn: async ({ id: e, status: t, waiverReason: n }) => (await
|
|
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
|
-
${
|
|
337
|
+
${m}
|
|
336
338
|
}
|
|
337
339
|
}`, {
|
|
338
340
|
id: e,
|
|
339
341
|
status: t,
|
|
340
342
|
waiverReason: n
|
|
341
|
-
},
|
|
342
|
-
onSuccess: () => {
|
|
343
|
-
|
|
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
|
-
},
|
|
347
|
-
let { apiGatewayUrl:
|
|
348
|
-
return
|
|
349
|
-
queryKey:
|
|
350
|
-
queryFn: async () => (await
|
|
351
|
-
adaListDriftRecords(resourceId: $resourceId, status: $status) { ${
|
|
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
|
-
},
|
|
356
|
-
staleTime:
|
|
362
|
+
}, n)).adaListDriftRecords,
|
|
363
|
+
staleTime: l
|
|
357
364
|
});
|
|
358
|
-
},
|
|
359
|
-
let
|
|
360
|
-
return
|
|
361
|
-
mutationFn: async (e) => (await
|
|
362
|
-
adaRemediateDrift(id: $id) { ${
|
|
363
|
-
}`, { id: e },
|
|
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
|
-
|
|
372
|
+
t.success("Drift marked remediated"), r.invalidateQueries({ queryKey: [...s.all, "drift"] }), r.invalidateQueries({ queryKey: [...s.all, "resources"] });
|
|
366
373
|
}
|
|
367
374
|
});
|
|
368
|
-
},
|
|
369
|
-
let { apiGatewayUrl:
|
|
370
|
-
return
|
|
371
|
-
queryKey:
|
|
372
|
-
queryFn: async () => (await
|
|
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 { ${
|
|
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
|
-
},
|
|
382
|
-
staleTime:
|
|
388
|
+
}, n)).adaListSyncRuns,
|
|
389
|
+
staleTime: l
|
|
383
390
|
});
|
|
384
|
-
},
|
|
385
|
-
let
|
|
386
|
-
return
|
|
387
|
-
mutationFn: async (e) => (await
|
|
388
|
-
adaStartSyncRun(input: $input) { ${
|
|
389
|
-
}`, { input: e },
|
|
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
|
-
|
|
398
|
+
t.success("Sync run started"), r.invalidateQueries({ queryKey: [...s.all, "sync-runs"] }), r.invalidateQueries({ queryKey: [...s.all, "connections"] });
|
|
392
399
|
}
|
|
393
400
|
});
|
|
394
|
-
},
|
|
395
|
-
let
|
|
396
|
-
return
|
|
397
|
-
mutationFn: async (e) => (await
|
|
398
|
-
adaCancelSyncRun(id: $id) { ${
|
|
399
|
-
}`, { id: e },
|
|
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
|
-
|
|
408
|
+
t.success("Sync run cancelled"), r.invalidateQueries({ queryKey: [...s.all, "sync-runs"] });
|
|
402
409
|
}
|
|
403
410
|
});
|
|
404
|
-
},
|
|
405
|
-
let { apiGatewayUrl:
|
|
406
|
-
return
|
|
407
|
-
queryKey:
|
|
408
|
-
queryFn: async () => (await
|
|
409
|
-
staleTime:
|
|
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
|
-
},
|
|
412
|
-
let { apiGatewayUrl:
|
|
413
|
-
return
|
|
414
|
-
queryKey:
|
|
415
|
-
queryFn: async () => (await
|
|
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
|
-
},
|
|
420
|
-
staleTime:
|
|
426
|
+
}, n)).adaListCostRecords,
|
|
427
|
+
staleTime: l
|
|
421
428
|
});
|
|
422
429
|
};
|
|
423
430
|
//#endregion
|
|
424
|
-
export {
|
|
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
|