@elevasis/ui 2.23.0 → 2.24.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/app/index.d.ts +2915 -0
- package/dist/app/index.js +5 -4
- package/dist/{chunk-3HEUGBOT.js → chunk-2WZ635SS.js} +2 -2
- package/dist/{chunk-D3KQAABP.js → chunk-4NWNS7TX.js} +1 -1
- package/dist/{chunk-7PGEGSUM.js → chunk-FUEXGRFR.js} +2 -2
- package/dist/{chunk-6IA2OMAE.js → chunk-HC2KV6BU.js} +9 -0
- package/dist/{chunk-YU6MBDVO.js → chunk-KCJ6VATY.js} +4 -68
- package/dist/{chunk-FXWETLEB.js → chunk-KLFIJDTD.js} +1 -1
- package/dist/{chunk-PXGSJNBH.js → chunk-M2HWJY6O.js} +704 -375
- package/dist/{chunk-N6WLOWOD.js → chunk-MTR6AN2C.js} +3 -12
- package/dist/chunk-OWHQ65EQ.js +211 -0
- package/dist/{chunk-XOTJNW4Q.js → chunk-QIW6OCEI.js} +18 -1
- package/dist/{chunk-GUJUK6EH.js → chunk-QULLZ5PE.js} +172 -2
- package/dist/{chunk-QZJM3RYI.js → chunk-SNHGSCKH.js} +1 -1
- package/dist/{chunk-LVUCBY7X.js → chunk-UDJE54WN.js} +85 -3
- package/dist/{chunk-EPV7NU2E.js → chunk-VGNAV3TH.js} +385 -188
- package/dist/{chunk-PTUOINQ2.js → chunk-YBZT7MJR.js} +3 -3
- package/dist/{chunk-SQ5JGELM.js → chunk-ZDKQNQ4X.js} +19 -1
- package/dist/components/index.d.ts +488 -452
- package/dist/components/index.js +58 -22
- package/dist/components/navigation/index.js +2 -2
- package/dist/features/auth/index.d.ts +463 -377
- package/dist/features/crm/index.d.ts +459 -379
- package/dist/features/crm/index.js +8 -8
- package/dist/features/dashboard/index.js +8 -8
- package/dist/features/delivery/index.d.ts +457 -371
- package/dist/features/delivery/index.js +8 -8
- package/dist/features/lead-gen/index.d.ts +213 -65
- package/dist/features/lead-gen/index.js +9 -8
- package/dist/features/monitoring/index.js +9 -9
- package/dist/features/monitoring/requests/index.js +7 -7
- package/dist/features/operations/index.js +11 -10
- package/dist/features/settings/index.d.ts +463 -377
- package/dist/features/settings/index.js +9 -9
- package/dist/hooks/delivery/index.d.ts +457 -371
- package/dist/hooks/index.d.ts +936 -718
- package/dist/hooks/index.js +7 -7
- package/dist/hooks/published.d.ts +936 -718
- package/dist/hooks/published.js +7 -7
- package/dist/index.d.ts +1313 -1027
- package/dist/index.js +8 -8
- package/dist/initialization/index.d.ts +463 -377
- package/dist/organization/index.d.ts +11 -1
- package/dist/organization/index.js +2 -2
- package/dist/profile/index.d.ts +463 -377
- package/dist/provider/index.d.ts +3132 -169
- package/dist/provider/index.js +6 -6
- package/dist/provider/published.d.ts +3098 -168
- package/dist/provider/published.js +3 -3
- package/dist/supabase/index.d.ts +559 -389
- package/dist/test-utils/index.d.ts +21 -1
- package/dist/test-utils/index.js +13 -4
- package/dist/theme/index.js +2 -2
- package/dist/types/index.d.ts +463 -377
- package/package.json +4 -4
- package/src/test-utils/README.md +2 -0
- /package/dist/{chunk-ZBCTB5CA.js → chunk-EIOJNUPL.js} +0 -0
|
@@ -5,7 +5,7 @@ import { SubshellNavItem } from './chunk-CEWTOKE7.js';
|
|
|
5
5
|
import { SubshellSidebarSection } from './chunk-IIMU5YAJ.js';
|
|
6
6
|
import { FilterBar } from './chunk-PDHTXPSF.js';
|
|
7
7
|
import { CustomModal } from './chunk-KVJ3LFH2.js';
|
|
8
|
-
import { useProjectRealtime, useTableSort, sortData, usePaginationState, useTableSelection, useProjectActivities } from './chunk-
|
|
8
|
+
import { useProjectRealtime, useTableSort, sortData, usePaginationState, useTableSelection, useProjectActivities } from './chunk-QULLZ5PE.js';
|
|
9
9
|
import { useCreateTask, useCreateMilestone, useProjectMilestones, useUpdateTask, useProjects, useDeleteProject, useProject, useProjectNotes, useUpdateMilestone, useCreateNote, showApiErrorNotification, projectKeys } from './chunk-Z6FAH4XV.js';
|
|
10
10
|
import { SubshellContentContainer } from './chunk-TKAYX2SP.js';
|
|
11
11
|
import { StatusBadge, EmptyState, PageTitleCaption, CenteredErrorState, StatCard, CardHeader } from './chunk-XUYBOO32.js';
|
|
@@ -1097,10 +1097,9 @@ function renderMilestoneBullet(status) {
|
|
|
1097
1097
|
function getMilestoneSurfaceStyles(status) {
|
|
1098
1098
|
const normalizedStatus = status ?? "upcoming";
|
|
1099
1099
|
const accent = normalizedStatus === "completed" ? "var(--color-primary)" : normalizedStatus === "in_progress" ? "color-mix(in srgb, var(--color-primary) 72%, white)" : "color-mix(in srgb, var(--color-primary) 36%, var(--color-border))";
|
|
1100
|
-
const background = normalizedStatus === "completed" ? "linear-gradient(180deg, color-mix(in srgb, var(--color-primary) 1.5%, transparent) 0%, transparent 100%)" : normalizedStatus === "in_progress" ? "linear-gradient(180deg, color-mix(in srgb, var(--color-primary) 3%, transparent) 0%, transparent 100%)" : "linear-gradient(180deg, color-mix(in srgb, var(--color-primary) 1.5%, transparent) 0%, transparent 100%)";
|
|
1101
1100
|
return {
|
|
1102
1101
|
accent,
|
|
1103
|
-
background
|
|
1102
|
+
background: "transparent"
|
|
1104
1103
|
};
|
|
1105
1104
|
}
|
|
1106
1105
|
function MilestoneChecklist({ milestone }) {
|
|
@@ -1477,15 +1476,7 @@ function ProjectDetailPage({ projectId, onBack, backLabel = "Projects" }) {
|
|
|
1477
1476
|
/* @__PURE__ */ jsxs(Group, { justify: "space-between", align: "flex-start", wrap: "wrap", children: [
|
|
1478
1477
|
/* @__PURE__ */ jsxs(Stack, { gap: 6, style: { flex: 1, minWidth: 260 }, children: [
|
|
1479
1478
|
/* @__PURE__ */ jsxs(Group, { gap: "xs", wrap: "wrap", children: [
|
|
1480
|
-
/* @__PURE__ */ jsx(
|
|
1481
|
-
Text,
|
|
1482
|
-
{
|
|
1483
|
-
fw: 700,
|
|
1484
|
-
size: "lg",
|
|
1485
|
-
c: "var(--color-text)",
|
|
1486
|
-
children: milestone.name
|
|
1487
|
-
}
|
|
1488
|
-
),
|
|
1479
|
+
/* @__PURE__ */ jsx(Text, { fw: 700, size: "lg", c: "var(--color-text)", children: milestone.name }),
|
|
1489
1480
|
/* @__PURE__ */ jsx(
|
|
1490
1481
|
Badge,
|
|
1491
1482
|
{
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
// ../core/src/organization-model/domains/sales.ts
|
|
4
|
+
var ModelIdSchema = z.string().trim().min(1).max(100).regex(/^[a-z0-9]+(?:[-._][a-z0-9]+)*$/, "IDs must be lowercase and use -, _, or . separators");
|
|
5
|
+
var LabelSchema = z.string().trim().min(1).max(120);
|
|
6
|
+
var DescriptionSchema = z.string().trim().min(1).max(2e3);
|
|
7
|
+
var ColorTokenSchema = z.string().trim().min(1).max(50);
|
|
8
|
+
var IconNameSchema = z.string().trim().min(1).max(80);
|
|
9
|
+
var PathSchema = z.string().trim().startsWith("/").max(300);
|
|
10
|
+
var ReferenceIdsSchema = z.array(ModelIdSchema).default([]);
|
|
11
|
+
var DisplayMetadataSchema = z.object({
|
|
12
|
+
label: LabelSchema,
|
|
13
|
+
description: DescriptionSchema.optional(),
|
|
14
|
+
color: ColorTokenSchema.optional(),
|
|
15
|
+
icon: IconNameSchema.optional()
|
|
16
|
+
});
|
|
17
|
+
var TechStackEntrySchema = z.object({
|
|
18
|
+
/** Name of the external platform (e.g. "HubSpot", "Stripe", "Notion"). */
|
|
19
|
+
platform: z.string().trim().min(1).max(200),
|
|
20
|
+
/** Free-form description of what this integration is used for. */
|
|
21
|
+
purpose: z.string().trim().min(1).max(500),
|
|
22
|
+
/**
|
|
23
|
+
* Health of the credential backing this integration.
|
|
24
|
+
* - configured: credential present and valid
|
|
25
|
+
* - pending: not yet set up
|
|
26
|
+
* - expired: credential existed but has lapsed
|
|
27
|
+
* - missing: expected but not present
|
|
28
|
+
*/
|
|
29
|
+
credentialStatus: z.enum(["configured", "pending", "expired", "missing"]),
|
|
30
|
+
/**
|
|
31
|
+
* Whether this integration is the primary system of record for its domain
|
|
32
|
+
* (e.g. HubSpot is SoR for contacts). Defaults to false.
|
|
33
|
+
*/
|
|
34
|
+
isSystemOfRecord: z.boolean().default(false)
|
|
35
|
+
});
|
|
36
|
+
DisplayMetadataSchema.extend({
|
|
37
|
+
id: ModelIdSchema,
|
|
38
|
+
resourceId: z.string().trim().min(1).max(255),
|
|
39
|
+
resourceType: z.enum(["workflow", "agent", "trigger", "integration", "external", "human_checkpoint"]),
|
|
40
|
+
featureIds: ReferenceIdsSchema,
|
|
41
|
+
entityIds: ReferenceIdsSchema,
|
|
42
|
+
surfaceIds: ReferenceIdsSchema,
|
|
43
|
+
capabilityIds: ReferenceIdsSchema,
|
|
44
|
+
/** Optional tech-stack metadata for external-SaaS integrations. */
|
|
45
|
+
techStack: TechStackEntrySchema.optional()
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
// ../core/src/organization-model/domains/sales.ts
|
|
49
|
+
var SalesStageSemanticClassSchema = z.enum(["open", "active", "nurturing", "closed_won", "closed_lost"]);
|
|
50
|
+
var SalesStageSchema = DisplayMetadataSchema.extend({
|
|
51
|
+
id: ModelIdSchema,
|
|
52
|
+
order: z.number().int().min(0),
|
|
53
|
+
semanticClass: SalesStageSemanticClassSchema,
|
|
54
|
+
surfaceIds: ReferenceIdsSchema,
|
|
55
|
+
resourceIds: ReferenceIdsSchema
|
|
56
|
+
});
|
|
57
|
+
var SalesPipelineSchema = z.object({
|
|
58
|
+
id: ModelIdSchema,
|
|
59
|
+
label: z.string().trim().min(1).max(120),
|
|
60
|
+
description: DescriptionSchema.optional(),
|
|
61
|
+
entityId: ModelIdSchema,
|
|
62
|
+
stages: z.array(SalesStageSchema).min(1)
|
|
63
|
+
});
|
|
64
|
+
var OrganizationModelSalesSchema = z.object({
|
|
65
|
+
entityId: ModelIdSchema,
|
|
66
|
+
defaultPipelineId: ModelIdSchema,
|
|
67
|
+
pipelines: z.array(SalesPipelineSchema).min(1)
|
|
68
|
+
});
|
|
69
|
+
function findPipeline(definitions, pipelineKey) {
|
|
70
|
+
return definitions.find((def) => def.pipelineKey === pipelineKey);
|
|
71
|
+
}
|
|
72
|
+
var PENDING_STATE = { stateKey: "pending", label: "Pending" };
|
|
73
|
+
var ACQ_LIST_MEMBERS_LEAD_GEN_PIPELINE = {
|
|
74
|
+
pipelineKey: "lead-gen",
|
|
75
|
+
label: "Lead Generation",
|
|
76
|
+
entityKey: "acq.list-member",
|
|
77
|
+
stages: [
|
|
78
|
+
{
|
|
79
|
+
stageKey: "outreach",
|
|
80
|
+
label: "Outreach",
|
|
81
|
+
states: [
|
|
82
|
+
PENDING_STATE,
|
|
83
|
+
{ stateKey: "personalized", label: "Personalized" },
|
|
84
|
+
{ stateKey: "uploaded", label: "Uploaded" },
|
|
85
|
+
{ stateKey: "interested", label: "Interested" }
|
|
86
|
+
]
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
stageKey: "prospecting",
|
|
90
|
+
label: "Prospecting",
|
|
91
|
+
states: [
|
|
92
|
+
PENDING_STATE,
|
|
93
|
+
{ stateKey: "discovered", label: "Discovered" },
|
|
94
|
+
{ stateKey: "verified", label: "Verified" }
|
|
95
|
+
]
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
stageKey: "qualification",
|
|
99
|
+
label: "Qualification",
|
|
100
|
+
states: [PENDING_STATE]
|
|
101
|
+
}
|
|
102
|
+
]
|
|
103
|
+
};
|
|
104
|
+
var ACQ_LIST_COMPANIES_LEAD_GEN_PIPELINE = {
|
|
105
|
+
pipelineKey: "lead-gen",
|
|
106
|
+
label: "Lead Generation",
|
|
107
|
+
entityKey: "acq.list-company",
|
|
108
|
+
stages: [
|
|
109
|
+
{
|
|
110
|
+
stageKey: "outreach",
|
|
111
|
+
label: "Outreach",
|
|
112
|
+
states: [PENDING_STATE]
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
stageKey: "prospecting",
|
|
116
|
+
label: "Prospecting",
|
|
117
|
+
states: [
|
|
118
|
+
PENDING_STATE,
|
|
119
|
+
{ stateKey: "populated", label: "Populated" },
|
|
120
|
+
{ stateKey: "extracted", label: "Extracted" }
|
|
121
|
+
]
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
stageKey: "qualification",
|
|
125
|
+
label: "Qualification",
|
|
126
|
+
states: [PENDING_STATE, { stateKey: "qualified", label: "Qualified" }]
|
|
127
|
+
}
|
|
128
|
+
]
|
|
129
|
+
};
|
|
130
|
+
var LEAD_GEN_PIPELINE_DEFINITIONS = {
|
|
131
|
+
"acq.list-member": [ACQ_LIST_MEMBERS_LEAD_GEN_PIPELINE],
|
|
132
|
+
"acq.list-company": [ACQ_LIST_COMPANIES_LEAD_GEN_PIPELINE]
|
|
133
|
+
};
|
|
134
|
+
var LEAD_GEN_STAGE_CATALOG = {
|
|
135
|
+
// Prospecting — company population
|
|
136
|
+
scraped: {
|
|
137
|
+
key: "scraped",
|
|
138
|
+
label: "Scraped",
|
|
139
|
+
description: "Company was scraped from a source directory (Apify actor run).",
|
|
140
|
+
order: 1,
|
|
141
|
+
entity: "company"
|
|
142
|
+
},
|
|
143
|
+
populated: {
|
|
144
|
+
key: "populated",
|
|
145
|
+
label: "Populated",
|
|
146
|
+
description: "Company record populated with structured data from scrape results.",
|
|
147
|
+
order: 2,
|
|
148
|
+
entity: "company"
|
|
149
|
+
},
|
|
150
|
+
extracted: {
|
|
151
|
+
key: "extracted",
|
|
152
|
+
label: "Extracted",
|
|
153
|
+
description: "Website content extracted and parsed for company intelligence.",
|
|
154
|
+
order: 3,
|
|
155
|
+
entity: "company"
|
|
156
|
+
},
|
|
157
|
+
enriched: {
|
|
158
|
+
key: "enriched",
|
|
159
|
+
label: "Enriched",
|
|
160
|
+
description: "Company or contact enriched with third-party data (e.g. Tomba, Anymailfinder).",
|
|
161
|
+
order: 4,
|
|
162
|
+
entity: "company"
|
|
163
|
+
},
|
|
164
|
+
// Prospecting — contact discovery
|
|
165
|
+
discovered: {
|
|
166
|
+
key: "discovered",
|
|
167
|
+
label: "Discovered",
|
|
168
|
+
description: "Contact email address discovered via an email-discovery workflow.",
|
|
169
|
+
order: 5,
|
|
170
|
+
entity: "contact"
|
|
171
|
+
},
|
|
172
|
+
verified: {
|
|
173
|
+
key: "verified",
|
|
174
|
+
label: "Verified",
|
|
175
|
+
description: "Contact email address verified as deliverable (email verification workflow).",
|
|
176
|
+
order: 6,
|
|
177
|
+
entity: "contact"
|
|
178
|
+
},
|
|
179
|
+
// Qualification
|
|
180
|
+
qualified: {
|
|
181
|
+
key: "qualified",
|
|
182
|
+
label: "Qualified",
|
|
183
|
+
description: "Company passed the ICP qualification rubric (company-qualification workflow).",
|
|
184
|
+
order: 7,
|
|
185
|
+
entity: "company"
|
|
186
|
+
},
|
|
187
|
+
// Outreach
|
|
188
|
+
personalized: {
|
|
189
|
+
key: "personalized",
|
|
190
|
+
label: "Personalized",
|
|
191
|
+
description: "Outreach message personalized for the contact (Instantly personalization workflow).",
|
|
192
|
+
order: 8,
|
|
193
|
+
entity: "contact"
|
|
194
|
+
},
|
|
195
|
+
uploaded: {
|
|
196
|
+
key: "uploaded",
|
|
197
|
+
label: "Uploaded",
|
|
198
|
+
description: "Contact uploaded to an Instantly campaign for outreach.",
|
|
199
|
+
order: 9,
|
|
200
|
+
entity: "contact"
|
|
201
|
+
},
|
|
202
|
+
interested: {
|
|
203
|
+
key: "interested",
|
|
204
|
+
label: "Interested",
|
|
205
|
+
description: "Contact replied with a positive signal (Instantly reply-handler transition).",
|
|
206
|
+
order: 10,
|
|
207
|
+
entity: "contact"
|
|
208
|
+
}
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
export { ColorTokenSchema, DescriptionSchema, DisplayMetadataSchema, IconNameSchema, LEAD_GEN_PIPELINE_DEFINITIONS, LEAD_GEN_STAGE_CATALOG, LabelSchema, ModelIdSchema, OrganizationModelSalesSchema, PathSchema, ReferenceIdsSchema, findPipeline };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AppBackground, AmbientBloomGrid, CyberBackground, FloatingMotes, WaveBackground } from './chunk-WLOQ4IBG.js';
|
|
2
2
|
import { createElement, Fragment, createContext, useRef, useEffect, useContext } from 'react';
|
|
3
3
|
import { jsxs, Fragment as Fragment$1, jsx } from 'react/jsx-runtime';
|
|
4
|
-
import { Tooltip, Text, Tabs, Table, Stack, SimpleGrid, Select, Combobox, SegmentedControl, ScrollArea, Paper, Popover, Notification, Modal, Menu, Input, HoverCard, Group, Grid, Flex, Code, Divider, Card, Button, Accordion, createTheme } from '@mantine/core';
|
|
4
|
+
import { Tooltip, Text, Tabs, Table, Stack, SimpleGrid, Select, Combobox, SegmentedControl, ScrollArea, Paper, Popover, Notification, Modal, Menu, Input, HoverCard, Group, Grid, Flex, Drawer, Code, Divider, Card, Button, Accordion, createTheme } from '@mantine/core';
|
|
5
5
|
|
|
6
6
|
// src/theme/presets/utils.ts
|
|
7
7
|
function hexToRgb(hex) {
|
|
@@ -2574,6 +2574,23 @@ var componentThemes = {
|
|
|
2574
2574
|
}
|
|
2575
2575
|
}
|
|
2576
2576
|
}),
|
|
2577
|
+
Drawer: Drawer.extend({
|
|
2578
|
+
styles: {
|
|
2579
|
+
header: {
|
|
2580
|
+
backgroundColor: "transparent"
|
|
2581
|
+
},
|
|
2582
|
+
title: {
|
|
2583
|
+
fontFamily: "var(--font-sans, var(--mantine-font-family))",
|
|
2584
|
+
fontSize: "var(--mantine-font-size-xl)",
|
|
2585
|
+
fontWeight: 600,
|
|
2586
|
+
color: "var(--color-text)"
|
|
2587
|
+
},
|
|
2588
|
+
content: {
|
|
2589
|
+
backgroundColor: "var(--color-elevated, var(--color-background))",
|
|
2590
|
+
...glassBase
|
|
2591
|
+
}
|
|
2592
|
+
}
|
|
2593
|
+
}),
|
|
2577
2594
|
Flex: Flex.extend({
|
|
2578
2595
|
defaultProps: {
|
|
2579
2596
|
gap: DEFAULT_SIZE
|
|
@@ -2,7 +2,7 @@ import { useSupabase } from './chunk-BRXELOHC.js';
|
|
|
2
2
|
import { observabilityKeys } from './chunk-QSTH6T77.js';
|
|
3
3
|
import { showApiErrorNotification, showSuccessNotification, projectKeys, noteKeys, taskKeys, milestoneKeys } from './chunk-Z6FAH4XV.js';
|
|
4
4
|
import { GRAPH_CONSTANTS } from './chunk-22UVE3RA.js';
|
|
5
|
-
import { useNotificationAdapter } from './chunk-
|
|
5
|
+
import { useNotificationAdapter, deriveActions } from './chunk-UDJE54WN.js';
|
|
6
6
|
import { useOptionalElevasisFeatures } from './chunk-LJWV4TWV.js';
|
|
7
7
|
import { HTTP_HEADERS } from './chunk-T6INEVX6.js';
|
|
8
8
|
import { ResourceTypeSchema, NonEmptyStringSchema, OriginResourceTypeSchema, UuidSchema, CredentialNameSchema, STALE_TIME_DEFAULT, REFETCH_INTERVAL_DASHBOARD, STALE_TIME_MONITORING, STALE_TIME_ADMIN, getTimeRangeDates, REFETCH_INTERVAL_RUNNING, WS_MAX_RETRIES_BEFORE_ERROR, WS_RECONNECT_BASE_DELAY, WS_RECONNECT_MAX_DELAY, APIClientError, GC_TIME_MEDIUM, GC_TIME_SHORT } from './chunk-SGXXJE52.js';
|
|
@@ -2871,6 +2871,155 @@ function useDeleteContacts() {
|
|
|
2871
2871
|
}
|
|
2872
2872
|
});
|
|
2873
2873
|
}
|
|
2874
|
+
var leadGenArtifactKeys = {
|
|
2875
|
+
all: ["lead-gen-artifacts"],
|
|
2876
|
+
list: (organizationId, ownerKind, ownerId) => [...leadGenArtifactKeys.all, organizationId, ownerKind, ownerId]
|
|
2877
|
+
};
|
|
2878
|
+
function useArtifacts({ ownerKind, ownerId }) {
|
|
2879
|
+
const { apiRequest, isReady, organizationId } = useElevasisServices();
|
|
2880
|
+
return useQuery({
|
|
2881
|
+
queryKey: leadGenArtifactKeys.list(organizationId, ownerKind, ownerId),
|
|
2882
|
+
queryFn: () => apiRequest(
|
|
2883
|
+
`/acquisition/artifacts?ownerKind=${encodeURIComponent(ownerKind)}&ownerId=${encodeURIComponent(ownerId)}`
|
|
2884
|
+
),
|
|
2885
|
+
enabled: isReady && !!ownerId
|
|
2886
|
+
});
|
|
2887
|
+
}
|
|
2888
|
+
function useCreateArtifact() {
|
|
2889
|
+
const { apiRequest, organizationId } = useElevasisServices();
|
|
2890
|
+
const queryClient = useQueryClient();
|
|
2891
|
+
return useMutation({
|
|
2892
|
+
mutationFn: (body) => apiRequest("/acquisition/artifacts", {
|
|
2893
|
+
method: "POST",
|
|
2894
|
+
body: JSON.stringify(body)
|
|
2895
|
+
}),
|
|
2896
|
+
onSuccess: (_, variables) => {
|
|
2897
|
+
queryClient.invalidateQueries({
|
|
2898
|
+
queryKey: leadGenArtifactKeys.list(organizationId, variables.ownerKind, variables.ownerId)
|
|
2899
|
+
});
|
|
2900
|
+
showSuccessNotification("Artifact created");
|
|
2901
|
+
},
|
|
2902
|
+
onError: (error) => {
|
|
2903
|
+
showApiErrorNotification(error);
|
|
2904
|
+
}
|
|
2905
|
+
});
|
|
2906
|
+
}
|
|
2907
|
+
var leadGenListMemberKeys = {
|
|
2908
|
+
all: ["lead-gen-list-members"],
|
|
2909
|
+
list: (organizationId, listId) => [...leadGenListMemberKeys.all, organizationId, "list", listId],
|
|
2910
|
+
detail: (organizationId, memberId) => [...leadGenListMemberKeys.all, organizationId, "detail", memberId]
|
|
2911
|
+
};
|
|
2912
|
+
function useListMembers({ listId }) {
|
|
2913
|
+
const { apiRequest, isReady, organizationId } = useElevasisServices();
|
|
2914
|
+
return useQuery({
|
|
2915
|
+
queryKey: leadGenListMemberKeys.list(organizationId, listId),
|
|
2916
|
+
queryFn: () => apiRequest(`/acquisition/lists/${listId}/members`),
|
|
2917
|
+
enabled: isReady && !!listId
|
|
2918
|
+
});
|
|
2919
|
+
}
|
|
2920
|
+
function useListMember(memberId) {
|
|
2921
|
+
const { apiRequest, isReady, organizationId } = useElevasisServices();
|
|
2922
|
+
return useQuery({
|
|
2923
|
+
queryKey: leadGenListMemberKeys.detail(organizationId, memberId),
|
|
2924
|
+
queryFn: () => apiRequest(`/acquisition/list-members/${memberId}`),
|
|
2925
|
+
enabled: isReady && !!memberId
|
|
2926
|
+
});
|
|
2927
|
+
}
|
|
2928
|
+
function useTransitionListMember() {
|
|
2929
|
+
const { apiRequest, organizationId } = useElevasisServices();
|
|
2930
|
+
const queryClient = useQueryClient();
|
|
2931
|
+
return useMutation({
|
|
2932
|
+
mutationFn: async (input) => {
|
|
2933
|
+
const { memberId, pipelineKey, stageKey, stateKey, reason, expectedUpdatedAt } = input;
|
|
2934
|
+
await apiRequest(`/acquisition/list-members/${memberId}/transition`, {
|
|
2935
|
+
method: "PATCH",
|
|
2936
|
+
body: JSON.stringify({
|
|
2937
|
+
pipelineKey,
|
|
2938
|
+
stageKey,
|
|
2939
|
+
...stateKey !== void 0 ? { stateKey } : {},
|
|
2940
|
+
...reason !== void 0 ? { reason } : {},
|
|
2941
|
+
...expectedUpdatedAt !== void 0 ? { expectedUpdatedAt } : {}
|
|
2942
|
+
})
|
|
2943
|
+
});
|
|
2944
|
+
},
|
|
2945
|
+
onSuccess: (_, variables) => {
|
|
2946
|
+
queryClient.invalidateQueries({ queryKey: leadGenListMemberKeys.detail(organizationId, variables.memberId) });
|
|
2947
|
+
if (variables.listId) {
|
|
2948
|
+
queryClient.invalidateQueries({ queryKey: leadGenListMemberKeys.list(organizationId, variables.listId) });
|
|
2949
|
+
}
|
|
2950
|
+
},
|
|
2951
|
+
onError: (error) => {
|
|
2952
|
+
queryClient.invalidateQueries({ queryKey: leadGenListMemberKeys.all });
|
|
2953
|
+
showApiErrorNotification(error);
|
|
2954
|
+
}
|
|
2955
|
+
});
|
|
2956
|
+
}
|
|
2957
|
+
var leadGenListCompanyKeys = {
|
|
2958
|
+
all: ["lead-gen-list-companies"],
|
|
2959
|
+
detail: (organizationId, listCompanyId) => [...leadGenListCompanyKeys.all, organizationId, "detail", listCompanyId]
|
|
2960
|
+
};
|
|
2961
|
+
function useTransitionListCompany() {
|
|
2962
|
+
const { apiRequest, organizationId } = useElevasisServices();
|
|
2963
|
+
const queryClient = useQueryClient();
|
|
2964
|
+
return useMutation({
|
|
2965
|
+
mutationFn: async (input) => {
|
|
2966
|
+
const { listCompanyId, pipelineKey, stageKey, stateKey, reason, expectedUpdatedAt } = input;
|
|
2967
|
+
await apiRequest(`/acquisition/list-companies/${listCompanyId}/transition`, {
|
|
2968
|
+
method: "PATCH",
|
|
2969
|
+
body: JSON.stringify({
|
|
2970
|
+
pipelineKey,
|
|
2971
|
+
stageKey,
|
|
2972
|
+
...stateKey !== void 0 ? { stateKey } : {},
|
|
2973
|
+
...reason !== void 0 ? { reason } : {},
|
|
2974
|
+
...expectedUpdatedAt !== void 0 ? { expectedUpdatedAt } : {}
|
|
2975
|
+
})
|
|
2976
|
+
});
|
|
2977
|
+
},
|
|
2978
|
+
onSuccess: (_, variables) => {
|
|
2979
|
+
queryClient.invalidateQueries({
|
|
2980
|
+
queryKey: leadGenListCompanyKeys.detail(organizationId, variables.listCompanyId)
|
|
2981
|
+
});
|
|
2982
|
+
if (variables.listId) {
|
|
2983
|
+
queryClient.invalidateQueries({ queryKey: acquisitionListKeys.telemetry(organizationId) });
|
|
2984
|
+
queryClient.invalidateQueries({ queryKey: acquisitionListKeys.detail(organizationId, variables.listId) });
|
|
2985
|
+
}
|
|
2986
|
+
},
|
|
2987
|
+
onError: (error) => {
|
|
2988
|
+
queryClient.invalidateQueries({ queryKey: leadGenListCompanyKeys.all });
|
|
2989
|
+
showApiErrorNotification(error);
|
|
2990
|
+
}
|
|
2991
|
+
});
|
|
2992
|
+
}
|
|
2993
|
+
function useDeriveActions(item) {
|
|
2994
|
+
return useMemo(() => {
|
|
2995
|
+
if (!item) return [];
|
|
2996
|
+
if (item.pipeline_key !== "lead-gen") {
|
|
2997
|
+
return deriveActions(item);
|
|
2998
|
+
}
|
|
2999
|
+
return [];
|
|
3000
|
+
}, [item]);
|
|
3001
|
+
}
|
|
3002
|
+
function useUpdateListStatus() {
|
|
3003
|
+
const { apiRequest, organizationId } = useElevasisServices();
|
|
3004
|
+
const queryClient = useQueryClient();
|
|
3005
|
+
return useMutation({
|
|
3006
|
+
mutationFn: async (input) => {
|
|
3007
|
+
await apiRequest(`/acquisition/lists/${input.listId}/status`, {
|
|
3008
|
+
method: "PATCH",
|
|
3009
|
+
body: JSON.stringify({ status: input.status })
|
|
3010
|
+
});
|
|
3011
|
+
},
|
|
3012
|
+
onSuccess: (_, variables) => {
|
|
3013
|
+
queryClient.invalidateQueries({ queryKey: acquisitionListKeys.list(organizationId) });
|
|
3014
|
+
queryClient.invalidateQueries({ queryKey: acquisitionListKeys.detail(organizationId, variables.listId) });
|
|
3015
|
+
queryClient.invalidateQueries({ queryKey: acquisitionListKeys.telemetry(organizationId) });
|
|
3016
|
+
},
|
|
3017
|
+
onError: (error) => {
|
|
3018
|
+
queryClient.invalidateQueries({ queryKey: acquisitionListKeys.all });
|
|
3019
|
+
showApiErrorNotification(error);
|
|
3020
|
+
}
|
|
3021
|
+
});
|
|
3022
|
+
}
|
|
2874
3023
|
var projectActivityKeys = {
|
|
2875
3024
|
all: ["project-activities"],
|
|
2876
3025
|
list: (projectId) => [...projectActivityKeys.all, "list", projectId]
|
|
@@ -4328,6 +4477,27 @@ function useDealDetail(acqDealId) {
|
|
|
4328
4477
|
enabled: isReady && !!acqDealId
|
|
4329
4478
|
});
|
|
4330
4479
|
}
|
|
4480
|
+
function useExecuteAction({ dealId }) {
|
|
4481
|
+
const { apiRequest, organizationId } = useElevasisServices();
|
|
4482
|
+
const queryClient = useQueryClient();
|
|
4483
|
+
return useMutation({
|
|
4484
|
+
mutationFn: async ({ key, payload }) => {
|
|
4485
|
+
await apiRequest(`/deals/${dealId}/actions/${encodeURIComponent(key)}`, {
|
|
4486
|
+
method: "POST",
|
|
4487
|
+
body: JSON.stringify({ payload })
|
|
4488
|
+
});
|
|
4489
|
+
},
|
|
4490
|
+
onSuccess: () => {
|
|
4491
|
+
queryClient.invalidateQueries({ queryKey: dealKeys.lists() });
|
|
4492
|
+
queryClient.invalidateQueries({ queryKey: dealKeys.summaries() });
|
|
4493
|
+
queryClient.invalidateQueries({ queryKey: ["deal-detail", organizationId, dealId] });
|
|
4494
|
+
},
|
|
4495
|
+
onError: (error) => {
|
|
4496
|
+
queryClient.invalidateQueries({ queryKey: dealKeys.all });
|
|
4497
|
+
showApiErrorNotification(error);
|
|
4498
|
+
}
|
|
4499
|
+
});
|
|
4500
|
+
}
|
|
4331
4501
|
|
|
4332
4502
|
// src/hooks/acquisition/useBatchTelemetry.ts
|
|
4333
4503
|
function useBatchTelemetry() {
|
|
@@ -4884,4 +5054,4 @@ function useProjectRealtime(projectId) {
|
|
|
4884
5054
|
});
|
|
4885
5055
|
}
|
|
4886
5056
|
|
|
4887
|
-
export { ApiKeyService, COMMAND_VIEW_VISUALIZATION_MODES, CredentialSchemas, CredentialService, DeploymentService, MEMBERSHIP_STATUS_COLORS, OperationsService, OrganizationMembershipService, WebhookEndpointService, acquisitionListKeys, collectResourceFilterFacets, companyKeys, contactKeys, dealKeys, dealNoteKeys, dealTaskKeys, executionsKeys, filterByDomainFilters, getCommandViewGraphPositions, getResourceFilterFacetIds, isSessionCapable, labelResourceFilterFacet, operationsKeys, projectActivityKeys, requestsKeys, scheduleKeys, sessionsKeys, sortData, transformMembershipToTableRow, useActivateDeployment, useActivities, useActivitiesRealtime, useActivityFilters, useActivityTrend, useArchiveSession, useArchivedLogs, useAssignRole, useBatchDelete, useBatchTelemetry, useBatchedResourcesHealth, useBulkDeleteExecutions, useBusinessImpact, useCancelExecution, useCancelSchedule, useCheckpointTasks, useCommandQueue, useCommandQueueTotals, useCommandViewData, useCommandViewDomainFilters, useCommandViewLayout, useCommandViewStats, useCommandViewStore, useCompanies, useCompany, useCompanyFacets, useCompleteDealTask, useContact, useContacts, useCostBreakdown, useCostByModel, useCostSummary, useCostTrends, useCreateApiKey, useCreateCompany, useCreateContact, useCreateCredential, useCreateDealNote, useCreateDealTask, useCreateList, useCreateOrgRole, useCreateSchedule, useCreateSession, useCreateWebhookEndpoint, useCredentials, useDashboardMetrics, useDeactivateDeployment, useDeactivateMembership, useDealDetail, useDealNotes, useDealTasks, useDealTasksDue, useDeals, useDealsLookup, useDealsSummary, useDeleteApiKey, useDeleteCompanies, useDeleteContacts, useDeleteCredential, useDeleteDeal, useDeleteDeployment, useDeleteExecution, useDeleteList, useDeleteOrgRole, useDeleteRequest, useDeleteSchedule, useDeleteSession, useDeleteTask, useDeleteWebhookEndpoint, useEffectivePermissions, useErrorAnalysis, useErrorDetail, useErrorDetails, useErrorDistribution, useErrorNotification, useExecuteAsync, useExecuteResource, useExecution, useExecutionHealth, useExecutionLogSSE, useExecutionLogs, useExecutionLogsFilters, useExecutionPanelState, useExecutions, useGetExecutionHistory, useGetSchedule, useGraphStats, useHasPermission, useList, useListApiKeys, useListDeployments, useListExecutions, useListProgress, useListSchedules, useListWebhookEndpoints, useLists, useListsTelemetry, useMarkAllAsRead, useMarkAsRead, useNotificationCount, useNotifications, useOrgRoles, useOrganizationMembers, useOrganizationPermissions, usePaginationState, usePatchTask, usePauseSchedule, usePermissionCatalog, useProjectActivities, useProjectRealtime, useReactivateMembership, useRecentExecutionsByResource, useRequest, useRequestsList, useResolveAllErrors, useResolveError, useResolveErrorsByExecution, useResourceDefinition, useResourceErrors, useResourceExecutions, useResourceSearch, useResources, useResourcesDomainFilters, useResourcesHealth, useResumeSchedule, useRetryExecution, useRevokeRole, useSSEConnection, useScheduledTasks, useSession, useSessionExecution, useSessionExecutions, useSessionMessages, useSessionWebSocket, useSessions, useSortedData, useStatusFilter, useSubmitAction, useSuccessNotification, useTableSelection, useTableSort, useTestNotification, useTimeRangeDates, useTopFailingResources, useTransitionItem, useUnresolveError, useUnresolvedErrors, useUpdateAnchor, useUpdateApiKey, useUpdateCompany, useUpdateContact, useUpdateCredential, useUpdateList, useUpdateListConfig, useUpdateMemberConfig, useUpdateOrgRole, useUpdateRequestStatus, useUpdateSchedule, useUpdateWebhookEndpoint, useUserMemberships, useVisibleResources, useWarningNotification };
|
|
5057
|
+
export { ApiKeyService, COMMAND_VIEW_VISUALIZATION_MODES, CredentialSchemas, CredentialService, DeploymentService, MEMBERSHIP_STATUS_COLORS, OperationsService, OrganizationMembershipService, WebhookEndpointService, acquisitionListKeys, collectResourceFilterFacets, companyKeys, contactKeys, dealKeys, dealNoteKeys, dealTaskKeys, executionsKeys, filterByDomainFilters, getCommandViewGraphPositions, getResourceFilterFacetIds, isSessionCapable, labelResourceFilterFacet, leadGenArtifactKeys, leadGenListCompanyKeys, leadGenListMemberKeys, operationsKeys, projectActivityKeys, requestsKeys, scheduleKeys, sessionsKeys, sortData, transformMembershipToTableRow, useActivateDeployment, useActivities, useActivitiesRealtime, useActivityFilters, useActivityTrend, useArchiveSession, useArchivedLogs, useArtifacts, useAssignRole, useBatchDelete, useBatchTelemetry, useBatchedResourcesHealth, useBulkDeleteExecutions, useBusinessImpact, useCancelExecution, useCancelSchedule, useCheckpointTasks, useCommandQueue, useCommandQueueTotals, useCommandViewData, useCommandViewDomainFilters, useCommandViewLayout, useCommandViewStats, useCommandViewStore, useCompanies, useCompany, useCompanyFacets, useCompleteDealTask, useContact, useContacts, useCostBreakdown, useCostByModel, useCostSummary, useCostTrends, useCreateApiKey, useCreateArtifact, useCreateCompany, useCreateContact, useCreateCredential, useCreateDealNote, useCreateDealTask, useCreateList, useCreateOrgRole, useCreateSchedule, useCreateSession, useCreateWebhookEndpoint, useCredentials, useDashboardMetrics, useDeactivateDeployment, useDeactivateMembership, useDealDetail, useDealNotes, useDealTasks, useDealTasksDue, useDeals, useDealsLookup, useDealsSummary, useDeleteApiKey, useDeleteCompanies, useDeleteContacts, useDeleteCredential, useDeleteDeal, useDeleteDeployment, useDeleteExecution, useDeleteList, useDeleteOrgRole, useDeleteRequest, useDeleteSchedule, useDeleteSession, useDeleteTask, useDeleteWebhookEndpoint, useDeriveActions, useEffectivePermissions, useErrorAnalysis, useErrorDetail, useErrorDetails, useErrorDistribution, useErrorNotification, useExecuteAction, useExecuteAsync, useExecuteResource, useExecution, useExecutionHealth, useExecutionLogSSE, useExecutionLogs, useExecutionLogsFilters, useExecutionPanelState, useExecutions, useGetExecutionHistory, useGetSchedule, useGraphStats, useHasPermission, useList, useListApiKeys, useListDeployments, useListExecutions, useListMember, useListMembers, useListProgress, useListSchedules, useListWebhookEndpoints, useLists, useListsTelemetry, useMarkAllAsRead, useMarkAsRead, useNotificationCount, useNotifications, useOrgRoles, useOrganizationMembers, useOrganizationPermissions, usePaginationState, usePatchTask, usePauseSchedule, usePermissionCatalog, useProjectActivities, useProjectRealtime, useReactivateMembership, useRecentExecutionsByResource, useRequest, useRequestsList, useResolveAllErrors, useResolveError, useResolveErrorsByExecution, useResourceDefinition, useResourceErrors, useResourceExecutions, useResourceSearch, useResources, useResourcesDomainFilters, useResourcesHealth, useResumeSchedule, useRetryExecution, useRevokeRole, useSSEConnection, useScheduledTasks, useSession, useSessionExecution, useSessionExecutions, useSessionMessages, useSessionWebSocket, useSessions, useSortedData, useStatusFilter, useSubmitAction, useSuccessNotification, useTableSelection, useTableSort, useTestNotification, useTimeRangeDates, useTopFailingResources, useTransitionItem, useTransitionListCompany, useTransitionListMember, useUnresolveError, useUnresolvedErrors, useUpdateAnchor, useUpdateApiKey, useUpdateCompany, useUpdateContact, useUpdateCredential, useUpdateList, useUpdateListConfig, useUpdateListStatus, useUpdateMemberConfig, useUpdateOrgRole, useUpdateRequestStatus, useUpdateSchedule, useUpdateWebhookEndpoint, useUserMemberships, useVisibleResources, useWarningNotification };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ApiClientProvider, useApiClient } from './chunk-T6INEVX6.js';
|
|
2
|
-
import { OrganizationProvider } from './chunk-
|
|
2
|
+
import { OrganizationProvider } from './chunk-HC2KV6BU.js';
|
|
3
3
|
import { getErrorInfo, getErrorTitle, formatErrorMessage } from './chunk-SGXXJE52.js';
|
|
4
4
|
import { InitializationProvider } from './chunk-DK2HVHCY.js';
|
|
5
5
|
import { useOrganization } from './chunk-DD3CCMCZ.js';
|
|
@@ -8,6 +8,7 @@ import { ElevasisServiceProvider } from './chunk-IRW7JMQ4.js';
|
|
|
8
8
|
import { useAuthContext } from './chunk-BRJ3QZ4E.js';
|
|
9
9
|
import { createContext, lazy, useContext, Suspense, useRef } from 'react';
|
|
10
10
|
import { jsx } from 'react/jsx-runtime';
|
|
11
|
+
import { z } from 'zod';
|
|
11
12
|
import { QueryClientProvider, QueryClient } from '@tanstack/react-query';
|
|
12
13
|
|
|
13
14
|
var consoleAdapter = {
|
|
@@ -37,6 +38,85 @@ function NotificationProvider({ adapter, children }) {
|
|
|
37
38
|
function useNotificationAdapter() {
|
|
38
39
|
return useContext(NotificationContext);
|
|
39
40
|
}
|
|
41
|
+
var SendReplyActionPayloadSchema = z.object({
|
|
42
|
+
replyBody: z.string().trim().min(1).max(1e4)
|
|
43
|
+
}).strict();
|
|
44
|
+
var DEFAULT_CRM_ACTIONS = [
|
|
45
|
+
{
|
|
46
|
+
key: "move_to_proposal",
|
|
47
|
+
label: "Move to Proposal",
|
|
48
|
+
isAvailableFor: (deal) => deal.stage_key === "interested",
|
|
49
|
+
workflowId: "move_to_proposal-workflow"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
key: "move_to_closing",
|
|
53
|
+
label: "Move to Closing",
|
|
54
|
+
isAvailableFor: (deal) => deal.stage_key === "proposal",
|
|
55
|
+
workflowId: "move_to_closing-workflow"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
key: "move_to_closed_won",
|
|
59
|
+
label: "Close Won",
|
|
60
|
+
isAvailableFor: (deal) => deal.stage_key === "closing",
|
|
61
|
+
workflowId: "move_to_closed_won-workflow"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
key: "move_to_closed_lost",
|
|
65
|
+
label: "Close Lost",
|
|
66
|
+
isAvailableFor: (deal) => deal.stage_key === "interested" || deal.stage_key === "proposal" || deal.stage_key === "closing",
|
|
67
|
+
workflowId: "move_to_closed_lost-workflow"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
key: "move_to_nurturing",
|
|
71
|
+
label: "Move to Nurturing",
|
|
72
|
+
isAvailableFor: (deal) => deal.stage_key === "interested" || deal.stage_key === "proposal" || deal.stage_key === "closing",
|
|
73
|
+
workflowId: "move_to_nurturing-workflow"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
key: "send_reply",
|
|
77
|
+
label: "Send Reply",
|
|
78
|
+
isAvailableFor: (deal) => deal.stage_key === "interested" && (deal.state_key === "discovery_replied" || deal.state_key === "discovery_link_sent" || deal.state_key === "discovery_nudging"),
|
|
79
|
+
workflowId: "crm-send-reply-workflow",
|
|
80
|
+
payloadSchema: SendReplyActionPayloadSchema
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
key: "send_link",
|
|
84
|
+
label: "Send Booking Link",
|
|
85
|
+
isAvailableFor: (deal) => deal.stage_key === "interested" && deal.state_key === "discovery_replied",
|
|
86
|
+
workflowId: "crm-send-booking-link-workflow"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
key: "send_nudge",
|
|
90
|
+
label: "Send Nudge",
|
|
91
|
+
isAvailableFor: (deal) => deal.stage_key === "interested" && (deal.state_key === "discovery_link_sent" || deal.state_key === "discovery_nudging"),
|
|
92
|
+
workflowId: "crm-send-nudge-workflow"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
key: "mark_no_show",
|
|
96
|
+
label: "Mark No-Show",
|
|
97
|
+
isAvailableFor: (deal) => deal.stage_key === "interested" && deal.state_key === "discovery_nudging",
|
|
98
|
+
// Mirrors the auto-timeout precedent in operations/sales/crm/pipeline/timeout-actions.ts:
|
|
99
|
+
// both manual-click and timeout move the deal to closed_lost. The action_taken activity
|
|
100
|
+
// event captures operator intent and distinguishes the manual variant from the timed one.
|
|
101
|
+
workflowId: "mark_no_show-workflow"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
key: "rebook",
|
|
105
|
+
label: "Rebook",
|
|
106
|
+
isAvailableFor: (deal) => deal.stage_key === "interested" && deal.state_key === "discovery_booking_cancelled",
|
|
107
|
+
workflowId: "crm-rebook-workflow"
|
|
108
|
+
}
|
|
109
|
+
];
|
|
110
|
+
function deriveActions(deal, actions = DEFAULT_CRM_ACTIONS) {
|
|
111
|
+
return actions.filter((a) => a.isAvailableFor(deal)).map(({ key, label, payloadSchema }) => ({ key, label, payloadSchema }));
|
|
112
|
+
}
|
|
113
|
+
var CrmActionsContext = createContext(DEFAULT_CRM_ACTIONS);
|
|
114
|
+
function CrmActionsProvider({ actions, children }) {
|
|
115
|
+
return /* @__PURE__ */ jsx(CrmActionsContext.Provider, { value: actions, children });
|
|
116
|
+
}
|
|
117
|
+
function useCrmActions() {
|
|
118
|
+
return useContext(CrmActionsContext);
|
|
119
|
+
}
|
|
40
120
|
var LazyCoreAuthKitInner = lazy(() => import('./CoreAuthKitInner-QC62UHTZ.js').then((m) => ({ default: m.CoreAuthKitInner })));
|
|
41
121
|
var defaultQueryClient = null;
|
|
42
122
|
function getDefaultQueryClient() {
|
|
@@ -70,6 +150,7 @@ function ElevasisCoreProvider({
|
|
|
70
150
|
apiUrl,
|
|
71
151
|
onError,
|
|
72
152
|
notifications,
|
|
153
|
+
crmActions,
|
|
73
154
|
children
|
|
74
155
|
}) {
|
|
75
156
|
if (auth.mode === "apiKey") {
|
|
@@ -78,9 +159,10 @@ function ElevasisCoreProvider({
|
|
|
78
159
|
);
|
|
79
160
|
}
|
|
80
161
|
const resolvedQueryClient = queryClient ?? getDefaultQueryClient();
|
|
162
|
+
const resolvedCrmActions = crmActions ?? DEFAULT_CRM_ACTIONS;
|
|
81
163
|
const content = apiUrl ? /* @__PURE__ */ jsx(ServiceStack, { apiUrl, onError, notifications, children }) : children;
|
|
82
164
|
const AuthInner = /* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(LazyCoreAuthKitInner, { auth, children: content }) });
|
|
83
|
-
return /* @__PURE__ */ jsx(QueryClientProvider, { client: resolvedQueryClient, children: AuthInner });
|
|
165
|
+
return /* @__PURE__ */ jsx(QueryClientProvider, { client: resolvedQueryClient, children: /* @__PURE__ */ jsx(CrmActionsProvider, { actions: resolvedCrmActions, children: AuthInner }) });
|
|
84
166
|
}
|
|
85
167
|
function ServiceStack({
|
|
86
168
|
apiUrl,
|
|
@@ -124,4 +206,4 @@ function OrgServiceBridge({
|
|
|
124
206
|
return /* @__PURE__ */ jsx(ElevasisServiceProvider, { apiRequest, organizationId: currentWorkOSOrganizationId, isReady, children: /* @__PURE__ */ jsx(NotificationProvider, { adapter: notifications, children: /* @__PURE__ */ jsx(InitializationProvider, { children }) }) });
|
|
125
207
|
}
|
|
126
208
|
|
|
127
|
-
export { ElevasisCoreProvider, NotificationProvider, useNotificationAdapter };
|
|
209
|
+
export { CrmActionsProvider, ElevasisCoreProvider, NotificationProvider, deriveActions, useCrmActions, useNotificationAdapter };
|