@elevasis/ui 2.6.0 → 2.8.0
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/{chunk-POFDRPDI.js → chunk-4PHPENKX.js} +3044 -1753
- package/dist/chunk-7M2VOCYN.js +1 -0
- package/dist/{chunk-PEDPD3PU.js → chunk-7PDDPNQS.js} +1 -1
- package/dist/{chunk-YIWLA2B6.js → chunk-C2OFFC7J.js} +0 -1
- package/dist/{chunk-ZB5PKIX5.js → chunk-CTWYIRKW.js} +1 -2
- package/dist/{chunk-FH5QGCXL.js → chunk-F5QSLYUB.js} +180 -7
- package/dist/{chunk-CC4WGHGG.js → chunk-KGEYEUR5.js} +1 -3
- package/dist/{chunk-MU5EZV3L.js → chunk-MGEC63TE.js} +5 -6
- package/dist/{chunk-SMJLS23U.js → chunk-NYMKWGKN.js} +18 -1
- package/dist/{chunk-X4BLH3JL.js → chunk-OFT2QK6B.js} +6 -7
- package/dist/{chunk-O4PMRC6J.js → chunk-OPT74SGF.js} +118 -111
- package/dist/{chunk-6RGNVHG3.js → chunk-UX3Q4YYN.js} +21 -13
- package/dist/{chunk-4GZ6VZWO.js → chunk-YCHZ4U5V.js} +10 -2
- package/dist/{chunk-PHRDZFJT.js → chunk-ZZ35VSNF.js} +1 -3
- package/dist/components/index.d.ts +134 -68
- package/dist/components/index.js +34 -25
- package/dist/features/auth/index.d.ts +3 -3
- package/dist/features/auth/index.js +9 -2
- package/dist/features/crm/index.d.ts +61 -5
- package/dist/features/crm/index.js +5 -5
- package/dist/features/dashboard/index.js +5 -5
- package/dist/features/delivery/index.d.ts +64 -4
- package/dist/features/delivery/index.js +5 -5
- package/dist/features/lead-gen/index.d.ts +61 -5
- package/dist/features/lead-gen/index.js +8 -8
- package/dist/features/monitoring/index.d.ts +20 -1
- package/dist/features/monitoring/index.js +6 -6
- package/dist/features/operations/index.d.ts +20 -1
- package/dist/features/operations/index.js +7 -7
- package/dist/features/seo/index.d.ts +20 -1
- package/dist/features/seo/index.js +1 -1
- package/dist/features/settings/index.d.ts +22 -2
- package/dist/features/settings/index.js +5 -5
- package/dist/hooks/index.d.ts +7735 -7719
- package/dist/hooks/index.js +4 -4
- package/dist/hooks/published.d.ts +3495 -48
- package/dist/hooks/published.js +3 -3
- package/dist/index.d.ts +1188 -989
- package/dist/index.js +4 -4
- package/dist/initialization/index.d.ts +2 -1
- package/dist/layout/index.d.ts +60 -2
- package/dist/layout/index.js +1 -1
- package/dist/organization/index.d.ts +2 -1
- package/dist/provider/index.d.ts +203 -20
- package/dist/provider/index.js +2 -2
- package/dist/provider/published.d.ts +194 -19
- package/dist/provider/published.js +1 -1
- package/dist/types/index.d.ts +2 -1
- package/package.json +58 -86
- package/dist/chunk-DQJM7T2N.js +0 -1303
package/dist/chunk-DQJM7T2N.js
DELETED
|
@@ -1,1303 +0,0 @@
|
|
|
1
|
-
import { CredentialNameSchema, UuidSchema, useErrorNotification, showApiErrorNotification } from './chunk-POFDRPDI.js';
|
|
2
|
-
import { getTimeRangeDates } from './chunk-LXHZYSMQ.js';
|
|
3
|
-
import { useNotificationAdapter } from './chunk-O4PMRC6J.js';
|
|
4
|
-
import { GC_TIME_SHORT, STALE_TIME_MONITORING, GC_TIME_MEDIUM, STALE_TIME_DEFAULT } from './chunk-IOKL7BKE.js';
|
|
5
|
-
import { useElevasisServices } from './chunk-QEPXAWE2.js';
|
|
6
|
-
import { z } from 'zod';
|
|
7
|
-
import { create } from 'zustand';
|
|
8
|
-
import { useState, useRef, useEffect, useCallback, useMemo } from 'react';
|
|
9
|
-
import { persist } from 'zustand/middleware';
|
|
10
|
-
import { useQuery, useQueryClient, useMutation } from '@tanstack/react-query';
|
|
11
|
-
import { notifications } from '@mantine/notifications';
|
|
12
|
-
|
|
13
|
-
// ../core/src/auth/multi-tenancy/memberships/membership.ts
|
|
14
|
-
function transformMembershipToTableRow(membership) {
|
|
15
|
-
return {
|
|
16
|
-
id: membership.id,
|
|
17
|
-
userId: membership.userId,
|
|
18
|
-
organizationId: membership.organizationId,
|
|
19
|
-
userEmail: membership.user?.email || "Unknown",
|
|
20
|
-
userFullName: membership.user?.firstName && membership.user?.lastName ? `${membership.user.firstName} ${membership.user.lastName}` : membership.user?.email || "Unknown User",
|
|
21
|
-
organizationName: membership.organization?.name || "Unknown Organization",
|
|
22
|
-
role: membership.role.slug,
|
|
23
|
-
status: membership.status,
|
|
24
|
-
statusBadge: membership.status,
|
|
25
|
-
joinedAt: new Date(membership.createdAt),
|
|
26
|
-
updatedAt: new Date(membership.updatedAt),
|
|
27
|
-
canEdit: membership.status === "active",
|
|
28
|
-
canRemove: true
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
var MEMBERSHIP_STATUS_COLORS = {
|
|
32
|
-
active: "green",
|
|
33
|
-
inactive: "gray"
|
|
34
|
-
};
|
|
35
|
-
var MembershipRoleSchema = z.enum(["admin", "member"]);
|
|
36
|
-
z.enum(["active", "inactive"]);
|
|
37
|
-
var MembershipIdParamSchema = z.object({
|
|
38
|
-
id: z.string().min(1)
|
|
39
|
-
// WorkOS membership IDs can be various formats
|
|
40
|
-
}).strict();
|
|
41
|
-
var CreateMembershipSchema = z.object({
|
|
42
|
-
userId: z.string().min(1),
|
|
43
|
-
organizationId: z.string().min(1),
|
|
44
|
-
roleSlug: MembershipRoleSchema.default("member")
|
|
45
|
-
}).strict();
|
|
46
|
-
var UpdateMembershipSchema = z.object({
|
|
47
|
-
roleSlug: MembershipRoleSchema
|
|
48
|
-
}).strict();
|
|
49
|
-
var ListMembershipsQuerySchema = z.object({
|
|
50
|
-
userId: z.string().optional(),
|
|
51
|
-
organizationId: z.string().optional(),
|
|
52
|
-
limit: z.coerce.number().int().min(1).max(100).optional(),
|
|
53
|
-
before: z.string().optional(),
|
|
54
|
-
// WorkOS pagination cursor
|
|
55
|
-
after: z.string().optional()
|
|
56
|
-
// WorkOS pagination cursor
|
|
57
|
-
}).strict().refine(
|
|
58
|
-
(data) => data.userId || data.organizationId,
|
|
59
|
-
{
|
|
60
|
-
message: "Either userId or organizationId must be provided"
|
|
61
|
-
}
|
|
62
|
-
);
|
|
63
|
-
var CredentialTypeSchema = z.enum(["oauth", "api-key", "webhook-secret", "api-key-secret"]);
|
|
64
|
-
var CredentialValueSchema = z.record(z.string(), z.unknown()).refine((val) => Object.keys(val).length > 0, { message: "Credential value must not be empty" }).refine((val) => Object.keys(val).length <= 50, { message: "Credential value has too many keys (max 50)" }).refine(
|
|
65
|
-
(val) => {
|
|
66
|
-
for (const v of Object.values(val)) {
|
|
67
|
-
if (typeof v === "string" && v.length > 10240) {
|
|
68
|
-
return false;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
return true;
|
|
72
|
-
},
|
|
73
|
-
{ message: "Individual credential values too large (max 10KB per string)" }
|
|
74
|
-
);
|
|
75
|
-
var CreateCredentialRequestSchema = z.object({
|
|
76
|
-
name: CredentialNameSchema,
|
|
77
|
-
type: CredentialTypeSchema,
|
|
78
|
-
value: CredentialValueSchema,
|
|
79
|
-
provider: z.string().optional()
|
|
80
|
-
// OAuth provider ID ('dropbox', 'notion', 'google-sheets')
|
|
81
|
-
}).strict();
|
|
82
|
-
var CreateCredentialResponseSchema = z.object({
|
|
83
|
-
id: UuidSchema,
|
|
84
|
-
name: z.string()
|
|
85
|
-
});
|
|
86
|
-
var ListCredentialsResponseSchema = z.object({
|
|
87
|
-
credentials: z.array(
|
|
88
|
-
z.object({
|
|
89
|
-
id: UuidSchema,
|
|
90
|
-
name: z.string(),
|
|
91
|
-
type: z.string(),
|
|
92
|
-
provider: z.string().nullable(),
|
|
93
|
-
// OAuth provider or null for non-OAuth
|
|
94
|
-
createdAt: z.string().datetime()
|
|
95
|
-
})
|
|
96
|
-
)
|
|
97
|
-
});
|
|
98
|
-
var UpdateCredentialParamsSchema = z.object({
|
|
99
|
-
credentialId: UuidSchema
|
|
100
|
-
});
|
|
101
|
-
var UpdateCredentialRequestSchema = z.object({
|
|
102
|
-
value: CredentialValueSchema.optional(),
|
|
103
|
-
name: CredentialNameSchema.optional()
|
|
104
|
-
}).strict().refine((data) => data.value !== void 0 || data.name !== void 0, {
|
|
105
|
-
message: "At least one field (value or name) must be provided"
|
|
106
|
-
});
|
|
107
|
-
var DeleteCredentialParamsSchema = z.object({
|
|
108
|
-
credentialId: UuidSchema
|
|
109
|
-
});
|
|
110
|
-
var DecryptCredentialParamsSchema = z.object({
|
|
111
|
-
credentialName: CredentialNameSchema
|
|
112
|
-
});
|
|
113
|
-
var DecryptCredentialResponseSchema = z.object({
|
|
114
|
-
value: z.record(z.string(), z.unknown())
|
|
115
|
-
});
|
|
116
|
-
var CredentialSchemas = {
|
|
117
|
-
CreateRequest: CreateCredentialRequestSchema,
|
|
118
|
-
CreateResponse: CreateCredentialResponseSchema,
|
|
119
|
-
ListResponse: ListCredentialsResponseSchema,
|
|
120
|
-
UpdateParams: UpdateCredentialParamsSchema,
|
|
121
|
-
UpdateRequest: UpdateCredentialRequestSchema,
|
|
122
|
-
DeleteParams: DeleteCredentialParamsSchema,
|
|
123
|
-
DecryptParams: DecryptCredentialParamsSchema,
|
|
124
|
-
DecryptResponse: DecryptCredentialResponseSchema
|
|
125
|
-
};
|
|
126
|
-
var useResourceSearch = create((set) => ({
|
|
127
|
-
query: "",
|
|
128
|
-
set: (query) => set({ query })
|
|
129
|
-
}));
|
|
130
|
-
var useStatusFilter = create((set) => ({
|
|
131
|
-
value: "all",
|
|
132
|
-
set: (value) => set({ value })
|
|
133
|
-
}));
|
|
134
|
-
function useVisibleResources() {
|
|
135
|
-
const [visibleIds, setVisibleIds] = useState(/* @__PURE__ */ new Set());
|
|
136
|
-
const observerRef = useRef(null);
|
|
137
|
-
const containerRef = useRef(null);
|
|
138
|
-
useEffect(() => {
|
|
139
|
-
observerRef.current = new IntersectionObserver(
|
|
140
|
-
(entries) => {
|
|
141
|
-
setVisibleIds((prev) => {
|
|
142
|
-
const next = new Set(prev);
|
|
143
|
-
for (const entry of entries) {
|
|
144
|
-
const id = entry.target.dataset.resourceId;
|
|
145
|
-
if (!id) continue;
|
|
146
|
-
if (entry.isIntersecting) {
|
|
147
|
-
next.add(id);
|
|
148
|
-
} else {
|
|
149
|
-
next.delete(id);
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
return next;
|
|
153
|
-
});
|
|
154
|
-
},
|
|
155
|
-
{ threshold: 0.5 }
|
|
156
|
-
);
|
|
157
|
-
return () => {
|
|
158
|
-
observerRef.current?.disconnect();
|
|
159
|
-
};
|
|
160
|
-
}, []);
|
|
161
|
-
useEffect(() => {
|
|
162
|
-
const observer = observerRef.current;
|
|
163
|
-
const container = containerRef.current;
|
|
164
|
-
if (!observer || !container) return;
|
|
165
|
-
const cards = container.querySelectorAll("[data-resource-id]");
|
|
166
|
-
cards.forEach((card) => observer.observe(card));
|
|
167
|
-
return () => {
|
|
168
|
-
cards.forEach((card) => observer.unobserve(card));
|
|
169
|
-
};
|
|
170
|
-
});
|
|
171
|
-
const setContainerRef = useCallback((node) => {
|
|
172
|
-
containerRef.current = node;
|
|
173
|
-
}, []);
|
|
174
|
-
return { visibleIds, setContainerRef };
|
|
175
|
-
}
|
|
176
|
-
var FILTER_CYCLE = ["neutral", "include", "exclude"];
|
|
177
|
-
function createDomainFiltersStore(storageKey) {
|
|
178
|
-
return create()(
|
|
179
|
-
persist(
|
|
180
|
-
(set) => ({
|
|
181
|
-
filters: {},
|
|
182
|
-
cycle: (domainId) => set((state) => {
|
|
183
|
-
const current = state.filters[domainId] || "neutral";
|
|
184
|
-
const next = FILTER_CYCLE[(FILTER_CYCLE.indexOf(current) + 1) % FILTER_CYCLE.length];
|
|
185
|
-
return { filters: { ...state.filters, [domainId]: next } };
|
|
186
|
-
}),
|
|
187
|
-
reset: () => set({ filters: {} })
|
|
188
|
-
}),
|
|
189
|
-
{ name: storageKey }
|
|
190
|
-
)
|
|
191
|
-
);
|
|
192
|
-
}
|
|
193
|
-
var useResourcesDomainFilters = createDomainFiltersStore("resources-domain-filters");
|
|
194
|
-
var useCommandViewDomainFilters = createDomainFiltersStore("command-view-domain-filters");
|
|
195
|
-
function filterByDomainFilters(items, filters) {
|
|
196
|
-
const includes = Object.entries(filters).filter(([, v]) => v === "include").map(([k]) => k);
|
|
197
|
-
const excludes = Object.entries(filters).filter(([, v]) => v === "exclude").map(([k]) => k);
|
|
198
|
-
if (includes.length === 0 && excludes.length === 0) return items;
|
|
199
|
-
return items.filter((r) => {
|
|
200
|
-
const domains = r.domains || [];
|
|
201
|
-
if (includes.length > 0 && !domains.some((d) => includes.includes(d))) return false;
|
|
202
|
-
if (excludes.length > 0 && domains.some((d) => excludes.includes(d))) return false;
|
|
203
|
-
return true;
|
|
204
|
-
});
|
|
205
|
-
}
|
|
206
|
-
var RANGE_MS = {
|
|
207
|
-
"1h": 60 * 60 * 1e3,
|
|
208
|
-
"24h": 24 * 60 * 60 * 1e3,
|
|
209
|
-
"7d": 7 * 24 * 60 * 60 * 1e3,
|
|
210
|
-
"30d": 30 * 24 * 60 * 60 * 1e3
|
|
211
|
-
};
|
|
212
|
-
function useTimeRangeDates(timeRange) {
|
|
213
|
-
return useMemo(() => {
|
|
214
|
-
const now = /* @__PURE__ */ new Date();
|
|
215
|
-
const start = new Date(now.getTime() - RANGE_MS[timeRange]);
|
|
216
|
-
return {
|
|
217
|
-
startDate: start.toISOString(),
|
|
218
|
-
endDate: now.toISOString()
|
|
219
|
-
};
|
|
220
|
-
}, [timeRange]);
|
|
221
|
-
}
|
|
222
|
-
function useActivityFilters(timeRange) {
|
|
223
|
-
const [filters, setFilters] = useState({
|
|
224
|
-
activityType: "all",
|
|
225
|
-
status: "all"
|
|
226
|
-
});
|
|
227
|
-
const updateFilter = useCallback((key, value) => {
|
|
228
|
-
setFilters((prev) => ({ ...prev, [key]: value }));
|
|
229
|
-
}, []);
|
|
230
|
-
const resetFilters = useCallback(() => {
|
|
231
|
-
setFilters({
|
|
232
|
-
activityType: "all",
|
|
233
|
-
status: "all"
|
|
234
|
-
});
|
|
235
|
-
}, []);
|
|
236
|
-
const getApiParams = useCallback(() => {
|
|
237
|
-
const params = {};
|
|
238
|
-
if (filters.activityType && filters.activityType !== "all") {
|
|
239
|
-
params.activityType = filters.activityType;
|
|
240
|
-
}
|
|
241
|
-
const { startDate } = getTimeRangeDates(timeRange);
|
|
242
|
-
params.startDate = startDate;
|
|
243
|
-
if (filters.status && filters.status !== "all") {
|
|
244
|
-
params.status = filters.status;
|
|
245
|
-
}
|
|
246
|
-
if (filters.search?.trim()) {
|
|
247
|
-
params.search = filters.search.trim();
|
|
248
|
-
}
|
|
249
|
-
return params;
|
|
250
|
-
}, [filters, timeRange]);
|
|
251
|
-
return {
|
|
252
|
-
filters,
|
|
253
|
-
updateFilter,
|
|
254
|
-
resetFilters,
|
|
255
|
-
getApiParams
|
|
256
|
-
};
|
|
257
|
-
}
|
|
258
|
-
var DEFAULT_FILTERS = {
|
|
259
|
-
resourceId: void 0,
|
|
260
|
-
status: "all",
|
|
261
|
-
resourceStatus: "all"
|
|
262
|
-
};
|
|
263
|
-
function useExecutionLogsFilters(_timeRange) {
|
|
264
|
-
const [filters, setFilters] = useState(DEFAULT_FILTERS);
|
|
265
|
-
const updateFilter = useCallback((key, value) => {
|
|
266
|
-
setFilters((prev) => ({ ...prev, [key]: value }));
|
|
267
|
-
}, []);
|
|
268
|
-
const resetFilters = useCallback(() => {
|
|
269
|
-
setFilters(DEFAULT_FILTERS);
|
|
270
|
-
}, []);
|
|
271
|
-
return { filters, updateFilter, resetFilters };
|
|
272
|
-
}
|
|
273
|
-
function useOrganizationMembers(organizationId, params) {
|
|
274
|
-
const { apiRequest } = useElevasisServices();
|
|
275
|
-
return useQuery({
|
|
276
|
-
queryKey: ["organization-members", organizationId, params],
|
|
277
|
-
queryFn: async () => {
|
|
278
|
-
const searchParams = new URLSearchParams();
|
|
279
|
-
searchParams.append("organizationId", organizationId);
|
|
280
|
-
const response = await apiRequest(`/memberships?${searchParams.toString()}`);
|
|
281
|
-
return response.data.map((membership) => ({
|
|
282
|
-
...membership,
|
|
283
|
-
createdAt: membership.createdAt,
|
|
284
|
-
updatedAt: membership.updatedAt
|
|
285
|
-
}));
|
|
286
|
-
},
|
|
287
|
-
enabled: !!organizationId,
|
|
288
|
-
staleTime: STALE_TIME_MONITORING,
|
|
289
|
-
gcTime: GC_TIME_SHORT,
|
|
290
|
-
refetchOnWindowFocus: false
|
|
291
|
-
});
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
// src/hooks/settings/api-keys/apiKeyService.ts
|
|
295
|
-
var ApiKeyService = class {
|
|
296
|
-
constructor(apiRequest) {
|
|
297
|
-
this.apiRequest = apiRequest;
|
|
298
|
-
}
|
|
299
|
-
/**
|
|
300
|
-
* List API keys for the current organization
|
|
301
|
-
*/
|
|
302
|
-
async listApiKeys() {
|
|
303
|
-
const response = await this.apiRequest("/api-keys");
|
|
304
|
-
return response.keys;
|
|
305
|
-
}
|
|
306
|
-
/**
|
|
307
|
-
* Create a new API key
|
|
308
|
-
*/
|
|
309
|
-
async createApiKey(data) {
|
|
310
|
-
return await this.apiRequest("/api-keys", {
|
|
311
|
-
method: "POST",
|
|
312
|
-
body: JSON.stringify(data)
|
|
313
|
-
});
|
|
314
|
-
}
|
|
315
|
-
/**
|
|
316
|
-
* Update an API key's name
|
|
317
|
-
*/
|
|
318
|
-
async updateApiKey(keyId, data) {
|
|
319
|
-
await this.apiRequest(`/api-keys/${keyId}`, {
|
|
320
|
-
method: "PATCH",
|
|
321
|
-
body: JSON.stringify(data)
|
|
322
|
-
});
|
|
323
|
-
}
|
|
324
|
-
/**
|
|
325
|
-
* Delete an API key
|
|
326
|
-
*/
|
|
327
|
-
async deleteApiKey(keyId) {
|
|
328
|
-
await this.apiRequest(`/api-keys/${keyId}`, {
|
|
329
|
-
method: "DELETE"
|
|
330
|
-
});
|
|
331
|
-
}
|
|
332
|
-
};
|
|
333
|
-
function useListApiKeys() {
|
|
334
|
-
const { apiRequest, organizationId, isReady } = useElevasisServices();
|
|
335
|
-
return useQuery({
|
|
336
|
-
queryKey: ["api-keys", organizationId],
|
|
337
|
-
queryFn: async () => {
|
|
338
|
-
const service = new ApiKeyService(apiRequest);
|
|
339
|
-
return await service.listApiKeys();
|
|
340
|
-
},
|
|
341
|
-
enabled: isReady
|
|
342
|
-
});
|
|
343
|
-
}
|
|
344
|
-
function useCreateApiKey() {
|
|
345
|
-
const { apiRequest } = useElevasisServices();
|
|
346
|
-
const adapter = useNotificationAdapter();
|
|
347
|
-
const queryClient = useQueryClient();
|
|
348
|
-
return useMutation({
|
|
349
|
-
mutationFn: async (data) => {
|
|
350
|
-
const service = new ApiKeyService(apiRequest);
|
|
351
|
-
return await service.createApiKey(data);
|
|
352
|
-
},
|
|
353
|
-
onSuccess: () => {
|
|
354
|
-
queryClient.invalidateQueries({ queryKey: ["api-keys"] });
|
|
355
|
-
notifications.show({
|
|
356
|
-
title: "Success",
|
|
357
|
-
message: "API key created successfully. Please save it immediately!",
|
|
358
|
-
color: "teal"
|
|
359
|
-
});
|
|
360
|
-
},
|
|
361
|
-
onError: (error) => {
|
|
362
|
-
console.error("Failed to create API key:", error);
|
|
363
|
-
adapter.apiError(error);
|
|
364
|
-
}
|
|
365
|
-
});
|
|
366
|
-
}
|
|
367
|
-
function useDeleteApiKey() {
|
|
368
|
-
const { apiRequest } = useElevasisServices();
|
|
369
|
-
const adapter = useNotificationAdapter();
|
|
370
|
-
const queryClient = useQueryClient();
|
|
371
|
-
return useMutation({
|
|
372
|
-
mutationFn: async (keyId) => {
|
|
373
|
-
const service = new ApiKeyService(apiRequest);
|
|
374
|
-
return await service.deleteApiKey(keyId);
|
|
375
|
-
},
|
|
376
|
-
onSuccess: () => {
|
|
377
|
-
queryClient.invalidateQueries({ queryKey: ["api-keys"] });
|
|
378
|
-
notifications.show({
|
|
379
|
-
title: "Success",
|
|
380
|
-
message: "API key deleted successfully",
|
|
381
|
-
color: "teal"
|
|
382
|
-
});
|
|
383
|
-
},
|
|
384
|
-
onError: (error) => {
|
|
385
|
-
console.error("Failed to delete API key:", error);
|
|
386
|
-
adapter.apiError(error);
|
|
387
|
-
}
|
|
388
|
-
});
|
|
389
|
-
}
|
|
390
|
-
function useUpdateApiKey() {
|
|
391
|
-
const { apiRequest } = useElevasisServices();
|
|
392
|
-
const adapter = useNotificationAdapter();
|
|
393
|
-
const queryClient = useQueryClient();
|
|
394
|
-
return useMutation({
|
|
395
|
-
mutationFn: async ({ keyId, name }) => {
|
|
396
|
-
const service = new ApiKeyService(apiRequest);
|
|
397
|
-
return await service.updateApiKey(keyId, { name });
|
|
398
|
-
},
|
|
399
|
-
onSuccess: () => {
|
|
400
|
-
queryClient.invalidateQueries({ queryKey: ["api-keys"] });
|
|
401
|
-
notifications.show({
|
|
402
|
-
title: "Success",
|
|
403
|
-
message: "API key renamed successfully",
|
|
404
|
-
color: "teal"
|
|
405
|
-
});
|
|
406
|
-
},
|
|
407
|
-
onError: (error) => {
|
|
408
|
-
console.error("Failed to update API key:", error);
|
|
409
|
-
adapter.apiError(error);
|
|
410
|
-
}
|
|
411
|
-
});
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
// src/hooks/settings/credentials/credentialService.ts
|
|
415
|
-
var CredentialService = class {
|
|
416
|
-
constructor(apiRequest) {
|
|
417
|
-
this.apiRequest = apiRequest;
|
|
418
|
-
}
|
|
419
|
-
/**
|
|
420
|
-
* List credentials for the current organization
|
|
421
|
-
* Organization context is provided via workos-organization-id header
|
|
422
|
-
*/
|
|
423
|
-
async listCredentials() {
|
|
424
|
-
const response = await this.apiRequest("/credentials");
|
|
425
|
-
return response.credentials;
|
|
426
|
-
}
|
|
427
|
-
/**
|
|
428
|
-
* Create a new credential
|
|
429
|
-
* Organization context is provided via workos-organization-id header
|
|
430
|
-
*/
|
|
431
|
-
async createCredential(data) {
|
|
432
|
-
const validated = CredentialSchemas.CreateRequest.parse(data);
|
|
433
|
-
return await this.apiRequest(`/credentials`, {
|
|
434
|
-
method: "POST",
|
|
435
|
-
body: JSON.stringify(validated)
|
|
436
|
-
});
|
|
437
|
-
}
|
|
438
|
-
/**
|
|
439
|
-
* Update a credential value or metadata
|
|
440
|
-
* Organization context is provided via workos-organization-id header
|
|
441
|
-
*/
|
|
442
|
-
async updateCredential(credentialId, updates) {
|
|
443
|
-
CredentialSchemas.UpdateParams.parse({ credentialId });
|
|
444
|
-
const validated = CredentialSchemas.UpdateRequest.parse(updates);
|
|
445
|
-
await this.apiRequest(`/credentials/${credentialId}`, {
|
|
446
|
-
method: "PATCH",
|
|
447
|
-
body: JSON.stringify(validated)
|
|
448
|
-
});
|
|
449
|
-
}
|
|
450
|
-
/**
|
|
451
|
-
* Delete a credential
|
|
452
|
-
* Organization context is provided via workos-organization-id header
|
|
453
|
-
*/
|
|
454
|
-
async deleteCredential(credentialId) {
|
|
455
|
-
CredentialSchemas.DeleteParams.parse({ credentialId });
|
|
456
|
-
await this.apiRequest(`/credentials/${credentialId}`, {
|
|
457
|
-
method: "DELETE"
|
|
458
|
-
});
|
|
459
|
-
}
|
|
460
|
-
};
|
|
461
|
-
function useCredentials() {
|
|
462
|
-
const { apiRequest, organizationId, isReady } = useElevasisServices();
|
|
463
|
-
return useQuery({
|
|
464
|
-
queryKey: ["credentials", organizationId],
|
|
465
|
-
queryFn: async () => {
|
|
466
|
-
const service = new CredentialService(apiRequest);
|
|
467
|
-
return await service.listCredentials();
|
|
468
|
-
},
|
|
469
|
-
enabled: isReady
|
|
470
|
-
});
|
|
471
|
-
}
|
|
472
|
-
function useCreateCredential() {
|
|
473
|
-
const { apiRequest } = useElevasisServices();
|
|
474
|
-
const adapter = useNotificationAdapter();
|
|
475
|
-
const queryClient = useQueryClient();
|
|
476
|
-
return useMutation({
|
|
477
|
-
mutationFn: async (data) => {
|
|
478
|
-
const service = new CredentialService(apiRequest);
|
|
479
|
-
return await service.createCredential(data);
|
|
480
|
-
},
|
|
481
|
-
onSuccess: () => {
|
|
482
|
-
queryClient.invalidateQueries({ queryKey: ["credentials"] });
|
|
483
|
-
notifications.show({
|
|
484
|
-
title: "Success",
|
|
485
|
-
message: "Credential created successfully",
|
|
486
|
-
color: "green"
|
|
487
|
-
});
|
|
488
|
-
},
|
|
489
|
-
onError: (error) => {
|
|
490
|
-
console.error("Failed to create credential:", error);
|
|
491
|
-
adapter.apiError(error);
|
|
492
|
-
}
|
|
493
|
-
});
|
|
494
|
-
}
|
|
495
|
-
function useDeleteCredential() {
|
|
496
|
-
const { apiRequest } = useElevasisServices();
|
|
497
|
-
const adapter = useNotificationAdapter();
|
|
498
|
-
const queryClient = useQueryClient();
|
|
499
|
-
return useMutation({
|
|
500
|
-
mutationFn: async (credentialId) => {
|
|
501
|
-
const service = new CredentialService(apiRequest);
|
|
502
|
-
return await service.deleteCredential(credentialId);
|
|
503
|
-
},
|
|
504
|
-
onSuccess: () => {
|
|
505
|
-
queryClient.invalidateQueries({ queryKey: ["credentials"] });
|
|
506
|
-
notifications.show({
|
|
507
|
-
title: "Success",
|
|
508
|
-
message: "Credential deleted successfully",
|
|
509
|
-
color: "green"
|
|
510
|
-
});
|
|
511
|
-
},
|
|
512
|
-
onError: (error) => {
|
|
513
|
-
console.error("Failed to delete credential:", error);
|
|
514
|
-
adapter.apiError(error);
|
|
515
|
-
}
|
|
516
|
-
});
|
|
517
|
-
}
|
|
518
|
-
function useUpdateCredential() {
|
|
519
|
-
const { apiRequest } = useElevasisServices();
|
|
520
|
-
const adapter = useNotificationAdapter();
|
|
521
|
-
const queryClient = useQueryClient();
|
|
522
|
-
return useMutation({
|
|
523
|
-
mutationFn: async ({ credentialId, updates }) => {
|
|
524
|
-
const service = new CredentialService(apiRequest);
|
|
525
|
-
return await service.updateCredential(credentialId, updates);
|
|
526
|
-
},
|
|
527
|
-
onSuccess: () => {
|
|
528
|
-
queryClient.invalidateQueries({ queryKey: ["credentials"] });
|
|
529
|
-
notifications.show({
|
|
530
|
-
title: "Success",
|
|
531
|
-
message: "Credential updated successfully",
|
|
532
|
-
color: "green"
|
|
533
|
-
});
|
|
534
|
-
},
|
|
535
|
-
onError: (error) => {
|
|
536
|
-
console.error("Failed to update credential:", error);
|
|
537
|
-
adapter.apiError(error);
|
|
538
|
-
}
|
|
539
|
-
});
|
|
540
|
-
}
|
|
541
|
-
|
|
542
|
-
// src/hooks/settings/deployments/deploymentService.ts
|
|
543
|
-
var DeploymentService = class {
|
|
544
|
-
constructor(apiRequest) {
|
|
545
|
-
this.apiRequest = apiRequest;
|
|
546
|
-
}
|
|
547
|
-
async listDeployments() {
|
|
548
|
-
const response = await this.apiRequest("/deployments");
|
|
549
|
-
return response.deployments;
|
|
550
|
-
}
|
|
551
|
-
async getDeployment(id) {
|
|
552
|
-
return await this.apiRequest(`/deployments/${id}`);
|
|
553
|
-
}
|
|
554
|
-
async activateDeployment(id) {
|
|
555
|
-
return await this.apiRequest(`/deployments/${id}/activate`, { method: "POST" });
|
|
556
|
-
}
|
|
557
|
-
async deactivateDeployment(id) {
|
|
558
|
-
return await this.apiRequest(`/deployments/${id}/deactivate`, { method: "POST" });
|
|
559
|
-
}
|
|
560
|
-
async deleteDeployment(id) {
|
|
561
|
-
await this.apiRequest(`/deployments/${id}`, { method: "DELETE" });
|
|
562
|
-
}
|
|
563
|
-
};
|
|
564
|
-
function useListDeployments() {
|
|
565
|
-
const { apiRequest, organizationId, isReady } = useElevasisServices();
|
|
566
|
-
return useQuery({
|
|
567
|
-
queryKey: ["deployments", organizationId],
|
|
568
|
-
queryFn: async () => {
|
|
569
|
-
const service = new DeploymentService(apiRequest);
|
|
570
|
-
return await service.listDeployments();
|
|
571
|
-
},
|
|
572
|
-
enabled: isReady,
|
|
573
|
-
refetchInterval: (query) => {
|
|
574
|
-
const deployments = query.state.data ?? [];
|
|
575
|
-
return deployments.some((d) => d.status === "deploying") ? 5e3 : false;
|
|
576
|
-
}
|
|
577
|
-
});
|
|
578
|
-
}
|
|
579
|
-
function useActivateDeployment() {
|
|
580
|
-
const { apiRequest, organizationId } = useElevasisServices();
|
|
581
|
-
const queryClient = useQueryClient();
|
|
582
|
-
const showError = useErrorNotification();
|
|
583
|
-
return useMutation({
|
|
584
|
-
mutationFn: (deploymentId) => {
|
|
585
|
-
const service = new DeploymentService(apiRequest);
|
|
586
|
-
return service.activateDeployment(deploymentId);
|
|
587
|
-
},
|
|
588
|
-
onSuccess: () => {
|
|
589
|
-
queryClient.invalidateQueries({ queryKey: ["deployments", organizationId] });
|
|
590
|
-
notifications.show({ title: "Success", message: "Deployment activated", color: "teal" });
|
|
591
|
-
},
|
|
592
|
-
onError: (error) => {
|
|
593
|
-
console.error("Failed to activate deployment:", error);
|
|
594
|
-
showError(error);
|
|
595
|
-
}
|
|
596
|
-
});
|
|
597
|
-
}
|
|
598
|
-
function useDeactivateDeployment() {
|
|
599
|
-
const { apiRequest, organizationId } = useElevasisServices();
|
|
600
|
-
const queryClient = useQueryClient();
|
|
601
|
-
const showError = useErrorNotification();
|
|
602
|
-
return useMutation({
|
|
603
|
-
mutationFn: (deploymentId) => {
|
|
604
|
-
const service = new DeploymentService(apiRequest);
|
|
605
|
-
return service.deactivateDeployment(deploymentId);
|
|
606
|
-
},
|
|
607
|
-
onSuccess: () => {
|
|
608
|
-
queryClient.invalidateQueries({ queryKey: ["deployments", organizationId] });
|
|
609
|
-
notifications.show({ title: "Success", message: "Deployment deactivated", color: "teal" });
|
|
610
|
-
},
|
|
611
|
-
onError: (error) => {
|
|
612
|
-
console.error("Failed to deactivate deployment:", error);
|
|
613
|
-
showError(error);
|
|
614
|
-
}
|
|
615
|
-
});
|
|
616
|
-
}
|
|
617
|
-
function useDeleteDeployment() {
|
|
618
|
-
const { apiRequest, organizationId } = useElevasisServices();
|
|
619
|
-
const queryClient = useQueryClient();
|
|
620
|
-
const showError = useErrorNotification();
|
|
621
|
-
return useMutation({
|
|
622
|
-
mutationFn: (deploymentId) => {
|
|
623
|
-
const service = new DeploymentService(apiRequest);
|
|
624
|
-
return service.deleteDeployment(deploymentId);
|
|
625
|
-
},
|
|
626
|
-
onSuccess: () => {
|
|
627
|
-
queryClient.invalidateQueries({ queryKey: ["deployments", organizationId] });
|
|
628
|
-
notifications.show({ title: "Success", message: "Deployment deleted", color: "teal" });
|
|
629
|
-
},
|
|
630
|
-
onError: (error) => {
|
|
631
|
-
console.error("Failed to delete deployment:", error);
|
|
632
|
-
showError(error);
|
|
633
|
-
}
|
|
634
|
-
});
|
|
635
|
-
}
|
|
636
|
-
|
|
637
|
-
// src/hooks/settings/organization/organizationMembershipService.ts
|
|
638
|
-
var OrganizationMembershipService = class {
|
|
639
|
-
constructor(apiRequest) {
|
|
640
|
-
this.apiRequest = apiRequest;
|
|
641
|
-
}
|
|
642
|
-
/**
|
|
643
|
-
* Get user's organization memberships
|
|
644
|
-
*/
|
|
645
|
-
async getUserMemberships(userId) {
|
|
646
|
-
const searchParams = new URLSearchParams();
|
|
647
|
-
searchParams.append("userId", userId);
|
|
648
|
-
const url = `/memberships?${searchParams.toString()}`;
|
|
649
|
-
const response = await this.apiRequest(url);
|
|
650
|
-
return response.data.map((membership) => ({
|
|
651
|
-
...membership,
|
|
652
|
-
createdAt: membership.createdAt,
|
|
653
|
-
updatedAt: membership.updatedAt
|
|
654
|
-
}));
|
|
655
|
-
}
|
|
656
|
-
/**
|
|
657
|
-
* Get organization members
|
|
658
|
-
*/
|
|
659
|
-
async getOrganizationMembers(organizationId) {
|
|
660
|
-
const searchParams = new URLSearchParams();
|
|
661
|
-
searchParams.append("organizationId", organizationId);
|
|
662
|
-
const url = `/memberships?${searchParams.toString()}`;
|
|
663
|
-
const response = await this.apiRequest(url);
|
|
664
|
-
return response.data.map((membership) => ({
|
|
665
|
-
...membership,
|
|
666
|
-
createdAt: membership.createdAt,
|
|
667
|
-
updatedAt: membership.updatedAt
|
|
668
|
-
}));
|
|
669
|
-
}
|
|
670
|
-
/**
|
|
671
|
-
* List memberships with filtering
|
|
672
|
-
*/
|
|
673
|
-
async listMemberships(params) {
|
|
674
|
-
if (params) {
|
|
675
|
-
ListMembershipsQuerySchema.parse(params);
|
|
676
|
-
}
|
|
677
|
-
const searchParams = new URLSearchParams();
|
|
678
|
-
if (params?.userId) {
|
|
679
|
-
searchParams.append("userId", params.userId);
|
|
680
|
-
}
|
|
681
|
-
if (params?.organizationId) {
|
|
682
|
-
searchParams.append("organizationId", params.organizationId);
|
|
683
|
-
}
|
|
684
|
-
if (params?.statuses) {
|
|
685
|
-
params.statuses.forEach((status) => searchParams.append("statuses", status));
|
|
686
|
-
}
|
|
687
|
-
if (params?.limit) {
|
|
688
|
-
searchParams.append("limit", params.limit.toString());
|
|
689
|
-
}
|
|
690
|
-
if (params?.before) {
|
|
691
|
-
searchParams.append("before", params.before);
|
|
692
|
-
}
|
|
693
|
-
if (params?.after) {
|
|
694
|
-
searchParams.append("after", params.after);
|
|
695
|
-
}
|
|
696
|
-
if (params?.order) {
|
|
697
|
-
searchParams.append("order", params.order);
|
|
698
|
-
}
|
|
699
|
-
const url = `/memberships${searchParams.toString() ? `?${searchParams.toString()}` : ""}`;
|
|
700
|
-
const response = await this.apiRequest(url);
|
|
701
|
-
return {
|
|
702
|
-
...response,
|
|
703
|
-
data: response.data.map((membership) => ({
|
|
704
|
-
...membership,
|
|
705
|
-
createdAt: membership.createdAt,
|
|
706
|
-
updatedAt: membership.updatedAt
|
|
707
|
-
}))
|
|
708
|
-
};
|
|
709
|
-
}
|
|
710
|
-
/**
|
|
711
|
-
* Get a single membership by ID
|
|
712
|
-
*/
|
|
713
|
-
async getMembership(membershipId) {
|
|
714
|
-
MembershipIdParamSchema.parse({ id: membershipId });
|
|
715
|
-
const membership = await this.apiRequest(`/memberships/${membershipId}`);
|
|
716
|
-
return {
|
|
717
|
-
...membership,
|
|
718
|
-
createdAt: membership.createdAt,
|
|
719
|
-
updatedAt: membership.updatedAt
|
|
720
|
-
};
|
|
721
|
-
}
|
|
722
|
-
/**
|
|
723
|
-
* Create a new organization membership
|
|
724
|
-
*/
|
|
725
|
-
async createMembership(data) {
|
|
726
|
-
const validated = CreateMembershipSchema.parse(data);
|
|
727
|
-
const membership = await this.apiRequest("/memberships", {
|
|
728
|
-
method: "POST",
|
|
729
|
-
body: JSON.stringify(validated)
|
|
730
|
-
});
|
|
731
|
-
return {
|
|
732
|
-
...membership,
|
|
733
|
-
createdAt: membership.createdAt,
|
|
734
|
-
updatedAt: membership.updatedAt
|
|
735
|
-
};
|
|
736
|
-
}
|
|
737
|
-
/**
|
|
738
|
-
* Update an existing membership
|
|
739
|
-
*/
|
|
740
|
-
async updateMembership(membershipId, data) {
|
|
741
|
-
MembershipIdParamSchema.parse({ id: membershipId });
|
|
742
|
-
const validated = UpdateMembershipSchema.parse(data);
|
|
743
|
-
const membership = await this.apiRequest(`/memberships/${membershipId}`, {
|
|
744
|
-
method: "PUT",
|
|
745
|
-
body: JSON.stringify(validated)
|
|
746
|
-
});
|
|
747
|
-
return {
|
|
748
|
-
...membership,
|
|
749
|
-
createdAt: membership.createdAt,
|
|
750
|
-
updatedAt: membership.updatedAt
|
|
751
|
-
};
|
|
752
|
-
}
|
|
753
|
-
/**
|
|
754
|
-
* Delete a membership
|
|
755
|
-
*/
|
|
756
|
-
async deleteMembership(membershipId) {
|
|
757
|
-
MembershipIdParamSchema.parse({ id: membershipId });
|
|
758
|
-
await this.apiRequest(`/memberships/${membershipId}`, {
|
|
759
|
-
method: "DELETE"
|
|
760
|
-
});
|
|
761
|
-
}
|
|
762
|
-
/**
|
|
763
|
-
* Deactivate a membership (soft delete)
|
|
764
|
-
*/
|
|
765
|
-
async deactivateMembership(membershipId) {
|
|
766
|
-
MembershipIdParamSchema.parse({ id: membershipId });
|
|
767
|
-
const membership = await this.apiRequest(`/memberships/${membershipId}/deactivate`, {
|
|
768
|
-
method: "POST"
|
|
769
|
-
});
|
|
770
|
-
return {
|
|
771
|
-
...membership,
|
|
772
|
-
createdAt: membership.createdAt,
|
|
773
|
-
updatedAt: membership.updatedAt
|
|
774
|
-
};
|
|
775
|
-
}
|
|
776
|
-
/**
|
|
777
|
-
* Reactivate a membership
|
|
778
|
-
*/
|
|
779
|
-
async reactivateMembership(membershipId) {
|
|
780
|
-
MembershipIdParamSchema.parse({ id: membershipId });
|
|
781
|
-
const membership = await this.apiRequest(`/memberships/${membershipId}/reactivate`, {
|
|
782
|
-
method: "POST"
|
|
783
|
-
});
|
|
784
|
-
return {
|
|
785
|
-
...membership,
|
|
786
|
-
createdAt: membership.createdAt,
|
|
787
|
-
updatedAt: membership.updatedAt
|
|
788
|
-
};
|
|
789
|
-
}
|
|
790
|
-
};
|
|
791
|
-
function useUserMemberships(userId, params) {
|
|
792
|
-
const { apiRequest, isReady } = useElevasisServices();
|
|
793
|
-
return useQuery({
|
|
794
|
-
queryKey: ["memberships", "user", userId, params],
|
|
795
|
-
queryFn: async () => {
|
|
796
|
-
const membershipService = new OrganizationMembershipService(apiRequest);
|
|
797
|
-
return await membershipService.getUserMemberships(userId);
|
|
798
|
-
},
|
|
799
|
-
enabled: isReady && !!userId,
|
|
800
|
-
refetchOnWindowFocus: false,
|
|
801
|
-
staleTime: STALE_TIME_DEFAULT,
|
|
802
|
-
gcTime: GC_TIME_MEDIUM
|
|
803
|
-
});
|
|
804
|
-
}
|
|
805
|
-
function useUpdateMemberConfig() {
|
|
806
|
-
const { apiRequest } = useElevasisServices();
|
|
807
|
-
const adapter = useNotificationAdapter();
|
|
808
|
-
const queryClient = useQueryClient();
|
|
809
|
-
return useMutation({
|
|
810
|
-
mutationFn: async ({ membershipId, config }) => {
|
|
811
|
-
return apiRequest(`/memberships/${membershipId}/config`, {
|
|
812
|
-
method: "PATCH",
|
|
813
|
-
body: JSON.stringify({ config })
|
|
814
|
-
});
|
|
815
|
-
},
|
|
816
|
-
onSuccess: () => {
|
|
817
|
-
queryClient.invalidateQueries({ queryKey: ["memberships"] });
|
|
818
|
-
notifications.show({
|
|
819
|
-
title: "Success",
|
|
820
|
-
message: "Member config updated",
|
|
821
|
-
color: "teal"
|
|
822
|
-
});
|
|
823
|
-
},
|
|
824
|
-
onError: (error) => {
|
|
825
|
-
adapter.apiError(error);
|
|
826
|
-
}
|
|
827
|
-
});
|
|
828
|
-
}
|
|
829
|
-
function useDeactivateMembership() {
|
|
830
|
-
const { apiRequest } = useElevasisServices();
|
|
831
|
-
const adapter = useNotificationAdapter();
|
|
832
|
-
const queryClient = useQueryClient();
|
|
833
|
-
return useMutation({
|
|
834
|
-
mutationFn: async ({ membershipId }) => {
|
|
835
|
-
const membershipService = new OrganizationMembershipService(apiRequest);
|
|
836
|
-
return await membershipService.deactivateMembership(membershipId);
|
|
837
|
-
},
|
|
838
|
-
onMutate: async (variables) => {
|
|
839
|
-
await queryClient.cancelQueries({ queryKey: ["memberships"] });
|
|
840
|
-
const previousData = queryClient.getQueryData(["memberships"]);
|
|
841
|
-
if (variables.userId) {
|
|
842
|
-
queryClient.setQueryData(
|
|
843
|
-
["memberships", "user", variables.userId],
|
|
844
|
-
(old) => {
|
|
845
|
-
if (!old) return old;
|
|
846
|
-
return old.map(
|
|
847
|
-
(membership) => membership.id === variables.membershipId ? { ...membership, status: "inactive", updatedAt: (/* @__PURE__ */ new Date()).toISOString() } : membership
|
|
848
|
-
);
|
|
849
|
-
}
|
|
850
|
-
);
|
|
851
|
-
}
|
|
852
|
-
if (variables.organizationId) {
|
|
853
|
-
queryClient.setQueryData(
|
|
854
|
-
["memberships", "organization", variables.organizationId],
|
|
855
|
-
(old) => {
|
|
856
|
-
if (!old) return old;
|
|
857
|
-
return old.map(
|
|
858
|
-
(membership) => membership.id === variables.membershipId ? { ...membership, status: "inactive", updatedAt: (/* @__PURE__ */ new Date()).toISOString() } : membership
|
|
859
|
-
);
|
|
860
|
-
}
|
|
861
|
-
);
|
|
862
|
-
}
|
|
863
|
-
return { previousData };
|
|
864
|
-
},
|
|
865
|
-
onError: (error, _variables, context) => {
|
|
866
|
-
if (context?.previousData) {
|
|
867
|
-
queryClient.setQueryData(["memberships"], context.previousData);
|
|
868
|
-
}
|
|
869
|
-
adapter.apiError(error);
|
|
870
|
-
},
|
|
871
|
-
onSuccess: () => {
|
|
872
|
-
queryClient.invalidateQueries({ queryKey: ["memberships"] });
|
|
873
|
-
},
|
|
874
|
-
onSettled: () => {
|
|
875
|
-
queryClient.invalidateQueries({ queryKey: ["memberships"] });
|
|
876
|
-
}
|
|
877
|
-
});
|
|
878
|
-
}
|
|
879
|
-
function useReactivateMembership() {
|
|
880
|
-
const { apiRequest } = useElevasisServices();
|
|
881
|
-
const adapter = useNotificationAdapter();
|
|
882
|
-
const queryClient = useQueryClient();
|
|
883
|
-
return useMutation({
|
|
884
|
-
mutationFn: async ({ membershipId }) => {
|
|
885
|
-
const membershipService = new OrganizationMembershipService(apiRequest);
|
|
886
|
-
return await membershipService.reactivateMembership(membershipId);
|
|
887
|
-
},
|
|
888
|
-
onMutate: async (variables) => {
|
|
889
|
-
await queryClient.cancelQueries({ queryKey: ["memberships"] });
|
|
890
|
-
const previousData = queryClient.getQueryData(["memberships"]);
|
|
891
|
-
if (variables.userId) {
|
|
892
|
-
queryClient.setQueryData(
|
|
893
|
-
["memberships", "user", variables.userId],
|
|
894
|
-
(old) => {
|
|
895
|
-
if (!old) return old;
|
|
896
|
-
return old.map(
|
|
897
|
-
(membership) => membership.id === variables.membershipId ? { ...membership, status: "active", updatedAt: (/* @__PURE__ */ new Date()).toISOString() } : membership
|
|
898
|
-
);
|
|
899
|
-
}
|
|
900
|
-
);
|
|
901
|
-
}
|
|
902
|
-
if (variables.organizationId) {
|
|
903
|
-
queryClient.setQueryData(
|
|
904
|
-
["memberships", "organization", variables.organizationId],
|
|
905
|
-
(old) => {
|
|
906
|
-
if (!old) return old;
|
|
907
|
-
return old.map(
|
|
908
|
-
(membership) => membership.id === variables.membershipId ? { ...membership, status: "active", updatedAt: (/* @__PURE__ */ new Date()).toISOString() } : membership
|
|
909
|
-
);
|
|
910
|
-
}
|
|
911
|
-
);
|
|
912
|
-
}
|
|
913
|
-
return { previousData };
|
|
914
|
-
},
|
|
915
|
-
onError: (error, _variables, context) => {
|
|
916
|
-
if (context?.previousData) {
|
|
917
|
-
queryClient.setQueryData(["memberships"], context.previousData);
|
|
918
|
-
}
|
|
919
|
-
adapter.apiError(error);
|
|
920
|
-
},
|
|
921
|
-
onSuccess: () => {
|
|
922
|
-
queryClient.invalidateQueries({ queryKey: ["memberships"] });
|
|
923
|
-
},
|
|
924
|
-
onSettled: () => {
|
|
925
|
-
queryClient.invalidateQueries({ queryKey: ["memberships"] });
|
|
926
|
-
}
|
|
927
|
-
});
|
|
928
|
-
}
|
|
929
|
-
|
|
930
|
-
// src/hooks/settings/webhooks/webhookEndpointService.ts
|
|
931
|
-
var WebhookEndpointService = class {
|
|
932
|
-
constructor(apiRequest) {
|
|
933
|
-
this.apiRequest = apiRequest;
|
|
934
|
-
}
|
|
935
|
-
/**
|
|
936
|
-
* List webhook endpoints for the current organization
|
|
937
|
-
*/
|
|
938
|
-
async listEndpoints() {
|
|
939
|
-
const response = await this.apiRequest("/webhook-endpoints");
|
|
940
|
-
return response.data;
|
|
941
|
-
}
|
|
942
|
-
/**
|
|
943
|
-
* Create a new webhook endpoint
|
|
944
|
-
*/
|
|
945
|
-
async createEndpoint(data) {
|
|
946
|
-
return await this.apiRequest("/webhook-endpoints", {
|
|
947
|
-
method: "POST",
|
|
948
|
-
body: JSON.stringify(data)
|
|
949
|
-
});
|
|
950
|
-
}
|
|
951
|
-
/**
|
|
952
|
-
* Update an existing webhook endpoint (e.g., toggle status, rename)
|
|
953
|
-
*/
|
|
954
|
-
async updateEndpoint(endpointId, data) {
|
|
955
|
-
return await this.apiRequest(`/webhook-endpoints/${endpointId}`, {
|
|
956
|
-
method: "PATCH",
|
|
957
|
-
body: JSON.stringify(data)
|
|
958
|
-
});
|
|
959
|
-
}
|
|
960
|
-
/**
|
|
961
|
-
* Delete a webhook endpoint
|
|
962
|
-
*/
|
|
963
|
-
async deleteEndpoint(endpointId) {
|
|
964
|
-
await this.apiRequest(`/webhook-endpoints/${endpointId}`, {
|
|
965
|
-
method: "DELETE"
|
|
966
|
-
});
|
|
967
|
-
}
|
|
968
|
-
};
|
|
969
|
-
|
|
970
|
-
// src/hooks/settings/webhooks/useListWebhookEndpoints.ts
|
|
971
|
-
function useListWebhookEndpoints() {
|
|
972
|
-
const { apiRequest, organizationId, isReady } = useElevasisServices();
|
|
973
|
-
return useQuery({
|
|
974
|
-
queryKey: ["webhook-endpoints", organizationId],
|
|
975
|
-
queryFn: async () => {
|
|
976
|
-
const service = new WebhookEndpointService(apiRequest);
|
|
977
|
-
return await service.listEndpoints();
|
|
978
|
-
},
|
|
979
|
-
enabled: isReady
|
|
980
|
-
});
|
|
981
|
-
}
|
|
982
|
-
function useCreateWebhookEndpoint() {
|
|
983
|
-
const { apiRequest } = useElevasisServices();
|
|
984
|
-
const queryClient = useQueryClient();
|
|
985
|
-
return useMutation({
|
|
986
|
-
mutationFn: async (data) => {
|
|
987
|
-
const service = new WebhookEndpointService(apiRequest);
|
|
988
|
-
return await service.createEndpoint(data);
|
|
989
|
-
},
|
|
990
|
-
onSuccess: () => {
|
|
991
|
-
queryClient.invalidateQueries({ queryKey: ["webhook-endpoints"] });
|
|
992
|
-
},
|
|
993
|
-
onError: (error) => {
|
|
994
|
-
console.error("Failed to create webhook endpoint:", error);
|
|
995
|
-
showApiErrorNotification(error);
|
|
996
|
-
}
|
|
997
|
-
});
|
|
998
|
-
}
|
|
999
|
-
function useDeleteWebhookEndpoint() {
|
|
1000
|
-
const { apiRequest } = useElevasisServices();
|
|
1001
|
-
const queryClient = useQueryClient();
|
|
1002
|
-
return useMutation({
|
|
1003
|
-
mutationFn: async (endpointId) => {
|
|
1004
|
-
const service = new WebhookEndpointService(apiRequest);
|
|
1005
|
-
return await service.deleteEndpoint(endpointId);
|
|
1006
|
-
},
|
|
1007
|
-
onSuccess: () => {
|
|
1008
|
-
queryClient.invalidateQueries({ queryKey: ["webhook-endpoints"] });
|
|
1009
|
-
notifications.show({
|
|
1010
|
-
title: "Success",
|
|
1011
|
-
message: "Webhook endpoint deleted",
|
|
1012
|
-
color: "teal"
|
|
1013
|
-
});
|
|
1014
|
-
},
|
|
1015
|
-
onError: (error) => {
|
|
1016
|
-
console.error("Failed to delete webhook endpoint:", error);
|
|
1017
|
-
showApiErrorNotification(error);
|
|
1018
|
-
}
|
|
1019
|
-
});
|
|
1020
|
-
}
|
|
1021
|
-
function useUpdateWebhookEndpoint() {
|
|
1022
|
-
const { apiRequest } = useElevasisServices();
|
|
1023
|
-
const queryClient = useQueryClient();
|
|
1024
|
-
return useMutation({
|
|
1025
|
-
mutationFn: async ({ endpointId, data }) => {
|
|
1026
|
-
const service = new WebhookEndpointService(apiRequest);
|
|
1027
|
-
return await service.updateEndpoint(endpointId, data);
|
|
1028
|
-
},
|
|
1029
|
-
onSuccess: () => {
|
|
1030
|
-
queryClient.invalidateQueries({ queryKey: ["webhook-endpoints"] });
|
|
1031
|
-
notifications.show({
|
|
1032
|
-
title: "Success",
|
|
1033
|
-
message: "Webhook endpoint updated",
|
|
1034
|
-
color: "teal"
|
|
1035
|
-
});
|
|
1036
|
-
},
|
|
1037
|
-
onError: (error) => {
|
|
1038
|
-
console.error("Failed to update webhook endpoint:", error);
|
|
1039
|
-
showApiErrorNotification(error);
|
|
1040
|
-
}
|
|
1041
|
-
});
|
|
1042
|
-
}
|
|
1043
|
-
var projectKeys = {
|
|
1044
|
-
all: ["projects"],
|
|
1045
|
-
lists: () => [...projectKeys.all, "list"],
|
|
1046
|
-
list: (orgId, filters) => [...projectKeys.all, "list", orgId, filters],
|
|
1047
|
-
details: () => [...projectKeys.all, "detail"],
|
|
1048
|
-
detail: (id) => [...projectKeys.all, "detail", id]
|
|
1049
|
-
};
|
|
1050
|
-
function useProjects(filters = {}) {
|
|
1051
|
-
const { apiRequest, isReady, organizationId } = useElevasisServices();
|
|
1052
|
-
return useQuery({
|
|
1053
|
-
queryKey: projectKeys.list(organizationId, filters),
|
|
1054
|
-
queryFn: async () => {
|
|
1055
|
-
const params = new URLSearchParams();
|
|
1056
|
-
if (filters.kind) params.set("kind", filters.kind);
|
|
1057
|
-
const qs = params.toString();
|
|
1058
|
-
const path = qs ? `/projects?${qs}` : "/projects";
|
|
1059
|
-
const res = await apiRequest(path);
|
|
1060
|
-
return res.projects;
|
|
1061
|
-
},
|
|
1062
|
-
enabled: isReady
|
|
1063
|
-
});
|
|
1064
|
-
}
|
|
1065
|
-
function useProject(id) {
|
|
1066
|
-
const { apiRequest, isReady, organizationId } = useElevasisServices();
|
|
1067
|
-
return useQuery({
|
|
1068
|
-
queryKey: [...projectKeys.detail(id), organizationId],
|
|
1069
|
-
queryFn: async () => {
|
|
1070
|
-
try {
|
|
1071
|
-
const res = await apiRequest(`/projects/${id}`);
|
|
1072
|
-
return res.project;
|
|
1073
|
-
} catch (err) {
|
|
1074
|
-
if (err && typeof err === "object" && "statusCode" in err && err.statusCode === 404) {
|
|
1075
|
-
return null;
|
|
1076
|
-
}
|
|
1077
|
-
throw err;
|
|
1078
|
-
}
|
|
1079
|
-
},
|
|
1080
|
-
enabled: isReady && !!id
|
|
1081
|
-
});
|
|
1082
|
-
}
|
|
1083
|
-
function useCreateProject() {
|
|
1084
|
-
const { apiRequest } = useElevasisServices();
|
|
1085
|
-
const queryClient = useQueryClient();
|
|
1086
|
-
return useMutation({
|
|
1087
|
-
mutationFn: async (params) => {
|
|
1088
|
-
const res = await apiRequest("/projects", {
|
|
1089
|
-
method: "POST",
|
|
1090
|
-
body: JSON.stringify(params)
|
|
1091
|
-
});
|
|
1092
|
-
return res.project;
|
|
1093
|
-
},
|
|
1094
|
-
onSuccess: () => {
|
|
1095
|
-
queryClient.invalidateQueries({ queryKey: projectKeys.all });
|
|
1096
|
-
},
|
|
1097
|
-
onError: (error) => {
|
|
1098
|
-
showApiErrorNotification(error);
|
|
1099
|
-
}
|
|
1100
|
-
});
|
|
1101
|
-
}
|
|
1102
|
-
function useUpdateProject() {
|
|
1103
|
-
const { apiRequest } = useElevasisServices();
|
|
1104
|
-
const queryClient = useQueryClient();
|
|
1105
|
-
return useMutation({
|
|
1106
|
-
mutationFn: async (params) => {
|
|
1107
|
-
const res = await apiRequest(`/projects/${params.id}`, {
|
|
1108
|
-
method: "PATCH",
|
|
1109
|
-
body: JSON.stringify(params.updates)
|
|
1110
|
-
});
|
|
1111
|
-
return res.project;
|
|
1112
|
-
},
|
|
1113
|
-
onSuccess: (data) => {
|
|
1114
|
-
queryClient.invalidateQueries({ queryKey: projectKeys.all });
|
|
1115
|
-
queryClient.invalidateQueries({ queryKey: projectKeys.detail(data.id) });
|
|
1116
|
-
},
|
|
1117
|
-
onError: (error) => {
|
|
1118
|
-
showApiErrorNotification(error);
|
|
1119
|
-
}
|
|
1120
|
-
});
|
|
1121
|
-
}
|
|
1122
|
-
function useDeleteProject() {
|
|
1123
|
-
const { apiRequest } = useElevasisServices();
|
|
1124
|
-
const queryClient = useQueryClient();
|
|
1125
|
-
return useMutation({
|
|
1126
|
-
mutationFn: async (id) => {
|
|
1127
|
-
await apiRequest(`/projects/${id}`, {
|
|
1128
|
-
method: "DELETE"
|
|
1129
|
-
});
|
|
1130
|
-
},
|
|
1131
|
-
onSuccess: () => {
|
|
1132
|
-
queryClient.invalidateQueries({ queryKey: projectKeys.all });
|
|
1133
|
-
},
|
|
1134
|
-
onError: (error) => {
|
|
1135
|
-
showApiErrorNotification(error);
|
|
1136
|
-
}
|
|
1137
|
-
});
|
|
1138
|
-
}
|
|
1139
|
-
var milestoneKeys = {
|
|
1140
|
-
all: ["project-milestones"],
|
|
1141
|
-
lists: () => [...milestoneKeys.all, "list"],
|
|
1142
|
-
list: (orgId, filters) => [...milestoneKeys.all, "list", orgId, filters],
|
|
1143
|
-
details: () => [...milestoneKeys.all, "detail"],
|
|
1144
|
-
detail: (id) => [...milestoneKeys.all, "detail", id]
|
|
1145
|
-
};
|
|
1146
|
-
function useMilestones(filters = {}) {
|
|
1147
|
-
const { apiRequest, isReady, organizationId } = useElevasisServices();
|
|
1148
|
-
return useQuery({
|
|
1149
|
-
queryKey: milestoneKeys.list(organizationId, filters),
|
|
1150
|
-
queryFn: async () => {
|
|
1151
|
-
const res = await apiRequest(`/projects/${filters.projectId}/milestones`);
|
|
1152
|
-
return res.milestones;
|
|
1153
|
-
},
|
|
1154
|
-
enabled: isReady && !!filters.projectId
|
|
1155
|
-
});
|
|
1156
|
-
}
|
|
1157
|
-
function useCreateMilestone() {
|
|
1158
|
-
const { apiRequest } = useElevasisServices();
|
|
1159
|
-
const queryClient = useQueryClient();
|
|
1160
|
-
return useMutation({
|
|
1161
|
-
mutationFn: async (params) => {
|
|
1162
|
-
const { project_id, ...body } = params;
|
|
1163
|
-
if (!project_id) throw new Error("project_id is required to create a milestone");
|
|
1164
|
-
const res = await apiRequest(`/projects/${project_id}/milestones`, {
|
|
1165
|
-
method: "POST",
|
|
1166
|
-
body: JSON.stringify(body)
|
|
1167
|
-
});
|
|
1168
|
-
return res.milestone;
|
|
1169
|
-
},
|
|
1170
|
-
onSuccess: (data) => {
|
|
1171
|
-
queryClient.invalidateQueries({ queryKey: milestoneKeys.all });
|
|
1172
|
-
queryClient.invalidateQueries({ queryKey: projectKeys.all });
|
|
1173
|
-
queryClient.invalidateQueries({ queryKey: projectKeys.detail(data.project_id) });
|
|
1174
|
-
},
|
|
1175
|
-
onError: (error) => {
|
|
1176
|
-
showApiErrorNotification(error);
|
|
1177
|
-
}
|
|
1178
|
-
});
|
|
1179
|
-
}
|
|
1180
|
-
function useUpdateMilestone() {
|
|
1181
|
-
const { apiRequest } = useElevasisServices();
|
|
1182
|
-
const queryClient = useQueryClient();
|
|
1183
|
-
return useMutation({
|
|
1184
|
-
mutationFn: async (params) => {
|
|
1185
|
-
const res = await apiRequest(`/milestones/${params.id}`, {
|
|
1186
|
-
method: "PATCH",
|
|
1187
|
-
body: JSON.stringify(params.updates)
|
|
1188
|
-
});
|
|
1189
|
-
return res.milestone;
|
|
1190
|
-
},
|
|
1191
|
-
onSuccess: (data) => {
|
|
1192
|
-
queryClient.invalidateQueries({ queryKey: milestoneKeys.all });
|
|
1193
|
-
queryClient.invalidateQueries({ queryKey: projectKeys.all });
|
|
1194
|
-
queryClient.invalidateQueries({ queryKey: projectKeys.detail(data.project_id) });
|
|
1195
|
-
},
|
|
1196
|
-
onError: (error) => {
|
|
1197
|
-
showApiErrorNotification(error);
|
|
1198
|
-
}
|
|
1199
|
-
});
|
|
1200
|
-
}
|
|
1201
|
-
function useDeleteMilestone() {
|
|
1202
|
-
const { apiRequest } = useElevasisServices();
|
|
1203
|
-
const queryClient = useQueryClient();
|
|
1204
|
-
return useMutation({
|
|
1205
|
-
mutationFn: async (params) => {
|
|
1206
|
-
await apiRequest(`/milestones/${params.id}`, {
|
|
1207
|
-
method: "DELETE"
|
|
1208
|
-
});
|
|
1209
|
-
},
|
|
1210
|
-
onSuccess: (_, params) => {
|
|
1211
|
-
queryClient.invalidateQueries({ queryKey: milestoneKeys.all });
|
|
1212
|
-
queryClient.invalidateQueries({ queryKey: projectKeys.all });
|
|
1213
|
-
queryClient.invalidateQueries({ queryKey: projectKeys.detail(params.projectId) });
|
|
1214
|
-
},
|
|
1215
|
-
onError: (error) => {
|
|
1216
|
-
showApiErrorNotification(error);
|
|
1217
|
-
}
|
|
1218
|
-
});
|
|
1219
|
-
}
|
|
1220
|
-
var taskKeys = {
|
|
1221
|
-
all: ["project-tasks"],
|
|
1222
|
-
lists: () => [...taskKeys.all, "list"],
|
|
1223
|
-
list: (orgId, filters) => [...taskKeys.all, "list", orgId, filters],
|
|
1224
|
-
details: () => [...taskKeys.all, "detail"],
|
|
1225
|
-
detail: (id) => [...taskKeys.all, "detail", id]
|
|
1226
|
-
};
|
|
1227
|
-
function useTasks(filters = {}) {
|
|
1228
|
-
const { apiRequest, isReady, organizationId } = useElevasisServices();
|
|
1229
|
-
return useQuery({
|
|
1230
|
-
queryKey: taskKeys.list(organizationId, filters),
|
|
1231
|
-
queryFn: async () => {
|
|
1232
|
-
const params = new URLSearchParams();
|
|
1233
|
-
if (filters.status) params.set("status", filters.status);
|
|
1234
|
-
if (filters.milestoneId) params.set("milestone_id", filters.milestoneId);
|
|
1235
|
-
const qs = params.toString();
|
|
1236
|
-
const base = `/projects/${filters.projectId}/tasks`;
|
|
1237
|
-
const path = qs ? `${base}?${qs}` : base;
|
|
1238
|
-
const res = await apiRequest(path);
|
|
1239
|
-
return res.tasks;
|
|
1240
|
-
},
|
|
1241
|
-
enabled: isReady && !!filters.projectId
|
|
1242
|
-
});
|
|
1243
|
-
}
|
|
1244
|
-
function useDeleteTask() {
|
|
1245
|
-
const { apiRequest } = useElevasisServices();
|
|
1246
|
-
const queryClient = useQueryClient();
|
|
1247
|
-
return useMutation({
|
|
1248
|
-
mutationFn: async (params) => {
|
|
1249
|
-
await apiRequest(`/project-tasks/${params.id}`, {
|
|
1250
|
-
method: "DELETE"
|
|
1251
|
-
});
|
|
1252
|
-
},
|
|
1253
|
-
onSuccess: (_, params) => {
|
|
1254
|
-
queryClient.invalidateQueries({ queryKey: taskKeys.all });
|
|
1255
|
-
queryClient.invalidateQueries({ queryKey: projectKeys.all });
|
|
1256
|
-
queryClient.invalidateQueries({ queryKey: projectKeys.detail(params.projectId) });
|
|
1257
|
-
},
|
|
1258
|
-
onError: (error) => {
|
|
1259
|
-
showApiErrorNotification(error);
|
|
1260
|
-
}
|
|
1261
|
-
});
|
|
1262
|
-
}
|
|
1263
|
-
var noteKeys = {
|
|
1264
|
-
all: ["project-notes"],
|
|
1265
|
-
lists: () => [...noteKeys.all, "list"],
|
|
1266
|
-
list: (orgId, filters) => [...noteKeys.all, "list", orgId, filters],
|
|
1267
|
-
details: () => [...noteKeys.all, "detail"],
|
|
1268
|
-
detail: (id) => [...noteKeys.all, "detail", id]
|
|
1269
|
-
};
|
|
1270
|
-
function useProjectNotes(filters = {}) {
|
|
1271
|
-
const { apiRequest, isReady, organizationId } = useElevasisServices();
|
|
1272
|
-
return useQuery({
|
|
1273
|
-
queryKey: noteKeys.list(organizationId, filters),
|
|
1274
|
-
queryFn: async () => {
|
|
1275
|
-
const res = await apiRequest(`/projects/${filters.projectId}/notes`);
|
|
1276
|
-
return res.notes;
|
|
1277
|
-
},
|
|
1278
|
-
enabled: isReady && !!filters.projectId
|
|
1279
|
-
});
|
|
1280
|
-
}
|
|
1281
|
-
function useCreateNote() {
|
|
1282
|
-
const { apiRequest } = useElevasisServices();
|
|
1283
|
-
const queryClient = useQueryClient();
|
|
1284
|
-
return useMutation({
|
|
1285
|
-
mutationFn: async (params) => {
|
|
1286
|
-
const res = await apiRequest("/project-notes", {
|
|
1287
|
-
method: "POST",
|
|
1288
|
-
body: JSON.stringify(params)
|
|
1289
|
-
});
|
|
1290
|
-
return res.note;
|
|
1291
|
-
},
|
|
1292
|
-
onSuccess: (data) => {
|
|
1293
|
-
queryClient.invalidateQueries({ queryKey: noteKeys.all });
|
|
1294
|
-
queryClient.invalidateQueries({ queryKey: projectKeys.all });
|
|
1295
|
-
queryClient.invalidateQueries({ queryKey: projectKeys.detail(data.project_id) });
|
|
1296
|
-
},
|
|
1297
|
-
onError: (error) => {
|
|
1298
|
-
showApiErrorNotification(error);
|
|
1299
|
-
}
|
|
1300
|
-
});
|
|
1301
|
-
}
|
|
1302
|
-
|
|
1303
|
-
export { ApiKeyService, CredentialSchemas, CredentialService, DeploymentService, MEMBERSHIP_STATUS_COLORS, OrganizationMembershipService, WebhookEndpointService, filterByDomainFilters, milestoneKeys, noteKeys, projectKeys, taskKeys, transformMembershipToTableRow, useActivateDeployment, useActivityFilters, useCommandViewDomainFilters, useCreateApiKey, useCreateCredential, useCreateMilestone, useCreateNote, useCreateProject, useCreateWebhookEndpoint, useCredentials, useDeactivateDeployment, useDeactivateMembership, useDeleteApiKey, useDeleteCredential, useDeleteDeployment, useDeleteMilestone, useDeleteProject, useDeleteTask, useDeleteWebhookEndpoint, useExecutionLogsFilters, useListApiKeys, useListDeployments, useListWebhookEndpoints, useMilestones, useOrganizationMembers, useProject, useProjectNotes, useProjects, useReactivateMembership, useResourceSearch, useResourcesDomainFilters, useStatusFilter, useTasks, useTimeRangeDates, useUpdateApiKey, useUpdateCredential, useUpdateMemberConfig, useUpdateMilestone, useUpdateProject, useUpdateWebhookEndpoint, useUserMemberships, useVisibleResources };
|