@elevasis/ui 2.73.0 → 2.75.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 +58 -0
- 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-Z4ICFQXG.js → chunk-2ZRY3ARL.js} +1 -1
- package/dist/{chunk-5B2ZFO44.js → chunk-3H5DIJN7.js} +1 -1
- package/dist/{chunk-LZT2H2MA.js → chunk-47YJVIZE.js} +36 -43
- package/dist/{chunk-3TS5U5BL.js → chunk-5RH6NYZH.js} +1 -1
- package/dist/chunk-5SLRGUC4.js +224 -0
- package/dist/{chunk-JYBJMVNY.js → chunk-5VF5LPYS.js} +1 -1
- package/dist/{chunk-SWKAH2YM.js → chunk-6BJ5HMMC.js} +282 -553
- package/dist/{chunk-NI37YNRP.js → chunk-7OOFMEX6.js} +11 -5
- package/dist/{chunk-IBCEAVB2.js → chunk-A2SB32YV.js} +65 -5
- package/dist/{chunk-CJ2232PQ.js → chunk-CRPH5AAB.js} +1 -1
- package/dist/chunk-D3XXPCCK.js +69 -0
- package/dist/chunk-DMSTDZCJ.js +305 -0
- package/dist/chunk-DTEGVSJ6.js +645 -0
- package/dist/chunk-DVAOCHIF.js +165 -0
- package/dist/chunk-G7O4CBMC.js +231 -0
- package/dist/{chunk-IGBPWD6S.js → chunk-GDTK33QT.js} +5 -3
- package/dist/chunk-ICHDIVQO.js +54 -0
- package/dist/{chunk-U2H3TIHD.js → chunk-IYATYH5I.js} +2 -52
- package/dist/chunk-L3NBMLRN.js +49 -0
- package/dist/{chunk-LEPYXLJ2.js → chunk-LFLM723H.js} +1 -1
- package/dist/chunk-M6VAZAQW.js +45 -0
- package/dist/{chunk-AJOVWB47.js → chunk-MLHZUN2X.js} +6 -3
- package/dist/chunk-N6K2Q5BM.js +393 -0
- package/dist/chunk-NMHQAYZU.js +439 -0
- package/dist/chunk-NYIIRZSA.js +286 -0
- package/dist/{chunk-ETN3TTRT.js → chunk-OGHTJKBV.js} +115 -8
- package/dist/{chunk-M7WWRZ5Z.js → chunk-QFGNRKIE.js} +1 -78
- package/dist/chunk-QFS2GZMV.js +515 -0
- package/dist/{chunk-OCVSPAKM.js → chunk-SB3IHM5Y.js} +1150 -4346
- package/dist/{chunk-4CW2C5BD.js → chunk-SEYOVNS5.js} +1 -1
- package/dist/chunk-SN7X5N2A.js +116 -0
- package/dist/{chunk-PQ4B62HH.js → chunk-TX3UHDL5.js} +2 -2
- package/dist/chunk-VM2OWOXL.js +24 -0
- package/dist/{chunk-ZDKPHFTH.js → chunk-VWGCURZF.js} +5 -3
- package/dist/chunk-WDBNW44Z.js +49 -0
- package/dist/chunk-YQQ5GRUR.js +21 -0
- package/dist/{chunk-NHNTX6ZL.js → chunk-ZG6YJUT4.js} +3 -2
- package/dist/components/index.d.ts +228 -6
- package/dist/components/index.js +321 -35
- package/dist/components/navigation/index.js +6 -7
- package/dist/features/auth/index.d.ts +78 -2
- package/dist/features/auth/index.js +18 -9
- package/dist/features/clients/index.js +7 -7
- package/dist/features/content/index.d.ts +226 -5
- package/dist/features/content/index.js +270 -19
- package/dist/features/crm/index.d.ts +58 -0
- package/dist/features/crm/index.js +10 -8
- package/dist/features/dashboard/index.js +9 -8
- package/dist/features/delivery/index.d.ts +58 -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 +9 -15
- 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.js +15 -11
- package/dist/features/public-agent-chat/index.js +3 -1
- package/dist/features/settings/index.d.ts +66 -3
- package/dist/features/settings/index.js +9 -8
- package/dist/hooks/access/index.js +5 -6
- package/dist/hooks/delivery/index.d.ts +58 -0
- package/dist/hooks/delivery/index.js +3 -2
- package/dist/hooks/operations/command-view/utils/transformCommandViewData.d.ts +1 -1
- package/dist/hooks/published.d.ts +181 -5
- package/dist/hooks/published.js +22 -6
- package/dist/initialization/index.d.ts +58 -0
- 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 +58 -0
- package/dist/provider/index.d.ts +77 -1
- package/dist/provider/index.js +5 -6
- package/dist/provider/published.d.ts +105 -1
- 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 +73 -1
- package/dist/utils/index.d.ts +83 -3
- package/dist/utils/index.js +1 -1
- package/package.json +10 -5
- 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 -14073
- package/dist/hooks/index.js +0 -27
- package/dist/supabase/index.d.ts +0 -7118
- 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,165 @@
|
|
|
1
|
+
import { deriveActions } from './chunk-NYIIRZSA.js';
|
|
2
|
+
import { acquisitionListKeys } from './chunk-SB3IHM5Y.js';
|
|
3
|
+
import { showApiErrorNotification, showSuccessNotification } from './chunk-ICHDIVQO.js';
|
|
4
|
+
import { useElevasisServices } from './chunk-BI5VDO2K.js';
|
|
5
|
+
import { useQuery, useQueryClient, useMutation } from '@tanstack/react-query';
|
|
6
|
+
import { useMemo } from 'react';
|
|
7
|
+
|
|
8
|
+
var leadGenArtifactKeys = {
|
|
9
|
+
all: ["lead-gen-artifacts"],
|
|
10
|
+
// ownerId is nullable/undefined here to match CreateArtifactRequest -- an
|
|
11
|
+
// 'organization'-owned artifact has no single owning entity row. See
|
|
12
|
+
// CreateArtifactRequestSchema (business/acquisition/api-schemas.ts).
|
|
13
|
+
list: (organizationId, ownerKind, ownerId) => [...leadGenArtifactKeys.all, organizationId, ownerKind, ownerId]
|
|
14
|
+
};
|
|
15
|
+
function useArtifacts({ ownerKind, ownerId }) {
|
|
16
|
+
const { apiRequest, isReady, workOSOrganizationId } = useElevasisServices();
|
|
17
|
+
return useQuery({
|
|
18
|
+
queryKey: leadGenArtifactKeys.list(workOSOrganizationId, ownerKind, ownerId),
|
|
19
|
+
queryFn: () => apiRequest(
|
|
20
|
+
`/acquisition/artifacts?ownerKind=${encodeURIComponent(ownerKind)}&ownerId=${encodeURIComponent(ownerId)}`
|
|
21
|
+
),
|
|
22
|
+
enabled: isReady && !!ownerId
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
function useCreateArtifact() {
|
|
26
|
+
const { apiRequest, workOSOrganizationId } = useElevasisServices();
|
|
27
|
+
const queryClient = useQueryClient();
|
|
28
|
+
return useMutation({
|
|
29
|
+
mutationFn: (body) => apiRequest("/acquisition/artifacts", {
|
|
30
|
+
method: "POST",
|
|
31
|
+
body: JSON.stringify(body)
|
|
32
|
+
}),
|
|
33
|
+
onSuccess: (_, variables) => {
|
|
34
|
+
queryClient.invalidateQueries({
|
|
35
|
+
queryKey: leadGenArtifactKeys.list(workOSOrganizationId, variables.ownerKind, variables.ownerId)
|
|
36
|
+
});
|
|
37
|
+
showSuccessNotification("Artifact created");
|
|
38
|
+
},
|
|
39
|
+
onError: (error) => {
|
|
40
|
+
showApiErrorNotification(error);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
var leadGenListMemberKeys = {
|
|
45
|
+
all: ["lead-gen-list-members"],
|
|
46
|
+
list: (organizationId, listId) => [...leadGenListMemberKeys.all, organizationId, "list", listId],
|
|
47
|
+
detail: (organizationId, memberId) => [...leadGenListMemberKeys.all, organizationId, "detail", memberId]
|
|
48
|
+
};
|
|
49
|
+
function useListMembers({ listId }) {
|
|
50
|
+
const { apiRequest, isReady, workOSOrganizationId } = useElevasisServices();
|
|
51
|
+
return useQuery({
|
|
52
|
+
queryKey: leadGenListMemberKeys.list(workOSOrganizationId, listId),
|
|
53
|
+
queryFn: () => apiRequest(`/acquisition/lists/${listId}/members`),
|
|
54
|
+
enabled: isReady && !!listId
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
function useListMember(memberId) {
|
|
58
|
+
const { apiRequest, isReady, workOSOrganizationId } = useElevasisServices();
|
|
59
|
+
return useQuery({
|
|
60
|
+
queryKey: leadGenListMemberKeys.detail(workOSOrganizationId, memberId),
|
|
61
|
+
queryFn: () => apiRequest(`/acquisition/list-members/${memberId}`),
|
|
62
|
+
enabled: isReady && !!memberId
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
function useTransitionListMember() {
|
|
66
|
+
const { apiRequest, workOSOrganizationId } = useElevasisServices();
|
|
67
|
+
const queryClient = useQueryClient();
|
|
68
|
+
return useMutation({
|
|
69
|
+
mutationFn: async (input) => {
|
|
70
|
+
const { memberId, pipelineKey, stageKey, stateKey, reason, expectedUpdatedAt } = input;
|
|
71
|
+
await apiRequest(`/acquisition/list-members/${memberId}/transition`, {
|
|
72
|
+
method: "PATCH",
|
|
73
|
+
body: JSON.stringify({
|
|
74
|
+
pipelineKey,
|
|
75
|
+
stageKey,
|
|
76
|
+
...stateKey !== void 0 ? { stateKey } : {},
|
|
77
|
+
...reason !== void 0 ? { reason } : {},
|
|
78
|
+
...expectedUpdatedAt !== void 0 ? { expectedUpdatedAt } : {}
|
|
79
|
+
})
|
|
80
|
+
});
|
|
81
|
+
},
|
|
82
|
+
onSuccess: (_, variables) => {
|
|
83
|
+
queryClient.invalidateQueries({
|
|
84
|
+
queryKey: leadGenListMemberKeys.detail(workOSOrganizationId, variables.memberId)
|
|
85
|
+
});
|
|
86
|
+
if (variables.listId) {
|
|
87
|
+
queryClient.invalidateQueries({ queryKey: leadGenListMemberKeys.list(workOSOrganizationId, variables.listId) });
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
onError: (error) => {
|
|
91
|
+
queryClient.invalidateQueries({ queryKey: leadGenListMemberKeys.all });
|
|
92
|
+
showApiErrorNotification(error);
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
function useDeriveActions(item) {
|
|
97
|
+
return useMemo(() => {
|
|
98
|
+
if (!item) return [];
|
|
99
|
+
if (item.pipeline_key !== "lead-gen") {
|
|
100
|
+
return deriveActions(item);
|
|
101
|
+
}
|
|
102
|
+
return [];
|
|
103
|
+
}, [item]);
|
|
104
|
+
}
|
|
105
|
+
function useUpdateListStatus() {
|
|
106
|
+
const { apiRequest, workOSOrganizationId } = useElevasisServices();
|
|
107
|
+
const queryClient = useQueryClient();
|
|
108
|
+
return useMutation({
|
|
109
|
+
mutationFn: async (input) => {
|
|
110
|
+
await apiRequest(`/acquisition/lists/${input.listId}/status`, {
|
|
111
|
+
method: "PATCH",
|
|
112
|
+
body: JSON.stringify({ status: input.status })
|
|
113
|
+
});
|
|
114
|
+
},
|
|
115
|
+
onSuccess: (_, variables) => {
|
|
116
|
+
queryClient.invalidateQueries({ queryKey: acquisitionListKeys.list(workOSOrganizationId) });
|
|
117
|
+
queryClient.invalidateQueries({ queryKey: acquisitionListKeys.detail(workOSOrganizationId, variables.listId) });
|
|
118
|
+
queryClient.invalidateQueries({ queryKey: acquisitionListKeys.telemetry(workOSOrganizationId) });
|
|
119
|
+
},
|
|
120
|
+
onError: (error) => {
|
|
121
|
+
queryClient.invalidateQueries({ queryKey: acquisitionListKeys.all });
|
|
122
|
+
showApiErrorNotification(error);
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// src/hooks/lead-gen/useTransitionListCompany.ts
|
|
128
|
+
var leadGenListCompanyKeys = {
|
|
129
|
+
all: ["lead-gen-list-companies"],
|
|
130
|
+
detail: (organizationId, listCompanyId) => [...leadGenListCompanyKeys.all, organizationId, "detail", listCompanyId]
|
|
131
|
+
};
|
|
132
|
+
function useTransitionListCompany() {
|
|
133
|
+
const { apiRequest, workOSOrganizationId } = useElevasisServices();
|
|
134
|
+
const queryClient = useQueryClient();
|
|
135
|
+
return useMutation({
|
|
136
|
+
mutationFn: async (input) => {
|
|
137
|
+
const { listCompanyId, pipelineKey, stageKey, stateKey, reason, expectedUpdatedAt } = input;
|
|
138
|
+
await apiRequest(`/acquisition/list-companies/${listCompanyId}/transition`, {
|
|
139
|
+
method: "PATCH",
|
|
140
|
+
body: JSON.stringify({
|
|
141
|
+
pipelineKey,
|
|
142
|
+
stageKey,
|
|
143
|
+
...stateKey !== void 0 ? { stateKey } : {},
|
|
144
|
+
...reason !== void 0 ? { reason } : {},
|
|
145
|
+
...expectedUpdatedAt !== void 0 ? { expectedUpdatedAt } : {}
|
|
146
|
+
})
|
|
147
|
+
});
|
|
148
|
+
},
|
|
149
|
+
onSuccess: (_, variables) => {
|
|
150
|
+
queryClient.invalidateQueries({
|
|
151
|
+
queryKey: leadGenListCompanyKeys.detail(workOSOrganizationId, variables.listCompanyId)
|
|
152
|
+
});
|
|
153
|
+
if (variables.listId) {
|
|
154
|
+
queryClient.invalidateQueries({ queryKey: acquisitionListKeys.telemetry(workOSOrganizationId) });
|
|
155
|
+
queryClient.invalidateQueries({ queryKey: acquisitionListKeys.detail(workOSOrganizationId, variables.listId) });
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
onError: (error) => {
|
|
159
|
+
queryClient.invalidateQueries({ queryKey: leadGenListCompanyKeys.all });
|
|
160
|
+
showApiErrorNotification(error);
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export { leadGenArtifactKeys, leadGenListCompanyKeys, leadGenListMemberKeys, useArtifacts, useCreateArtifact, useDeriveActions, useListMember, useListMembers, useTransitionListCompany, useTransitionListMember, useUpdateListStatus };
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import { useNotificationAdapter } from './chunk-SB3IHM5Y.js';
|
|
2
|
+
import { useElevasisServices } from './chunk-BI5VDO2K.js';
|
|
3
|
+
import { CredentialNameSchema, UuidSchema } from './chunk-TVTSASST.js';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
|
|
6
|
+
import { notifications } from '@mantine/notifications';
|
|
7
|
+
|
|
8
|
+
var CredentialTypeSchema = z.enum([
|
|
9
|
+
"oauth",
|
|
10
|
+
"api-key",
|
|
11
|
+
"webhook-secret",
|
|
12
|
+
"api-key-secret",
|
|
13
|
+
"clickup",
|
|
14
|
+
"instagram"
|
|
15
|
+
]);
|
|
16
|
+
var CredentialValueSchema = z.record(z.string(), z.unknown()).refine((val) => Object.keys(val).length > 0, { message: "Credential value must not be empty" }).refine((val) => Object.keys(val).length <= 50, { message: "Credential value has too many keys (max 50)" }).refine(
|
|
17
|
+
(val) => {
|
|
18
|
+
for (const v of Object.values(val)) {
|
|
19
|
+
if (typeof v === "string" && v.length > 10240) {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return true;
|
|
24
|
+
},
|
|
25
|
+
{ message: "Individual credential values too large (max 10KB per string)" }
|
|
26
|
+
);
|
|
27
|
+
var CreateCredentialRequestSchema = z.object({
|
|
28
|
+
name: CredentialNameSchema,
|
|
29
|
+
type: CredentialTypeSchema,
|
|
30
|
+
value: CredentialValueSchema,
|
|
31
|
+
provider: z.string().optional()
|
|
32
|
+
// OAuth provider ID ('dropbox', 'notion', 'google-sheets')
|
|
33
|
+
}).strict();
|
|
34
|
+
var CreateCredentialResponseSchema = z.object({
|
|
35
|
+
id: UuidSchema,
|
|
36
|
+
name: z.string()
|
|
37
|
+
});
|
|
38
|
+
var ListCredentialsResponseSchema = z.object({
|
|
39
|
+
credentials: z.array(
|
|
40
|
+
z.object({
|
|
41
|
+
id: UuidSchema,
|
|
42
|
+
name: z.string(),
|
|
43
|
+
type: z.string(),
|
|
44
|
+
provider: z.string().nullable(),
|
|
45
|
+
// OAuth provider or null for non-OAuth
|
|
46
|
+
createdAt: z.string().datetime()
|
|
47
|
+
})
|
|
48
|
+
)
|
|
49
|
+
});
|
|
50
|
+
var UpdateCredentialParamsSchema = z.object({
|
|
51
|
+
credentialId: UuidSchema
|
|
52
|
+
});
|
|
53
|
+
var UpdateCredentialRequestSchema = z.object({
|
|
54
|
+
value: CredentialValueSchema.optional(),
|
|
55
|
+
name: CredentialNameSchema.optional()
|
|
56
|
+
}).strict().refine((data) => data.value !== void 0 || data.name !== void 0, {
|
|
57
|
+
message: "At least one field (value or name) must be provided"
|
|
58
|
+
});
|
|
59
|
+
var DeleteCredentialParamsSchema = z.object({
|
|
60
|
+
credentialId: UuidSchema
|
|
61
|
+
});
|
|
62
|
+
var VerifyCredentialParamsSchema = z.object({
|
|
63
|
+
credentialId: UuidSchema
|
|
64
|
+
});
|
|
65
|
+
var VerifyCredentialResponseSchema = z.object({
|
|
66
|
+
ok: z.boolean(),
|
|
67
|
+
provider: z.string(),
|
|
68
|
+
checkedAt: z.string().datetime(),
|
|
69
|
+
message: z.string().optional(),
|
|
70
|
+
details: z.record(z.string(), z.unknown()).optional()
|
|
71
|
+
});
|
|
72
|
+
var CredentialSchemas = {
|
|
73
|
+
CreateRequest: CreateCredentialRequestSchema,
|
|
74
|
+
CreateResponse: CreateCredentialResponseSchema,
|
|
75
|
+
ListResponse: ListCredentialsResponseSchema,
|
|
76
|
+
UpdateParams: UpdateCredentialParamsSchema,
|
|
77
|
+
UpdateRequest: UpdateCredentialRequestSchema,
|
|
78
|
+
DeleteParams: DeleteCredentialParamsSchema,
|
|
79
|
+
VerifyParams: VerifyCredentialParamsSchema,
|
|
80
|
+
VerifyResponse: VerifyCredentialResponseSchema
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
// src/hooks/settings/credentials/credentialService.ts
|
|
84
|
+
var CredentialService = class {
|
|
85
|
+
constructor(apiRequest) {
|
|
86
|
+
this.apiRequest = apiRequest;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* List credentials for the current organization
|
|
90
|
+
* Organization context is provided via workos-organization-id header
|
|
91
|
+
*/
|
|
92
|
+
async listCredentials() {
|
|
93
|
+
const response = await this.apiRequest("/credentials");
|
|
94
|
+
return response.credentials;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Create a new credential
|
|
98
|
+
* Organization context is provided via workos-organization-id header
|
|
99
|
+
*/
|
|
100
|
+
async createCredential(data) {
|
|
101
|
+
const validated = CredentialSchemas.CreateRequest.parse(data);
|
|
102
|
+
return await this.apiRequest(`/credentials`, {
|
|
103
|
+
method: "POST",
|
|
104
|
+
body: JSON.stringify(validated)
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Update a credential value or metadata
|
|
109
|
+
* Organization context is provided via workos-organization-id header
|
|
110
|
+
*/
|
|
111
|
+
async updateCredential(credentialId, updates) {
|
|
112
|
+
CredentialSchemas.UpdateParams.parse({ credentialId });
|
|
113
|
+
const validated = CredentialSchemas.UpdateRequest.parse(updates);
|
|
114
|
+
await this.apiRequest(`/credentials/${credentialId}`, {
|
|
115
|
+
method: "PATCH",
|
|
116
|
+
body: JSON.stringify(validated)
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Delete a credential
|
|
121
|
+
* Organization context is provided via workos-organization-id header
|
|
122
|
+
*/
|
|
123
|
+
async deleteCredential(credentialId) {
|
|
124
|
+
CredentialSchemas.DeleteParams.parse({ credentialId });
|
|
125
|
+
await this.apiRequest(`/credentials/${credentialId}`, {
|
|
126
|
+
method: "DELETE"
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Verify a credential server-side without exposing secret material
|
|
131
|
+
*/
|
|
132
|
+
async verifyCredential(credentialId) {
|
|
133
|
+
CredentialSchemas.VerifyParams.parse({ credentialId });
|
|
134
|
+
const response = await this.apiRequest(`/credentials/${credentialId}/verify`, {
|
|
135
|
+
method: "POST"
|
|
136
|
+
});
|
|
137
|
+
return CredentialSchemas.VerifyResponse.parse(response);
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
function useCredentials() {
|
|
141
|
+
const { apiRequest, workOSOrganizationId, isReady } = useElevasisServices();
|
|
142
|
+
return useQuery({
|
|
143
|
+
queryKey: ["credentials", workOSOrganizationId],
|
|
144
|
+
queryFn: async () => {
|
|
145
|
+
const service = new CredentialService(apiRequest);
|
|
146
|
+
return await service.listCredentials();
|
|
147
|
+
},
|
|
148
|
+
enabled: isReady && Boolean(workOSOrganizationId),
|
|
149
|
+
retry: false
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
function useVerifyCredential() {
|
|
153
|
+
const { apiRequest } = useElevasisServices();
|
|
154
|
+
return useMutation({
|
|
155
|
+
mutationFn: async (credentialId) => {
|
|
156
|
+
const service = new CredentialService(apiRequest);
|
|
157
|
+
return await service.verifyCredential(credentialId);
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
function useCreateCredential() {
|
|
162
|
+
const { apiRequest } = useElevasisServices();
|
|
163
|
+
const adapter = useNotificationAdapter();
|
|
164
|
+
const queryClient = useQueryClient();
|
|
165
|
+
return useMutation({
|
|
166
|
+
mutationFn: async (data) => {
|
|
167
|
+
const service = new CredentialService(apiRequest);
|
|
168
|
+
return await service.createCredential(data);
|
|
169
|
+
},
|
|
170
|
+
onSuccess: () => {
|
|
171
|
+
queryClient.invalidateQueries({ queryKey: ["credentials"] });
|
|
172
|
+
notifications.show({
|
|
173
|
+
title: "Success",
|
|
174
|
+
message: "Credential created successfully",
|
|
175
|
+
color: "green"
|
|
176
|
+
});
|
|
177
|
+
},
|
|
178
|
+
onError: (error) => {
|
|
179
|
+
console.error("Failed to create credential:", error);
|
|
180
|
+
adapter.apiError(error);
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
function useDeleteCredential() {
|
|
185
|
+
const { apiRequest } = useElevasisServices();
|
|
186
|
+
const adapter = useNotificationAdapter();
|
|
187
|
+
const queryClient = useQueryClient();
|
|
188
|
+
return useMutation({
|
|
189
|
+
mutationFn: async (credentialId) => {
|
|
190
|
+
const service = new CredentialService(apiRequest);
|
|
191
|
+
return await service.deleteCredential(credentialId);
|
|
192
|
+
},
|
|
193
|
+
onSuccess: () => {
|
|
194
|
+
queryClient.invalidateQueries({ queryKey: ["credentials"] });
|
|
195
|
+
notifications.show({
|
|
196
|
+
title: "Success",
|
|
197
|
+
message: "Credential deleted successfully",
|
|
198
|
+
color: "green"
|
|
199
|
+
});
|
|
200
|
+
},
|
|
201
|
+
onError: (error) => {
|
|
202
|
+
console.error("Failed to delete credential:", error);
|
|
203
|
+
adapter.apiError(error);
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
function useUpdateCredential() {
|
|
208
|
+
const { apiRequest } = useElevasisServices();
|
|
209
|
+
const adapter = useNotificationAdapter();
|
|
210
|
+
const queryClient = useQueryClient();
|
|
211
|
+
return useMutation({
|
|
212
|
+
mutationFn: async ({ credentialId, updates }) => {
|
|
213
|
+
const service = new CredentialService(apiRequest);
|
|
214
|
+
return await service.updateCredential(credentialId, updates);
|
|
215
|
+
},
|
|
216
|
+
onSuccess: () => {
|
|
217
|
+
queryClient.invalidateQueries({ queryKey: ["credentials"] });
|
|
218
|
+
notifications.show({
|
|
219
|
+
title: "Success",
|
|
220
|
+
message: "Credential updated successfully",
|
|
221
|
+
color: "green"
|
|
222
|
+
});
|
|
223
|
+
},
|
|
224
|
+
onError: (error) => {
|
|
225
|
+
console.error("Failed to update credential:", error);
|
|
226
|
+
adapter.apiError(error);
|
|
227
|
+
}
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
export { CredentialSchemas, CredentialService, useCreateCredential, useCredentials, useDeleteCredential, useUpdateCredential, useVerifyCredential };
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useMarkAsRead, useExecutionLogsFilters, useExecutionLogs, useExecutionHealth, useCostSummary, useActivityFilters, useActivityTrend, useActivities, useNotifications, useMarkAllAsRead } from './chunk-DMSTDZCJ.js';
|
|
2
|
+
import { useTimeRangeDates } from './chunk-YQQ5GRUR.js';
|
|
3
|
+
import { AppShellLoader } from './chunk-5RH6NYZH.js';
|
|
2
4
|
import { FilterBar } from './chunk-PDHTXPSF.js';
|
|
3
|
-
import { CenteredErrorState, StatsCardSkeleton, CyberAreaChart, TrendIndicator, DetailCardSkeleton, useResolveError, useResolveAllErrors, usePaginationState, useErrorDetails, EmptyState,
|
|
5
|
+
import { CenteredErrorState, StatsCardSkeleton, CyberAreaChart, TrendIndicator, DetailCardSkeleton, useResolveError, useResolveAllErrors, usePaginationState, useErrorDetails, EmptyState, PageTitleCaption, useErrorAnalysis, useErrorDetail, useResolveErrorsByExecution, useResources, CustomModal, JsonViewer, useCostTrends, useCostByModel, useCostBreakdown, CostTrendChart, ActivityTrendChart } from './chunk-SB3IHM5Y.js';
|
|
4
6
|
import { CardHeader } from './chunk-62GVNH5U.js';
|
|
5
7
|
import { formatDuration } from './chunk-BLXJEIQS.js';
|
|
6
|
-
import { PAGE_SIZE_DEFAULT } from './chunk-
|
|
8
|
+
import { PAGE_SIZE_DEFAULT } from './chunk-A2SB32YV.js';
|
|
7
9
|
import { formatBucketTime, getTimeRangeDates } from './chunk-Y6I3IC45.js';
|
|
8
10
|
import { useRouterContext } from './chunk-Q7DJKLEN.js';
|
|
9
11
|
import { useState, useMemo, useCallback } from 'react';
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { getErrorInfo, formatErrorMessage, getErrorTitle } from './chunk-A2SB32YV.js';
|
|
2
|
+
import { notifications } from '@mantine/notifications';
|
|
3
|
+
|
|
4
|
+
var showInfoNotification = (message) => {
|
|
5
|
+
notifications.show({
|
|
6
|
+
title: "Info",
|
|
7
|
+
message,
|
|
8
|
+
autoClose: 5e3,
|
|
9
|
+
color: "blue",
|
|
10
|
+
position: "top-right"
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
var showSuccessNotification = (message) => {
|
|
14
|
+
notifications.show({
|
|
15
|
+
title: "Action Successful",
|
|
16
|
+
message,
|
|
17
|
+
autoClose: 5e3,
|
|
18
|
+
color: "green",
|
|
19
|
+
position: "top-right"
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
var showErrorNotification = (error) => {
|
|
23
|
+
if (error instanceof Error) {
|
|
24
|
+
error = error.message;
|
|
25
|
+
}
|
|
26
|
+
notifications.show({
|
|
27
|
+
title: "Action Failed",
|
|
28
|
+
message: error,
|
|
29
|
+
autoClose: 5e3,
|
|
30
|
+
color: "red",
|
|
31
|
+
position: "top-right"
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
var showWarningNotification = (message) => {
|
|
35
|
+
notifications.show({
|
|
36
|
+
title: "Warning",
|
|
37
|
+
message,
|
|
38
|
+
autoClose: 5e3,
|
|
39
|
+
color: "orange",
|
|
40
|
+
position: "top-right"
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
var showApiErrorNotification = (error) => {
|
|
44
|
+
const { message, code, requestId, fields, retryAfter } = getErrorInfo(error);
|
|
45
|
+
notifications.show({
|
|
46
|
+
title: getErrorTitle(code),
|
|
47
|
+
message: formatErrorMessage(message, requestId, fields, retryAfter),
|
|
48
|
+
autoClose: retryAfter ? retryAfter * 1e3 : 5e3,
|
|
49
|
+
color: "red",
|
|
50
|
+
position: "top-right"
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export { showApiErrorNotification, showErrorNotification, showInfoNotification, showSuccessNotification, showWarningNotification };
|
|
@@ -1,57 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { showApiErrorNotification } from './chunk-ICHDIVQO.js';
|
|
2
2
|
import { useElevasisServices } from './chunk-BI5VDO2K.js';
|
|
3
3
|
import { useQuery, useQueryClient, useMutation } from '@tanstack/react-query';
|
|
4
|
-
import { notifications } from '@mantine/notifications';
|
|
5
4
|
|
|
6
|
-
var showInfoNotification = (message) => {
|
|
7
|
-
notifications.show({
|
|
8
|
-
title: "Info",
|
|
9
|
-
message,
|
|
10
|
-
autoClose: 5e3,
|
|
11
|
-
color: "blue",
|
|
12
|
-
position: "top-right"
|
|
13
|
-
});
|
|
14
|
-
};
|
|
15
|
-
var showSuccessNotification = (message) => {
|
|
16
|
-
notifications.show({
|
|
17
|
-
title: "Action Successful",
|
|
18
|
-
message,
|
|
19
|
-
autoClose: 5e3,
|
|
20
|
-
color: "green",
|
|
21
|
-
position: "top-right"
|
|
22
|
-
});
|
|
23
|
-
};
|
|
24
|
-
var showErrorNotification = (error) => {
|
|
25
|
-
if (error instanceof Error) {
|
|
26
|
-
error = error.message;
|
|
27
|
-
}
|
|
28
|
-
notifications.show({
|
|
29
|
-
title: "Action Failed",
|
|
30
|
-
message: error,
|
|
31
|
-
autoClose: 5e3,
|
|
32
|
-
color: "red",
|
|
33
|
-
position: "top-right"
|
|
34
|
-
});
|
|
35
|
-
};
|
|
36
|
-
var showWarningNotification = (message) => {
|
|
37
|
-
notifications.show({
|
|
38
|
-
title: "Warning",
|
|
39
|
-
message,
|
|
40
|
-
autoClose: 5e3,
|
|
41
|
-
color: "orange",
|
|
42
|
-
position: "top-right"
|
|
43
|
-
});
|
|
44
|
-
};
|
|
45
|
-
var showApiErrorNotification = (error) => {
|
|
46
|
-
const { message, code, requestId, fields, retryAfter } = getErrorInfo(error);
|
|
47
|
-
notifications.show({
|
|
48
|
-
title: getErrorTitle(code),
|
|
49
|
-
message: formatErrorMessage(message, requestId, fields, retryAfter),
|
|
50
|
-
autoClose: retryAfter ? retryAfter * 1e3 : 5e3,
|
|
51
|
-
color: "red",
|
|
52
|
-
position: "top-right"
|
|
53
|
-
});
|
|
54
|
-
};
|
|
55
5
|
var milestoneKeys = {
|
|
56
6
|
all: ["project-milestones"],
|
|
57
7
|
lists: () => [...milestoneKeys.all, "list"],
|
|
@@ -380,4 +330,4 @@ function useDeleteProject() {
|
|
|
380
330
|
});
|
|
381
331
|
}
|
|
382
332
|
|
|
383
|
-
export { milestoneKeys, noteKeys, projectKeys,
|
|
333
|
+
export { milestoneKeys, noteKeys, projectKeys, taskKeys, useCreateMilestone, useCreateNote, useCreateProject, useCreateTask, useDeleteMilestone, useDeleteProject, useDeleteTask, useMilestones, useProject, useProjectMilestones, useProjectNotes, useProjectTasks, useProjects, useTasks, useUpdateMilestone, useUpdateProject, useUpdateTask };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { computeInterfaceReadiness, getSystem } from './chunk-A2SB32YV.js';
|
|
2
|
+
|
|
3
|
+
// src/features/operations/systems/systemInterfaceReadiness.ts
|
|
4
|
+
function summarizeReadinessIssues(issues) {
|
|
5
|
+
return issues[0]?.message;
|
|
6
|
+
}
|
|
7
|
+
function getSystemApiInterfaceReadiness(model, systemPath, interfaceKey = "api") {
|
|
8
|
+
if (!model) {
|
|
9
|
+
const reason = `No Organization Model is available for "${systemPath}" System Interface readiness.`;
|
|
10
|
+
return {
|
|
11
|
+
systemPath,
|
|
12
|
+
interfaceKey,
|
|
13
|
+
declared: false,
|
|
14
|
+
ready: false,
|
|
15
|
+
reason,
|
|
16
|
+
issues: [{ family: "SYSTEM_INTERFACE_MISSING", code: "missing-organization-model", message: reason }]
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
const readiness = computeInterfaceReadiness(model, { systemPath, interfaceKey });
|
|
20
|
+
return {
|
|
21
|
+
systemPath,
|
|
22
|
+
interfaceKey,
|
|
23
|
+
readinessProfile: readiness.readinessProfile,
|
|
24
|
+
declared: getSystem(model, systemPath)?.apiInterface !== void 0,
|
|
25
|
+
ready: readiness.ready,
|
|
26
|
+
reason: summarizeReadinessIssues(readiness.issues),
|
|
27
|
+
issues: readiness.issues
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function collectSidebarSurfacesForSystem(nodes, systemPath, systemId, found) {
|
|
31
|
+
if (!nodes) return;
|
|
32
|
+
for (const node of Object.values(nodes)) {
|
|
33
|
+
if (node.type === "surface") {
|
|
34
|
+
const targetedSystems = node.targets?.systems ?? [];
|
|
35
|
+
if (targetedSystems.includes(systemPath) || targetedSystems.includes(systemId)) found.push(node);
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
collectSidebarSurfacesForSystem(node.children, systemPath, systemId, found);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
function findNavigationSurfaceForSystem(model, systemPath, systemId) {
|
|
42
|
+
if (!model?.navigation?.sidebar) return void 0;
|
|
43
|
+
const matches = [];
|
|
44
|
+
collectSidebarSurfacesForSystem(model.navigation.sidebar.primary, systemPath, systemId, matches);
|
|
45
|
+
collectSidebarSurfacesForSystem(model.navigation.sidebar.bottom, systemPath, systemId, matches);
|
|
46
|
+
return matches.sort((a, b) => (a.targets?.systems?.length ?? 0) - (b.targets?.systems?.length ?? 0))[0];
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export { findNavigationSurfaceForSystem, getSystemApiInterfaceReadiness };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { dealKeys } from './chunk-SB3IHM5Y.js';
|
|
2
|
+
import { showApiErrorNotification } from './chunk-ICHDIVQO.js';
|
|
3
|
+
import { APIClientError } from './chunk-A2SB32YV.js';
|
|
4
|
+
import { useElevasisServices } from './chunk-BI5VDO2K.js';
|
|
5
|
+
import { useQuery, useQueryClient, useMutation } from '@tanstack/react-query';
|
|
6
|
+
|
|
7
|
+
function useDealDetail(acqDealId) {
|
|
8
|
+
const { apiRequest, isReady, workOSOrganizationId } = useElevasisServices();
|
|
9
|
+
return useQuery({
|
|
10
|
+
queryKey: ["deal-detail", workOSOrganizationId, acqDealId],
|
|
11
|
+
queryFn: async () => {
|
|
12
|
+
if (!acqDealId) return null;
|
|
13
|
+
try {
|
|
14
|
+
return await apiRequest(`/deals/${acqDealId}`);
|
|
15
|
+
} catch (err) {
|
|
16
|
+
if (err instanceof APIClientError && err.statusCode === 404) return null;
|
|
17
|
+
throw err;
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
enabled: isReady && !!acqDealId
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function useExecuteAction({ dealId }) {
|
|
24
|
+
const { apiRequest, workOSOrganizationId } = useElevasisServices();
|
|
25
|
+
const queryClient = useQueryClient();
|
|
26
|
+
return useMutation({
|
|
27
|
+
mutationFn: async ({ key, payload }) => {
|
|
28
|
+
await apiRequest(`/deals/${dealId}/actions/${encodeURIComponent(key)}`, {
|
|
29
|
+
method: "POST",
|
|
30
|
+
body: JSON.stringify({ payload })
|
|
31
|
+
});
|
|
32
|
+
},
|
|
33
|
+
onSuccess: () => {
|
|
34
|
+
queryClient.invalidateQueries({ queryKey: dealKeys.lists() });
|
|
35
|
+
queryClient.invalidateQueries({ queryKey: dealKeys.summaries() });
|
|
36
|
+
queryClient.invalidateQueries({ queryKey: ["deal-detail", workOSOrganizationId, dealId] });
|
|
37
|
+
},
|
|
38
|
+
onError: (error) => {
|
|
39
|
+
queryClient.invalidateQueries({ queryKey: dealKeys.all });
|
|
40
|
+
showApiErrorNotification(error);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export { useDealDetail, useExecuteAction };
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
+
import { useProjectRealtime, useProjectActivities } from './chunk-DTEGVSJ6.js';
|
|
2
|
+
import { useCreateTask, useCreateMilestone, useProjectMilestones, useUpdateTask, useProjects, useDeleteProject, useProject, useProjectNotes, useUpdateMilestone, useCreateNote } from './chunk-IYATYH5I.js';
|
|
3
|
+
import { useTableSort, sortData } from './chunk-NYIIRZSA.js';
|
|
4
|
+
import { useTableSelection } from './chunk-WDBNW44Z.js';
|
|
1
5
|
import { milestoneStatusColors, formatStatusLabel, taskTypeColors, taskStatusColors, projectStatusColors, calculateProgress, noteTypeColors } from './chunk-DLR4SDZW.js';
|
|
2
6
|
import { PageContainer } from './chunk-BZZCNLT6.js';
|
|
3
7
|
import { TableSelectionToolbar, SortableHeader } from './chunk-TUMSNGTX.js';
|
|
4
8
|
import { FilterBar } from './chunk-PDHTXPSF.js';
|
|
5
|
-
import { StatusBadge, EmptyState, SubshellContentContainer, PageTitleCaption,
|
|
6
|
-
import { useCreateTask, useCreateMilestone, useProjectMilestones, useUpdateTask, useProjects, useDeleteProject, useProject, useProjectNotes, useUpdateMilestone, useCreateNote } from './chunk-U2H3TIHD.js';
|
|
9
|
+
import { StatusBadge, EmptyState, SubshellContentContainer, PageTitleCaption, usePaginationState, CenteredErrorState, CustomModal, StatCard } from './chunk-SB3IHM5Y.js';
|
|
7
10
|
import { SubshellSidebarSection, SubshellNavItem } from './chunk-MISHPEJX.js';
|
|
8
11
|
import { CardHeader } from './chunk-62GVNH5U.js';
|
|
9
|
-
import { PAGE_SIZE_DEFAULT, formatTimeAgo, formatDate, formatRelativeTime } from './chunk-
|
|
12
|
+
import { PAGE_SIZE_DEFAULT, formatTimeAgo, formatDate, formatRelativeTime } from './chunk-A2SB32YV.js';
|
|
10
13
|
import { useRouterContext } from './chunk-Q7DJKLEN.js';
|
|
11
14
|
import { useState, useMemo } from 'react';
|
|
12
15
|
import { Stack, Text, Group, Checkbox, ActionIcon, TextInput, Button, Modal, Title, Textarea, Select, SimpleGrid, Card, ThemeIcon, RingProgress, Paper, Timeline, Badge, Collapse, Center, Loader, Table, Pagination, Alert, CopyButton, Tooltip, Space, Tabs, Divider, Anchor, Chip, List } from '@mantine/core';
|