@elevasis/ui 2.75.0 → 2.76.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/api/index.js +3 -3
- package/dist/app/index.d.ts +277 -249
- package/dist/app/index.js +12 -11
- package/dist/auth/index.js +6 -7
- package/dist/charts/index.js +6 -7
- package/dist/{chunk-CRPH5AAB.js → chunk-2GIHWU5O.js} +4 -3
- package/dist/chunk-2Y6AKWGU.js +42 -0
- package/dist/chunk-3QYRZSHP.js +854 -0
- package/dist/{chunk-L3NBMLRN.js → chunk-3RK2NNJX.js} +1 -1
- package/dist/{chunk-R6NMRXNO.js → chunk-4WLAVUPS.js} +1 -1
- package/dist/{chunk-DTEGVSJ6.js → chunk-5R4I2PAN.js} +9 -43
- package/dist/chunk-6B4ZPBQJ.js +7 -0
- package/dist/{chunk-QFS2GZMV.js → chunk-73G3I5HJ.js} +160 -160
- package/dist/{chunk-7OOFMEX6.js → chunk-BFLYDVEN.js} +28 -41
- package/dist/{chunk-VWGCURZF.js → chunk-BG6PWDJ3.js} +381 -381
- package/dist/{chunk-5VF5LPYS.js → chunk-BV2RNLPP.js} +1 -1
- package/dist/{chunk-NMHQAYZU.js → chunk-CTT4RDXE.js} +150 -151
- package/dist/chunk-E2LJ3FRA.js +237 -0
- package/dist/{chunk-5RH6NYZH.js → chunk-EFQLXRYT.js} +1 -2
- package/dist/{chunk-M6VAZAQW.js → chunk-EVNLJHDD.js} +3 -3
- package/dist/{chunk-NYIIRZSA.js → chunk-GDQQX5SL.js} +4 -42
- package/dist/{chunk-IYATYH5I.js → chunk-GFSOQH3N.js} +1 -1
- package/dist/{chunk-G7O4CBMC.js → chunk-H5AEYSVX.js} +164 -3
- package/dist/{chunk-ZFISGKYW.js → chunk-IIEZXXDD.js} +1 -1
- package/dist/{chunk-5SLRGUC4.js → chunk-INCEZAM3.js} +1 -1
- package/dist/{chunk-ZG6YJUT4.js → chunk-JZQNUQE4.js} +1 -1
- package/dist/{chunk-SB3IHM5Y.js → chunk-K55TU6CC.js} +2023 -1700
- package/dist/chunk-KB5CAN5D.js +33 -0
- package/dist/{chunk-OGHTJKBV.js → chunk-KMA4FOSV.js} +5682 -5675
- package/dist/{chunk-ICHDIVQO.js → chunk-KXNRTJAE.js} +1 -1
- package/dist/{chunk-MLHZUN2X.js → chunk-MGAELVTZ.js} +12 -12
- package/dist/chunk-MKH2KOAO.js +39 -0
- package/dist/{chunk-6BJ5HMMC.js → chunk-NAPXMYFW.js} +35 -362
- package/dist/{chunk-GDTK33QT.js → chunk-OGG3QJYW.js} +14 -5
- package/dist/{chunk-SN7X5N2A.js → chunk-P6HHXMLJ.js} +1 -1
- package/dist/{chunk-SEYOVNS5.js → chunk-QAILYRC2.js} +1 -1
- package/dist/{chunk-RBGVNPA6.js → chunk-RXZ3XDBM.js} +1 -1
- package/dist/{chunk-2ZRY3ARL.js → chunk-SPW6UA6B.js} +1 -1
- package/dist/{chunk-3H5DIJN7.js → chunk-SVZR4GYA.js} +1 -1
- package/dist/{chunk-47YJVIZE.js → chunk-UEY4AB3R.js} +789 -66
- package/dist/{chunk-LFLM723H.js → chunk-UL6MPMKY.js} +1 -1
- package/dist/{chunk-TX3UHDL5.js → chunk-WELN7DDV.js} +2 -2
- package/dist/{chunk-D3XXPCCK.js → chunk-WJN2VVVJ.js} +1 -1
- package/dist/{chunk-DMSTDZCJ.js → chunk-XODQUPFW.js} +11 -11
- package/dist/components/index.d.ts +135 -25
- package/dist/components/index.js +2165 -1996
- package/dist/components/navigation/index.js +7 -8
- package/dist/features/auth/index.d.ts +35 -3716
- package/dist/features/auth/index.js +9 -10
- package/dist/features/clients/index.js +18 -12
- package/dist/features/content/index.js +27 -27
- package/dist/features/crm/index.css +59 -59
- package/dist/features/crm/index.d.ts +18 -1
- package/dist/features/crm/index.js +13 -11
- package/dist/features/dashboard/index.css +59 -59
- package/dist/features/dashboard/index.js +8 -9
- package/dist/features/delivery/index.d.ts +3 -0
- package/dist/features/delivery/index.js +21 -20
- package/dist/features/knowledge/index.js +6 -7
- package/dist/features/lead-gen/index.css +59 -59
- package/dist/features/lead-gen/index.d.ts +3903 -2
- package/dist/features/lead-gen/index.js +15 -13
- package/dist/features/monitoring/index.js +10 -11
- package/dist/features/monitoring/requests/index.css +59 -59
- package/dist/features/monitoring/requests/index.js +8 -9
- package/dist/features/notes/index.js +4 -4
- package/dist/features/operations/index.css +59 -59
- package/dist/features/operations/index.js +13 -15
- package/dist/features/seo/index.css +659 -0
- package/dist/features/seo/index.d.ts +3962 -1
- package/dist/features/seo/index.js +31 -2
- package/dist/features/settings/index.css +59 -59
- package/dist/features/settings/index.d.ts +79 -3742
- package/dist/features/settings/index.js +10 -12
- package/dist/hooks/access/index.js +6 -7
- package/dist/hooks/delivery/index.css +59 -59
- package/dist/hooks/delivery/index.d.ts +13 -4
- package/dist/hooks/delivery/index.js +3 -3
- package/dist/hooks/published.d.ts +63 -25
- package/dist/hooks/published.js +19 -19
- package/dist/initialization/index.d.ts +35 -3716
- package/dist/knowledge/index.js +11 -11
- package/dist/layout/index.d.ts +55 -2
- package/dist/layout/index.js +10 -10
- package/dist/organization/index.css +59 -59
- package/dist/profile/index.d.ts +64 -3716
- package/dist/provider/index.d.ts +3 -0
- package/dist/provider/index.js +6 -7
- package/dist/provider/published.d.ts +3 -0
- package/dist/provider/published.js +6 -7
- package/dist/test-utils/index.js +3 -3
- package/dist/theme/index.js +3 -3
- package/dist/theme/presets/index.js +1 -1
- package/dist/types/index.d.ts +298 -251
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +1 -1
- package/package.json +5 -9
- package/src/hooks/README.md +22 -23
- package/dist/chunk-6ZAP3FOA.js +0 -93
- package/dist/chunk-AH52XQB7.js +0 -1
- package/dist/chunk-DVAOCHIF.js +0 -165
- package/dist/chunk-MISHPEJX.js +0 -244
- package/dist/hooks/operations/command-view/utils/transformCommandViewData.d.ts +0 -879
- package/dist/hooks/operations/command-view/utils/transformCommandViewData.js +0 -2
- /package/dist/{chunk-A2SB32YV.js → chunk-5ZK7K7YP.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PRESETS, getPreset, generateShades } from './chunk-
|
|
1
|
+
import { PRESETS, getPreset, generateShades } from './chunk-RXZ3XDBM.js';
|
|
2
2
|
import { Tooltip, Tree, Text, TagsInput, Tabs, Table, Stack, SimpleGrid, Select, Combobox, SegmentedControl, ScrollArea, Paper, Popover, Notification, MultiSelect, Modal, Menu, Input, HoverCard, Group, Grid, Flex, Drawer, Code, Divider, Card, Button, Accordion, createTheme } from '@mantine/core';
|
|
3
3
|
import { createContext, useContext } from 'react';
|
|
4
4
|
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
import { projectKeys, noteKeys, taskKeys, milestoneKeys } from './chunk-
|
|
2
|
-
import { leadGenListMemberKeys } from './chunk-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import { projectKeys, noteKeys, taskKeys, milestoneKeys } from './chunk-GFSOQH3N.js';
|
|
2
|
+
import { leadGenListMemberKeys } from './chunk-H5AEYSVX.js';
|
|
3
|
+
import { useSupabase } from './chunk-MKH2KOAO.js';
|
|
4
|
+
import { companyKeys, contactKeys } from './chunk-GDQQX5SL.js';
|
|
5
|
+
import { useErrorNotification } from './chunk-XODQUPFW.js';
|
|
6
|
+
import { useNotificationAdapter, dealKeys, acquisitionListKeys, useListsTelemetry, useOptionalElevasisSystems, useSSEConnection } from './chunk-K55TU6CC.js';
|
|
7
|
+
import { HTTP_HEADERS } from './chunk-JZQNUQE4.js';
|
|
8
|
+
import { showApiErrorNotification, showSuccessNotification } from './chunk-KXNRTJAE.js';
|
|
8
9
|
import { OrganizationContext, useOrganization } from './chunk-DD3CCMCZ.js';
|
|
9
|
-
import { STALE_TIME_DEFAULT, STALE_TIME_ADMIN } from './chunk-
|
|
10
|
+
import { STALE_TIME_DEFAULT, STALE_TIME_ADMIN } from './chunk-5ZK7K7YP.js';
|
|
10
11
|
import { useElevasisServices } from './chunk-BI5VDO2K.js';
|
|
11
|
-
import { useAuthContext } from './chunk-BRJ3QZ4E.js';
|
|
12
12
|
import { useContext, useEffect, useState, useRef, useCallback, useMemo } from 'react';
|
|
13
13
|
import { useQueryClient, useMutation, useQuery } from '@tanstack/react-query';
|
|
14
14
|
import { notifications } from '@mantine/notifications';
|
|
15
|
-
import { createClient } from '@supabase/supabase-js';
|
|
16
15
|
|
|
17
16
|
function useCreateOrgRole() {
|
|
18
17
|
const { apiRequest } = useElevasisServices();
|
|
@@ -274,39 +273,6 @@ function useTransitionItem() {
|
|
|
274
273
|
}
|
|
275
274
|
});
|
|
276
275
|
}
|
|
277
|
-
function getSupabaseConfig() {
|
|
278
|
-
const url = import.meta.env?.VITE_SUPABASE_URL;
|
|
279
|
-
const anonKey = import.meta.env?.VITE_SUPABASE_ANON_KEY;
|
|
280
|
-
if (!url || !anonKey) {
|
|
281
|
-
throw new Error("Missing Supabase environment variables (VITE_SUPABASE_URL, VITE_SUPABASE_ANON_KEY)");
|
|
282
|
-
}
|
|
283
|
-
return { url, anonKey };
|
|
284
|
-
}
|
|
285
|
-
var useSupabase = () => {
|
|
286
|
-
const { getAccessToken } = useAuthContext();
|
|
287
|
-
const { url, anonKey } = getSupabaseConfig();
|
|
288
|
-
return useMemo(
|
|
289
|
-
() => createClient(url, anonKey, {
|
|
290
|
-
global: {
|
|
291
|
-
headers: {
|
|
292
|
-
// Additional headers if needed
|
|
293
|
-
}
|
|
294
|
-
},
|
|
295
|
-
accessToken: async () => {
|
|
296
|
-
try {
|
|
297
|
-
const token = await getAccessToken();
|
|
298
|
-
if (!token) {
|
|
299
|
-
return null;
|
|
300
|
-
}
|
|
301
|
-
return token;
|
|
302
|
-
} catch {
|
|
303
|
-
return null;
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
}),
|
|
307
|
-
[getAccessToken, url, anonKey]
|
|
308
|
-
);
|
|
309
|
-
};
|
|
310
276
|
var projectActivityKeys = {
|
|
311
277
|
all: ["project-activities"],
|
|
312
278
|
list: (projectId) => [...projectActivityKeys.all, "list", projectId]
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PageContainer } from './chunk-BZZCNLT6.js';
|
|
2
|
+
import { SubshellContentContainer } from './chunk-K55TU6CC.js';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
var SubshellPageLayout = ({ children, className }) => /* @__PURE__ */ jsx(SubshellContentContainer, { className, children: /* @__PURE__ */ jsx(PageContainer, { children }) });
|
|
6
|
+
|
|
7
|
+
export { SubshellPageLayout };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { useNotificationAdapter } from './chunk-
|
|
2
|
-
import { showApiErrorNotification } from './chunk-
|
|
1
|
+
import { useNotificationAdapter } from './chunk-K55TU6CC.js';
|
|
2
|
+
import { showApiErrorNotification } from './chunk-KXNRTJAE.js';
|
|
3
3
|
import { OrganizationContext } from './chunk-DD3CCMCZ.js';
|
|
4
|
-
import {
|
|
4
|
+
import { GC_TIME_MEDIUM, STALE_TIME_DEFAULT, GC_TIME_SHORT, STALE_TIME_MONITORING } from './chunk-5ZK7K7YP.js';
|
|
5
5
|
import { useElevasisServices } from './chunk-BI5VDO2K.js';
|
|
6
6
|
import { useQuery, useQueryClient, useMutation } from '@tanstack/react-query';
|
|
7
7
|
import { z } from 'zod';
|
|
8
|
-
import { notifications } from '@mantine/notifications';
|
|
9
8
|
import { useContext } from 'react';
|
|
9
|
+
import { notifications } from '@mantine/notifications';
|
|
10
10
|
|
|
11
11
|
// ../core/src/auth/multi-tenancy/memberships/membership.ts
|
|
12
12
|
function transformMembershipToTableRow(membership) {
|
|
@@ -95,162 +95,6 @@ function usePermissionCatalog() {
|
|
|
95
95
|
});
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
// src/hooks/settings/webhooks/webhookEndpointService.ts
|
|
99
|
-
var WebhookEndpointService = class {
|
|
100
|
-
constructor(apiRequest) {
|
|
101
|
-
this.apiRequest = apiRequest;
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* List webhook endpoints for the current organization
|
|
105
|
-
*/
|
|
106
|
-
async listEndpoints() {
|
|
107
|
-
const response = await this.apiRequest("/webhook-endpoints");
|
|
108
|
-
return response.data;
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* Create a new webhook endpoint
|
|
112
|
-
*/
|
|
113
|
-
async createEndpoint(data) {
|
|
114
|
-
return this.apiRequest("/webhook-endpoints", {
|
|
115
|
-
method: "POST",
|
|
116
|
-
body: JSON.stringify(data)
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
/**
|
|
120
|
-
* Update an existing webhook endpoint (e.g., toggle status, rename)
|
|
121
|
-
*/
|
|
122
|
-
async updateEndpoint(endpointId, data) {
|
|
123
|
-
return this.apiRequest(`/webhook-endpoints/${endpointId}`, {
|
|
124
|
-
method: "PATCH",
|
|
125
|
-
body: JSON.stringify(data)
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* Delete a webhook endpoint
|
|
130
|
-
*/
|
|
131
|
-
async deleteEndpoint(endpointId) {
|
|
132
|
-
await this.apiRequest(`/webhook-endpoints/${endpointId}`, {
|
|
133
|
-
method: "DELETE"
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
};
|
|
137
|
-
function useDeleteWebhookEndpoint() {
|
|
138
|
-
const { apiRequest } = useElevasisServices();
|
|
139
|
-
const queryClient = useQueryClient();
|
|
140
|
-
return useMutation({
|
|
141
|
-
mutationFn: async (endpointId) => {
|
|
142
|
-
const service = new WebhookEndpointService(apiRequest);
|
|
143
|
-
return await service.deleteEndpoint(endpointId);
|
|
144
|
-
},
|
|
145
|
-
onSuccess: () => {
|
|
146
|
-
queryClient.invalidateQueries({ queryKey: ["webhook-endpoints"] });
|
|
147
|
-
notifications.show({
|
|
148
|
-
title: "Success",
|
|
149
|
-
message: "Webhook endpoint deleted",
|
|
150
|
-
color: "teal"
|
|
151
|
-
});
|
|
152
|
-
},
|
|
153
|
-
onError: (error) => {
|
|
154
|
-
console.error("Failed to delete webhook endpoint:", error);
|
|
155
|
-
showApiErrorNotification(error);
|
|
156
|
-
}
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
function useUpdateWebhookEndpoint() {
|
|
160
|
-
const { apiRequest } = useElevasisServices();
|
|
161
|
-
const queryClient = useQueryClient();
|
|
162
|
-
return useMutation({
|
|
163
|
-
mutationFn: async ({ endpointId, data }) => {
|
|
164
|
-
const service = new WebhookEndpointService(apiRequest);
|
|
165
|
-
return await service.updateEndpoint(endpointId, data);
|
|
166
|
-
},
|
|
167
|
-
onSuccess: () => {
|
|
168
|
-
queryClient.invalidateQueries({ queryKey: ["webhook-endpoints"] });
|
|
169
|
-
notifications.show({
|
|
170
|
-
title: "Success",
|
|
171
|
-
message: "Webhook endpoint updated",
|
|
172
|
-
color: "teal"
|
|
173
|
-
});
|
|
174
|
-
},
|
|
175
|
-
onError: (error) => {
|
|
176
|
-
console.error("Failed to update webhook endpoint:", error);
|
|
177
|
-
showApiErrorNotification(error);
|
|
178
|
-
}
|
|
179
|
-
});
|
|
180
|
-
}
|
|
181
|
-
function useCreateWebhookEndpoint() {
|
|
182
|
-
const { apiRequest } = useElevasisServices();
|
|
183
|
-
const queryClient = useQueryClient();
|
|
184
|
-
return useMutation({
|
|
185
|
-
mutationFn: async (data) => {
|
|
186
|
-
const service = new WebhookEndpointService(apiRequest);
|
|
187
|
-
return await service.createEndpoint(data);
|
|
188
|
-
},
|
|
189
|
-
onSuccess: () => {
|
|
190
|
-
queryClient.invalidateQueries({ queryKey: ["webhook-endpoints"] });
|
|
191
|
-
},
|
|
192
|
-
onError: (error) => {
|
|
193
|
-
console.error("Failed to create webhook endpoint:", error);
|
|
194
|
-
showApiErrorNotification(error);
|
|
195
|
-
}
|
|
196
|
-
});
|
|
197
|
-
}
|
|
198
|
-
function useListWebhookEndpoints() {
|
|
199
|
-
const { apiRequest, workOSOrganizationId, isReady } = useElevasisServices();
|
|
200
|
-
return useQuery({
|
|
201
|
-
queryKey: ["webhook-endpoints", workOSOrganizationId],
|
|
202
|
-
queryFn: async () => {
|
|
203
|
-
const service = new WebhookEndpointService(apiRequest);
|
|
204
|
-
return await service.listEndpoints();
|
|
205
|
-
},
|
|
206
|
-
enabled: isReady
|
|
207
|
-
});
|
|
208
|
-
}
|
|
209
|
-
function useOrgRoles(orgId) {
|
|
210
|
-
const { apiRequest, isReady } = useElevasisServices();
|
|
211
|
-
const organization = useContext(OrganizationContext);
|
|
212
|
-
const targetOrgId = orgId ?? organization?.currentSupabaseOrganizationId ?? void 0;
|
|
213
|
-
return useQuery({
|
|
214
|
-
queryKey: ["org-roles", targetOrgId],
|
|
215
|
-
queryFn: () => apiRequest(`/organizations/${targetOrgId}/roles`),
|
|
216
|
-
enabled: isReady && !!targetOrgId,
|
|
217
|
-
staleTime: STALE_TIME_DEFAULT
|
|
218
|
-
});
|
|
219
|
-
}
|
|
220
|
-
function useAssignRole() {
|
|
221
|
-
const { apiRequest } = useElevasisServices();
|
|
222
|
-
const organization = useContext(OrganizationContext);
|
|
223
|
-
const orgId = organization?.currentSupabaseOrganizationId ?? null;
|
|
224
|
-
const queryClient = useQueryClient();
|
|
225
|
-
return useMutation({
|
|
226
|
-
mutationFn: ({ membershipId, roleId }) => apiRequest(`/memberships/${membershipId}/roles`, {
|
|
227
|
-
method: "POST",
|
|
228
|
-
body: JSON.stringify({ roleId })
|
|
229
|
-
}),
|
|
230
|
-
onSettled: (_data, _error, { membershipId }) => {
|
|
231
|
-
queryClient.invalidateQueries({ queryKey: ["member-roles", orgId, membershipId] });
|
|
232
|
-
queryClient.invalidateQueries({ queryKey: ["organization-permissions", orgId] });
|
|
233
|
-
queryClient.invalidateQueries({ queryKey: ["org-roles", orgId] });
|
|
234
|
-
}
|
|
235
|
-
});
|
|
236
|
-
}
|
|
237
|
-
function useRevokeRole() {
|
|
238
|
-
const { apiRequest } = useElevasisServices();
|
|
239
|
-
const organization = useContext(OrganizationContext);
|
|
240
|
-
const orgId = organization?.currentSupabaseOrganizationId ?? null;
|
|
241
|
-
const queryClient = useQueryClient();
|
|
242
|
-
return useMutation({
|
|
243
|
-
mutationFn: ({ membershipId, roleId }) => apiRequest(`/memberships/${membershipId}/roles/${roleId}`, {
|
|
244
|
-
method: "DELETE"
|
|
245
|
-
}),
|
|
246
|
-
onSettled: (_data, _error, { membershipId }) => {
|
|
247
|
-
queryClient.invalidateQueries({ queryKey: ["member-roles", orgId, membershipId] });
|
|
248
|
-
queryClient.invalidateQueries({ queryKey: ["organization-permissions", orgId] });
|
|
249
|
-
queryClient.invalidateQueries({ queryKey: ["org-roles", orgId] });
|
|
250
|
-
}
|
|
251
|
-
});
|
|
252
|
-
}
|
|
253
|
-
|
|
254
98
|
// src/hooks/settings/organization/organizationMembershipService.ts
|
|
255
99
|
var OrganizationMembershipService = class {
|
|
256
100
|
constructor(apiRequest) {
|
|
@@ -473,6 +317,162 @@ function useReactivateMembership() {
|
|
|
473
317
|
}
|
|
474
318
|
});
|
|
475
319
|
}
|
|
320
|
+
function useOrgRoles(orgId) {
|
|
321
|
+
const { apiRequest, isReady } = useElevasisServices();
|
|
322
|
+
const organization = useContext(OrganizationContext);
|
|
323
|
+
const targetOrgId = orgId ?? organization?.currentSupabaseOrganizationId ?? void 0;
|
|
324
|
+
return useQuery({
|
|
325
|
+
queryKey: ["org-roles", targetOrgId],
|
|
326
|
+
queryFn: () => apiRequest(`/organizations/${targetOrgId}/roles`),
|
|
327
|
+
enabled: isReady && !!targetOrgId,
|
|
328
|
+
staleTime: STALE_TIME_DEFAULT
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
function useAssignRole() {
|
|
332
|
+
const { apiRequest } = useElevasisServices();
|
|
333
|
+
const organization = useContext(OrganizationContext);
|
|
334
|
+
const orgId = organization?.currentSupabaseOrganizationId ?? null;
|
|
335
|
+
const queryClient = useQueryClient();
|
|
336
|
+
return useMutation({
|
|
337
|
+
mutationFn: ({ membershipId, roleId }) => apiRequest(`/memberships/${membershipId}/roles`, {
|
|
338
|
+
method: "POST",
|
|
339
|
+
body: JSON.stringify({ roleId })
|
|
340
|
+
}),
|
|
341
|
+
onSettled: (_data, _error, { membershipId }) => {
|
|
342
|
+
queryClient.invalidateQueries({ queryKey: ["member-roles", orgId, membershipId] });
|
|
343
|
+
queryClient.invalidateQueries({ queryKey: ["organization-permissions", orgId] });
|
|
344
|
+
queryClient.invalidateQueries({ queryKey: ["org-roles", orgId] });
|
|
345
|
+
}
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
function useRevokeRole() {
|
|
349
|
+
const { apiRequest } = useElevasisServices();
|
|
350
|
+
const organization = useContext(OrganizationContext);
|
|
351
|
+
const orgId = organization?.currentSupabaseOrganizationId ?? null;
|
|
352
|
+
const queryClient = useQueryClient();
|
|
353
|
+
return useMutation({
|
|
354
|
+
mutationFn: ({ membershipId, roleId }) => apiRequest(`/memberships/${membershipId}/roles/${roleId}`, {
|
|
355
|
+
method: "DELETE"
|
|
356
|
+
}),
|
|
357
|
+
onSettled: (_data, _error, { membershipId }) => {
|
|
358
|
+
queryClient.invalidateQueries({ queryKey: ["member-roles", orgId, membershipId] });
|
|
359
|
+
queryClient.invalidateQueries({ queryKey: ["organization-permissions", orgId] });
|
|
360
|
+
queryClient.invalidateQueries({ queryKey: ["org-roles", orgId] });
|
|
361
|
+
}
|
|
362
|
+
});
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
// src/hooks/settings/webhooks/webhookEndpointService.ts
|
|
366
|
+
var WebhookEndpointService = class {
|
|
367
|
+
constructor(apiRequest) {
|
|
368
|
+
this.apiRequest = apiRequest;
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* List webhook endpoints for the current organization
|
|
372
|
+
*/
|
|
373
|
+
async listEndpoints() {
|
|
374
|
+
const response = await this.apiRequest("/webhook-endpoints");
|
|
375
|
+
return response.data;
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
* Create a new webhook endpoint
|
|
379
|
+
*/
|
|
380
|
+
async createEndpoint(data) {
|
|
381
|
+
return this.apiRequest("/webhook-endpoints", {
|
|
382
|
+
method: "POST",
|
|
383
|
+
body: JSON.stringify(data)
|
|
384
|
+
});
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* Update an existing webhook endpoint (e.g., toggle status, rename)
|
|
388
|
+
*/
|
|
389
|
+
async updateEndpoint(endpointId, data) {
|
|
390
|
+
return this.apiRequest(`/webhook-endpoints/${endpointId}`, {
|
|
391
|
+
method: "PATCH",
|
|
392
|
+
body: JSON.stringify(data)
|
|
393
|
+
});
|
|
394
|
+
}
|
|
395
|
+
/**
|
|
396
|
+
* Delete a webhook endpoint
|
|
397
|
+
*/
|
|
398
|
+
async deleteEndpoint(endpointId) {
|
|
399
|
+
await this.apiRequest(`/webhook-endpoints/${endpointId}`, {
|
|
400
|
+
method: "DELETE"
|
|
401
|
+
});
|
|
402
|
+
}
|
|
403
|
+
};
|
|
404
|
+
function useListWebhookEndpoints() {
|
|
405
|
+
const { apiRequest, workOSOrganizationId, isReady } = useElevasisServices();
|
|
406
|
+
return useQuery({
|
|
407
|
+
queryKey: ["webhook-endpoints", workOSOrganizationId],
|
|
408
|
+
queryFn: async () => {
|
|
409
|
+
const service = new WebhookEndpointService(apiRequest);
|
|
410
|
+
return await service.listEndpoints();
|
|
411
|
+
},
|
|
412
|
+
enabled: isReady
|
|
413
|
+
});
|
|
414
|
+
}
|
|
415
|
+
function useCreateWebhookEndpoint() {
|
|
416
|
+
const { apiRequest } = useElevasisServices();
|
|
417
|
+
const queryClient = useQueryClient();
|
|
418
|
+
return useMutation({
|
|
419
|
+
mutationFn: async (data) => {
|
|
420
|
+
const service = new WebhookEndpointService(apiRequest);
|
|
421
|
+
return await service.createEndpoint(data);
|
|
422
|
+
},
|
|
423
|
+
onSuccess: () => {
|
|
424
|
+
queryClient.invalidateQueries({ queryKey: ["webhook-endpoints"] });
|
|
425
|
+
},
|
|
426
|
+
onError: (error) => {
|
|
427
|
+
console.error("Failed to create webhook endpoint:", error);
|
|
428
|
+
showApiErrorNotification(error);
|
|
429
|
+
}
|
|
430
|
+
});
|
|
431
|
+
}
|
|
432
|
+
function useDeleteWebhookEndpoint() {
|
|
433
|
+
const { apiRequest } = useElevasisServices();
|
|
434
|
+
const queryClient = useQueryClient();
|
|
435
|
+
return useMutation({
|
|
436
|
+
mutationFn: async (endpointId) => {
|
|
437
|
+
const service = new WebhookEndpointService(apiRequest);
|
|
438
|
+
return await service.deleteEndpoint(endpointId);
|
|
439
|
+
},
|
|
440
|
+
onSuccess: () => {
|
|
441
|
+
queryClient.invalidateQueries({ queryKey: ["webhook-endpoints"] });
|
|
442
|
+
notifications.show({
|
|
443
|
+
title: "Success",
|
|
444
|
+
message: "Webhook endpoint deleted",
|
|
445
|
+
color: "teal"
|
|
446
|
+
});
|
|
447
|
+
},
|
|
448
|
+
onError: (error) => {
|
|
449
|
+
console.error("Failed to delete webhook endpoint:", error);
|
|
450
|
+
showApiErrorNotification(error);
|
|
451
|
+
}
|
|
452
|
+
});
|
|
453
|
+
}
|
|
454
|
+
function useUpdateWebhookEndpoint() {
|
|
455
|
+
const { apiRequest } = useElevasisServices();
|
|
456
|
+
const queryClient = useQueryClient();
|
|
457
|
+
return useMutation({
|
|
458
|
+
mutationFn: async ({ endpointId, data }) => {
|
|
459
|
+
const service = new WebhookEndpointService(apiRequest);
|
|
460
|
+
return await service.updateEndpoint(endpointId, data);
|
|
461
|
+
},
|
|
462
|
+
onSuccess: () => {
|
|
463
|
+
queryClient.invalidateQueries({ queryKey: ["webhook-endpoints"] });
|
|
464
|
+
notifications.show({
|
|
465
|
+
title: "Success",
|
|
466
|
+
message: "Webhook endpoint updated",
|
|
467
|
+
color: "teal"
|
|
468
|
+
});
|
|
469
|
+
},
|
|
470
|
+
onError: (error) => {
|
|
471
|
+
console.error("Failed to update webhook endpoint:", error);
|
|
472
|
+
showApiErrorNotification(error);
|
|
473
|
+
}
|
|
474
|
+
});
|
|
475
|
+
}
|
|
476
476
|
function useOrganizationMembers(organizationId, params) {
|
|
477
477
|
const { apiRequest, isReady } = useElevasisServices();
|
|
478
478
|
return useQuery({
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import { useDealDetail, useExecuteAction } from './chunk-
|
|
2
|
-
import { CRM_API_INTERFACE } from './chunk-
|
|
3
|
-
import {
|
|
1
|
+
import { useDealDetail, useExecuteAction } from './chunk-EVNLJHDD.js';
|
|
2
|
+
import { CRM_API_INTERFACE } from './chunk-WELN7DDV.js';
|
|
3
|
+
import { useCompany, useContact, deriveActions } from './chunk-GDQQX5SL.js';
|
|
4
|
+
import { useTableSort, sortData } from './chunk-2Y6AKWGU.js';
|
|
5
|
+
import { getSystemApiInterfaceReadiness } from './chunk-3RK2NNJX.js';
|
|
4
6
|
import { useTableSelection } from './chunk-WDBNW44Z.js';
|
|
7
|
+
import { SubshellPageLayout } from './chunk-6B4ZPBQJ.js';
|
|
5
8
|
import { PageContainer } from './chunk-BZZCNLT6.js';
|
|
6
9
|
import { TableSelectionToolbar, SortableHeader } from './chunk-TUMSNGTX.js';
|
|
7
10
|
import { FilterBar } from './chunk-PDHTXPSF.js';
|
|
8
|
-
import { CrmSidebarMiddle, useDealsSummary, useOptionalElevasisSystems, getCrmPipelineCatalog, CenteredErrorState, StatCard, PageTitleCaption, useDeleteDeal, usePaginationState, useDeals, SubshellContentContainer, EmptyState, CustomModal, useCrmActions, ActivityTimeline, ContextViewer, JsonViewer, dealKeys } from './chunk-
|
|
9
|
-
import { showApiErrorNotification, showSuccessNotification } from './chunk-
|
|
10
|
-
import { SubshellSidebarSection } from './chunk-MISHPEJX.js';
|
|
11
|
+
import { SubshellSidebarSection, CrmSidebarMiddle, useDealsSummary, useOptionalElevasisSystems, getCrmPipelineCatalog, CenteredErrorState, StatCard, PageTitleCaption, useDeleteDeal, usePaginationState, useDeals, SubshellContentContainer, EmptyState, CustomModal, useCrmActions, ActivityTimeline, ContextViewer, JsonViewer, dealKeys } from './chunk-K55TU6CC.js';
|
|
12
|
+
import { showApiErrorNotification, showSuccessNotification } from './chunk-KXNRTJAE.js';
|
|
11
13
|
import { CardHeader } from './chunk-62GVNH5U.js';
|
|
12
|
-
import {
|
|
14
|
+
import { PAGE_SIZE_DEFAULT, formatTimeAgo } from './chunk-5ZK7K7YP.js';
|
|
13
15
|
import { useElevasisServices } from './chunk-BI5VDO2K.js';
|
|
14
16
|
import { Stack, Paper, Center, Loader, Group, Box, Text, Alert, Table, SimpleGrid, Button, Select, TextInput, Tabs, Checkbox, Badge, Tooltip, Pagination, Title, Code, Card, SegmentedControl, Switch, NumberInput, ColorSwatch, Popover, ActionIcon, Anchor, CopyButton, Divider, Textarea } from '@mantine/core';
|
|
15
17
|
import { IconAddressBook, IconColumns, IconHistory, IconAlertCircle, IconCurrencyDollar, IconChartBar, IconBriefcase, IconTrophy, IconSearch, IconTargetArrow, IconAlertTriangle, IconMessages, IconArrowLeft, IconFileText, IconInbox, IconUser, IconBolt, IconBuilding, IconSettings, IconRestore, IconInfoCircle, IconMailForward, IconPlus, IconArrowRight, IconNote, IconCheck, IconCopy } from '@tabler/icons-react';
|
|
@@ -203,36 +205,21 @@ function useRecentCrmActivity(opts) {
|
|
|
203
205
|
error: query.error
|
|
204
206
|
};
|
|
205
207
|
}
|
|
206
|
-
function summarizeReadinessIssues(issues) {
|
|
207
|
-
return issues[0]?.message;
|
|
208
|
-
}
|
|
209
208
|
function getCrmApiInterfaceReadiness(model) {
|
|
210
|
-
|
|
211
|
-
return {
|
|
212
|
-
systemPath: CRM_API_INTERFACE.systemPath,
|
|
213
|
-
interfaceKey: CRM_API_INTERFACE.interfaceKey,
|
|
214
|
-
readinessProfile: CRM_API_INTERFACE.readinessProfile,
|
|
215
|
-
declared: false,
|
|
216
|
-
ready: false,
|
|
217
|
-
reason: "No Organization Model is available for CRM System Interface readiness.",
|
|
218
|
-
issues: [
|
|
219
|
-
{
|
|
220
|
-
family: "SYSTEM_INTERFACE_MISSING",
|
|
221
|
-
code: "missing-organization-model",
|
|
222
|
-
message: "No Organization Model is available for CRM System Interface readiness."
|
|
223
|
-
}
|
|
224
|
-
]
|
|
225
|
-
};
|
|
226
|
-
}
|
|
227
|
-
const readiness = computeInterfaceReadiness(model, CRM_API_INTERFACE);
|
|
209
|
+
const readiness = getSystemApiInterfaceReadiness(model, CRM_API_INTERFACE.systemPath, CRM_API_INTERFACE.interfaceKey);
|
|
228
210
|
return {
|
|
211
|
+
...readiness,
|
|
229
212
|
systemPath: CRM_API_INTERFACE.systemPath,
|
|
230
213
|
interfaceKey: CRM_API_INTERFACE.interfaceKey,
|
|
231
|
-
readinessProfile: readiness.readinessProfile,
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
214
|
+
readinessProfile: model ? readiness.readinessProfile : CRM_API_INTERFACE.readinessProfile,
|
|
215
|
+
reason: model ? readiness.reason : "No Organization Model is available for CRM System Interface readiness.",
|
|
216
|
+
issues: model ? readiness.issues : [
|
|
217
|
+
{
|
|
218
|
+
family: "SYSTEM_INTERFACE_MISSING",
|
|
219
|
+
code: "missing-organization-model",
|
|
220
|
+
message: "No Organization Model is available for CRM System Interface readiness."
|
|
221
|
+
}
|
|
222
|
+
]
|
|
236
223
|
};
|
|
237
224
|
}
|
|
238
225
|
function useCrmPipelineConfig() {
|
|
@@ -1202,10 +1189,10 @@ function DealDetailPage({ dealId, renderActions, onDealLoaded, bookingUrl }) {
|
|
|
1202
1189
|
deal && renderActions?.(deal)
|
|
1203
1190
|
] });
|
|
1204
1191
|
if (isLoading) {
|
|
1205
|
-
return /* @__PURE__ */ jsx(
|
|
1192
|
+
return /* @__PURE__ */ jsx(SubshellPageLayout, { children: /* @__PURE__ */ jsxs(Stack, { children: [
|
|
1206
1193
|
/* @__PURE__ */ jsx(PageTitleCaption, { title, caption: "Loading deal details...", rightSection: headerActions }),
|
|
1207
1194
|
/* @__PURE__ */ jsx(Paper, { withBorder: true, children: /* @__PURE__ */ jsx(Center, { p: "xl", children: /* @__PURE__ */ jsx(Loader, {}) }) })
|
|
1208
|
-
] }) })
|
|
1195
|
+
] }) });
|
|
1209
1196
|
}
|
|
1210
1197
|
if (error) {
|
|
1211
1198
|
return /* @__PURE__ */ jsx(SubshellContentContainer, { children: /* @__PURE__ */ jsx(PageContainer, { children: /* @__PURE__ */ jsxs(Stack, { children: [
|
|
@@ -1366,10 +1353,10 @@ function CompanyDetailPage({ companyId }) {
|
|
|
1366
1353
|
}
|
|
1367
1354
|
);
|
|
1368
1355
|
if (isLoading) {
|
|
1369
|
-
return /* @__PURE__ */
|
|
1356
|
+
return /* @__PURE__ */ jsxs(SubshellPageLayout, { children: [
|
|
1370
1357
|
/* @__PURE__ */ jsx(Stack, { children: /* @__PURE__ */ jsx(PageTitleCaption, { title, caption: "Loading company details...", rightSection: headerActions }) }),
|
|
1371
1358
|
/* @__PURE__ */ jsx(Paper, { withBorder: true, children: /* @__PURE__ */ jsx(Center, { p: "xl", children: /* @__PURE__ */ jsx(Loader, {}) }) })
|
|
1372
|
-
] })
|
|
1359
|
+
] });
|
|
1373
1360
|
}
|
|
1374
1361
|
if (error) {
|
|
1375
1362
|
return /* @__PURE__ */ jsx(SubshellContentContainer, { children: /* @__PURE__ */ jsxs(PageContainer, { children: [
|
|
@@ -1660,7 +1647,7 @@ function CrmSettingsPage() {
|
|
|
1660
1647
|
const response = await resetSettings.mutateAsync();
|
|
1661
1648
|
setDraft(draftFromConfig(toResolvedConfig(response.resolved), defaultConfig.buckets));
|
|
1662
1649
|
};
|
|
1663
|
-
return /* @__PURE__ */ jsx(
|
|
1650
|
+
return /* @__PURE__ */ jsx(SubshellPageLayout, { children: /* @__PURE__ */ jsxs(Stack, { children: [
|
|
1664
1651
|
/* @__PURE__ */ jsx(
|
|
1665
1652
|
PageTitleCaption,
|
|
1666
1653
|
{
|
|
@@ -1805,7 +1792,7 @@ function CrmSettingsPage() {
|
|
|
1805
1792
|
}) })
|
|
1806
1793
|
] })
|
|
1807
1794
|
] }) })
|
|
1808
|
-
] }) })
|
|
1795
|
+
] }) });
|
|
1809
1796
|
}
|
|
1810
1797
|
function ContactDetailPage({ contactId }) {
|
|
1811
1798
|
const navigate = useNavigate();
|
|
@@ -1823,10 +1810,10 @@ function ContactDetailPage({ contactId }) {
|
|
|
1823
1810
|
}
|
|
1824
1811
|
);
|
|
1825
1812
|
if (isLoading) {
|
|
1826
|
-
return /* @__PURE__ */
|
|
1813
|
+
return /* @__PURE__ */ jsxs(SubshellPageLayout, { children: [
|
|
1827
1814
|
/* @__PURE__ */ jsx(Stack, { children: /* @__PURE__ */ jsx(PageTitleCaption, { title, caption: "Loading contact details...", rightSection: headerActions }) }),
|
|
1828
1815
|
/* @__PURE__ */ jsx(Paper, { withBorder: true, children: /* @__PURE__ */ jsx(Center, { p: "xl", children: /* @__PURE__ */ jsx(Loader, {}) }) })
|
|
1829
|
-
] })
|
|
1816
|
+
] });
|
|
1830
1817
|
}
|
|
1831
1818
|
if (error) {
|
|
1832
1819
|
return /* @__PURE__ */ jsx(SubshellContentContainer, { children: /* @__PURE__ */ jsxs(PageContainer, { children: [
|