@elevasis/ui 2.74.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.
Files changed (105) hide show
  1. package/dist/api/index.js +3 -3
  2. package/dist/app/index.d.ts +277 -249
  3. package/dist/app/index.js +12 -11
  4. package/dist/auth/index.js +6 -7
  5. package/dist/charts/index.js +6 -7
  6. package/dist/{chunk-GO4XJ5D4.js → chunk-2GIHWU5O.js} +4 -3
  7. package/dist/chunk-2Y6AKWGU.js +42 -0
  8. package/dist/chunk-3QYRZSHP.js +854 -0
  9. package/dist/{chunk-CRA7WQZH.js → chunk-3RK2NNJX.js} +1 -1
  10. package/dist/{chunk-R6NMRXNO.js → chunk-4WLAVUPS.js} +1 -1
  11. package/dist/{chunk-GPQQGQGT.js → chunk-5R4I2PAN.js} +9 -43
  12. package/dist/{chunk-R5UGIFYU.js → chunk-5ZK7K7YP.js} +25 -1
  13. package/dist/chunk-6B4ZPBQJ.js +7 -0
  14. package/dist/{chunk-ARAFQBNI.js → chunk-73G3I5HJ.js} +160 -160
  15. package/dist/{chunk-ZWI62BQ6.js → chunk-BFLYDVEN.js} +32 -42
  16. package/dist/{chunk-W2QRBQQA.js → chunk-BG6PWDJ3.js} +381 -381
  17. package/dist/{chunk-7ARBBELS.js → chunk-BV2RNLPP.js} +1 -1
  18. package/dist/{chunk-FA7LMNQO.js → chunk-CTT4RDXE.js} +150 -151
  19. package/dist/chunk-E2LJ3FRA.js +237 -0
  20. package/dist/{chunk-E6YGA5WH.js → chunk-EFQLXRYT.js} +1 -2
  21. package/dist/{chunk-FZSG6M6W.js → chunk-EVNLJHDD.js} +3 -3
  22. package/dist/{chunk-ZYNVCWDZ.js → chunk-GDQQX5SL.js} +4 -42
  23. package/dist/{chunk-DCQKTDIG.js → chunk-GFSOQH3N.js} +1 -1
  24. package/dist/{chunk-3LOKYZJC.js → chunk-H5AEYSVX.js} +164 -3
  25. package/dist/{chunk-ZFISGKYW.js → chunk-IIEZXXDD.js} +1 -1
  26. package/dist/{chunk-3QHX4ZKV.js → chunk-INCEZAM3.js} +1 -1
  27. package/dist/{chunk-O32UQ26A.js → chunk-JZQNUQE4.js} +1 -1
  28. package/dist/{chunk-6JN2TLV2.js → chunk-K55TU6CC.js} +2023 -1700
  29. package/dist/chunk-KB5CAN5D.js +33 -0
  30. package/dist/{chunk-2MRRDF32.js → chunk-KMA4FOSV.js} +5682 -5675
  31. package/dist/{chunk-HYQOGRWG.js → chunk-KXNRTJAE.js} +1 -1
  32. package/dist/{chunk-7RJ7P6S6.js → chunk-MGAELVTZ.js} +12 -12
  33. package/dist/chunk-MKH2KOAO.js +39 -0
  34. package/dist/{chunk-4MXNHJTA.js → chunk-NAPXMYFW.js} +939 -1570
  35. package/dist/{chunk-CQPULKKL.js → chunk-OGG3QJYW.js} +14 -5
  36. package/dist/{chunk-4M2BSHVT.js → chunk-P6HHXMLJ.js} +1 -1
  37. package/dist/{chunk-WZU3MCKI.js → chunk-QAILYRC2.js} +1 -1
  38. package/dist/{chunk-RBGVNPA6.js → chunk-RXZ3XDBM.js} +1 -1
  39. package/dist/{chunk-BA3AZJUR.js → chunk-SPW6UA6B.js} +1 -1
  40. package/dist/{chunk-RFNJ2PTO.js → chunk-SVZR4GYA.js} +1 -1
  41. package/dist/{chunk-5A6KCFS5.js → chunk-UEY4AB3R.js} +789 -66
  42. package/dist/{chunk-LN4UW6S4.js → chunk-UL6MPMKY.js} +1 -1
  43. package/dist/{chunk-ZFA56VSR.js → chunk-WELN7DDV.js} +2 -2
  44. package/dist/{chunk-43LC6XAX.js → chunk-WJN2VVVJ.js} +1 -1
  45. package/dist/{chunk-BRTGCFBH.js → chunk-XODQUPFW.js} +11 -11
  46. package/dist/components/index.d.ts +181 -34
  47. package/dist/components/index.js +2249 -1804
  48. package/dist/components/navigation/index.js +7 -8
  49. package/dist/features/auth/index.d.ts +35 -3716
  50. package/dist/features/auth/index.js +9 -10
  51. package/dist/features/clients/index.js +18 -12
  52. package/dist/features/content/index.js +34 -31
  53. package/dist/features/crm/index.css +59 -59
  54. package/dist/features/crm/index.d.ts +18 -1
  55. package/dist/features/crm/index.js +13 -11
  56. package/dist/features/dashboard/index.css +59 -59
  57. package/dist/features/dashboard/index.js +8 -9
  58. package/dist/features/delivery/index.d.ts +3 -0
  59. package/dist/features/delivery/index.js +21 -20
  60. package/dist/features/knowledge/index.js +6 -7
  61. package/dist/features/lead-gen/index.css +59 -59
  62. package/dist/features/lead-gen/index.d.ts +3903 -2
  63. package/dist/features/lead-gen/index.js +15 -13
  64. package/dist/features/monitoring/index.js +10 -11
  65. package/dist/features/monitoring/requests/index.css +59 -59
  66. package/dist/features/monitoring/requests/index.js +8 -9
  67. package/dist/features/notes/index.js +4 -4
  68. package/dist/features/operations/index.css +59 -59
  69. package/dist/features/operations/index.js +13 -15
  70. package/dist/features/seo/index.css +659 -0
  71. package/dist/features/seo/index.d.ts +3962 -1
  72. package/dist/features/seo/index.js +31 -2
  73. package/dist/features/settings/index.css +59 -59
  74. package/dist/features/settings/index.d.ts +87 -3745
  75. package/dist/features/settings/index.js +10 -12
  76. package/dist/hooks/access/index.js +6 -7
  77. package/dist/hooks/delivery/index.css +59 -59
  78. package/dist/hooks/delivery/index.d.ts +13 -4
  79. package/dist/hooks/delivery/index.js +3 -3
  80. package/dist/hooks/published.d.ts +69 -27
  81. package/dist/hooks/published.js +19 -19
  82. package/dist/initialization/index.d.ts +35 -3716
  83. package/dist/knowledge/index.js +11 -11
  84. package/dist/layout/index.d.ts +55 -2
  85. package/dist/layout/index.js +10 -10
  86. package/dist/organization/index.css +59 -59
  87. package/dist/profile/index.d.ts +64 -3716
  88. package/dist/provider/index.d.ts +3 -0
  89. package/dist/provider/index.js +6 -7
  90. package/dist/provider/published.d.ts +3 -0
  91. package/dist/provider/published.js +6 -7
  92. package/dist/test-utils/index.js +3 -3
  93. package/dist/theme/index.js +3 -3
  94. package/dist/theme/presets/index.js +1 -1
  95. package/dist/types/index.d.ts +312 -251
  96. package/dist/utils/index.d.ts +1 -1
  97. package/dist/utils/index.js +1 -1
  98. package/package.json +9 -9
  99. package/src/hooks/README.md +22 -23
  100. package/dist/chunk-6ZAP3FOA.js +0 -93
  101. package/dist/chunk-AH52XQB7.js +0 -1
  102. package/dist/chunk-GDOR57D7.js +0 -165
  103. package/dist/chunk-MISHPEJX.js +0 -244
  104. package/dist/hooks/operations/command-view/utils/transformCommandViewData.d.ts +0 -879
  105. package/dist/hooks/operations/command-view/utils/transformCommandViewData.js +0 -2
@@ -1,4 +1,4 @@
1
- import { computeInterfaceReadiness, getSystem } from './chunk-R5UGIFYU.js';
1
+ import { computeInterfaceReadiness, getSystem } from './chunk-5ZK7K7YP.js';
2
2
 
3
3
  // src/features/operations/systems/systemInterfaceReadiness.ts
4
4
  function summarizeReadinessIssues(issues) {
@@ -1,4 +1,4 @@
1
- import { PRESETS, getPreset, generateShades } from './chunk-RBGVNPA6.js';
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-DCQKTDIG.js';
2
- import { leadGenListMemberKeys } from './chunk-GDOR57D7.js';
3
- import { companyKeys, contactKeys } from './chunk-ZYNVCWDZ.js';
4
- import { useErrorNotification } from './chunk-BRTGCFBH.js';
5
- import { useNotificationAdapter, dealKeys, acquisitionListKeys, useListsTelemetry, useOptionalElevasisSystems, useSSEConnection } from './chunk-6JN2TLV2.js';
6
- import { HTTP_HEADERS } from './chunk-O32UQ26A.js';
7
- import { showApiErrorNotification, showSuccessNotification } from './chunk-HYQOGRWG.js';
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-R5UGIFYU.js';
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]
@@ -1380,6 +1380,30 @@ function computeInterfaceReadiness(model, request) {
1380
1380
  };
1381
1381
  }
1382
1382
 
1383
+ // ../core/src/organization-model/readiness/remedies.ts
1384
+ var REDEPLOY_REMEDY = "Deploy the organization model again to fix this: elevasis-sdk deploy";
1385
+ var FAMILY_REMEDY = {
1386
+ SYSTEM_INTERFACE_MISSING: "The System does not declare this interface. Add an apiInterface block for it in the organization model, then deploy again.",
1387
+ SYSTEM_INTERFACE_DISABLED: "The interface is declared but not enabled. Set its lifecycle to enabled in the organization model, then deploy again.",
1388
+ SYSTEM_INTERFACE_INVALID: "The interface declaration did not validate. Fix the declaration named in the issues above, then deploy again.",
1389
+ SYSTEM_INTERFACE_NOT_READY: "The interface is declared and enabled but its readiness contract is unsatisfied. Resolve the issues above, then deploy again.",
1390
+ SYSTEM_BRIDGE_NOT_READY: "The bridge between two Systems is not ready. Resolve the issues above on both Systems, then deploy again.",
1391
+ STALE_OM_SNAPSHOT: REDEPLOY_REMEDY
1392
+ };
1393
+ var RESOLUTION_ISSUE_CODES = [
1394
+ "model-parse-failed",
1395
+ "stale-om-snapshot",
1396
+ "active-deployment-model-missing",
1397
+ "canonical-fallback-not-allowed"
1398
+ ];
1399
+ function isResolutionIssue(issue) {
1400
+ return RESOLUTION_ISSUE_CODES.includes(issue.code);
1401
+ }
1402
+ function resolveReadinessRemedy(issue) {
1403
+ if (isResolutionIssue(issue)) return REDEPLOY_REMEDY;
1404
+ return FAMILY_REMEDY[issue.family] ?? FAMILY_REMEDY.SYSTEM_INTERFACE_NOT_READY;
1405
+ }
1406
+
1383
1407
  // ../core/src/platform/registry/resource-metadata.ts
1384
1408
  var resourceTypeIconNames = {
1385
1409
  agent: "IconBrain",
@@ -1504,4 +1528,4 @@ function setupBrowserMocks() {
1504
1528
  setupResizeObserver();
1505
1529
  }
1506
1530
 
1507
- export { APIClientError, API_URL, ActionInvocationSchema, ActionSchema, ActionsDomainSchema, DEBOUNCE_FILTER, DEBOUNCE_SLIDER, DEFAULT_ONTOLOGY_SCOPE, DEFAULT_ORGANIZATION_MODEL_ACTIONS, DEFAULT_ORGANIZATION_MODEL_SYSTEMS, DescriptionSchema, EntitiesDomainSchema, EntitySchema, GC_TIME_LONG, GC_TIME_MEDIUM, GC_TIME_SHORT, IconNameSchema, JsonValueSchema, LIMIT_ACTIVITY_FEED, LabelSchema, ModelIdSchema, NodeIdStringSchema, OAUTH_FLOW_TIMEOUT, OntologyIdSchema, OntologyScopeSchema, PAGE_SIZE_DEFAULT, PathSchema, STALE_TIME_ADMIN, STALE_TIME_DEFAULT, STALE_TIME_MONITORING, SYSTEM_INTERFACE_PROFILES, SystemEntrySchema, SystemIdSchema, SystemInterfaceRefSchema, SystemLifecycleSchema, SystemPathSchema, SystemsDomainSchema, addReadinessIssue, ancestorsOf, childrenOf, compileOrganizationOntology, computeInterfaceReadiness, defaultPathFor, devOnlyFor, findById, findByPath, formatChartAxisDate, formatDate, formatDateTime, formatErrorMessage, formatInterfaceIdentity, formatOntologyId, formatRelativeTime, formatTimeAgo, getErrorInfo, getErrorTitle, getResourceColor, getResourceIcon, getResourcesForSystem, getSystem, getSystemAncestors, getSystemReadinessServerErrorDetails, isAPIClientError, isSystemLifecycleVisible, listAllSystems, listResolvedOntologyRecords, ontologyGraphNodeId, parentOf, parseOntologyId, registerBuiltInReadinessProfile, registerReadinessInterfaceMarker, requireCatalogReadiness, requireContractReadiness, requireScopedBinding, resolveSystemConfig, resourceBindingIds, restoreConsole, setupBrowserMocks, suppressKnownWarnings, systemLifecycleAllowsAccess, topLevel, validateEmail };
1531
+ export { APIClientError, API_URL, ActionInvocationSchema, ActionSchema, ActionsDomainSchema, DEBOUNCE_FILTER, DEBOUNCE_SLIDER, DEFAULT_ONTOLOGY_SCOPE, DEFAULT_ORGANIZATION_MODEL_ACTIONS, DEFAULT_ORGANIZATION_MODEL_SYSTEMS, DescriptionSchema, EntitiesDomainSchema, EntitySchema, GC_TIME_LONG, GC_TIME_MEDIUM, GC_TIME_SHORT, IconNameSchema, JsonValueSchema, LIMIT_ACTIVITY_FEED, LabelSchema, ModelIdSchema, NodeIdStringSchema, OAUTH_FLOW_TIMEOUT, OntologyIdSchema, OntologyScopeSchema, PAGE_SIZE_DEFAULT, PathSchema, STALE_TIME_ADMIN, STALE_TIME_DEFAULT, STALE_TIME_MONITORING, SYSTEM_INTERFACE_PROFILES, SystemEntrySchema, SystemIdSchema, SystemInterfaceRefSchema, SystemLifecycleSchema, SystemPathSchema, SystemsDomainSchema, addReadinessIssue, ancestorsOf, childrenOf, compileOrganizationOntology, computeInterfaceReadiness, defaultPathFor, devOnlyFor, findById, findByPath, formatChartAxisDate, formatDate, formatDateTime, formatErrorMessage, formatInterfaceIdentity, formatOntologyId, formatRelativeTime, formatTimeAgo, getErrorInfo, getErrorTitle, getResourceColor, getResourceIcon, getResourcesForSystem, getSystem, getSystemAncestors, getSystemReadinessServerErrorDetails, isAPIClientError, isSystemLifecycleVisible, listAllSystems, listResolvedOntologyRecords, ontologyGraphNodeId, parentOf, parseOntologyId, registerBuiltInReadinessProfile, registerReadinessInterfaceMarker, requireCatalogReadiness, requireContractReadiness, requireScopedBinding, resolveReadinessRemedy, resolveSystemConfig, resourceBindingIds, restoreConsole, setupBrowserMocks, suppressKnownWarnings, systemLifecycleAllowsAccess, topLevel, validateEmail };
@@ -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-6JN2TLV2.js';
2
- import { showApiErrorNotification } from './chunk-HYQOGRWG.js';
1
+ import { useNotificationAdapter } from './chunk-K55TU6CC.js';
2
+ import { showApiErrorNotification } from './chunk-KXNRTJAE.js';
3
3
  import { OrganizationContext } from './chunk-DD3CCMCZ.js';
4
- import { STALE_TIME_DEFAULT, GC_TIME_MEDIUM, GC_TIME_SHORT, STALE_TIME_MONITORING } from './chunk-R5UGIFYU.js';
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-FZSG6M6W.js';
2
- import { CRM_API_INTERFACE } from './chunk-ZFA56VSR.js';
3
- import { useTableSort, sortData, useCompany, useContact, deriveActions } from './chunk-ZYNVCWDZ.js';
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-6JN2TLV2.js';
9
- import { showApiErrorNotification, showSuccessNotification } from './chunk-HYQOGRWG.js';
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 { computeInterfaceReadiness, getSystem, PAGE_SIZE_DEFAULT, formatTimeAgo } from './chunk-R5UGIFYU.js';
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
- if (!model) {
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
- declared: getSystem(model, CRM_API_INTERFACE.systemPath)?.apiInterface !== void 0,
233
- ready: readiness.ready,
234
- reason: summarizeReadinessIssues(readiness.issues),
235
- issues: readiness.issues
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(SubshellContentContainer, { children: /* @__PURE__ */ jsx(PageContainer, { children: /* @__PURE__ */ jsxs(Stack, { children: [
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__ */ jsx(SubshellContentContainer, { children: /* @__PURE__ */ jsxs(PageContainer, { children: [
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(SubshellContentContainer, { children: /* @__PURE__ */ jsx(PageContainer, { children: /* @__PURE__ */ jsxs(Stack, { children: [
1650
+ return /* @__PURE__ */ jsx(SubshellPageLayout, { children: /* @__PURE__ */ jsxs(Stack, { children: [
1664
1651
  /* @__PURE__ */ jsx(
1665
1652
  PageTitleCaption,
1666
1653
  {
@@ -1671,7 +1658,10 @@ function CrmSettingsPage() {
1671
1658
  {
1672
1659
  label: "Priority Enabled",
1673
1660
  checked: draft.enabled,
1674
- onChange: (event) => setDraft((current) => ({ ...current, enabled: event.currentTarget.checked }))
1661
+ onChange: (event) => {
1662
+ const enabled = event.currentTarget.checked;
1663
+ setDraft((current) => ({ ...current, enabled }));
1664
+ }
1675
1665
  }
1676
1666
  ) : null
1677
1667
  }
@@ -1802,7 +1792,7 @@ function CrmSettingsPage() {
1802
1792
  }) })
1803
1793
  ] })
1804
1794
  ] }) })
1805
- ] }) }) });
1795
+ ] }) });
1806
1796
  }
1807
1797
  function ContactDetailPage({ contactId }) {
1808
1798
  const navigate = useNavigate();
@@ -1820,10 +1810,10 @@ function ContactDetailPage({ contactId }) {
1820
1810
  }
1821
1811
  );
1822
1812
  if (isLoading) {
1823
- return /* @__PURE__ */ jsx(SubshellContentContainer, { children: /* @__PURE__ */ jsxs(PageContainer, { children: [
1813
+ return /* @__PURE__ */ jsxs(SubshellPageLayout, { children: [
1824
1814
  /* @__PURE__ */ jsx(Stack, { children: /* @__PURE__ */ jsx(PageTitleCaption, { title, caption: "Loading contact details...", rightSection: headerActions }) }),
1825
1815
  /* @__PURE__ */ jsx(Paper, { withBorder: true, children: /* @__PURE__ */ jsx(Center, { p: "xl", children: /* @__PURE__ */ jsx(Loader, {}) }) })
1826
- ] }) });
1816
+ ] });
1827
1817
  }
1828
1818
  if (error) {
1829
1819
  return /* @__PURE__ */ jsx(SubshellContentContainer, { children: /* @__PURE__ */ jsxs(PageContainer, { children: [