@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.
- package/dist/adaptercloud/AdapterCloudRoot.d.ts.map +1 -1
- package/dist/adaptercloud/AdapterCloudRoot.js +52 -55
- package/dist/adaptercloud/AdapterCloudRoot.js.map +1 -1
- package/dist/adaptercloud/hooks/index.d.ts +1 -0
- package/dist/adaptercloud/hooks/index.d.ts.map +1 -1
- package/dist/adaptercloud/hooks/useAdapterCloudApi.d.ts.map +1 -1
- package/dist/adaptercloud/hooks/useAdapterCloudApi.js +302 -300
- package/dist/adaptercloud/hooks/useAdapterCloudApi.js.map +1 -1
- package/dist/adaptercloud/hooks/useTr.d.ts +2 -0
- package/dist/adaptercloud/hooks/useTr.d.ts.map +1 -0
- package/dist/adaptercloud/hooks/useTr.js +14 -0
- package/dist/adaptercloud/hooks/useTr.js.map +1 -0
- package/dist/adaptercloud/pages/OverviewPage.d.ts.map +1 -1
- package/dist/adaptercloud/pages/OverviewPage.js +116 -119
- package/dist/adaptercloud/pages/OverviewPage.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,97 +1,98 @@
|
|
|
1
|
-
import {
|
|
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
|
|
4
|
-
import { useMutation as
|
|
5
|
-
import { graphqlFetch as
|
|
6
|
-
import { clearGraphqlFetchResponseCache as
|
|
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
|
|
9
|
+
var c = {
|
|
9
10
|
all: ["adaptercloud"],
|
|
10
|
-
health: () => [...
|
|
11
|
+
health: () => [...c.all, "health"],
|
|
11
12
|
costSummary: (e) => [
|
|
12
|
-
...
|
|
13
|
+
...c.all,
|
|
13
14
|
"cost-summary",
|
|
14
15
|
e ?? null
|
|
15
16
|
],
|
|
16
17
|
costRecords: (e) => [
|
|
17
|
-
...
|
|
18
|
+
...c.all,
|
|
18
19
|
"cost-records",
|
|
19
20
|
e
|
|
20
21
|
],
|
|
21
22
|
adapters: (e) => [
|
|
22
|
-
...
|
|
23
|
+
...c.all,
|
|
23
24
|
"adapters",
|
|
24
25
|
e
|
|
25
26
|
],
|
|
26
27
|
adapter: (e) => [
|
|
27
|
-
...
|
|
28
|
+
...c.all,
|
|
28
29
|
"adapter",
|
|
29
30
|
e
|
|
30
31
|
],
|
|
31
32
|
connections: (e) => [
|
|
32
|
-
...
|
|
33
|
+
...c.all,
|
|
33
34
|
"connections",
|
|
34
35
|
e
|
|
35
36
|
],
|
|
36
37
|
connection: (e) => [
|
|
37
|
-
...
|
|
38
|
+
...c.all,
|
|
38
39
|
"connection",
|
|
39
40
|
e
|
|
40
41
|
],
|
|
41
42
|
resources: (e) => [
|
|
42
|
-
...
|
|
43
|
+
...c.all,
|
|
43
44
|
"resources",
|
|
44
45
|
e
|
|
45
46
|
],
|
|
46
47
|
resource: (e) => [
|
|
47
|
-
...
|
|
48
|
+
...c.all,
|
|
48
49
|
"resource",
|
|
49
50
|
e
|
|
50
51
|
],
|
|
51
52
|
policies: (e) => [
|
|
52
|
-
...
|
|
53
|
+
...c.all,
|
|
53
54
|
"policies",
|
|
54
55
|
e
|
|
55
56
|
],
|
|
56
57
|
policy: (e) => [
|
|
57
|
-
...
|
|
58
|
+
...c.all,
|
|
58
59
|
"policy",
|
|
59
60
|
e
|
|
60
61
|
],
|
|
61
62
|
violations: (e) => [
|
|
62
|
-
...
|
|
63
|
+
...c.all,
|
|
63
64
|
"violations",
|
|
64
65
|
e
|
|
65
66
|
],
|
|
66
67
|
drift: (e) => [
|
|
67
|
-
...
|
|
68
|
+
...c.all,
|
|
68
69
|
"drift",
|
|
69
70
|
e
|
|
70
71
|
],
|
|
71
72
|
driftCount: (e) => [
|
|
72
|
-
...
|
|
73
|
+
...c.all,
|
|
73
74
|
"drift",
|
|
74
75
|
"count",
|
|
75
76
|
e ?? null
|
|
76
77
|
],
|
|
77
78
|
syncRuns: (e) => [
|
|
78
|
-
...
|
|
79
|
+
...c.all,
|
|
79
80
|
"sync-runs",
|
|
80
81
|
e
|
|
81
82
|
],
|
|
82
83
|
syncRun: (e) => [
|
|
83
|
-
...
|
|
84
|
+
...c.all,
|
|
84
85
|
"sync-run",
|
|
85
86
|
e
|
|
86
87
|
],
|
|
87
88
|
topology: (e) => [
|
|
88
|
-
...
|
|
89
|
+
...c.all,
|
|
89
90
|
"topology",
|
|
90
91
|
e
|
|
91
92
|
],
|
|
92
|
-
topologyResources: () => [...
|
|
93
|
-
},
|
|
94
|
-
let r = await
|
|
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) &&
|
|
104
|
-
},
|
|
105
|
-
let { apiGatewayUrl: n } =
|
|
106
|
-
return
|
|
107
|
-
queryKey:
|
|
108
|
-
queryFn: async () => (await
|
|
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 { ${
|
|
111
|
-
pageInfo { ${
|
|
111
|
+
items { ${d} }
|
|
112
|
+
pageInfo { ${v} }
|
|
112
113
|
}
|
|
113
114
|
}`, {
|
|
114
|
-
kind:
|
|
115
|
-
status:
|
|
116
|
-
pagination:
|
|
115
|
+
kind: e.kind,
|
|
116
|
+
status: e.status,
|
|
117
|
+
pagination: e.pagination
|
|
117
118
|
}, n)).adaListAdapters,
|
|
118
119
|
placeholderData: (e) => e,
|
|
119
|
-
staleTime:
|
|
120
|
+
staleTime: u
|
|
120
121
|
});
|
|
121
|
-
},
|
|
122
|
-
let { apiGatewayUrl: n } =
|
|
123
|
-
return
|
|
124
|
-
queryKey:
|
|
125
|
-
queryFn: async () => (await
|
|
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
|
-
${
|
|
128
|
-
connections { ${
|
|
128
|
+
${d}
|
|
129
|
+
connections { ${f} }
|
|
129
130
|
}
|
|
130
|
-
}`, { id:
|
|
131
|
-
enabled: !!
|
|
132
|
-
staleTime:
|
|
131
|
+
}`, { id: e }, n)).adaAdapter,
|
|
132
|
+
enabled: !!e,
|
|
133
|
+
staleTime: u
|
|
133
134
|
});
|
|
134
|
-
},
|
|
135
|
-
let
|
|
136
|
-
return
|
|
137
|
-
mutationFn: async (e) => (await
|
|
138
|
-
adaCreateAdapter(input: $input) { ${
|
|
139
|
-
}`, { input: e },
|
|
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
|
-
|
|
142
|
+
e.invalidateQueries({ queryKey: [...c.all, "adapters"] });
|
|
142
143
|
}
|
|
143
144
|
});
|
|
144
|
-
},
|
|
145
|
-
let
|
|
146
|
-
return
|
|
147
|
-
mutationFn: async ({ id: e, input: t }) => (await
|
|
148
|
-
adaUpdateAdapter(id: $id, input: $input) { ${
|
|
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
|
-
},
|
|
153
|
-
onSuccess: (
|
|
154
|
-
|
|
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
|
-
},
|
|
158
|
-
let
|
|
159
|
-
return
|
|
160
|
-
mutationFn: async (e) => (await
|
|
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
|
-
|
|
163
|
+
e.invalidateQueries({ queryKey: [...c.all, "adapters"] });
|
|
163
164
|
}
|
|
164
165
|
});
|
|
165
|
-
},
|
|
166
|
-
let { apiGatewayUrl: n } =
|
|
167
|
-
return
|
|
168
|
-
queryKey:
|
|
169
|
-
queryFn: async () => (await
|
|
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
|
-
${
|
|
173
|
+
${f}
|
|
173
174
|
adapter { id name slug kind }
|
|
174
175
|
}
|
|
175
|
-
pageInfo { ${
|
|
176
|
+
pageInfo { ${v} }
|
|
176
177
|
}
|
|
177
178
|
}`, {
|
|
178
|
-
adapterId:
|
|
179
|
-
status:
|
|
180
|
-
pagination:
|
|
179
|
+
adapterId: e.adapterId,
|
|
180
|
+
status: e.status,
|
|
181
|
+
pagination: e.pagination
|
|
181
182
|
}, n)).adaListConnections,
|
|
182
183
|
placeholderData: (e) => e,
|
|
183
|
-
staleTime:
|
|
184
|
+
staleTime: u
|
|
184
185
|
});
|
|
185
|
-
},
|
|
186
|
-
let { apiGatewayUrl: n } =
|
|
187
|
-
return
|
|
188
|
-
queryKey:
|
|
189
|
-
queryFn: async () => (await
|
|
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
|
-
${
|
|
192
|
-
adapter { ${
|
|
193
|
-
resources { ${
|
|
192
|
+
${f}
|
|
193
|
+
adapter { ${d} }
|
|
194
|
+
resources { ${p} }
|
|
194
195
|
}
|
|
195
|
-
}`, { id:
|
|
196
|
-
enabled: !!
|
|
197
|
-
staleTime:
|
|
196
|
+
}`, { id: e }, n)).adaConnection,
|
|
197
|
+
enabled: !!e,
|
|
198
|
+
staleTime: u
|
|
198
199
|
});
|
|
199
|
-
},
|
|
200
|
-
let
|
|
201
|
-
return
|
|
202
|
-
mutationFn: async (e) => (await
|
|
203
|
-
adaCreateConnection(input: $input) { ${
|
|
204
|
-
}`, { input: e },
|
|
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
|
-
|
|
207
|
+
e.invalidateQueries({ queryKey: [...c.all, "connections"] });
|
|
207
208
|
}
|
|
208
209
|
});
|
|
209
|
-
},
|
|
210
|
-
let
|
|
211
|
-
return
|
|
212
|
-
mutationFn: async ({ id: e, input: t }) => (await
|
|
213
|
-
adaUpdateConnection(id: $id, input: $input) { ${
|
|
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
|
-
},
|
|
218
|
-
onSuccess: (
|
|
219
|
-
|
|
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
|
-
},
|
|
223
|
-
let
|
|
224
|
-
return
|
|
225
|
-
mutationFn: async ({ id: e, status: t }) => (await
|
|
226
|
-
adaSetConnectionStatus(id: $id, status: $status) { ${
|
|
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
|
-
},
|
|
231
|
+
}, o)).adaSetConnectionStatus,
|
|
231
232
|
onSuccess: (e) => {
|
|
232
|
-
|
|
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
|
-
},
|
|
236
|
-
let
|
|
237
|
-
return
|
|
238
|
-
mutationFn: async (e) => (await
|
|
239
|
-
adaDisableConnection(id: $id) { ${
|
|
240
|
-
}`, { id: e },
|
|
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
|
-
|
|
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
|
-
},
|
|
246
|
-
let { apiGatewayUrl: n } =
|
|
247
|
-
return
|
|
248
|
-
queryKey:
|
|
249
|
-
queryFn: async () => (await
|
|
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
|
-
${
|
|
253
|
+
${p}
|
|
253
254
|
connection { id name }
|
|
254
255
|
}
|
|
255
|
-
pageInfo { ${
|
|
256
|
+
pageInfo { ${v} }
|
|
256
257
|
}
|
|
257
258
|
}`, {
|
|
258
|
-
connectionId:
|
|
259
|
-
resourceType:
|
|
260
|
-
state:
|
|
261
|
-
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:
|
|
265
|
+
staleTime: u
|
|
265
266
|
});
|
|
266
|
-
},
|
|
267
|
-
let { apiGatewayUrl: n } =
|
|
268
|
-
return
|
|
269
|
-
queryKey:
|
|
270
|
-
queryFn: async () => (await
|
|
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
|
-
${
|
|
273
|
-
connection { ${
|
|
273
|
+
${p}
|
|
274
|
+
connection { ${f} adapter { id name slug kind } }
|
|
274
275
|
dependsOn { id name resourceType region state monthlyCost }
|
|
275
276
|
}
|
|
276
|
-
}`, { id:
|
|
277
|
-
enabled: !!
|
|
278
|
-
staleTime:
|
|
277
|
+
}`, { id: e }, n)).adaResource,
|
|
278
|
+
enabled: !!e,
|
|
279
|
+
staleTime: u
|
|
279
280
|
});
|
|
280
|
-
},
|
|
281
|
-
let { apiGatewayUrl: n } =
|
|
282
|
-
return
|
|
283
|
-
queryKey:
|
|
284
|
-
queryFn: async () => (await
|
|
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 { ${
|
|
287
|
+
items { ${m} }
|
|
287
288
|
pageInfo { cursor hasMore }
|
|
288
289
|
}
|
|
289
290
|
}`, {
|
|
290
|
-
isActive:
|
|
291
|
-
kind:
|
|
292
|
-
pagination:
|
|
291
|
+
isActive: e.isActive,
|
|
292
|
+
kind: e.kind,
|
|
293
|
+
pagination: e.pagination
|
|
293
294
|
}, n)).adaListPolicies,
|
|
294
295
|
placeholderData: (e) => e,
|
|
295
|
-
staleTime:
|
|
296
|
+
staleTime: u
|
|
296
297
|
});
|
|
297
|
-
},
|
|
298
|
-
let { apiGatewayUrl: n } =
|
|
299
|
-
return
|
|
300
|
-
queryKey:
|
|
301
|
-
queryFn: async () => (await
|
|
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
|
-
${
|
|
304
|
-
violations { ${
|
|
304
|
+
${m}
|
|
305
|
+
violations { ${h} }
|
|
305
306
|
}
|
|
306
|
-
}`, { id:
|
|
307
|
-
enabled: !!
|
|
308
|
-
staleTime:
|
|
307
|
+
}`, { id: e }, n)).adaPolicy,
|
|
308
|
+
enabled: !!e,
|
|
309
|
+
staleTime: u
|
|
309
310
|
});
|
|
310
|
-
},
|
|
311
|
-
let
|
|
312
|
-
return
|
|
313
|
-
mutationFn: async (e) => (await
|
|
314
|
-
adaCreatePolicy(input: $input) { ${
|
|
315
|
-
}`, { input: e },
|
|
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
|
-
|
|
318
|
+
e.invalidateQueries({ queryKey: [...c.all, "policies"] });
|
|
318
319
|
}
|
|
319
320
|
});
|
|
320
|
-
},
|
|
321
|
-
let
|
|
322
|
-
return
|
|
323
|
-
mutationFn: async ({ id: e, input: t }) => (await
|
|
324
|
-
adaUpdatePolicy(id: $id, input: $input) { ${
|
|
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
|
-
},
|
|
329
|
+
}, o)).adaUpdatePolicy,
|
|
329
330
|
onSuccess: (e) => {
|
|
330
|
-
|
|
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
|
-
},
|
|
334
|
-
let
|
|
335
|
-
return
|
|
336
|
-
mutationFn: async (e) => (await
|
|
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
|
-
|
|
339
|
+
e.invalidateQueries({ queryKey: [...c.all, "policies"] });
|
|
339
340
|
}
|
|
340
341
|
});
|
|
341
|
-
},
|
|
342
|
-
let { apiGatewayUrl:
|
|
343
|
-
return
|
|
342
|
+
}, L = (e = {}, n = {}) => {
|
|
343
|
+
let { apiGatewayUrl: r } = t();
|
|
344
|
+
return i({
|
|
344
345
|
enabled: n.enabled ?? !0,
|
|
345
|
-
queryKey:
|
|
346
|
-
queryFn: async () => (await
|
|
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
|
-
${
|
|
350
|
+
${h}
|
|
350
351
|
policy { id name kind severity }
|
|
351
352
|
}
|
|
352
|
-
pageInfo { ${
|
|
353
|
+
pageInfo { ${v} }
|
|
353
354
|
}
|
|
354
355
|
}`, {
|
|
355
|
-
policyId:
|
|
356
|
-
resourceId:
|
|
357
|
-
status:
|
|
358
|
-
pagination:
|
|
359
|
-
},
|
|
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:
|
|
362
|
+
staleTime: u
|
|
362
363
|
});
|
|
363
|
-
},
|
|
364
|
-
let
|
|
365
|
-
return
|
|
366
|
-
mutationFn: async ({ id: e, status: t, waiverReason: n }) => (await
|
|
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
|
-
${
|
|
369
|
+
${h}
|
|
369
370
|
}
|
|
370
371
|
}`, {
|
|
371
372
|
id: e,
|
|
372
373
|
status: t,
|
|
373
374
|
waiverReason: n
|
|
374
|
-
},
|
|
375
|
+
}, o)).adaResolveViolation,
|
|
375
376
|
onSuccess: (e) => {
|
|
376
|
-
t
|
|
377
|
-
ACKNOWLEDGED: "Violation acknowledged",
|
|
378
|
-
RESOLVED: "Violation resolved",
|
|
379
|
-
WAIVED: "Violation waived",
|
|
380
|
-
OPEN: "Violation reopened"
|
|
381
|
-
}
|
|
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
|
-
},
|
|
385
|
-
let { apiGatewayUrl: n } =
|
|
386
|
-
return
|
|
387
|
-
queryKey:
|
|
388
|
-
queryFn: async () => (await
|
|
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 { ${
|
|
391
|
-
pageInfo { ${
|
|
392
|
+
items { ${g} }
|
|
393
|
+
pageInfo { ${v} }
|
|
392
394
|
}
|
|
393
395
|
}`, {
|
|
394
|
-
resourceId:
|
|
395
|
-
status:
|
|
396
|
+
resourceId: e.resourceId,
|
|
397
|
+
status: e.status,
|
|
396
398
|
pagination: { limit: 100 }
|
|
397
399
|
}, n)).adaListDriftRecords.items,
|
|
398
|
-
staleTime:
|
|
400
|
+
staleTime: u
|
|
399
401
|
});
|
|
400
|
-
},
|
|
401
|
-
let { apiGatewayUrl: n } =
|
|
402
|
-
return
|
|
403
|
-
queryKey:
|
|
404
|
-
queryFn: async () => (await
|
|
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:
|
|
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:
|
|
417
|
+
staleTime: u
|
|
416
418
|
});
|
|
417
|
-
},
|
|
418
|
-
let
|
|
419
|
-
return
|
|
420
|
-
mutationFn: async (e) => (await
|
|
421
|
-
adaRemediateDrift(id: $id) { ${
|
|
422
|
-
}`, { id: e },
|
|
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
|
-
|
|
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
|
-
},
|
|
428
|
-
let { apiGatewayUrl:
|
|
429
|
-
return
|
|
429
|
+
}, H = (e = {}, n = {}) => {
|
|
430
|
+
let { apiGatewayUrl: r } = t();
|
|
431
|
+
return i({
|
|
430
432
|
enabled: n.enabled ?? !0,
|
|
431
|
-
queryKey:
|
|
432
|
-
queryFn: async () => (await
|
|
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
|
-
${
|
|
437
|
+
${_}
|
|
436
438
|
connection { id name adapter { id kind } }
|
|
437
439
|
}
|
|
438
|
-
pageInfo { ${
|
|
440
|
+
pageInfo { ${v} }
|
|
439
441
|
}
|
|
440
442
|
}`, {
|
|
441
|
-
connectionId:
|
|
442
|
-
status:
|
|
443
|
-
pagination:
|
|
444
|
-
},
|
|
443
|
+
connectionId: e.connectionId,
|
|
444
|
+
status: e.status,
|
|
445
|
+
pagination: e.pagination
|
|
446
|
+
}, r)).adaListSyncRuns,
|
|
445
447
|
placeholderData: (e) => e,
|
|
446
|
-
staleTime:
|
|
448
|
+
staleTime: u
|
|
447
449
|
});
|
|
448
|
-
},
|
|
449
|
-
let
|
|
450
|
-
return
|
|
451
|
-
mutationFn: async (e) => (await
|
|
452
|
-
adaStartSyncRun(input: $input) { ${
|
|
453
|
-
}`, { input: e },
|
|
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
|
-
|
|
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
|
-
},
|
|
459
|
-
let
|
|
460
|
-
return
|
|
461
|
-
mutationFn: async (e) => (await
|
|
462
|
-
adaCancelSyncRun(id: $id) { ${
|
|
463
|
-
}`, { id: e },
|
|
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
|
-
|
|
467
|
+
n.success(s("adaptercloud.toast.syncRunCancelled", "Sync run cancelled")), i.invalidateQueries({ queryKey: [...c.all, "sync-runs"] });
|
|
466
468
|
}
|
|
467
469
|
});
|
|
468
|
-
},
|
|
469
|
-
let { apiGatewayUrl: n } =
|
|
470
|
-
return
|
|
471
|
-
queryKey:
|
|
472
|
-
queryFn: async () => (await
|
|
473
|
-
staleTime:
|
|
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
|
-
},
|
|
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
|
-
}`,
|
|
486
|
-
let { apiGatewayUrl: n } =
|
|
487
|
-
return
|
|
488
|
-
queryKey:
|
|
487
|
+
}`, q = (e = {}) => {
|
|
488
|
+
let { apiGatewayUrl: n } = t();
|
|
489
|
+
return i({
|
|
490
|
+
queryKey: c.costRecords(e),
|
|
489
491
|
queryFn: async () => {
|
|
490
|
-
let
|
|
492
|
+
let t = [], r = 0;
|
|
491
493
|
for (;;) {
|
|
492
|
-
let i = (await
|
|
493
|
-
connectionId:
|
|
494
|
-
resourceId:
|
|
495
|
-
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 (
|
|
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:
|
|
507
|
+
staleTime: u
|
|
506
508
|
});
|
|
507
|
-
},
|
|
508
|
-
let { apiGatewayUrl:
|
|
509
|
-
return
|
|
510
|
-
queryKey:
|
|
509
|
+
}, J = 100, Y = () => {
|
|
510
|
+
let { apiGatewayUrl: e } = t();
|
|
511
|
+
return i({
|
|
512
|
+
queryKey: c.topologyResources(),
|
|
511
513
|
queryFn: async () => {
|
|
512
|
-
let
|
|
514
|
+
let t = [], n = 0;
|
|
513
515
|
for (;;) {
|
|
514
|
-
let r = (await
|
|
516
|
+
let r = (await l(`query AdaTopologyResources($pagination: PaginationInput) {
|
|
515
517
|
adaListResources(pagination: $pagination) {
|
|
516
518
|
items {
|
|
517
|
-
${
|
|
519
|
+
${p}
|
|
518
520
|
connection { id name }
|
|
519
521
|
}
|
|
520
|
-
pageInfo { ${
|
|
522
|
+
pageInfo { ${v} }
|
|
521
523
|
}
|
|
522
524
|
}`, { pagination: {
|
|
523
|
-
limit:
|
|
525
|
+
limit: J,
|
|
524
526
|
offset: n
|
|
525
|
-
} },
|
|
526
|
-
if (
|
|
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:
|
|
532
|
+
staleTime: u
|
|
531
533
|
});
|
|
532
|
-
},
|
|
533
|
-
let { apiGatewayUrl: n } =
|
|
534
|
-
return
|
|
535
|
-
queryKey:
|
|
534
|
+
}, X = (e = {}) => {
|
|
535
|
+
let { apiGatewayUrl: n } = t();
|
|
536
|
+
return i({
|
|
537
|
+
queryKey: c.topology(e),
|
|
536
538
|
queryFn: async () => {
|
|
537
|
-
let
|
|
539
|
+
let t = [], r = 0;
|
|
538
540
|
for (;;) {
|
|
539
|
-
let i = (await
|
|
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:
|
|
549
|
-
kind:
|
|
550
|
+
resourceId: e.resourceId,
|
|
551
|
+
kind: e.kind,
|
|
550
552
|
pagination: {
|
|
551
|
-
limit:
|
|
553
|
+
limit: J,
|
|
552
554
|
offset: r
|
|
553
555
|
}
|
|
554
556
|
}, n)).adaListTopologyEdges;
|
|
555
|
-
if (
|
|
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:
|
|
561
|
+
staleTime: u
|
|
560
562
|
});
|
|
561
563
|
};
|
|
562
564
|
//#endregion
|
|
563
|
-
export {
|
|
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
|