@elevasis/ui 2.15.0 → 2.17.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 (78) hide show
  1. package/dist/api/index.js +3 -2
  2. package/dist/app/index.js +9 -7
  3. package/dist/auth/index.js +4 -3
  4. package/dist/charts/index.js +11 -10
  5. package/dist/{chunk-C7BX547M.js → chunk-2TDZBYXI.js} +9 -3
  6. package/dist/{chunk-5IBTTMWX.js → chunk-34NQLV2W.js} +2 -2
  7. package/dist/{chunk-FL67C3WY.js → chunk-6IA2OMAE.js} +1 -1
  8. package/dist/{chunk-L4XXM55J.js → chunk-7YQKVWSD.js} +1 -1
  9. package/dist/{chunk-XJ7KC54A.js → chunk-ABUDMATM.js} +7 -8
  10. package/dist/{chunk-TUXTSEAF.js → chunk-DK2HVHCY.js} +1 -1
  11. package/dist/{chunk-GHIPBT5V.js → chunk-E4WQGJNS.js} +1 -1
  12. package/dist/{chunk-5SXYCICG.js → chunk-FNWWVX5N.js} +8 -6
  13. package/dist/{chunk-IOKL7BKE.js → chunk-GCBWGGI6.js} +133 -1
  14. package/dist/chunk-GRGRBWIO.js +383 -0
  15. package/dist/{chunk-SLVC5OJ2.js → chunk-HQ7M6PBW.js} +1 -1
  16. package/dist/chunk-IRW7JMQ4.js +28 -0
  17. package/dist/{chunk-YNPVQDNB.js → chunk-JU6UB4YA.js} +4 -4
  18. package/dist/{chunk-SFW573HS.js → chunk-MDO4UCEJ.js} +4 -4
  19. package/dist/{chunk-STZJ7SY5.js → chunk-MJ6YV2B5.js} +3 -2
  20. package/dist/{chunk-D7HBX5US.js → chunk-MUZIYL5Q.js} +5 -4
  21. package/dist/{chunk-DKQQK3WX.js → chunk-OCCZRPER.js} +1 -1
  22. package/dist/{chunk-FFXHKADZ.js → chunk-OXWQQCDR.js} +13 -32
  23. package/dist/{chunk-ZB5GAV7J.js → chunk-P3TFNFZS.js} +6 -5
  24. package/dist/{chunk-QEPXAWE2.js → chunk-QHSW4WHM.js} +3 -26
  25. package/dist/{chunk-LXHZYSMQ.js → chunk-QSTH6T77.js} +2 -52
  26. package/dist/{chunk-U2RXVZGY.js → chunk-R7GKX4HW.js} +66 -461
  27. package/dist/{chunk-X75JEGHS.js → chunk-S6CYH4RI.js} +7 -6
  28. package/dist/{chunk-MTJ43R2E.js → chunk-SLH2QLKV.js} +1 -1
  29. package/dist/{chunk-32NXXCQU.js → chunk-TP5NMF6K.js} +6 -7
  30. package/dist/{chunk-SQQGLGHW.js → chunk-TTP62HWW.js} +3 -3
  31. package/dist/{chunk-NVOCKXUQ.js → chunk-VDM6DQES.js} +1 -1
  32. package/dist/chunk-ZTWA5H77.js +94 -0
  33. package/dist/components/index.d.ts +2640 -2640
  34. package/dist/components/index.js +38 -35
  35. package/dist/execution/index.js +2 -2
  36. package/dist/features/auth/index.js +5 -4
  37. package/dist/features/crm/index.d.ts +51 -51
  38. package/dist/features/crm/index.js +21 -19
  39. package/dist/features/dashboard/index.js +23 -21
  40. package/dist/features/delivery/index.d.ts +2604 -2604
  41. package/dist/features/delivery/index.js +21 -19
  42. package/dist/features/lead-gen/index.js +29 -26
  43. package/dist/features/monitoring/index.js +26 -24
  44. package/dist/features/monitoring/requests/index.d.ts +26 -26
  45. package/dist/features/monitoring/requests/index.js +21 -19
  46. package/dist/features/operations/index.d.ts +10 -10
  47. package/dist/features/operations/index.js +28 -25
  48. package/dist/features/seo/index.js +1 -1
  49. package/dist/features/settings/index.d.ts +34 -34
  50. package/dist/features/settings/index.js +22 -20
  51. package/dist/hooks/delivery/index.css +589 -0
  52. package/dist/hooks/delivery/index.d.ts +3044 -0
  53. package/dist/hooks/delivery/index.js +4 -0
  54. package/dist/hooks/index.d.ts +3103 -3120
  55. package/dist/hooks/index.js +20 -18
  56. package/dist/hooks/operations/command-view/utils/transformCommandViewData.d.ts +506 -0
  57. package/dist/hooks/operations/command-view/utils/transformCommandViewData.js +1 -0
  58. package/dist/hooks/published.d.ts +3103 -3120
  59. package/dist/hooks/published.js +20 -18
  60. package/dist/index.d.ts +3409 -3361
  61. package/dist/index.js +21 -19
  62. package/dist/initialization/index.js +4 -3
  63. package/dist/layout/index.js +3 -3
  64. package/dist/organization/index.js +4 -3
  65. package/dist/profile/index.js +2 -1
  66. package/dist/provider/ElevasisServiceContext.d.ts +54 -0
  67. package/dist/provider/ElevasisServiceContext.js +1 -0
  68. package/dist/provider/index.d.ts +244 -240
  69. package/dist/provider/index.js +17 -16
  70. package/dist/provider/published.d.ts +244 -240
  71. package/dist/provider/published.js +15 -14
  72. package/dist/types/index.d.ts +2349 -2332
  73. package/dist/utils/index.d.ts +73 -1
  74. package/dist/utils/index.js +2 -1
  75. package/dist/zustand/index.d.ts +7 -7
  76. package/package.json +3 -3
  77. package/dist/{chunk-4BF74JVD.js → chunk-6GUW5GGF.js} +1 -1
  78. package/dist/{chunk-ELJIFLCB.js → chunk-KRWALB24.js} +6 -6
@@ -1,4 +1,4 @@
1
- import { useElevasisServices } from './chunk-QEPXAWE2.js';
1
+ import { useElevasisServices } from './chunk-IRW7JMQ4.js';
2
2
  import { useQuery } from '@tanstack/react-query';
3
3
 
4
4
  // src/hooks/observability/queryKeys.ts
@@ -47,54 +47,4 @@ function useErrorTrends({ startDate, endDate, granularity }) {
47
47
  });
48
48
  }
49
49
 
50
- // ../core/src/operations/observability/utils.ts
51
- function getTimeRangeDates(range) {
52
- const end = /* @__PURE__ */ new Date();
53
- const start = /* @__PURE__ */ new Date();
54
- switch (range) {
55
- case "1h":
56
- start.setHours(start.getHours() - 1);
57
- break;
58
- case "24h":
59
- start.setHours(start.getHours() - 24);
60
- break;
61
- case "7d":
62
- start.setDate(start.getDate() - 7);
63
- break;
64
- case "30d":
65
- start.setDate(start.getDate() - 30);
66
- break;
67
- }
68
- return {
69
- startDate: start.toISOString(),
70
- endDate: end.toISOString()
71
- };
72
- }
73
- function getTimeRangeLabel(range) {
74
- switch (range) {
75
- case "1h":
76
- return "Last 1 hour";
77
- case "24h":
78
- return "Last 24 hours";
79
- case "7d":
80
- return "Last 7 days";
81
- case "30d":
82
- return "Last 30 days";
83
- }
84
- }
85
- function formatBucketTime(timestamp, granularity) {
86
- const date = new Date(timestamp);
87
- if (granularity === "hour") {
88
- return date.toLocaleTimeString("en-US", {
89
- hour: "2-digit",
90
- minute: "2-digit",
91
- hour12: false
92
- });
93
- }
94
- return date.toLocaleDateString("en-US", {
95
- month: "short",
96
- day: "numeric"
97
- });
98
- }
99
-
100
- export { formatBucketTime, getTimeRangeDates, getTimeRangeLabel, observabilityKeys, useErrorTrends };
50
+ export { observabilityKeys, useErrorTrends };
@@ -1,12 +1,14 @@
1
- import { getTimeRangeDates, observabilityKeys } from './chunk-LXHZYSMQ.js';
2
1
  import { useSupabase } from './chunk-BRXELOHC.js';
2
+ import { observabilityKeys } from './chunk-QSTH6T77.js';
3
+ import { showApiErrorNotification, showSuccessNotification, projectKeys, noteKeys, taskKeys, milestoneKeys } from './chunk-GRGRBWIO.js';
3
4
  import { GRAPH_CONSTANTS } from './chunk-22UVE3RA.js';
4
- import { useNotificationAdapter } from './chunk-ZB5GAV7J.js';
5
- import { HTTP_HEADERS } from './chunk-NVOCKXUQ.js';
6
- import { REFETCH_INTERVAL_DASHBOARD, STALE_TIME_MONITORING, REFETCH_INTERVAL_RUNNING, WS_MAX_RETRIES_BEFORE_ERROR, WS_RECONNECT_BASE_DELAY, WS_RECONNECT_MAX_DELAY, STALE_TIME_DEFAULT, STALE_TIME_ADMIN, getErrorInfo, formatErrorMessage, getErrorTitle, APIClientError, GC_TIME_MEDIUM, GC_TIME_SHORT } from './chunk-IOKL7BKE.js';
7
- import { useStableAccessToken } from './chunk-MTJ43R2E.js';
5
+ import { useOptionalElevasisFeatures } from './chunk-2TDZBYXI.js';
6
+ import { useNotificationAdapter } from './chunk-P3TFNFZS.js';
7
+ import { HTTP_HEADERS } from './chunk-VDM6DQES.js';
8
+ import { UuidSchema, ResourceTypeSchema, NonEmptyStringSchema, OriginResourceTypeSchema, CredentialNameSchema, REFETCH_INTERVAL_DASHBOARD, getTimeRangeDates, STALE_TIME_MONITORING, REFETCH_INTERVAL_RUNNING, WS_MAX_RETRIES_BEFORE_ERROR, WS_RECONNECT_BASE_DELAY, WS_RECONNECT_MAX_DELAY, STALE_TIME_DEFAULT, STALE_TIME_ADMIN, APIClientError, GC_TIME_MEDIUM, GC_TIME_SHORT } from './chunk-GCBWGGI6.js';
9
+ import { useStableAccessToken } from './chunk-SLH2QLKV.js';
8
10
  import { useOrganization } from './chunk-DD3CCMCZ.js';
9
- import { useElevasisServices } from './chunk-QEPXAWE2.js';
11
+ import { useElevasisServices } from './chunk-IRW7JMQ4.js';
10
12
  import { useAuthContext } from './chunk-BRJ3QZ4E.js';
11
13
  import { useQuery, useQueryClient, useMutation, useQueries } from '@tanstack/react-query';
12
14
  import { z } from 'zod';
@@ -164,31 +166,6 @@ function useBulkDeleteExecutions() {
164
166
  }
165
167
  });
166
168
  }
167
- var UuidSchema = z.string().uuid();
168
- var NonEmptyStringSchema = z.string().trim().min(1).max(1e3);
169
- var ResourceTypeSchema = z.enum(["agent", "workflow"]);
170
- var OriginResourceTypeSchema = z.enum(["agent", "workflow", "scheduler", "api"]);
171
- var CredentialNameSchema = z.string().trim().toLowerCase().min(1, "Credential name required").max(100, "Credential name too long (max 100 chars)").regex(
172
- /^[a-z0-9]+(-[a-z0-9]+)+$/,
173
- "Credential name must be lowercase letters, numbers, and hyphens in format: service-environment (e.g., gmail-prod, attio-dev)"
174
- );
175
- z.enum(["google-sheets", "dropbox"]);
176
- z.string().min(10, "Authorization code too short").max(1e3, "Authorization code too long");
177
- z.string().min(10, "State parameter too short").max(2048, "State parameter too long");
178
- z.string().trim().transform((str) => str.replace(/[<>'"]/g, ""));
179
- z.string().email();
180
- z.string().url();
181
- z.object({
182
- limit: z.coerce.number().int().min(1).max(100).default(20),
183
- offset: z.coerce.number().int().min(0).default(0)
184
- });
185
- z.string().datetime();
186
- z.object({
187
- startDate: z.string().datetime(),
188
- endDate: z.string().datetime()
189
- });
190
-
191
- // ../core/src/operations/sessions/api-schemas.ts
192
169
  var SessionIdParamSchema = z.object({
193
170
  sessionId: UuidSchema
194
171
  }).strict();
@@ -2778,55 +2755,6 @@ function useResourceExecutions({ resourceId, timeRange, enabled = true }) {
2778
2755
  staleTime: STALE_TIME_MONITORING
2779
2756
  });
2780
2757
  }
2781
- var showInfoNotification = (message) => {
2782
- notifications.show({
2783
- title: "Info",
2784
- message,
2785
- autoClose: 5e3,
2786
- color: "blue",
2787
- position: "top-right"
2788
- });
2789
- };
2790
- var showSuccessNotification = (message) => {
2791
- notifications.show({
2792
- title: "Action Successful",
2793
- message,
2794
- autoClose: 5e3,
2795
- color: "green",
2796
- position: "top-right"
2797
- });
2798
- };
2799
- var showErrorNotification = (error) => {
2800
- if (error instanceof Error) {
2801
- error = error.message;
2802
- }
2803
- notifications.show({
2804
- title: "Action Failed",
2805
- message: error,
2806
- autoClose: 5e3,
2807
- color: "red",
2808
- position: "top-right"
2809
- });
2810
- };
2811
- var showWarningNotification = (message) => {
2812
- notifications.show({
2813
- title: "Warning",
2814
- message,
2815
- autoClose: 5e3,
2816
- color: "orange",
2817
- position: "top-right"
2818
- });
2819
- };
2820
- var showApiErrorNotification = (error) => {
2821
- const { message, code, requestId, fields, retryAfter } = getErrorInfo(error);
2822
- notifications.show({
2823
- title: getErrorTitle(code),
2824
- message: formatErrorMessage(message, requestId, fields, retryAfter),
2825
- autoClose: retryAfter ? retryAfter * 1e3 : 5e3,
2826
- color: "red",
2827
- position: "top-right"
2828
- });
2829
- };
2830
2758
 
2831
2759
  // src/hooks/settings/api-keys/apiKeyService.ts
2832
2760
  var ApiKeyService = class {
@@ -3672,126 +3600,6 @@ function useDeleteContacts() {
3672
3600
  }
3673
3601
  });
3674
3602
  }
3675
- var projectKeys = {
3676
- all: ["projects"],
3677
- lists: () => [...projectKeys.all, "list"],
3678
- list: (orgId, filters) => [...projectKeys.all, "list", orgId, filters],
3679
- details: () => [...projectKeys.all, "detail"],
3680
- detail: (id) => [...projectKeys.all, "detail", id],
3681
- milestones: (id) => [...projectKeys.all, id, "milestones"],
3682
- tasks: (id) => [...projectKeys.all, id, "tasks"]
3683
- };
3684
- function useProjects(filters = {}) {
3685
- const { apiRequest, isReady, organizationId } = useElevasisServices();
3686
- return useQuery({
3687
- queryKey: projectKeys.list(organizationId, filters),
3688
- queryFn: async () => {
3689
- const params = new URLSearchParams();
3690
- if (filters.kind) params.set("kind", filters.kind);
3691
- const qs = params.toString();
3692
- const path = qs ? `/projects?${qs}` : "/projects";
3693
- const res = await apiRequest(path);
3694
- return res.projects;
3695
- },
3696
- enabled: isReady
3697
- });
3698
- }
3699
- function useProject(id) {
3700
- const { apiRequest, isReady, organizationId } = useElevasisServices();
3701
- return useQuery({
3702
- queryKey: [...projectKeys.detail(id), organizationId],
3703
- queryFn: async () => {
3704
- try {
3705
- const res = await apiRequest(`/projects/${id}`);
3706
- return res.project;
3707
- } catch (err) {
3708
- if (err && typeof err === "object" && "statusCode" in err && err.statusCode === 404) {
3709
- return null;
3710
- }
3711
- throw err;
3712
- }
3713
- },
3714
- enabled: isReady && !!id
3715
- });
3716
- }
3717
- function useProjectMilestones(projectId) {
3718
- const { apiRequest, isReady } = useElevasisServices();
3719
- return useQuery({
3720
- queryKey: projectKeys.milestones(projectId),
3721
- queryFn: async () => {
3722
- const res = await apiRequest(`/projects/${projectId}/milestones`);
3723
- return res.milestones;
3724
- },
3725
- enabled: isReady && !!projectId
3726
- });
3727
- }
3728
- function useProjectTasks(projectId) {
3729
- const { apiRequest, isReady } = useElevasisServices();
3730
- return useQuery({
3731
- queryKey: projectKeys.tasks(projectId),
3732
- queryFn: async () => {
3733
- const res = await apiRequest(`/projects/${projectId}/tasks`);
3734
- return res.tasks;
3735
- },
3736
- enabled: isReady && !!projectId
3737
- });
3738
- }
3739
- function useCreateProject() {
3740
- const { apiRequest } = useElevasisServices();
3741
- const queryClient = useQueryClient();
3742
- return useMutation({
3743
- mutationFn: async (params) => {
3744
- const res = await apiRequest("/projects", {
3745
- method: "POST",
3746
- body: JSON.stringify(params)
3747
- });
3748
- return res.project;
3749
- },
3750
- onSuccess: () => {
3751
- queryClient.invalidateQueries({ queryKey: projectKeys.all });
3752
- },
3753
- onError: (error) => {
3754
- showApiErrorNotification(error);
3755
- }
3756
- });
3757
- }
3758
- function useUpdateProject() {
3759
- const { apiRequest } = useElevasisServices();
3760
- const queryClient = useQueryClient();
3761
- return useMutation({
3762
- mutationFn: async (params) => {
3763
- const res = await apiRequest(`/projects/${params.id}`, {
3764
- method: "PATCH",
3765
- body: JSON.stringify(params.updates)
3766
- });
3767
- return res.project;
3768
- },
3769
- onSuccess: (data) => {
3770
- queryClient.invalidateQueries({ queryKey: projectKeys.all });
3771
- queryClient.invalidateQueries({ queryKey: projectKeys.detail(data.id) });
3772
- },
3773
- onError: (error) => {
3774
- showApiErrorNotification(error);
3775
- }
3776
- });
3777
- }
3778
- function useDeleteProject() {
3779
- const { apiRequest } = useElevasisServices();
3780
- const queryClient = useQueryClient();
3781
- return useMutation({
3782
- mutationFn: async (id) => {
3783
- await apiRequest(`/projects/${id}`, {
3784
- method: "DELETE"
3785
- });
3786
- },
3787
- onSuccess: () => {
3788
- queryClient.invalidateQueries({ queryKey: projectKeys.all });
3789
- },
3790
- onError: (error) => {
3791
- showApiErrorNotification(error);
3792
- }
3793
- });
3794
- }
3795
3603
 
3796
3604
  // src/hooks/settings/webhooks/webhookEndpointService.ts
3797
3605
  var WebhookEndpointService = class {
@@ -4426,273 +4234,70 @@ function useOrganizationMembers(organizationId, params) {
4426
4234
  refetchOnWindowFocus: false
4427
4235
  });
4428
4236
  }
4429
- var noteKeys = {
4430
- all: ["project-notes"],
4431
- lists: () => [...noteKeys.all, "list"],
4432
- list: (orgId, filters) => [...noteKeys.all, "list", orgId, filters],
4433
- details: () => [...noteKeys.all, "detail"],
4434
- detail: (id) => [...noteKeys.all, "detail", id]
4237
+ var noopSSEManager = {
4238
+ subscribe: () => () => {
4239
+ },
4240
+ closeConnection: () => {
4241
+ },
4242
+ getConnectionInfo: () => /* @__PURE__ */ new Map()
4435
4243
  };
4436
- function useProjectNotes(filters = {}) {
4437
- const { apiRequest, isReady, organizationId } = useElevasisServices();
4438
- return useQuery({
4439
- queryKey: noteKeys.list(organizationId, filters),
4440
- queryFn: async () => {
4441
- const res = await apiRequest(`/projects/${filters.projectId}/notes`);
4442
- return res.notes;
4443
- },
4444
- enabled: isReady && !!filters.projectId
4445
- });
4446
- }
4447
- function useCreateNote() {
4448
- const { apiRequest } = useElevasisServices();
4449
- const queryClient = useQueryClient();
4450
- return useMutation({
4451
- mutationFn: async (params) => {
4452
- const res = await apiRequest("/project-notes", {
4453
- method: "POST",
4454
- body: JSON.stringify(params)
4455
- });
4456
- return res.note;
4457
- },
4458
- onSuccess: (data) => {
4459
- queryClient.invalidateQueries({ queryKey: noteKeys.all });
4460
- queryClient.invalidateQueries({ queryKey: projectKeys.all });
4461
- queryClient.invalidateQueries({ queryKey: projectKeys.detail(data.project_id) });
4462
- },
4463
- onError: (error) => {
4464
- showApiErrorNotification(error);
4465
- }
4466
- });
4467
- }
4468
-
4469
- // src/hooks/projects/useProjectRealtime.ts
4470
4244
  function useProjectRealtime(projectId) {
4471
4245
  const queryClient = useQueryClient();
4472
- const supabase = useSupabase();
4473
- useEffect(() => {
4474
- if (!projectId) {
4475
- return;
4246
+ const features = useOptionalElevasisFeatures();
4247
+ const { isReady, organizationId } = useElevasisServices();
4248
+ const { currentMembership } = useOrganization();
4249
+ const deliveryApiUrl = features?.deliveryApiUrl;
4250
+ const deliverySSEManager = features?.deliverySSEManager ?? noopSSEManager;
4251
+ const currentWorkOSOrganizationId = currentMembership?.organization?.workos_org_id;
4252
+ const headers = useMemo(() => {
4253
+ if (!currentWorkOSOrganizationId) {
4254
+ return {};
4476
4255
  }
4477
- const channel = supabase.channel(`project-realtime-${projectId}`).on(
4478
- "postgres_changes",
4479
- {
4480
- event: "*",
4481
- schema: "public",
4482
- table: "prj_projects",
4483
- filter: `id=eq.${projectId}`
4484
- },
4485
- () => {
4486
- queryClient.invalidateQueries({ queryKey: projectKeys.detail(projectId) });
4487
- queryClient.invalidateQueries({ queryKey: projectActivityKeys.list(projectId) });
4488
- }
4489
- ).on(
4490
- "postgres_changes",
4491
- {
4492
- event: "*",
4493
- schema: "public",
4494
- table: "prj_milestones",
4495
- filter: `project_id=eq.${projectId}`
4496
- },
4497
- () => {
4498
- queryClient.invalidateQueries({ queryKey: projectKeys.milestones(projectId) });
4499
- queryClient.invalidateQueries({ queryKey: projectActivityKeys.list(projectId) });
4500
- }
4501
- ).on(
4502
- "postgres_changes",
4503
- {
4504
- event: "*",
4505
- schema: "public",
4506
- table: "prj_tasks",
4507
- filter: `project_id=eq.${projectId}`
4508
- },
4509
- () => {
4510
- queryClient.invalidateQueries({ queryKey: projectKeys.tasks(projectId) });
4511
- queryClient.invalidateQueries({ queryKey: projectActivityKeys.list(projectId) });
4512
- }
4513
- ).on(
4514
- "postgres_changes",
4515
- {
4516
- event: "*",
4517
- schema: "public",
4518
- table: "prj_notes",
4519
- filter: `project_id=eq.${projectId}`
4520
- },
4521
- () => {
4522
- queryClient.invalidateQueries({ queryKey: noteKeys.all });
4523
- queryClient.invalidateQueries({ queryKey: projectActivityKeys.list(projectId) });
4256
+ const nextHeaders = {};
4257
+ nextHeaders[HTTP_HEADERS.WORKOS_ORGANIZATION_ID] = currentWorkOSOrganizationId;
4258
+ return nextHeaders;
4259
+ }, [currentWorkOSOrganizationId]);
4260
+ const handleMessage = useCallback(
4261
+ (rawData) => {
4262
+ try {
4263
+ const event = JSON.parse(rawData);
4264
+ if (event.type !== "entity_changed") {
4265
+ return;
4266
+ }
4267
+ const { entityType, projectId: changedProjectId } = event.data;
4268
+ queryClient.invalidateQueries({ queryKey: projectKeys.all });
4269
+ queryClient.invalidateQueries({ queryKey: projectKeys.detail(changedProjectId) });
4270
+ queryClient.invalidateQueries({ queryKey: projectActivityKeys.list(changedProjectId) });
4271
+ switch (entityType) {
4272
+ case "milestone":
4273
+ queryClient.invalidateQueries({ queryKey: milestoneKeys.all });
4274
+ queryClient.invalidateQueries({ queryKey: projectKeys.milestones(changedProjectId) });
4275
+ break;
4276
+ case "task":
4277
+ queryClient.invalidateQueries({ queryKey: taskKeys.all });
4278
+ queryClient.invalidateQueries({ queryKey: projectKeys.tasks(changedProjectId) });
4279
+ break;
4280
+ case "note":
4281
+ queryClient.invalidateQueries({ queryKey: noteKeys.all });
4282
+ break;
4283
+ case "activity":
4284
+ case "project":
4285
+ break;
4286
+ }
4287
+ } catch {
4524
4288
  }
4525
- ).subscribe();
4526
- return () => {
4527
- void supabase.removeChannel(channel);
4528
- };
4529
- }, [projectId, queryClient, supabase]);
4530
- }
4531
- var milestoneKeys = {
4532
- all: ["project-milestones"],
4533
- lists: () => [...milestoneKeys.all, "list"],
4534
- list: (orgId, filters) => [...milestoneKeys.all, "list", orgId, filters],
4535
- details: () => [...milestoneKeys.all, "detail"],
4536
- detail: (id) => [...milestoneKeys.all, "detail", id]
4537
- };
4538
- function useMilestones(filters = {}) {
4539
- const { apiRequest, isReady, organizationId } = useElevasisServices();
4540
- return useQuery({
4541
- queryKey: milestoneKeys.list(organizationId, filters),
4542
- queryFn: async () => {
4543
- const res = await apiRequest(`/projects/${filters.projectId}/milestones`);
4544
- return res.milestones;
4545
4289
  },
4546
- enabled: isReady && !!filters.projectId
4547
- });
4548
- }
4549
- function useCreateMilestone() {
4550
- const { apiRequest } = useElevasisServices();
4551
- const queryClient = useQueryClient();
4552
- return useMutation({
4553
- mutationFn: async (params) => {
4554
- const { project_id, ...body } = params;
4555
- if (!project_id) throw new Error("project_id is required to create a milestone");
4556
- const res = await apiRequest(`/projects/${project_id}/milestones`, {
4557
- method: "POST",
4558
- body: JSON.stringify(body)
4559
- });
4560
- return res.milestone;
4561
- },
4562
- onSuccess: (data) => {
4563
- queryClient.invalidateQueries({ queryKey: milestoneKeys.all });
4564
- queryClient.invalidateQueries({ queryKey: projectKeys.all });
4565
- queryClient.invalidateQueries({ queryKey: projectKeys.detail(data.project_id) });
4566
- },
4567
- onError: (error) => {
4568
- showApiErrorNotification(error);
4569
- }
4570
- });
4571
- }
4572
- function useUpdateMilestone() {
4573
- const { apiRequest } = useElevasisServices();
4574
- const queryClient = useQueryClient();
4575
- return useMutation({
4576
- mutationFn: async (params) => {
4577
- const res = await apiRequest(`/milestones/${params.id}`, {
4578
- method: "PATCH",
4579
- body: JSON.stringify(params.updates)
4580
- });
4581
- return res.milestone;
4582
- },
4583
- onSuccess: (data) => {
4584
- queryClient.invalidateQueries({ queryKey: milestoneKeys.all });
4585
- queryClient.invalidateQueries({ queryKey: projectKeys.all });
4586
- queryClient.invalidateQueries({ queryKey: projectKeys.detail(data.project_id) });
4587
- },
4588
- onError: (error) => {
4589
- showApiErrorNotification(error);
4590
- }
4591
- });
4592
- }
4593
- function useDeleteMilestone() {
4594
- const { apiRequest } = useElevasisServices();
4595
- const queryClient = useQueryClient();
4596
- return useMutation({
4597
- mutationFn: async (params) => {
4598
- await apiRequest(`/milestones/${params.id}`, {
4599
- method: "DELETE"
4600
- });
4601
- },
4602
- onSuccess: (_, params) => {
4603
- queryClient.invalidateQueries({ queryKey: milestoneKeys.all });
4604
- queryClient.invalidateQueries({ queryKey: projectKeys.all });
4605
- queryClient.invalidateQueries({ queryKey: projectKeys.detail(params.projectId) });
4606
- },
4607
- onError: (error) => {
4608
- showApiErrorNotification(error);
4609
- }
4610
- });
4611
- }
4612
- var taskKeys = {
4613
- all: ["project-tasks"],
4614
- lists: () => [...taskKeys.all, "list"],
4615
- list: (orgId, filters) => [...taskKeys.all, "list", orgId, filters],
4616
- details: () => [...taskKeys.all, "detail"],
4617
- detail: (id) => [...taskKeys.all, "detail", id]
4618
- };
4619
- function useTasks(filters = {}) {
4620
- const { apiRequest, isReady, organizationId } = useElevasisServices();
4621
- return useQuery({
4622
- queryKey: taskKeys.list(organizationId, filters),
4623
- queryFn: async () => {
4624
- const params = new URLSearchParams();
4625
- if (filters.status) params.set("status", filters.status);
4626
- if (filters.milestoneId) params.set("milestone_id", filters.milestoneId);
4627
- const qs = params.toString();
4628
- const base = `/projects/${filters.projectId}/tasks`;
4629
- const path = qs ? `${base}?${qs}` : base;
4630
- const res = await apiRequest(path);
4631
- return res.tasks;
4632
- },
4633
- enabled: isReady && !!filters.projectId
4634
- });
4635
- }
4636
- function useCreateTask() {
4637
- const { apiRequest } = useElevasisServices();
4638
- const queryClient = useQueryClient();
4639
- return useMutation({
4640
- mutationFn: async (params) => {
4641
- const res = await apiRequest("/project-tasks", {
4642
- method: "POST",
4643
- body: JSON.stringify(params)
4644
- });
4645
- return res.task;
4646
- },
4647
- onSuccess: (data) => {
4648
- queryClient.invalidateQueries({ queryKey: taskKeys.all });
4649
- queryClient.invalidateQueries({ queryKey: projectKeys.all });
4650
- queryClient.invalidateQueries({ queryKey: projectKeys.detail(data.project_id) });
4651
- },
4652
- onError: (error) => {
4653
- showApiErrorNotification(error);
4654
- }
4655
- });
4656
- }
4657
- function useUpdateTask() {
4658
- const { apiRequest } = useElevasisServices();
4659
- const queryClient = useQueryClient();
4660
- return useMutation({
4661
- mutationFn: async (params) => {
4662
- const res = await apiRequest(`/project-tasks/${params.id}`, {
4663
- method: "PATCH",
4664
- body: JSON.stringify(params.updates)
4665
- });
4666
- return res.task;
4667
- },
4668
- onSuccess: (data) => {
4669
- queryClient.invalidateQueries({ queryKey: taskKeys.all });
4670
- queryClient.invalidateQueries({ queryKey: projectKeys.all });
4671
- queryClient.invalidateQueries({ queryKey: projectKeys.detail(data.project_id) });
4672
- },
4673
- onError: (error) => {
4674
- showApiErrorNotification(error);
4675
- }
4676
- });
4677
- }
4678
- function useDeleteTask2() {
4679
- const { apiRequest } = useElevasisServices();
4680
- const queryClient = useQueryClient();
4681
- return useMutation({
4682
- mutationFn: async (params) => {
4683
- await apiRequest(`/project-tasks/${params.id}`, {
4684
- method: "DELETE"
4685
- });
4686
- },
4687
- onSuccess: (_, params) => {
4688
- queryClient.invalidateQueries({ queryKey: taskKeys.all });
4689
- queryClient.invalidateQueries({ queryKey: projectKeys.all });
4690
- queryClient.invalidateQueries({ queryKey: projectKeys.detail(params.projectId) });
4691
- },
4692
- onError: (error) => {
4693
- showApiErrorNotification(error);
4694
- }
4290
+ [queryClient]
4291
+ );
4292
+ useSSEConnection({
4293
+ manager: deliverySSEManager,
4294
+ connectionKey: `delivery-${currentWorkOSOrganizationId ?? organizationId ?? projectId ?? "unknown"}`,
4295
+ url: deliveryApiUrl ? `${deliveryApiUrl}/api/projects/sse` : "",
4296
+ enabled: Boolean(deliveryApiUrl && features?.deliverySSEManager && currentWorkOSOrganizationId && isReady),
4297
+ headers,
4298
+ onmessage: handleMessage,
4299
+ onopen: (response) => response.status === 403 ? "Organization access denied" : void 0
4695
4300
  });
4696
4301
  }
4697
4302
 
4698
- export { ApiKeyService, CredentialSchemas, CredentialService, DeploymentService, MEMBERSHIP_STATUS_COLORS, OperationsService, OrganizationMembershipService, WebhookEndpointService, acquisitionListKeys, companyKeys, contactKeys, dealKeys, dealNoteKeys, dealTaskKeys, executionsKeys, filterByDomainFilters, isSessionCapable, milestoneKeys, noteKeys, operationsKeys, projectActivityKeys, projectKeys, requestsKeys, scheduleKeys, sessionsKeys, showApiErrorNotification, showErrorNotification, showInfoNotification, showSuccessNotification, showWarningNotification, sortData, taskKeys, transformMembershipToTableRow, useActivateDeployment, useActivities, useActivitiesRealtime, useActivityFilters, useActivityTrend, useArchiveSession, useArchivedLogs, useBatchDelete, useBatchTelemetry, useBatchedResourcesHealth, useBulkDeleteExecutions, useBusinessImpact, useCancelExecution, useCancelSchedule, useCheckpointTasks, useCommandQueue, useCommandQueueTotals, useCommandViewData, useCommandViewDomainFilters, useCommandViewLayout, useCommandViewStats, useCommandViewStore, useCompanies, useCompany, useCompleteDealTask, useContact, useContacts, useCostBreakdown, useCostByModel, useCostSummary, useCostTrends, useCreateApiKey, useCreateCompany, useCreateContact, useCreateCredential, useCreateDealNote, useCreateDealTask, useCreateList, useCreateMilestone, useCreateNote, useCreateProject, useCreateSchedule, useCreateSession, useCreateTask, useCreateWebhookEndpoint, useCredentials, useDashboardMetrics, useDeactivateDeployment, useDeactivateMembership, useDealDetail, useDealNotes, useDealTasks, useDealTasksDue, useDeals, useDeleteApiKey, useDeleteCompanies, useDeleteContacts, useDeleteCredential, useDeleteDeal, useDeleteDeployment, useDeleteExecution, useDeleteList, useDeleteMilestone, useDeleteProject, useDeleteSchedule, useDeleteSession, useDeleteTask, useDeleteTask2, useDeleteWebhookEndpoint, useErrorAnalysis, useErrorDetail, useErrorDetails, useErrorDistribution, useErrorNotification, useExecuteAsync, useExecuteResource, useExecution, useExecutionHealth, useExecutionLogSSE, useExecutionLogs, useExecutionLogsFilters, useExecutionPanelState, useExecutions, useGetExecutionHistory, useGetSchedule, useGraphStats, useList, useListApiKeys, useListDeployments, useListExecutions, useListProgress, useListSchedules, useListWebhookEndpoints, useLists, useListsTelemetry, useMarkAllAsRead, useMarkAsRead, useMilestones, useNotificationCount, useNotifications, useOrganizationMembers, usePaginationState, usePatchTask, usePauseSchedule, useProject, useProjectActivities, useProjectMilestones, useProjectNotes, useProjectRealtime, useProjectTasks, useProjects, useReactivateMembership, useRecentExecutionsByResource, useRequest, useRequestsList, useResolveAllErrors, useResolveError, useResolveErrorsByExecution, useResourceDefinition, useResourceErrors, useResourceExecutions, useResourceSearch, useResources, useResourcesDomainFilters, useResourcesHealth, useResumeSchedule, useRetryExecution, useSSEConnection, useScheduledTasks, useSession, useSessionExecution, useSessionExecutions, useSessionMessages, useSessionWebSocket, useSessions, useSortedData, useStatusFilter, useSubmitAction, useSuccessNotification, useSyncDealStage, useTableSelection, useTableSort, useTasks, useTestNotification, useTimeRangeDates, useTopFailingResources, useUnresolveError, useUnresolvedErrors, useUpdateAnchor, useUpdateApiKey, useUpdateCompany, useUpdateContact, useUpdateCredential, useUpdateList, useUpdateListConfig, useUpdateMemberConfig, useUpdateMilestone, useUpdateProject, useUpdateRequestStatus, useUpdateSchedule, useUpdateTask, useUpdateWebhookEndpoint, useUserMemberships, useVisibleResources, useWarningNotification };
4303
+ export { ApiKeyService, CredentialSchemas, CredentialService, DeploymentService, MEMBERSHIP_STATUS_COLORS, OperationsService, OrganizationMembershipService, WebhookEndpointService, acquisitionListKeys, companyKeys, contactKeys, dealKeys, dealNoteKeys, dealTaskKeys, executionsKeys, filterByDomainFilters, isSessionCapable, operationsKeys, projectActivityKeys, requestsKeys, scheduleKeys, sessionsKeys, sortData, transformMembershipToTableRow, useActivateDeployment, useActivities, useActivitiesRealtime, useActivityFilters, useActivityTrend, useArchiveSession, useArchivedLogs, useBatchDelete, useBatchTelemetry, useBatchedResourcesHealth, useBulkDeleteExecutions, useBusinessImpact, useCancelExecution, useCancelSchedule, useCheckpointTasks, useCommandQueue, useCommandQueueTotals, useCommandViewData, useCommandViewDomainFilters, useCommandViewLayout, useCommandViewStats, useCommandViewStore, useCompanies, useCompany, useCompleteDealTask, useContact, useContacts, useCostBreakdown, useCostByModel, useCostSummary, useCostTrends, useCreateApiKey, useCreateCompany, useCreateContact, useCreateCredential, useCreateDealNote, useCreateDealTask, useCreateList, useCreateSchedule, useCreateSession, useCreateWebhookEndpoint, useCredentials, useDashboardMetrics, useDeactivateDeployment, useDeactivateMembership, useDealDetail, useDealNotes, useDealTasks, useDealTasksDue, useDeals, useDeleteApiKey, useDeleteCompanies, useDeleteContacts, useDeleteCredential, useDeleteDeal, useDeleteDeployment, useDeleteExecution, useDeleteList, useDeleteSchedule, useDeleteSession, useDeleteTask, useDeleteWebhookEndpoint, useErrorAnalysis, useErrorDetail, useErrorDetails, useErrorDistribution, useErrorNotification, useExecuteAsync, useExecuteResource, useExecution, useExecutionHealth, useExecutionLogSSE, useExecutionLogs, useExecutionLogsFilters, useExecutionPanelState, useExecutions, useGetExecutionHistory, useGetSchedule, useGraphStats, useList, useListApiKeys, useListDeployments, useListExecutions, useListProgress, useListSchedules, useListWebhookEndpoints, useLists, useListsTelemetry, useMarkAllAsRead, useMarkAsRead, useNotificationCount, useNotifications, useOrganizationMembers, usePaginationState, usePatchTask, usePauseSchedule, useProjectActivities, useProjectRealtime, useReactivateMembership, useRecentExecutionsByResource, useRequest, useRequestsList, useResolveAllErrors, useResolveError, useResolveErrorsByExecution, useResourceDefinition, useResourceErrors, useResourceExecutions, useResourceSearch, useResources, useResourcesDomainFilters, useResourcesHealth, useResumeSchedule, useRetryExecution, useSSEConnection, useScheduledTasks, useSession, useSessionExecution, useSessionExecutions, useSessionMessages, useSessionWebSocket, useSessions, useSortedData, useStatusFilter, useSubmitAction, useSuccessNotification, useSyncDealStage, useTableSelection, useTableSort, useTestNotification, useTimeRangeDates, useTopFailingResources, useUnresolveError, useUnresolvedErrors, useUpdateAnchor, useUpdateApiKey, useUpdateCompany, useUpdateContact, useUpdateCredential, useUpdateList, useUpdateListConfig, useUpdateMemberConfig, useUpdateRequestStatus, useUpdateSchedule, useUpdateWebhookEndpoint, useUserMemberships, useVisibleResources, useWarningNotification };
@@ -1,12 +1,13 @@
1
+ import { AppShellLoader } from './chunk-M25JL54Z.js';
1
2
  import { FilterBar } from './chunk-PDHTXPSF.js';
2
3
  import { CustomModal } from './chunk-GBMNCNHX.js';
3
- import { AppShellLoader } from './chunk-M25JL54Z.js';
4
4
  import { useAvailablePresets } from './chunk-6RWMRQN5.js';
5
- import { useDeleteCredential, useCreateCredential, useCredentials, MEMBERSHIP_STATUS_COLORS, transformMembershipToTableRow, useUserMemberships, useUpdateWebhookEndpoint, useResources, useDeleteWebhookEndpoint, useCreateWebhookEndpoint, useListWebhookEndpoints, useUpdateMemberConfig, useOrganizationMembers, useUpdateCredential, CredentialSchemas, showErrorNotification } from './chunk-U2RXVZGY.js';
6
- import { ListSkeleton, EmptyState, PageTitleCaption, CardHeader, APIErrorAlert, StatCard } from './chunk-SQQGLGHW.js';
7
- import { formatDateTime, OAUTH_POPUP_CHECK_INTERVAL, OAUTH_FLOW_TIMEOUT } from './chunk-IOKL7BKE.js';
8
- import { useInitialization } from './chunk-TUXTSEAF.js';
9
- import { useElevasisServices } from './chunk-QEPXAWE2.js';
5
+ import { useDeleteCredential, useCreateCredential, useCredentials, MEMBERSHIP_STATUS_COLORS, transformMembershipToTableRow, useUserMemberships, useUpdateWebhookEndpoint, useResources, useDeleteWebhookEndpoint, useCreateWebhookEndpoint, useListWebhookEndpoints, useUpdateMemberConfig, useOrganizationMembers, useUpdateCredential, CredentialSchemas } from './chunk-R7GKX4HW.js';
6
+ import { showErrorNotification } from './chunk-GRGRBWIO.js';
7
+ import { ListSkeleton, EmptyState, PageTitleCaption, CardHeader, APIErrorAlert, StatCard } from './chunk-TTP62HWW.js';
8
+ import { formatDateTime, OAUTH_POPUP_CHECK_INTERVAL, OAUTH_FLOW_TIMEOUT } from './chunk-GCBWGGI6.js';
9
+ import { useInitialization } from './chunk-DK2HVHCY.js';
10
+ import { useElevasisServices } from './chunk-IRW7JMQ4.js';
10
11
  import { Table, Group, Text, Tooltip, ActionIcon, Stack, Title, Button, Select, TextInput, Alert, PasswordInput, Anchor, Paper, Card, Switch, Badge, Center, Loader, Box, Code, CopyButton, ThemeIcon, useMantineColorScheme, SimpleGrid, UnstyledButton, Divider, Textarea } from '@mantine/core';
11
12
  import { IconSettings, IconKey, IconCalendar, IconPencil, IconTrash, IconAlertTriangle, IconInfoCircle, IconExclamationMark, IconPlus, IconAlertCircle, IconUsers, IconSearch, IconBuilding, IconWebhook, IconCheck, IconCopy, IconUser, IconMail, IconRefresh, IconPalette, IconSun, IconEye, IconSparkles, IconTrendingUp, IconClock, IconPlayerPause, IconPlayerPlay, IconActivity, IconBrandDropbox, IconBrandGoogleDrive, IconPlug, IconMoon, IconDeviceDesktop } from '@tabler/icons-react';
12
13
  import { z } from 'zod';
@@ -1,4 +1,4 @@
1
- import { useInitialization } from './chunk-TUXTSEAF.js';
1
+ import { useInitialization } from './chunk-DK2HVHCY.js';
2
2
  import { useAuthContext } from './chunk-BRJ3QZ4E.js';
3
3
  import { useRef, useCallback, useEffect } from 'react';
4
4
  import { useQueryClient } from '@tanstack/react-query';