@elevasis/ui 2.72.0 → 2.74.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/index.js +3 -3
- package/dist/app/index.d.ts +172 -20
- package/dist/app/index.js +9 -10
- package/dist/auth/index.js +5 -6
- package/dist/charts/index.js +5 -6
- package/dist/chunk-2GIJBHZT.js +60 -0
- package/dist/{chunk-2454MK7P.js → chunk-2MRRDF32.js} +115 -8
- package/dist/chunk-3LOKYZJC.js +231 -0
- package/dist/chunk-3QHX4ZKV.js +224 -0
- package/dist/chunk-43LC6XAX.js +69 -0
- package/dist/chunk-4M2BSHVT.js +116 -0
- package/dist/{chunk-SV4M2BUI.js → chunk-4MXNHJTA.js} +111 -46
- package/dist/{chunk-LEQGGX2U.js → chunk-5A6KCFS5.js} +36 -43
- package/dist/{chunk-KIDZXZM5.js → chunk-6JN2TLV2.js} +1480 -4200
- package/dist/{chunk-UZ5JO5TK.js → chunk-7ARBBELS.js} +1 -1
- package/dist/{chunk-DJWIIPKW.js → chunk-7RJ7P6S6.js} +6 -3
- package/dist/chunk-ARAFQBNI.js +515 -0
- package/dist/{chunk-DKVGO6RJ.js → chunk-BA3AZJUR.js} +1 -1
- package/dist/chunk-BRTGCFBH.js +305 -0
- package/dist/{chunk-7ESZKTQG.js → chunk-CQPULKKL.js} +5 -3
- package/dist/chunk-CRA7WQZH.js +49 -0
- package/dist/{chunk-XZIOCB5D.js → chunk-DCQKTDIG.js} +2 -52
- package/dist/{chunk-A3JHFZDP.js → chunk-E6YGA5WH.js} +1 -1
- package/dist/chunk-FA7LMNQO.js +439 -0
- package/dist/chunk-FZSG6M6W.js +45 -0
- package/dist/chunk-GDOR57D7.js +165 -0
- package/dist/{chunk-RRS2QR3W.js → chunk-GO4XJ5D4.js} +1 -1
- package/dist/chunk-GPQQGQGT.js +645 -0
- package/dist/chunk-HYQOGRWG.js +54 -0
- package/dist/{chunk-LCHL5SM2.js → chunk-LN4UW6S4.js} +1 -1
- package/dist/chunk-N6K2Q5BM.js +393 -0
- package/dist/{chunk-Z2W5VNN3.js → chunk-O32UQ26A.js} +3 -2
- package/dist/{chunk-M7WWRZ5Z.js → chunk-QFGNRKIE.js} +1 -78
- package/dist/{chunk-Q3O3WY7Q.js → chunk-R5UGIFYU.js} +74 -18
- package/dist/{chunk-753MKWFV.js → chunk-RFNJ2PTO.js} +1 -1
- package/dist/chunk-VM2OWOXL.js +24 -0
- package/dist/{chunk-ZBXCEWKF.js → chunk-W2QRBQQA.js} +5 -3
- package/dist/chunk-WDBNW44Z.js +49 -0
- package/dist/{chunk-IXBRUIYI.js → chunk-WZU3MCKI.js} +1 -1
- package/dist/chunk-YQQ5GRUR.js +21 -0
- package/dist/{chunk-IMZTRDY2.js → chunk-ZFA56VSR.js} +2 -2
- package/dist/{chunk-AFBFSXP3.js → chunk-ZWI62BQ6.js} +7 -4
- package/dist/chunk-ZYNVCWDZ.js +286 -0
- package/dist/components/index.d.ts +490 -22
- package/dist/components/index.js +335 -35
- package/dist/components/navigation/index.js +6 -7
- package/dist/features/auth/index.d.ts +154 -2
- package/dist/features/auth/index.js +18 -9
- package/dist/features/clients/index.js +7 -7
- package/dist/features/content/index.d.ts +718 -34
- package/dist/features/content/index.js +1345 -51
- package/dist/features/crm/index.d.ts +172 -20
- package/dist/features/crm/index.js +10 -8
- package/dist/features/dashboard/index.d.ts +19 -10
- package/dist/features/dashboard/index.js +9 -8
- package/dist/features/delivery/index.d.ts +134 -0
- package/dist/features/delivery/index.js +23 -7
- package/dist/features/knowledge/index.js +5 -6
- package/dist/features/lead-gen/index.d.ts +47 -35
- package/dist/features/lead-gen/index.js +12 -8
- package/dist/features/monitoring/index.js +11 -9
- package/dist/features/monitoring/requests/index.js +8 -7
- package/dist/features/operations/index.d.ts +38 -20
- package/dist/features/operations/index.js +15 -11
- package/dist/features/public-agent-chat/index.js +3 -1
- package/dist/features/settings/index.d.ts +134 -0
- package/dist/features/settings/index.js +9 -8
- package/dist/hooks/access/index.js +5 -6
- package/dist/hooks/delivery/index.d.ts +134 -0
- package/dist/hooks/delivery/index.js +3 -2
- package/dist/hooks/operations/command-view/utils/transformCommandViewData.d.ts +20 -11
- package/dist/hooks/published.d.ts +1421 -29
- package/dist/hooks/published.js +22 -6
- package/dist/initialization/index.d.ts +134 -0
- package/dist/knowledge/index.d.ts +38 -20
- package/dist/knowledge/index.js +167 -11
- package/dist/{knowledge-search-index-RZLIVWPJ.js → knowledge-search-index-6GQK55IQ.js} +1 -1
- package/dist/layout/index.js +8 -9
- package/dist/profile/index.d.ts +134 -0
- package/dist/provider/index.d.ts +191 -21
- package/dist/provider/index.js +5 -6
- package/dist/provider/published.d.ts +219 -21
- package/dist/provider/published.js +5 -6
- package/dist/test-utils/index.d.ts +16 -5
- package/dist/test-utils/index.js +17 -18
- package/dist/types/index.d.ts +184 -14
- package/dist/utils/index.d.ts +102 -13
- package/dist/utils/index.js +1 -1
- package/package.json +7 -6
- package/dist/chunk-6M6OLGQY.js +0 -36
- package/dist/chunk-MKH2KOAO.js +0 -39
- package/dist/hooks/index.css +0 -659
- package/dist/hooks/index.d.ts +0 -12853
- package/dist/hooks/index.js +0 -27
- package/dist/supabase/index.d.ts +0 -6969
- package/dist/supabase/index.js +0 -3
- package/dist/typeform/index.d.ts +0 -462
- package/dist/typeform/index.js +0 -2051
- package/dist/typeform/schemas.d.ts +0 -67
- package/dist/typeform/schemas.js +0 -2
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { showApiErrorNotification } from './chunk-HYQOGRWG.js';
|
|
2
|
+
import { useElevasisServices } from './chunk-BI5VDO2K.js';
|
|
3
|
+
import { useQuery, useQueryClient, useMutation } from '@tanstack/react-query';
|
|
4
|
+
|
|
5
|
+
// src/hooks/clients/queryKeys.ts
|
|
6
|
+
var clientsKeys = {
|
|
7
|
+
all: ["clients"],
|
|
8
|
+
lists: () => [...clientsKeys.all, "list"],
|
|
9
|
+
list: (organizationId, filters) => [...clientsKeys.lists(), organizationId, filters],
|
|
10
|
+
statuses: () => [...clientsKeys.all, "status"],
|
|
11
|
+
status: (organizationId) => [...clientsKeys.statuses(), organizationId],
|
|
12
|
+
details: () => [...clientsKeys.all, "detail"],
|
|
13
|
+
detail: (organizationId, id) => [...clientsKeys.details(), organizationId, id]
|
|
14
|
+
};
|
|
15
|
+
function useClients(filters = {}) {
|
|
16
|
+
const { apiRequest, isReady, workOSOrganizationId } = useElevasisServices();
|
|
17
|
+
return useQuery({
|
|
18
|
+
queryKey: clientsKeys.list(workOSOrganizationId ?? void 0, filters),
|
|
19
|
+
queryFn: async () => {
|
|
20
|
+
const { status, source, search, limit, offset } = filters;
|
|
21
|
+
const params = new URLSearchParams();
|
|
22
|
+
if (status) params.set("status", status);
|
|
23
|
+
if (source) params.set("source", source);
|
|
24
|
+
if (search) params.set("search", search);
|
|
25
|
+
if (limit !== void 0) params.set("limit", String(limit));
|
|
26
|
+
if (offset !== void 0) params.set("offset", String(offset));
|
|
27
|
+
const query = params.toString();
|
|
28
|
+
return apiRequest(`/clients${query ? "?" + query : ""}`);
|
|
29
|
+
},
|
|
30
|
+
enabled: isReady
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
function useClientStatus() {
|
|
34
|
+
const { apiRequest, isReady, workOSOrganizationId } = useElevasisServices();
|
|
35
|
+
return useQuery({
|
|
36
|
+
queryKey: clientsKeys.status(workOSOrganizationId ?? void 0),
|
|
37
|
+
queryFn: async () => {
|
|
38
|
+
return apiRequest("/clients/status");
|
|
39
|
+
},
|
|
40
|
+
enabled: isReady
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
function useClient(clientId) {
|
|
44
|
+
const { apiRequest, isReady, workOSOrganizationId } = useElevasisServices();
|
|
45
|
+
return useQuery({
|
|
46
|
+
queryKey: clientsKeys.detail(workOSOrganizationId ?? void 0, clientId),
|
|
47
|
+
queryFn: async () => {
|
|
48
|
+
return apiRequest(`/clients/${clientId}`);
|
|
49
|
+
},
|
|
50
|
+
enabled: isReady && !!clientId
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
function useCreateClient() {
|
|
54
|
+
const { apiRequest } = useElevasisServices();
|
|
55
|
+
const queryClient = useQueryClient();
|
|
56
|
+
return useMutation({
|
|
57
|
+
mutationFn: async (data) => {
|
|
58
|
+
return apiRequest("/clients", {
|
|
59
|
+
method: "POST",
|
|
60
|
+
body: JSON.stringify(data)
|
|
61
|
+
});
|
|
62
|
+
},
|
|
63
|
+
onSuccess: () => {
|
|
64
|
+
void queryClient.invalidateQueries({ queryKey: clientsKeys.lists() });
|
|
65
|
+
void queryClient.invalidateQueries({ queryKey: clientsKeys.statuses() });
|
|
66
|
+
},
|
|
67
|
+
onError: (error) => {
|
|
68
|
+
console.error("Failed to create client:", error);
|
|
69
|
+
showApiErrorNotification(error);
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
function useUpdateClient() {
|
|
74
|
+
const { apiRequest, workOSOrganizationId } = useElevasisServices();
|
|
75
|
+
const queryClient = useQueryClient();
|
|
76
|
+
return useMutation({
|
|
77
|
+
mutationFn: async ({ clientId, updates }) => {
|
|
78
|
+
return apiRequest(`/clients/${clientId}`, {
|
|
79
|
+
method: "PATCH",
|
|
80
|
+
body: JSON.stringify(updates)
|
|
81
|
+
});
|
|
82
|
+
},
|
|
83
|
+
onSuccess: (_data, { clientId }) => {
|
|
84
|
+
void queryClient.invalidateQueries({ queryKey: clientsKeys.lists() });
|
|
85
|
+
void queryClient.invalidateQueries({
|
|
86
|
+
queryKey: clientsKeys.detail(workOSOrganizationId ?? void 0, clientId)
|
|
87
|
+
});
|
|
88
|
+
void queryClient.invalidateQueries({ queryKey: clientsKeys.statuses() });
|
|
89
|
+
},
|
|
90
|
+
onError: (error) => {
|
|
91
|
+
console.error("Failed to update client:", error);
|
|
92
|
+
showApiErrorNotification(error);
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
function useDeleteClient() {
|
|
97
|
+
const { apiRequest } = useElevasisServices();
|
|
98
|
+
const queryClient = useQueryClient();
|
|
99
|
+
return useMutation({
|
|
100
|
+
mutationFn: async (clientId) => {
|
|
101
|
+
await apiRequest(`/clients/${clientId}`, {
|
|
102
|
+
method: "DELETE"
|
|
103
|
+
});
|
|
104
|
+
},
|
|
105
|
+
onSuccess: () => {
|
|
106
|
+
void queryClient.invalidateQueries({ queryKey: clientsKeys.lists() });
|
|
107
|
+
void queryClient.invalidateQueries({ queryKey: clientsKeys.statuses() });
|
|
108
|
+
},
|
|
109
|
+
onError: (error) => {
|
|
110
|
+
console.error("Failed to delete client:", error);
|
|
111
|
+
showApiErrorNotification(error);
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export { clientsKeys, useClient, useClientStatus, useClients, useCreateClient, useDeleteClient, useUpdateClient };
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { useAvailablePresets } from './chunk-ZFISGKYW.js';
|
|
2
|
-
import {
|
|
2
|
+
import { MEMBERSHIP_STATUS_COLORS, PROVISIONING_STATE_DISPLAY, transformMembershipToTableRow, useUserMemberships, useUpdateWebhookEndpoint, useDeleteWebhookEndpoint, useCreateWebhookEndpoint, useListWebhookEndpoints, useOrgRoles, useAssignRole, useRevokeRole, useOrganizationMembers, usePermissionCatalog } from './chunk-ARAFQBNI.js';
|
|
3
|
+
import { useDeleteCredential, useCreateCredential, useCredentials, useUpdateCredential, CredentialSchemas } from './chunk-3LOKYZJC.js';
|
|
4
|
+
import { AppShellLoader } from './chunk-E6YGA5WH.js';
|
|
3
5
|
import { FilterBar } from './chunk-PDHTXPSF.js';
|
|
4
|
-
import {
|
|
5
|
-
import { showApiErrorNotification, showErrorNotification, showSuccessNotification } from './chunk-
|
|
6
|
+
import { ListSkeleton, EmptyState, CustomModal, PageTitleCaption, APIErrorAlert, useResources, StatCard, useAccess, AccessKeys, AccessGuard } from './chunk-6JN2TLV2.js';
|
|
7
|
+
import { showApiErrorNotification, showErrorNotification, showSuccessNotification } from './chunk-HYQOGRWG.js';
|
|
6
8
|
import { CardHeader } from './chunk-62GVNH5U.js';
|
|
7
9
|
import { useInitialization } from './chunk-P45GQ3ZW.js';
|
|
8
10
|
import { RoleBadge } from './chunk-UD657ICS.js';
|
|
9
11
|
import { useOrganization } from './chunk-DD3CCMCZ.js';
|
|
10
|
-
import { isAPIClientError, formatDateTime, OAUTH_FLOW_TIMEOUT } from './chunk-
|
|
12
|
+
import { isAPIClientError, formatDateTime, OAUTH_FLOW_TIMEOUT } from './chunk-R5UGIFYU.js';
|
|
11
13
|
import { useElevasisServices } from './chunk-BI5VDO2K.js';
|
|
12
14
|
import { brandSupabaseOrgId } from './chunk-MQZE7SUI.js';
|
|
15
|
+
import { useAuthContext } from './chunk-BRJ3QZ4E.js';
|
|
13
16
|
import { createUseExternalEvents, Text, Table, Group, Tooltip, ActionIcon, Stack, Title, Button, Select, TextInput, Alert, PasswordInput, Anchor, Paper, Badge, Center, Loader, Box, Code, CopyButton, ThemeIcon, SimpleGrid, UnstyledButton, Card, Switch, Divider, Textarea, MultiSelect } from '@mantine/core';
|
|
14
17
|
import { IconShieldOff, IconKey, IconCalendar, IconPencil, IconTrash, IconAlertTriangle, IconInfoCircle, IconExclamationMark, IconPlus, IconAlertCircle, IconUsers, IconSearch, IconBuilding, IconWebhook, IconCheck, IconCopy, IconUser, IconMail, IconPalette, IconEye, IconSparkles, IconTrendingUp, IconClock, IconPlayerPause, IconPlayerPlay, IconActivity, IconShieldLock, IconStar, IconUserCog, IconUsersGroup, IconSettings, IconRefresh, IconBrandDropbox, IconBrandGoogleDrive, IconPlug, IconEdit, IconUserX, IconUserCheck } from '@tabler/icons-react';
|
|
15
18
|
import { randomId } from '@mantine/hooks';
|
|
@@ -91,7 +94,25 @@ var OAUTH_PROVIDERS = {
|
|
|
91
94
|
// Required for refresh token
|
|
92
95
|
},
|
|
93
96
|
tokenExchange: "form-encoded",
|
|
94
|
-
|
|
97
|
+
// files.metadata.read: files/list_folder, files/list_folder/continue, files/get_metadata
|
|
98
|
+
// sharing.write: sharing/create_shared_link_with_settings
|
|
99
|
+
// sharing.read: sharing/list_shared_links, the recovery path when a 409 conflict
|
|
100
|
+
// omits the existing link's metadata. A token without it degrades to the plain
|
|
101
|
+
// conflict error rather than failing differently, so this is not urgent to adopt.
|
|
102
|
+
// files.content.read already covers files/get_temporary_link, files/download, and both thumbnail calls
|
|
103
|
+
//
|
|
104
|
+
// NOTE: adding a scope here does NOT retroactively grant it to already-issued tokens --
|
|
105
|
+
// an org's existing Dropbox credential must be disconnected and reauthorized (via OAuth)
|
|
106
|
+
// before these new scopes take effect. That is a user action; nothing in this repo can
|
|
107
|
+
// migrate a live credential.
|
|
108
|
+
scopes: [
|
|
109
|
+
"files.content.write",
|
|
110
|
+
"files.content.read",
|
|
111
|
+
"files.metadata.write",
|
|
112
|
+
"files.metadata.read",
|
|
113
|
+
"sharing.write",
|
|
114
|
+
"sharing.read"
|
|
115
|
+
]
|
|
95
116
|
}
|
|
96
117
|
};
|
|
97
118
|
var CredentialFieldSchema = z.object({
|
|
@@ -217,6 +238,31 @@ var CREDENTIAL_SCHEMAS = {
|
|
|
217
238
|
],
|
|
218
239
|
docsUrl: "https://developer.clickup.com/docs/authentication",
|
|
219
240
|
nameSuggestions: ["clickup-demo", "clickup-prod", "clickup-dev"]
|
|
241
|
+
},
|
|
242
|
+
instagram: {
|
|
243
|
+
type: "single_field",
|
|
244
|
+
label: "Instagram",
|
|
245
|
+
description: "Long-lived Instagram access token for publishing through Meta\u2019s Content Publishing API.",
|
|
246
|
+
fields: [
|
|
247
|
+
{
|
|
248
|
+
key: "accessToken",
|
|
249
|
+
label: "Access Token",
|
|
250
|
+
type: "password",
|
|
251
|
+
required: true,
|
|
252
|
+
placeholder: "IGAA...",
|
|
253
|
+
description: "Long-lived token from the Meta app dashboard. Valid 60 days from issue or last refresh."
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
key: "igUserId",
|
|
257
|
+
label: "Instagram User ID",
|
|
258
|
+
type: "text",
|
|
259
|
+
required: true,
|
|
260
|
+
placeholder: "17841400000000000",
|
|
261
|
+
description: "The Instagram professional account id shown beside the token on the same Meta screen."
|
|
262
|
+
}
|
|
263
|
+
],
|
|
264
|
+
docsUrl: "https://developers.facebook.com/docs/instagram-platform/instagram-api-with-instagram-login/content-publishing",
|
|
265
|
+
nameSuggestions: ["elevasis-instagram", "instagram-prod", "instagram-dev"]
|
|
220
266
|
}
|
|
221
267
|
};
|
|
222
268
|
function getCredentialSchema(type) {
|
|
@@ -476,20 +522,23 @@ function CreateCredentialModal({ opened, onClose, onSuccess }) {
|
|
|
476
522
|
schema.label,
|
|
477
523
|
" account."
|
|
478
524
|
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
479
|
-
schema.fields?.map((field) =>
|
|
480
|
-
PasswordInput
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
525
|
+
schema.fields?.map((field) => {
|
|
526
|
+
const Input = field.type === "text" ? TextInput : PasswordInput;
|
|
527
|
+
return /* @__PURE__ */ jsx(
|
|
528
|
+
Input,
|
|
529
|
+
{
|
|
530
|
+
label: field.label,
|
|
531
|
+
description: field.description,
|
|
532
|
+
placeholder: field.placeholder,
|
|
533
|
+
required: field.required,
|
|
534
|
+
value: form.values[field.key] || "",
|
|
535
|
+
onChange: (e) => form.setFieldValue(field.key, e.target.value),
|
|
536
|
+
error: form.errors[field.key],
|
|
537
|
+
disabled: createCredential.isPending
|
|
538
|
+
},
|
|
539
|
+
field.key
|
|
540
|
+
);
|
|
541
|
+
}),
|
|
493
542
|
schema.docsUrl && /* @__PURE__ */ jsxs(Text, { size: "sm", c: "dimmed", children: [
|
|
494
543
|
"Get credentials from",
|
|
495
544
|
" ",
|
|
@@ -1800,7 +1849,7 @@ function useOAuthFlow({ apiUrl }) {
|
|
|
1800
1849
|
const [isAuthorizing, setIsAuthorizing] = useState(false);
|
|
1801
1850
|
const [error, setError] = useState(null);
|
|
1802
1851
|
const { isReady } = useElevasisServices();
|
|
1803
|
-
const {
|
|
1852
|
+
const { getAccessToken, organizationId } = useAuthContext();
|
|
1804
1853
|
const authorize = useCallback(
|
|
1805
1854
|
async (provider, credentialName) => {
|
|
1806
1855
|
if (!isReady || !organizationId) {
|
|
@@ -1809,22 +1858,35 @@ function useOAuthFlow({ apiUrl }) {
|
|
|
1809
1858
|
}
|
|
1810
1859
|
setIsAuthorizing(true);
|
|
1811
1860
|
setError(null);
|
|
1861
|
+
const width = 600;
|
|
1862
|
+
const height = 700;
|
|
1863
|
+
const left = Math.round(window.screen.width / 2 - width / 2);
|
|
1864
|
+
const top = Math.round(window.screen.height / 2 - height / 2);
|
|
1865
|
+
const popup = window.open(
|
|
1866
|
+
"about:blank",
|
|
1867
|
+
`oauth-${provider}`,
|
|
1868
|
+
`width=${width},height=${height},left=${left},top=${top}`
|
|
1869
|
+
);
|
|
1870
|
+
if (!popup) {
|
|
1871
|
+
setIsAuthorizing(false);
|
|
1872
|
+
setError("Please enable popups and try again");
|
|
1873
|
+
return;
|
|
1874
|
+
}
|
|
1875
|
+
let token;
|
|
1876
|
+
try {
|
|
1877
|
+
token = await getAccessToken();
|
|
1878
|
+
} catch {
|
|
1879
|
+
popup.close();
|
|
1880
|
+
setIsAuthorizing(false);
|
|
1881
|
+
setError("Authorization failed. Please sign in again.");
|
|
1882
|
+
return;
|
|
1883
|
+
}
|
|
1812
1884
|
try {
|
|
1813
1885
|
const authorizeUrl = new URL(`${apiUrl}/api/oauth/authorize/${provider}`);
|
|
1814
1886
|
authorizeUrl.searchParams.set("credentialName", credentialName);
|
|
1815
|
-
authorizeUrl.searchParams.set("
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
const left = Math.round(window.screen.width / 2 - width / 2);
|
|
1819
|
-
const top = Math.round(window.screen.height / 2 - height / 2);
|
|
1820
|
-
const popup = window.open(
|
|
1821
|
-
authorizeUrl.toString(),
|
|
1822
|
-
`oauth-${provider}`,
|
|
1823
|
-
`width=${width},height=${height},left=${left},top=${top}`
|
|
1824
|
-
);
|
|
1825
|
-
if (!popup) {
|
|
1826
|
-
throw new Error("popup_blocked");
|
|
1827
|
-
}
|
|
1887
|
+
authorizeUrl.searchParams.set("token", token);
|
|
1888
|
+
authorizeUrl.searchParams.set("orgId", organizationId);
|
|
1889
|
+
popup.location.href = authorizeUrl.toString();
|
|
1828
1890
|
await waitForOAuthCallback(popup, Date.now());
|
|
1829
1891
|
} catch (err) {
|
|
1830
1892
|
const rawError = err instanceof Error ? err.message : "unknown";
|
|
@@ -1848,7 +1910,7 @@ function useOAuthFlow({ apiUrl }) {
|
|
|
1848
1910
|
setIsAuthorizing(false);
|
|
1849
1911
|
}
|
|
1850
1912
|
},
|
|
1851
|
-
[isReady, organizationId, apiUrl]
|
|
1913
|
+
[isReady, organizationId, apiUrl, getAccessToken]
|
|
1852
1914
|
);
|
|
1853
1915
|
const waitForOAuthCallback = (popup, startedAt) => {
|
|
1854
1916
|
return new Promise((resolve, reject) => {
|
|
@@ -2056,18 +2118,21 @@ function EditCredentialModal({ apiUrl, credential, onClose }) {
|
|
|
2056
2118
|
] }),
|
|
2057
2119
|
!isOAuth && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2058
2120
|
/* @__PURE__ */ jsx(Text, { size: "sm", c: "dimmed", children: "Current values are encrypted and cannot be displayed. Enter new values below to replace them." }),
|
|
2059
|
-
schema.fields?.map((field) =>
|
|
2060
|
-
PasswordInput
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2121
|
+
schema.fields?.map((field) => {
|
|
2122
|
+
const Input = field.type === "text" ? TextInput : PasswordInput;
|
|
2123
|
+
return /* @__PURE__ */ jsx(
|
|
2124
|
+
Input,
|
|
2125
|
+
{
|
|
2126
|
+
label: `New ${field.label}`,
|
|
2127
|
+
placeholder: field.placeholder || `Enter new ${field.label.toLowerCase()}`,
|
|
2128
|
+
value: fieldValues[field.key] || "",
|
|
2129
|
+
onChange: (e) => handleFieldChange(field.key, e.target.value),
|
|
2130
|
+
description: field.description,
|
|
2131
|
+
disabled: isPending
|
|
2132
|
+
},
|
|
2133
|
+
field.key
|
|
2134
|
+
);
|
|
2135
|
+
}),
|
|
2071
2136
|
updateMutation.error && /* @__PURE__ */ jsx(Alert, { icon: /* @__PURE__ */ jsx(IconAlertCircle, { size: 16 }), color: "red", title: "Update Failed", children: "Failed to update credential" }),
|
|
2072
2137
|
/* @__PURE__ */ jsxs(Group, { justify: "space-between", gap: "sm", children: [
|
|
2073
2138
|
/* @__PURE__ */ jsx(Button, { variant: "light", onClick: handleClose, disabled: isPending, children: "Cancel" }),
|
|
@@ -1,13 +1,18 @@
|
|
|
1
|
-
import { LEAD_GEN_API_INTERFACE } from './chunk-
|
|
1
|
+
import { LEAD_GEN_API_INTERFACE } from './chunk-ZFA56VSR.js';
|
|
2
|
+
import { useListMembers, useListMember, useTransitionListMember, useDeriveActions, useArtifacts } from './chunk-GDOR57D7.js';
|
|
3
|
+
import { useCredentials, useVerifyCredential } from './chunk-3LOKYZJC.js';
|
|
4
|
+
import { useTableSort, sortData, useCompanyFacets, useCompanies, useDeleteCompanies, useContacts, useDeleteContacts } from './chunk-ZYNVCWDZ.js';
|
|
5
|
+
import { getSystemApiInterfaceReadiness } from './chunk-CRA7WQZH.js';
|
|
2
6
|
import { sanitizeInput } from './chunk-3MEXPLWT.js';
|
|
7
|
+
import { useTableSelection } from './chunk-WDBNW44Z.js';
|
|
3
8
|
import { PageContainer } from './chunk-BZZCNLT6.js';
|
|
4
9
|
import { TableSelectionToolbar, SortableHeader } from './chunk-TUMSNGTX.js';
|
|
5
10
|
import { FilterBar } from './chunk-PDHTXPSF.js';
|
|
6
|
-
import { LeadGenSidebarMiddle, SubshellContentContainer, PageTitleCaption, acquisitionListKeys, useOptionalElevasisSystems, getAllBuildTemplates, getLeadGenStageCatalog, useListsTelemetry, useLists, useAccess, AccessKeys, CenteredErrorState, StatCard,
|
|
7
|
-
import { showApiErrorNotification, showSuccessNotification } from './chunk-
|
|
11
|
+
import { LeadGenSidebarMiddle, SubshellContentContainer, PageTitleCaption, acquisitionListKeys, useOptionalElevasisSystems, getAllBuildTemplates, getLeadGenStageCatalog, useListsTelemetry, useLists, useAccess, AccessKeys, CenteredErrorState, StatCard, usePaginationState, EmptyState, CustomModal, useListActions, useList, useListProgress, useListExecutions, useDeleteList, useExecuteAsync, SystemReadinessAlert, useCreateList, JsonViewer, useWorkflowExecution, useInFlightExecutions, useExecutionSSE, useListRecords } from './chunk-6JN2TLV2.js';
|
|
12
|
+
import { showApiErrorNotification, showSuccessNotification } from './chunk-HYQOGRWG.js';
|
|
8
13
|
import { SubshellSidebarSection } from './chunk-MISHPEJX.js';
|
|
9
14
|
import { CardHeader } from './chunk-62GVNH5U.js';
|
|
10
|
-
import {
|
|
15
|
+
import { getSystem } from './chunk-R5UGIFYU.js';
|
|
11
16
|
import { useElevasisServices } from './chunk-BI5VDO2K.js';
|
|
12
17
|
import { Stack, Group, Title, Text, Alert, Button, Collapse, Paper, Anchor, Center, Loader, SimpleGrid, Table, Badge, TextInput, Select, Checkbox, Pagination, ActionIcon, Tooltip, Tabs, ThemeIcon, Box, Textarea, Card, SegmentedControl, UnstyledButton, Pill, Drawer, JsonInput, Switch, NumberInput, MultiSelect, TagsInput, ScrollArea } from '@mantine/core';
|
|
13
18
|
import { IconTarget, IconAlertCircle, IconPlayerPlay, IconArrowRight, IconListDetails, IconPlus, IconAlertTriangle, IconSearch, IconList, IconExternalLink, IconCopy, IconTrash, IconBuilding, IconUsers, IconBolt, IconLayoutDashboard, IconBuildingFactory2, IconArrowLeft, IconSparkles, IconAddressBook, IconSettings, IconChevronDown, IconChevronRight, IconRefresh, IconMail, IconUser, IconDatabase } from '@tabler/icons-react';
|
|
@@ -519,43 +524,33 @@ function toBuildStepDefinition(step) {
|
|
|
519
524
|
}
|
|
520
525
|
function getDefaultBuildTemplateId(model, templates) {
|
|
521
526
|
const configuredId = getSystem(model, "sales.lead-gen")?.config?.defaultBuildTemplateId;
|
|
522
|
-
if (typeof configuredId === "string" && templates.some((template) => template.id === configuredId))
|
|
527
|
+
if (typeof configuredId === "string" && templates.some((template) => template.id === configuredId))
|
|
528
|
+
return configuredId;
|
|
523
529
|
return templates[0]?.id;
|
|
524
530
|
}
|
|
525
531
|
function getDefaultBuildSteps(templates, defaultBuildTemplateId) {
|
|
526
532
|
const template = templates.find((item) => item.id === defaultBuildTemplateId) ?? templates[0];
|
|
527
533
|
return template?.steps.map((step) => toBuildStepDefinition(step)) ?? [];
|
|
528
534
|
}
|
|
529
|
-
function summarizeReadinessIssues(issues) {
|
|
530
|
-
return issues[0]?.message;
|
|
531
|
-
}
|
|
532
535
|
function getLeadGenApiInterfaceReadiness(model) {
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
declared: false,
|
|
539
|
-
ready: false,
|
|
540
|
-
reason: "No Organization Model is available for lead-gen System Interface readiness.",
|
|
541
|
-
issues: [
|
|
542
|
-
{
|
|
543
|
-
family: "SYSTEM_INTERFACE_MISSING",
|
|
544
|
-
code: "missing-organization-model",
|
|
545
|
-
message: "No Organization Model is available for lead-gen System Interface readiness."
|
|
546
|
-
}
|
|
547
|
-
]
|
|
548
|
-
};
|
|
549
|
-
}
|
|
550
|
-
const readiness = computeInterfaceReadiness(model, LEAD_GEN_API_INTERFACE);
|
|
536
|
+
const readiness = getSystemApiInterfaceReadiness(
|
|
537
|
+
model,
|
|
538
|
+
LEAD_GEN_API_INTERFACE.systemPath,
|
|
539
|
+
LEAD_GEN_API_INTERFACE.interfaceKey
|
|
540
|
+
);
|
|
551
541
|
return {
|
|
542
|
+
...readiness,
|
|
552
543
|
systemPath: LEAD_GEN_API_INTERFACE.systemPath,
|
|
553
544
|
interfaceKey: LEAD_GEN_API_INTERFACE.interfaceKey,
|
|
554
|
-
readinessProfile: readiness.readinessProfile,
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
545
|
+
readinessProfile: model ? readiness.readinessProfile : LEAD_GEN_API_INTERFACE.readinessProfile,
|
|
546
|
+
reason: model ? readiness.reason : "No Organization Model is available for lead-gen System Interface readiness.",
|
|
547
|
+
issues: model ? readiness.issues : [
|
|
548
|
+
{
|
|
549
|
+
family: "SYSTEM_INTERFACE_MISSING",
|
|
550
|
+
code: "missing-organization-model",
|
|
551
|
+
message: "No Organization Model is available for lead-gen System Interface readiness."
|
|
552
|
+
}
|
|
553
|
+
]
|
|
559
554
|
};
|
|
560
555
|
}
|
|
561
556
|
function useLeadGenConfig() {
|
|
@@ -1349,16 +1344,6 @@ function ListMemberDrawer({ memberId, memberKind, listId, onClose }) {
|
|
|
1349
1344
|
}
|
|
1350
1345
|
);
|
|
1351
1346
|
}
|
|
1352
|
-
function LeadGenReadinessAlert({
|
|
1353
|
-
canUseApiActions,
|
|
1354
|
-
reason
|
|
1355
|
-
}) {
|
|
1356
|
-
if (canUseApiActions) return null;
|
|
1357
|
-
return /* @__PURE__ */ jsxs(Alert, { icon: /* @__PURE__ */ jsx(IconAlertCircle, { size: 16 }), color: "yellow", variant: "light", children: [
|
|
1358
|
-
"Lead-gen API actions are disabled until System Interface readiness passes. Read-only list detail can still render when data is available.",
|
|
1359
|
-
reason ? ` ${reason}` : ""
|
|
1360
|
-
] });
|
|
1361
|
-
}
|
|
1362
1347
|
function formatDateTime2(value) {
|
|
1363
1348
|
if (!value) return "Not yet";
|
|
1364
1349
|
return new Date(value).toLocaleString("en-US", {
|
|
@@ -3482,7 +3467,15 @@ function LeadGenListDetailPage({
|
|
|
3482
3467
|
backButton
|
|
3483
3468
|
] })
|
|
3484
3469
|
] }),
|
|
3485
|
-
/* @__PURE__ */ jsx(
|
|
3470
|
+
/* @__PURE__ */ jsx(
|
|
3471
|
+
SystemReadinessAlert,
|
|
3472
|
+
{
|
|
3473
|
+
ready: canUseApiActions,
|
|
3474
|
+
actionLabel: "Lead-gen API actions",
|
|
3475
|
+
fallbackNote: "Read-only list detail can still render when data is available.",
|
|
3476
|
+
reason: apiDisabledReason
|
|
3477
|
+
}
|
|
3478
|
+
),
|
|
3486
3479
|
headerActions ? /* @__PURE__ */ jsx(Group, { gap: "xs", children: headerActions }) : null,
|
|
3487
3480
|
/* @__PURE__ */ jsx(Paper, { withBorder: true, children: /* @__PURE__ */ jsxs(Tabs, { value: activeTab, onChange: handleTabChange, keepMounted: false, children: [
|
|
3488
3481
|
/* @__PURE__ */ jsxs(Tabs.List, { children: [
|
|
@@ -4525,4 +4518,4 @@ function LeadGenContactsPage({ extraColumns, replaceDefaultColumns } = {}) {
|
|
|
4525
4518
|
] }) });
|
|
4526
4519
|
}
|
|
4527
4520
|
|
|
4528
|
-
export { LEAD_GEN_ROUTE_LINKS, LeadGenCompaniesPage, LeadGenContactsPage, LeadGenListDetailPage, LeadGenListsPage, LeadGenOverviewPage,
|
|
4521
|
+
export { LEAD_GEN_ROUTE_LINKS, LeadGenCompaniesPage, LeadGenContactsPage, LeadGenListDetailPage, LeadGenListsPage, LeadGenOverviewPage, LeadGenRouteShell, LeadGenSidebar, LeadGenSidebarTop, ListBuilderIndexPage, ListBuilderPage, ORPHAN_STAGE_ORDER, StepConfigForm, TabSection, deriveBusinessProgress, formatDate, getEnrichmentColor, getEnrichmentStatus, getLeadGenApiInterfaceReadiness, getLeadGenExportWorkflowId, getStateKeyColor, getStatusColor, getStepActionLabel, isLeadGenExportAction, resolveBuildPlanSteps, resolveBuildState, sortStageKeys, useDeleteLists, useLeadGenConfig };
|