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