@elevasis/ui 2.72.0 → 2.73.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 +114 -20
- package/dist/app/index.js +8 -8
- package/dist/auth/index.js +4 -4
- package/dist/charts/index.js +4 -4
- package/dist/{chunk-A3JHFZDP.js → chunk-3TS5U5BL.js} +1 -1
- package/dist/{chunk-IXBRUIYI.js → chunk-4CW2C5BD.js} +1 -1
- package/dist/{chunk-753MKWFV.js → chunk-5B2ZFO44.js} +1 -1
- package/dist/{chunk-DJWIIPKW.js → chunk-AJOVWB47.js} +3 -3
- package/dist/{chunk-RRS2QR3W.js → chunk-CJ2232PQ.js} +1 -1
- package/dist/{chunk-2454MK7P.js → chunk-ETN3TTRT.js} +7 -7
- package/dist/{chunk-Q3O3WY7Q.js → chunk-IBCEAVB2.js} +33 -13
- package/dist/{chunk-7ESZKTQG.js → chunk-IGBPWD6S.js} +3 -3
- package/dist/{chunk-UZ5JO5TK.js → chunk-JYBJMVNY.js} +1 -1
- package/dist/{chunk-LCHL5SM2.js → chunk-LEPYXLJ2.js} +1 -1
- package/dist/{chunk-LEQGGX2U.js → chunk-LZT2H2MA.js} +4 -4
- package/dist/{chunk-Z2W5VNN3.js → chunk-NHNTX6ZL.js} +1 -1
- package/dist/{chunk-AFBFSXP3.js → chunk-NI37YNRP.js} +4 -4
- package/dist/{chunk-KIDZXZM5.js → chunk-OCVSPAKM.js} +501 -25
- package/dist/{chunk-IMZTRDY2.js → chunk-PQ4B62HH.js} +2 -2
- package/dist/{chunk-SV4M2BUI.js → chunk-SWKAH2YM.js} +52 -20
- package/dist/{chunk-XZIOCB5D.js → chunk-U2H3TIHD.js} +1 -1
- package/dist/{chunk-DKVGO6RJ.js → chunk-Z4ICFQXG.js} +1 -1
- package/dist/{chunk-ZBXCEWKF.js → chunk-ZDKPHFTH.js} +3 -3
- package/dist/components/index.d.ts +305 -22
- package/dist/components/index.js +316 -26
- package/dist/components/navigation/index.js +5 -5
- package/dist/features/auth/index.d.ts +76 -0
- package/dist/features/auth/index.js +6 -6
- package/dist/features/clients/index.js +5 -5
- package/dist/features/content/index.d.ts +494 -31
- package/dist/features/content/index.js +1090 -44
- package/dist/features/crm/index.d.ts +114 -20
- package/dist/features/crm/index.js +6 -6
- package/dist/features/dashboard/index.d.ts +19 -10
- package/dist/features/dashboard/index.js +6 -6
- package/dist/features/delivery/index.d.ts +76 -0
- package/dist/features/delivery/index.js +5 -5
- package/dist/features/knowledge/index.js +4 -4
- package/dist/features/lead-gen/index.d.ts +38 -20
- package/dist/features/lead-gen/index.js +6 -6
- package/dist/features/monitoring/index.js +7 -7
- package/dist/features/monitoring/requests/index.js +5 -5
- package/dist/features/operations/index.d.ts +38 -20
- package/dist/features/operations/index.js +9 -9
- package/dist/features/settings/index.d.ts +76 -0
- package/dist/features/settings/index.js +6 -6
- package/dist/hooks/access/index.js +4 -4
- package/dist/hooks/delivery/index.d.ts +76 -0
- package/dist/hooks/delivery/index.js +2 -2
- package/dist/hooks/index.d.ts +1248 -28
- package/dist/hooks/index.js +4 -4
- package/dist/hooks/operations/command-view/utils/transformCommandViewData.d.ts +19 -10
- package/dist/hooks/published.d.ts +1248 -28
- package/dist/hooks/published.js +4 -4
- package/dist/initialization/index.d.ts +76 -0
- package/dist/knowledge/index.d.ts +38 -20
- package/dist/knowledge/index.js +8 -8
- package/dist/layout/index.js +7 -7
- package/dist/profile/index.d.ts +76 -0
- package/dist/provider/index.d.ts +114 -20
- package/dist/provider/index.js +4 -4
- package/dist/provider/published.d.ts +114 -20
- package/dist/provider/published.js +4 -4
- package/dist/supabase/index.d.ts +149 -0
- package/dist/test-utils/index.js +3 -3
- package/dist/types/index.d.ts +125 -13
- package/dist/utils/index.d.ts +19 -10
- package/dist/utils/index.js +1 -1
- package/package.json +5 -5
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { mantineThemeOverride, createCssVariablesResolver, PresetsProvider } from './chunk-R6NMRXNO.js';
|
|
2
2
|
import { PRESETS, getPreset, AppBackground, generateShades } from './chunk-RBGVNPA6.js';
|
|
3
3
|
import { useSupabase } from './chunk-MKH2KOAO.js';
|
|
4
|
-
import { HTTP_HEADERS, ApiClientProvider, useApiClient } from './chunk-
|
|
5
|
-
import { showApiErrorNotification, showSuccessNotification, projectKeys, noteKeys, taskKeys, milestoneKeys } from './chunk-
|
|
4
|
+
import { HTTP_HEADERS, ApiClientProvider, useApiClient } from './chunk-NHNTX6ZL.js';
|
|
5
|
+
import { showApiErrorNotification, showSuccessNotification, projectKeys, noteKeys, taskKeys, milestoneKeys } from './chunk-U2H3TIHD.js';
|
|
6
6
|
import { topbarHeight, sidebarTransitionDuration, sidebarBottomSectionHeight, SubshellSidebarSection, sidebarItemPadding, sidebarItemHeight, sidebarIconSize, sidebarIconStroke, sidebarIconInnerSize, SubshellNavItem } from './chunk-MISHPEJX.js';
|
|
7
7
|
import { CardHeader } from './chunk-62GVNH5U.js';
|
|
8
8
|
import { InitializationContext, useInitialization, InitializationProvider } from './chunk-P45GQ3ZW.js';
|
|
@@ -12,7 +12,7 @@ import { getStatusIcon } from './chunk-BLXJEIQS.js';
|
|
|
12
12
|
import { invalidateOrgScopedQueries, OrganizationProvider } from './chunk-UD657ICS.js';
|
|
13
13
|
import { OrganizationContext, useOrganization } from './chunk-DD3CCMCZ.js';
|
|
14
14
|
import { ProfileProvider } from './chunk-RT4KRGZT.js';
|
|
15
|
-
import { LabelSchema, DescriptionSchema, PathSchema, ModelIdSchema, IconNameSchema, SystemLifecycleSchema, OntologyIdSchema, SystemPathSchema, ActionInvocationSchema, SystemIdSchema, NodeIdStringSchema, JsonValueSchema, SystemInterfaceRefSchema, EntitiesDomainSchema, ActionsDomainSchema, DEFAULT_ORGANIZATION_MODEL_ACTIONS, OntologyScopeSchema, DEFAULT_ONTOLOGY_SCOPE, SystemsDomainSchema, DEFAULT_ORGANIZATION_MODEL_SYSTEMS, formatOntologyId, listResolvedOntologyRecords, getErrorInfo, getErrorTitle, formatErrorMessage, compileOrganizationOntology, listAllSystems, ontologyGraphNodeId, parseOntologyId, getSystem, STALE_TIME_DEFAULT, GC_TIME_SHORT, STALE_TIME_MONITORING, getResourceIcon, formatTimeAgo, APIClientError, getResourcesForSystem, STALE_TIME_ADMIN, GC_TIME_MEDIUM, formatRelativeTime, PAGE_SIZE_DEFAULT, devOnlyFor, topLevel, parentOf, ancestorsOf, childrenOf, findById, findByPath, resolveSystemConfig, defaultPathFor } from './chunk-
|
|
15
|
+
import { LabelSchema, DescriptionSchema, PathSchema, ModelIdSchema, IconNameSchema, SystemLifecycleSchema, OntologyIdSchema, SystemPathSchema, ActionInvocationSchema, SystemIdSchema, NodeIdStringSchema, JsonValueSchema, SystemInterfaceRefSchema, EntitiesDomainSchema, ActionsDomainSchema, DEFAULT_ORGANIZATION_MODEL_ACTIONS, OntologyScopeSchema, DEFAULT_ONTOLOGY_SCOPE, SystemsDomainSchema, DEFAULT_ORGANIZATION_MODEL_SYSTEMS, formatOntologyId, listResolvedOntologyRecords, getErrorInfo, getErrorTitle, formatErrorMessage, compileOrganizationOntology, listAllSystems, ontologyGraphNodeId, parseOntologyId, getSystem, STALE_TIME_DEFAULT, GC_TIME_SHORT, STALE_TIME_MONITORING, getResourceIcon, formatTimeAgo, APIClientError, getResourcesForSystem, STALE_TIME_ADMIN, GC_TIME_MEDIUM, formatRelativeTime, PAGE_SIZE_DEFAULT, devOnlyFor, topLevel, parentOf, ancestorsOf, childrenOf, findById, findByPath, resolveSystemConfig, defaultPathFor } from './chunk-IBCEAVB2.js';
|
|
16
16
|
import { getTimeRangeLabel, getTimeRangeDates, formatBucketTime, REFETCH_INTERVAL_DASHBOARD, WS_MAX_RETRIES_BEFORE_ERROR, WS_RECONNECT_BASE_DELAY, WS_RECONNECT_MAX_DELAY, REFETCH_INTERVAL_RUNNING, debounce } from './chunk-Y6I3IC45.js';
|
|
17
17
|
import { ResourceStatusColors } from './chunk-6SSQGWK7.js';
|
|
18
18
|
import { ElevasisServiceContext, useElevasisServices, ElevasisServiceProvider } from './chunk-BI5VDO2K.js';
|
|
@@ -2094,7 +2094,7 @@ function deriveActions(deal, actions = []) {
|
|
|
2094
2094
|
return actions.filter((a) => a.isAvailableFor(deal)).map(({ key, label, payloadSchema }) => ({ key, label, payloadSchema }));
|
|
2095
2095
|
}
|
|
2096
2096
|
var ContentPipelineStepActorSchema = z.enum(["workflow", "agent", "vendor"]);
|
|
2097
|
-
var ContentPipelineStepReviewModeSchema = z.enum(["
|
|
2097
|
+
var ContentPipelineStepReviewModeSchema = z.enum(["none", "required"]);
|
|
2098
2098
|
var ContentPayloadFieldTypeSchema = z.enum(["string", "text", "number", "boolean", "url", "string-array"]);
|
|
2099
2099
|
var ContentPayloadFieldDeclarationSchema = z.object({
|
|
2100
2100
|
key: z.string().trim().min(1).max(200),
|
|
@@ -2143,6 +2143,10 @@ var ContentPipelineStepDeclarationSchema = z.object({
|
|
|
2143
2143
|
function resolveContentWorkspaceRoute(pipeline, step) {
|
|
2144
2144
|
return step?.workspaceRoute ?? pipeline?.workspaceRoute;
|
|
2145
2145
|
}
|
|
2146
|
+
function resolveContentReviewVenue(pipeline, step) {
|
|
2147
|
+
if (step.reviewMode === "none") return "none";
|
|
2148
|
+
return resolveContentWorkspaceRoute(pipeline, step) !== void 0 ? "workspace" : "queue";
|
|
2149
|
+
}
|
|
2146
2150
|
z.object({
|
|
2147
2151
|
label: z.string().trim().min(1).max(160).optional(),
|
|
2148
2152
|
description: z.string().trim().min(1).max(2e3).optional(),
|
|
@@ -2321,7 +2325,8 @@ function getLeadGenStageCatalog(model) {
|
|
|
2321
2325
|
);
|
|
2322
2326
|
}
|
|
2323
2327
|
var CONTENT_SYSTEM_PATH = "content";
|
|
2324
|
-
function contentStepsFromCatalog(stepCatalog) {
|
|
2328
|
+
function contentStepsFromCatalog(stepCatalog, pipelineWorkspaceRoute) {
|
|
2329
|
+
const pipeline = { workspaceRoute: pipelineWorkspaceRoute };
|
|
2325
2330
|
return entriesOf(stepCatalog).flatMap(([stepId, entry]) => {
|
|
2326
2331
|
const parsed = ContentPipelineStepDeclarationSchema.safeParse(entry);
|
|
2327
2332
|
if (!parsed.success) return [];
|
|
@@ -2333,6 +2338,7 @@ function contentStepsFromCatalog(stepCatalog) {
|
|
|
2333
2338
|
order: parsed.data.order ?? Number.MAX_SAFE_INTEGER,
|
|
2334
2339
|
actor: parsed.data.actor,
|
|
2335
2340
|
reviewMode: parsed.data.reviewMode,
|
|
2341
|
+
reviewVenue: resolveContentReviewVenue(pipeline, parsed.data),
|
|
2336
2342
|
...parsed.data.advancesTo !== void 0 ? { advancesTo: parsed.data.advancesTo } : {},
|
|
2337
2343
|
...parsed.data.actionId !== void 0 ? { actionId: parsed.data.actionId } : {},
|
|
2338
2344
|
...parsed.data.workspaceRoute !== void 0 ? { workspaceRoute: parsed.data.workspaceRoute } : {},
|
|
@@ -2350,10 +2356,10 @@ function getContentBuildTemplates(model) {
|
|
|
2350
2356
|
);
|
|
2351
2357
|
return catalogs.filter((catalog) => catalog.kind === "content-pipeline").flatMap(
|
|
2352
2358
|
(catalog) => entriesOf(catalog).map(([templateId, templateEntry]) => {
|
|
2359
|
+
const workspaceRoute = ContentWorkspaceRouteSchema.safeParse(templateEntry.workspaceRoute);
|
|
2353
2360
|
const stepCatalogId = stringValue(templateEntry.stepCatalog);
|
|
2354
2361
|
const stepCatalog = stepCatalogId !== void 0 ? stepCatalogs.get(stepCatalogId) : void 0;
|
|
2355
|
-
const steps = stepCatalog === void 0 ? [] : contentStepsFromCatalog(stepCatalog);
|
|
2356
|
-
const workspaceRoute = ContentWorkspaceRouteSchema.safeParse(templateEntry.workspaceRoute);
|
|
2362
|
+
const steps = stepCatalog === void 0 ? [] : contentStepsFromCatalog(stepCatalog, workspaceRoute.success ? workspaceRoute.data : void 0);
|
|
2357
2363
|
return {
|
|
2358
2364
|
order: numberValue(templateEntry.order, Number.MAX_SAFE_INTEGER),
|
|
2359
2365
|
template: {
|
|
@@ -2381,7 +2387,8 @@ function getContentStageCatalog(model) {
|
|
|
2381
2387
|
label: stringValue(entry.label) ?? entryId,
|
|
2382
2388
|
description: stringValue(entry.description) ?? "",
|
|
2383
2389
|
order: numberValue(entry.order),
|
|
2384
|
-
...stringValue(entry.color) ? { color: stringValue(entry.color) } : {}
|
|
2390
|
+
...stringValue(entry.color) ? { color: stringValue(entry.color) } : {},
|
|
2391
|
+
...stringValue(entry.semanticClass) ? { semanticClass: stringValue(entry.semanticClass) } : {}
|
|
2385
2392
|
};
|
|
2386
2393
|
}
|
|
2387
2394
|
}
|
|
@@ -8070,6 +8077,148 @@ function useTransitionItem() {
|
|
|
8070
8077
|
});
|
|
8071
8078
|
}
|
|
8072
8079
|
|
|
8080
|
+
// src/hooks/cloud-storage/queryKeys.ts
|
|
8081
|
+
var cloudStorageKeys = {
|
|
8082
|
+
all: ["cloud-storage"],
|
|
8083
|
+
folders: () => [...cloudStorageKeys.all, "folders"],
|
|
8084
|
+
folder: (organizationId, filters) => [...cloudStorageKeys.folders(), organizationId, filters],
|
|
8085
|
+
thumbnails: () => [...cloudStorageKeys.all, "thumbnails"],
|
|
8086
|
+
/**
|
|
8087
|
+
* One key per resolved batch (at most `THUMBNAIL_BATCH_SIZE` ids) -- `useQueries`
|
|
8088
|
+
* issues one query per batch, so the batch's own id list is part of its key.
|
|
8089
|
+
*/
|
|
8090
|
+
thumbnailBatch: (organizationId, credentialName, batchFileIds) => [...cloudStorageKeys.thumbnails(), organizationId, credentialName, batchFileIds],
|
|
8091
|
+
temporaryLinks: () => [...cloudStorageKeys.all, "temporary-links"],
|
|
8092
|
+
/**
|
|
8093
|
+
* Keyed per file. Shared by every consumer that needs the original's bytes --
|
|
8094
|
+
* measuring, cropping, and previewing all read this one key, so a selected
|
|
8095
|
+
* image resolves one link and downloads once rather than three times.
|
|
8096
|
+
*/
|
|
8097
|
+
temporaryLinkFor: (organizationId, credentialName, fileId) => [...cloudStorageKeys.temporaryLinks(), organizationId, credentialName, fileId],
|
|
8098
|
+
imageDimensions: () => [...cloudStorageKeys.all, "image-dimensions"],
|
|
8099
|
+
/**
|
|
8100
|
+
* Keyed per file rather than per set -- dimensions are measured one file at a time
|
|
8101
|
+
* and a measured file stays measured no matter what else is selected alongside it.
|
|
8102
|
+
*/
|
|
8103
|
+
imageDimensionsFor: (organizationId, credentialName, fileId) => [...cloudStorageKeys.imageDimensions(), organizationId, credentialName, fileId]
|
|
8104
|
+
};
|
|
8105
|
+
function useCloudStorageFolder(params) {
|
|
8106
|
+
const { apiRequest, isReady, workOSOrganizationId } = useElevasisServices();
|
|
8107
|
+
const { credentialName, folderPath, cursor } = params;
|
|
8108
|
+
return useQuery({
|
|
8109
|
+
queryKey: cloudStorageKeys.folder(workOSOrganizationId ?? void 0, { credentialName, folderPath, cursor }),
|
|
8110
|
+
queryFn: async () => {
|
|
8111
|
+
const searchParams = new URLSearchParams({ credentialName });
|
|
8112
|
+
if (folderPath) searchParams.set("folderPath", folderPath);
|
|
8113
|
+
if (cursor) searchParams.set("cursor", cursor);
|
|
8114
|
+
return apiRequest(`/integrations/dropbox/files?${searchParams.toString()}`);
|
|
8115
|
+
},
|
|
8116
|
+
enabled: isReady && !!credentialName
|
|
8117
|
+
});
|
|
8118
|
+
}
|
|
8119
|
+
var THUMBNAIL_BATCH_SIZE = 25;
|
|
8120
|
+
function chunkIntoBatches(items, size) {
|
|
8121
|
+
if (size <= 0) {
|
|
8122
|
+
return items.length ? [items] : [];
|
|
8123
|
+
}
|
|
8124
|
+
const batches = [];
|
|
8125
|
+
for (let i = 0; i < items.length; i += size) {
|
|
8126
|
+
batches.push(items.slice(i, i + size));
|
|
8127
|
+
}
|
|
8128
|
+
return batches;
|
|
8129
|
+
}
|
|
8130
|
+
function mergeThumbnailBatches(batches) {
|
|
8131
|
+
const thumbnails = {};
|
|
8132
|
+
let connected = false;
|
|
8133
|
+
for (const batch of batches) {
|
|
8134
|
+
if (!batch) continue;
|
|
8135
|
+
Object.assign(thumbnails, batch.thumbnails);
|
|
8136
|
+
if (batch.connected) connected = true;
|
|
8137
|
+
}
|
|
8138
|
+
return { thumbnails, connected };
|
|
8139
|
+
}
|
|
8140
|
+
function useCloudStorageThumbnails(credentialName, fileIds) {
|
|
8141
|
+
const { apiRequest, isReady, workOSOrganizationId } = useElevasisServices();
|
|
8142
|
+
const batches = chunkIntoBatches(fileIds, THUMBNAIL_BATCH_SIZE);
|
|
8143
|
+
const results = useQueries({
|
|
8144
|
+
queries: batches.map((batchIds) => ({
|
|
8145
|
+
queryKey: cloudStorageKeys.thumbnailBatch(workOSOrganizationId ?? void 0, credentialName, batchIds),
|
|
8146
|
+
queryFn: async () => {
|
|
8147
|
+
const searchParams = new URLSearchParams({ credentialName, ids: batchIds.join(",") });
|
|
8148
|
+
return apiRequest(
|
|
8149
|
+
`/integrations/dropbox/thumbnails?${searchParams.toString()}`
|
|
8150
|
+
);
|
|
8151
|
+
},
|
|
8152
|
+
enabled: isReady && !!credentialName && batchIds.length > 0
|
|
8153
|
+
}))
|
|
8154
|
+
});
|
|
8155
|
+
const { thumbnails, connected } = mergeThumbnailBatches(results.map((result) => result.data));
|
|
8156
|
+
return {
|
|
8157
|
+
thumbnails,
|
|
8158
|
+
connected,
|
|
8159
|
+
isLoading: results.some((result) => result.isLoading)
|
|
8160
|
+
};
|
|
8161
|
+
}
|
|
8162
|
+
var TEMPORARY_LINK_STALE_MS = 60 * 60 * 1e3;
|
|
8163
|
+
function useCloudStorageTemporaryLinks(credentialName, fileIds) {
|
|
8164
|
+
const { apiRequest, isReady, workOSOrganizationId } = useElevasisServices();
|
|
8165
|
+
const results = useQueries({
|
|
8166
|
+
queries: fileIds.map((fileId) => ({
|
|
8167
|
+
queryKey: cloudStorageKeys.temporaryLinkFor(workOSOrganizationId ?? void 0, credentialName, fileId),
|
|
8168
|
+
queryFn: async () => {
|
|
8169
|
+
const searchParams = new URLSearchParams({ credentialName, id: fileId });
|
|
8170
|
+
const response = await apiRequest(
|
|
8171
|
+
`/integrations/dropbox/temporary-link?${searchParams.toString()}`
|
|
8172
|
+
);
|
|
8173
|
+
return response.link;
|
|
8174
|
+
},
|
|
8175
|
+
enabled: isReady && !!credentialName && !!fileId,
|
|
8176
|
+
staleTime: TEMPORARY_LINK_STALE_MS
|
|
8177
|
+
}))
|
|
8178
|
+
});
|
|
8179
|
+
const links = {};
|
|
8180
|
+
results.forEach((result, index) => {
|
|
8181
|
+
const fileId = fileIds[index];
|
|
8182
|
+
if (fileId !== void 0 && result.data !== void 0) links[fileId] = result.data;
|
|
8183
|
+
});
|
|
8184
|
+
return { links, isLoading: results.some((result) => result.isLoading) };
|
|
8185
|
+
}
|
|
8186
|
+
|
|
8187
|
+
// src/hooks/cloud-storage/useCloudStorageImageDimensions.ts
|
|
8188
|
+
function measureImageDimensions(url) {
|
|
8189
|
+
return new Promise((resolve) => {
|
|
8190
|
+
const image = new Image();
|
|
8191
|
+
image.onload = () => resolve({ width: image.naturalWidth, height: image.naturalHeight });
|
|
8192
|
+
image.onerror = () => resolve(null);
|
|
8193
|
+
image.src = url;
|
|
8194
|
+
});
|
|
8195
|
+
}
|
|
8196
|
+
function useCloudStorageImageDimensions(credentialName, fileIds) {
|
|
8197
|
+
const { isReady, workOSOrganizationId } = useElevasisServices();
|
|
8198
|
+
const { links, isLoading: isResolvingLinks } = useCloudStorageTemporaryLinks(credentialName, fileIds);
|
|
8199
|
+
const results = useQueries({
|
|
8200
|
+
queries: fileIds.map((fileId) => {
|
|
8201
|
+
const link = links[fileId];
|
|
8202
|
+
return {
|
|
8203
|
+
queryKey: cloudStorageKeys.imageDimensionsFor(workOSOrganizationId ?? void 0, credentialName, fileId),
|
|
8204
|
+
queryFn: async () => link ? measureImageDimensions(link) : null,
|
|
8205
|
+
// `link === undefined` means the link query has not settled; `null` means it
|
|
8206
|
+
// settled with nothing, which is a measurable outcome (`null` dimensions).
|
|
8207
|
+
enabled: isReady && !!credentialName && !!fileId && link !== void 0,
|
|
8208
|
+
// The underlying file does not change size, so re-measuring on every remount
|
|
8209
|
+
// would re-download the original for a value that cannot have moved.
|
|
8210
|
+
staleTime: 60 * 60 * 1e3
|
|
8211
|
+
};
|
|
8212
|
+
})
|
|
8213
|
+
});
|
|
8214
|
+
const dimensions = {};
|
|
8215
|
+
results.forEach((result, index) => {
|
|
8216
|
+
const fileId = fileIds[index];
|
|
8217
|
+
if (fileId !== void 0 && result.data !== void 0) dimensions[fileId] = result.data;
|
|
8218
|
+
});
|
|
8219
|
+
return { dimensions, isLoading: isResolvingLinks || results.some((result) => result.isLoading) };
|
|
8220
|
+
}
|
|
8221
|
+
|
|
8073
8222
|
// src/features/crm/workbench/constants.ts
|
|
8074
8223
|
var SAVED_VIEW_PRESETS = [
|
|
8075
8224
|
{
|
|
@@ -9804,6 +9953,7 @@ function useSessionWebSocket(sessionId, apiUrl) {
|
|
|
9804
9953
|
const wsRef = useRef(null);
|
|
9805
9954
|
const retryCountRef = useRef(0);
|
|
9806
9955
|
const reconnectTimeoutRef = useRef(null);
|
|
9956
|
+
const connectionEpochRef = useRef(0);
|
|
9807
9957
|
const { getAccessToken } = useAuthContext();
|
|
9808
9958
|
const { currentWorkOSOrganizationId, currentSupabaseOrganizationId } = useOrganization();
|
|
9809
9959
|
const queryClient = useQueryClient();
|
|
@@ -9825,10 +9975,14 @@ function useSessionWebSocket(sessionId, apiUrl) {
|
|
|
9825
9975
|
if (wsRef.current?.readyState === WebSocket.OPEN || wsRef.current?.readyState === WebSocket.CONNECTING) {
|
|
9826
9976
|
return;
|
|
9827
9977
|
}
|
|
9978
|
+
const epoch = connectionEpochRef.current;
|
|
9828
9979
|
const token = await getAccessTokenRef.current();
|
|
9829
9980
|
if (!token) {
|
|
9830
9981
|
return;
|
|
9831
9982
|
}
|
|
9983
|
+
if (epoch !== connectionEpochRef.current) {
|
|
9984
|
+
return;
|
|
9985
|
+
}
|
|
9832
9986
|
const orgId = currentWorkOSOrgIdRef.current;
|
|
9833
9987
|
const wsUrl = `${getWsUrl(apiUrl)}/ws/sessions/${sessionId}?token=${token}&orgId=${orgId}`;
|
|
9834
9988
|
const ws = new WebSocket(wsUrl);
|
|
@@ -9920,11 +10074,18 @@ function useSessionWebSocket(sessionId, apiUrl) {
|
|
|
9920
10074
|
connect();
|
|
9921
10075
|
}
|
|
9922
10076
|
return () => {
|
|
10077
|
+
connectionEpochRef.current += 1;
|
|
9923
10078
|
if (reconnectTimeoutRef.current) {
|
|
9924
10079
|
clearTimeout(reconnectTimeoutRef.current);
|
|
10080
|
+
reconnectTimeoutRef.current = null;
|
|
9925
10081
|
}
|
|
9926
|
-
|
|
9927
|
-
|
|
10082
|
+
const ws = wsRef.current;
|
|
10083
|
+
if (ws) {
|
|
10084
|
+
ws.onopen = null;
|
|
10085
|
+
ws.onmessage = null;
|
|
10086
|
+
ws.onerror = null;
|
|
10087
|
+
ws.onclose = null;
|
|
10088
|
+
ws.close();
|
|
9928
10089
|
wsRef.current = null;
|
|
9929
10090
|
}
|
|
9930
10091
|
};
|
|
@@ -12316,6 +12477,21 @@ var contentKeys = {
|
|
|
12316
12477
|
itemsList: (organizationId, filters) => [...contentKeys.items(), "list", organizationId, filters],
|
|
12317
12478
|
itemDetail: (organizationId, itemId) => [...contentKeys.items(), "detail", organizationId, itemId],
|
|
12318
12479
|
itemAttempts: (organizationId, itemId) => [...contentKeys.items(), "attempts", organizationId, itemId],
|
|
12480
|
+
/**
|
|
12481
|
+
* One item's ordered source-asset membership (`content_item_source_assets`).
|
|
12482
|
+
*
|
|
12483
|
+
* Nested under `items()` on purpose, matching `itemAttempts`: membership is a
|
|
12484
|
+
* property of the item, and every item read that expands `sourceAssets` goes
|
|
12485
|
+
* stale for exactly the same writes. That makes `contentKeys.items()` a
|
|
12486
|
+
* prefix that reaches this key, the item list, and the item detail in one
|
|
12487
|
+
* invalidation -- which is why the membership mutations invalidate both this
|
|
12488
|
+
* key (the direct read) and `items()` (every reader carrying the expansion).
|
|
12489
|
+
*
|
|
12490
|
+
* Distinct from `sourceAssets()` below, which keys the assets themselves.
|
|
12491
|
+
* A membership row carries `sourceAssetId` and no display fields, so the two
|
|
12492
|
+
* caches are never interchangeable.
|
|
12493
|
+
*/
|
|
12494
|
+
itemSourceAssets: (organizationId, itemId) => [...contentKeys.items(), "source-assets", organizationId, itemId],
|
|
12319
12495
|
distributions: () => [...contentKeys.all, "distributions"],
|
|
12320
12496
|
distributionsList: (organizationId, filters) => [...contentKeys.distributions(), "list", organizationId, filters],
|
|
12321
12497
|
distributionDetail: (organizationId, distributionId) => [...contentKeys.distributions(), "detail", organizationId, distributionId],
|
|
@@ -12414,6 +12590,29 @@ function useUpdateContentItem() {
|
|
|
12414
12590
|
}
|
|
12415
12591
|
});
|
|
12416
12592
|
}
|
|
12593
|
+
function useCreateContentDistribution() {
|
|
12594
|
+
const { apiRequest, workOSOrganizationId } = useElevasisServices();
|
|
12595
|
+
const queryClient = useQueryClient();
|
|
12596
|
+
return useMutation({
|
|
12597
|
+
mutationFn: async (distribution) => {
|
|
12598
|
+
return apiRequest("/content/distributions", {
|
|
12599
|
+
method: "POST",
|
|
12600
|
+
body: JSON.stringify(distribution)
|
|
12601
|
+
});
|
|
12602
|
+
},
|
|
12603
|
+
onSuccess: (_data, { contentItemId }) => {
|
|
12604
|
+
void queryClient.invalidateQueries({ queryKey: contentKeys.distributions() });
|
|
12605
|
+
void queryClient.invalidateQueries({ queryKey: contentKeys.items() });
|
|
12606
|
+
void queryClient.invalidateQueries({
|
|
12607
|
+
queryKey: contentKeys.itemDetail(workOSOrganizationId ?? void 0, contentItemId)
|
|
12608
|
+
});
|
|
12609
|
+
},
|
|
12610
|
+
onError: (error) => {
|
|
12611
|
+
console.error("Failed to create content distribution:", error);
|
|
12612
|
+
showApiErrorNotification(error);
|
|
12613
|
+
}
|
|
12614
|
+
});
|
|
12615
|
+
}
|
|
12417
12616
|
function useUpdateContentDistribution() {
|
|
12418
12617
|
const { apiRequest, workOSOrganizationId } = useElevasisServices();
|
|
12419
12618
|
const queryClient = useQueryClient();
|
|
@@ -12487,6 +12686,25 @@ function useContentSourceAsset(sourceAssetId) {
|
|
|
12487
12686
|
enabled: isReady && !!sourceAssetId
|
|
12488
12687
|
});
|
|
12489
12688
|
}
|
|
12689
|
+
function useCreateContentItem() {
|
|
12690
|
+
const { apiRequest } = useElevasisServices();
|
|
12691
|
+
const queryClient = useQueryClient();
|
|
12692
|
+
return useMutation({
|
|
12693
|
+
mutationFn: async (item) => {
|
|
12694
|
+
return apiRequest("/content/items", {
|
|
12695
|
+
method: "POST",
|
|
12696
|
+
body: JSON.stringify(item)
|
|
12697
|
+
});
|
|
12698
|
+
},
|
|
12699
|
+
onSuccess: () => {
|
|
12700
|
+
void queryClient.invalidateQueries({ queryKey: contentKeys.items() });
|
|
12701
|
+
},
|
|
12702
|
+
onError: (error) => {
|
|
12703
|
+
console.error("Failed to create content item:", error);
|
|
12704
|
+
showApiErrorNotification(error);
|
|
12705
|
+
}
|
|
12706
|
+
});
|
|
12707
|
+
}
|
|
12490
12708
|
function useCreateContentSourceAsset() {
|
|
12491
12709
|
const { apiRequest } = useElevasisServices();
|
|
12492
12710
|
const queryClient = useQueryClient();
|
|
@@ -12531,6 +12749,154 @@ function useUpdateContentSourceAsset() {
|
|
|
12531
12749
|
}
|
|
12532
12750
|
});
|
|
12533
12751
|
}
|
|
12752
|
+
function useContentItemSourceAssets(itemId) {
|
|
12753
|
+
const { apiRequest, isReady, workOSOrganizationId } = useElevasisServices();
|
|
12754
|
+
return useQuery({
|
|
12755
|
+
queryKey: contentKeys.itemSourceAssets(workOSOrganizationId ?? void 0, itemId),
|
|
12756
|
+
queryFn: async () => {
|
|
12757
|
+
return apiRequest(`/content/items/${itemId}/source-assets`);
|
|
12758
|
+
},
|
|
12759
|
+
enabled: isReady && !!itemId
|
|
12760
|
+
});
|
|
12761
|
+
}
|
|
12762
|
+
function readItemSourceAssets(item) {
|
|
12763
|
+
const sourceAssets = item?.sourceAssets;
|
|
12764
|
+
if (sourceAssets === void 0) return { expanded: false, sourceAssets: void 0 };
|
|
12765
|
+
return { expanded: true, sourceAssets };
|
|
12766
|
+
}
|
|
12767
|
+
function pickCoverSourceAsset(memberships) {
|
|
12768
|
+
if (!memberships || memberships.length === 0) return void 0;
|
|
12769
|
+
return memberships.reduce((lowest, candidate) => candidate.position < lowest.position ? candidate : lowest);
|
|
12770
|
+
}
|
|
12771
|
+
function joinSourceAssetDetails(memberships, assets) {
|
|
12772
|
+
const byId = /* @__PURE__ */ new Map();
|
|
12773
|
+
for (const asset of assets) {
|
|
12774
|
+
if (asset) byId.set(asset.id, asset);
|
|
12775
|
+
}
|
|
12776
|
+
return memberships.map((membership) => ({
|
|
12777
|
+
membership,
|
|
12778
|
+
asset: byId.get(membership.sourceAssetId)
|
|
12779
|
+
}));
|
|
12780
|
+
}
|
|
12781
|
+
function useContentItemSourceAssetDetails(itemId) {
|
|
12782
|
+
const { apiRequest, isReady, workOSOrganizationId } = useElevasisServices();
|
|
12783
|
+
const membershipQuery = useContentItemSourceAssets(itemId);
|
|
12784
|
+
const memberships = membershipQuery.data?.data ?? [];
|
|
12785
|
+
const assetQueries = useQueries({
|
|
12786
|
+
queries: memberships.map((membership) => ({
|
|
12787
|
+
queryKey: contentKeys.sourceAssetDetail(workOSOrganizationId ?? void 0, membership.sourceAssetId),
|
|
12788
|
+
queryFn: async () => {
|
|
12789
|
+
return apiRequest(`/content/source-assets/${membership.sourceAssetId}`);
|
|
12790
|
+
},
|
|
12791
|
+
enabled: isReady
|
|
12792
|
+
}))
|
|
12793
|
+
});
|
|
12794
|
+
return {
|
|
12795
|
+
memberships: joinSourceAssetDetails(
|
|
12796
|
+
memberships,
|
|
12797
|
+
assetQueries.map((query) => query.data)
|
|
12798
|
+
),
|
|
12799
|
+
isLoading: membershipQuery.isLoading || assetQueries.some((query) => query.isLoading),
|
|
12800
|
+
isMembershipLoaded: membershipQuery.isSuccess
|
|
12801
|
+
};
|
|
12802
|
+
}
|
|
12803
|
+
function useAddContentItemSourceAsset() {
|
|
12804
|
+
const { apiRequest, workOSOrganizationId } = useElevasisServices();
|
|
12805
|
+
const queryClient = useQueryClient();
|
|
12806
|
+
return useMutation({
|
|
12807
|
+
mutationFn: async ({
|
|
12808
|
+
itemId,
|
|
12809
|
+
membership
|
|
12810
|
+
}) => {
|
|
12811
|
+
return apiRequest(`/content/items/${itemId}/source-assets`, {
|
|
12812
|
+
method: "POST",
|
|
12813
|
+
body: JSON.stringify(membership)
|
|
12814
|
+
});
|
|
12815
|
+
},
|
|
12816
|
+
onSuccess: (_data, { itemId }) => {
|
|
12817
|
+
void queryClient.invalidateQueries({
|
|
12818
|
+
queryKey: contentKeys.itemSourceAssets(workOSOrganizationId ?? void 0, itemId)
|
|
12819
|
+
});
|
|
12820
|
+
void queryClient.invalidateQueries({ queryKey: contentKeys.items() });
|
|
12821
|
+
},
|
|
12822
|
+
onError: (error) => {
|
|
12823
|
+
console.error("Failed to add content item source asset:", error);
|
|
12824
|
+
showApiErrorNotification(error);
|
|
12825
|
+
}
|
|
12826
|
+
});
|
|
12827
|
+
}
|
|
12828
|
+
function useRemoveContentItemSourceAsset() {
|
|
12829
|
+
const { apiRequest, workOSOrganizationId } = useElevasisServices();
|
|
12830
|
+
const queryClient = useQueryClient();
|
|
12831
|
+
return useMutation({
|
|
12832
|
+
mutationFn: async ({ itemId, sourceAssetId }) => {
|
|
12833
|
+
await apiRequest(`/content/items/${itemId}/source-assets/${sourceAssetId}`, {
|
|
12834
|
+
method: "DELETE"
|
|
12835
|
+
});
|
|
12836
|
+
},
|
|
12837
|
+
onSuccess: (_data, { itemId }) => {
|
|
12838
|
+
void queryClient.invalidateQueries({
|
|
12839
|
+
queryKey: contentKeys.itemSourceAssets(workOSOrganizationId ?? void 0, itemId)
|
|
12840
|
+
});
|
|
12841
|
+
void queryClient.invalidateQueries({ queryKey: contentKeys.items() });
|
|
12842
|
+
},
|
|
12843
|
+
onError: (error) => {
|
|
12844
|
+
console.error("Failed to remove content item source asset:", error);
|
|
12845
|
+
showApiErrorNotification(error);
|
|
12846
|
+
}
|
|
12847
|
+
});
|
|
12848
|
+
}
|
|
12849
|
+
function useReorderContentItemSourceAssets() {
|
|
12850
|
+
const { apiRequest, workOSOrganizationId } = useElevasisServices();
|
|
12851
|
+
const queryClient = useQueryClient();
|
|
12852
|
+
return useMutation({
|
|
12853
|
+
mutationFn: async ({
|
|
12854
|
+
itemId,
|
|
12855
|
+
orderedAssetIds
|
|
12856
|
+
}) => {
|
|
12857
|
+
return apiRequest(`/content/items/${itemId}/source-assets/reorder`, {
|
|
12858
|
+
method: "POST",
|
|
12859
|
+
body: JSON.stringify({ orderedAssetIds })
|
|
12860
|
+
});
|
|
12861
|
+
},
|
|
12862
|
+
onSuccess: (_data, { itemId }) => {
|
|
12863
|
+
void queryClient.invalidateQueries({
|
|
12864
|
+
queryKey: contentKeys.itemSourceAssets(workOSOrganizationId ?? void 0, itemId)
|
|
12865
|
+
});
|
|
12866
|
+
void queryClient.invalidateQueries({ queryKey: contentKeys.items() });
|
|
12867
|
+
},
|
|
12868
|
+
onError: (error) => {
|
|
12869
|
+
console.error("Failed to reorder content item source assets:", error);
|
|
12870
|
+
showApiErrorNotification(error);
|
|
12871
|
+
}
|
|
12872
|
+
});
|
|
12873
|
+
}
|
|
12874
|
+
function useUpdateContentItemSourceAsset() {
|
|
12875
|
+
const { apiRequest, workOSOrganizationId } = useElevasisServices();
|
|
12876
|
+
const queryClient = useQueryClient();
|
|
12877
|
+
return useMutation({
|
|
12878
|
+
mutationFn: async ({
|
|
12879
|
+
itemId,
|
|
12880
|
+
sourceAssetId,
|
|
12881
|
+
updates
|
|
12882
|
+
}) => {
|
|
12883
|
+
return apiRequest(`/content/items/${itemId}/source-assets/${sourceAssetId}`, {
|
|
12884
|
+
method: "PATCH",
|
|
12885
|
+
body: JSON.stringify(updates)
|
|
12886
|
+
});
|
|
12887
|
+
},
|
|
12888
|
+
onSuccess: (_data, { itemId }) => {
|
|
12889
|
+
void queryClient.invalidateQueries({
|
|
12890
|
+
queryKey: contentKeys.itemSourceAssets(workOSOrganizationId ?? void 0, itemId)
|
|
12891
|
+
});
|
|
12892
|
+
void queryClient.invalidateQueries({ queryKey: contentKeys.items() });
|
|
12893
|
+
},
|
|
12894
|
+
onError: (error) => {
|
|
12895
|
+
console.error("Failed to update content item source asset:", error);
|
|
12896
|
+
showApiErrorNotification(error);
|
|
12897
|
+
}
|
|
12898
|
+
});
|
|
12899
|
+
}
|
|
12534
12900
|
function sumStatusCounts(statusKeys, totals) {
|
|
12535
12901
|
const countsByStatus = {};
|
|
12536
12902
|
let totalItems = 0;
|
|
@@ -12583,6 +12949,85 @@ function useContentPipelineSummary(pipelineId, statusKeys, stepResourceIds) {
|
|
|
12583
12949
|
isLoading: itemResults.some((result) => result.isLoading) || runResults.some((result) => result.isLoading)
|
|
12584
12950
|
};
|
|
12585
12951
|
}
|
|
12952
|
+
|
|
12953
|
+
// src/hooks/storage/queryKeys.ts
|
|
12954
|
+
var storageKeys = {
|
|
12955
|
+
all: ["storage"],
|
|
12956
|
+
signedUrls: () => [...storageKeys.all, "signed-urls"],
|
|
12957
|
+
/**
|
|
12958
|
+
* Keyed per object rather than per set, so a path already signed stays signed no
|
|
12959
|
+
* matter what else is requested alongside it -- the same reason
|
|
12960
|
+
* `cloudStorageKeys.temporaryLinkFor` is per file.
|
|
12961
|
+
*/
|
|
12962
|
+
signedUrlFor: (organizationId, bucket, path) => [...storageKeys.signedUrls(), organizationId, bucket, path]
|
|
12963
|
+
};
|
|
12964
|
+
async function blobToBase64(blob) {
|
|
12965
|
+
const dataUrl = await new Promise((resolve, reject) => {
|
|
12966
|
+
const reader = new FileReader();
|
|
12967
|
+
reader.onload = () => resolve(reader.result);
|
|
12968
|
+
reader.onerror = () => reject(reader.error ?? new Error("Failed to read the file"));
|
|
12969
|
+
reader.readAsDataURL(blob);
|
|
12970
|
+
});
|
|
12971
|
+
const comma = dataUrl.indexOf(",");
|
|
12972
|
+
if (comma === -1) throw new Error("Unreadable data URL while encoding the upload");
|
|
12973
|
+
return dataUrl.slice(comma + 1);
|
|
12974
|
+
}
|
|
12975
|
+
function useUploadStorageFile() {
|
|
12976
|
+
const { apiRequest } = useElevasisServices();
|
|
12977
|
+
return useMutation({
|
|
12978
|
+
mutationFn: async ({
|
|
12979
|
+
bucket,
|
|
12980
|
+
path,
|
|
12981
|
+
file,
|
|
12982
|
+
contentType,
|
|
12983
|
+
upsert
|
|
12984
|
+
}) => {
|
|
12985
|
+
const content = await blobToBase64(file);
|
|
12986
|
+
return apiRequest("/storage/upload", {
|
|
12987
|
+
method: "POST",
|
|
12988
|
+
body: JSON.stringify({
|
|
12989
|
+
bucket,
|
|
12990
|
+
path,
|
|
12991
|
+
content,
|
|
12992
|
+
contentType: contentType ?? file.type,
|
|
12993
|
+
...upsert === void 0 ? {} : { upsert }
|
|
12994
|
+
})
|
|
12995
|
+
});
|
|
12996
|
+
},
|
|
12997
|
+
onError: (error) => {
|
|
12998
|
+
console.error("Failed to upload file to storage:", error);
|
|
12999
|
+
showApiErrorNotification(error);
|
|
13000
|
+
}
|
|
13001
|
+
});
|
|
13002
|
+
}
|
|
13003
|
+
function storageObjectRefKey(ref) {
|
|
13004
|
+
return `${ref.bucket}/${ref.path}`;
|
|
13005
|
+
}
|
|
13006
|
+
var SIGNED_URL_EXPIRES_IN_SECONDS = 60 * 60;
|
|
13007
|
+
var SIGNED_URL_STALE_MS = (SIGNED_URL_EXPIRES_IN_SECONDS - 5 * 60) * 1e3;
|
|
13008
|
+
function useStorageSignedUrls(refs) {
|
|
13009
|
+
const { apiRequest, isReady, workOSOrganizationId } = useElevasisServices();
|
|
13010
|
+
const results = useQueries({
|
|
13011
|
+
queries: refs.map(({ bucket, path }) => ({
|
|
13012
|
+
queryKey: storageKeys.signedUrlFor(workOSOrganizationId ?? void 0, bucket, path),
|
|
13013
|
+
queryFn: async () => {
|
|
13014
|
+
const response = await apiRequest("/storage/signed-url", {
|
|
13015
|
+
method: "POST",
|
|
13016
|
+
body: JSON.stringify({ bucket, path, expiresIn: SIGNED_URL_EXPIRES_IN_SECONDS })
|
|
13017
|
+
});
|
|
13018
|
+
return response.signedUrl;
|
|
13019
|
+
},
|
|
13020
|
+
enabled: isReady && !!bucket && !!path,
|
|
13021
|
+
staleTime: SIGNED_URL_STALE_MS
|
|
13022
|
+
}))
|
|
13023
|
+
});
|
|
13024
|
+
const urls = {};
|
|
13025
|
+
results.forEach((result, index) => {
|
|
13026
|
+
const ref = refs[index];
|
|
13027
|
+
if (ref !== void 0 && typeof result.data === "string") urls[storageObjectRefKey(ref)] = result.data;
|
|
13028
|
+
});
|
|
13029
|
+
return { urls, isLoading: results.some((result) => result.isLoading) };
|
|
13030
|
+
}
|
|
12586
13031
|
function useResourceErrors({ resourceId, timeRange, hasFailures }) {
|
|
12587
13032
|
const { apiRequest, workOSOrganizationId, isReady } = useElevasisServices();
|
|
12588
13033
|
return useQuery({
|
|
@@ -13260,7 +13705,7 @@ function useProjectRealtime(projectId) {
|
|
|
13260
13705
|
|
|
13261
13706
|
// ../core/src/content/review-gates.ts
|
|
13262
13707
|
function isOpenContentReviewGate(entry, step) {
|
|
13263
|
-
if (!step || step.
|
|
13708
|
+
if (!step || step.reviewVenue !== "queue") return false;
|
|
13264
13709
|
if (entry.status === "running" || entry.executionId === null) return false;
|
|
13265
13710
|
return true;
|
|
13266
13711
|
}
|
|
@@ -13275,6 +13720,38 @@ function getOpenContentReviewGates(processingState, steps) {
|
|
|
13275
13720
|
gates.sort((a, b) => Date.parse(a.entry.attemptedAt) - Date.parse(b.entry.attemptedAt));
|
|
13276
13721
|
return gates;
|
|
13277
13722
|
}
|
|
13723
|
+
function resolveCurrentContentStep(item, steps) {
|
|
13724
|
+
if (steps.length === 0) return void 0;
|
|
13725
|
+
const sortedSteps = [...steps].sort((a, b) => {
|
|
13726
|
+
if (a.order !== b.order) return a.order - b.order;
|
|
13727
|
+
return a.key < b.key ? -1 : a.key > b.key ? 1 : 0;
|
|
13728
|
+
});
|
|
13729
|
+
const stateKeys = Object.keys(item.processingState);
|
|
13730
|
+
if (stateKeys.length > 0) {
|
|
13731
|
+
const catalogKeys = new Set(sortedSteps.map((step) => step.key));
|
|
13732
|
+
const hasKnownKey = stateKeys.some((key) => catalogKeys.has(key));
|
|
13733
|
+
if (!hasKnownKey) return void 0;
|
|
13734
|
+
}
|
|
13735
|
+
const currentStep = sortedSteps.find((step) => {
|
|
13736
|
+
const entry = item.processingState[step.key];
|
|
13737
|
+
return !entry || entry.status !== "success";
|
|
13738
|
+
});
|
|
13739
|
+
return currentStep ?? sortedSteps[sortedSteps.length - 1];
|
|
13740
|
+
}
|
|
13741
|
+
function isAwaitingReview(item, step) {
|
|
13742
|
+
if (!step) return false;
|
|
13743
|
+
return step.reviewMode !== "none" && item.reviewedAt === null;
|
|
13744
|
+
}
|
|
13745
|
+
function resolveReviewTarget(item, pipeline, steps) {
|
|
13746
|
+
const gate = getOpenContentReviewGates(item.processingState, steps)[0];
|
|
13747
|
+
if (gate) return { kind: "queued", gate };
|
|
13748
|
+
const step = resolveCurrentContentStep(item, steps);
|
|
13749
|
+
if (step?.reviewVenue === "workspace" && isAwaitingReview(item, step)) {
|
|
13750
|
+
const route = resolveContentWorkspaceRoute(pipeline, step);
|
|
13751
|
+
if (route) return { kind: "workspace", route };
|
|
13752
|
+
}
|
|
13753
|
+
return { kind: "none" };
|
|
13754
|
+
}
|
|
13278
13755
|
|
|
13279
13756
|
// ../core/src/content/derive-board.ts
|
|
13280
13757
|
function sortPipelineSteps(steps) {
|
|
@@ -13299,17 +13776,13 @@ function deriveItemPlacement(item, sortedSteps) {
|
|
|
13299
13776
|
});
|
|
13300
13777
|
if (!currentStep) {
|
|
13301
13778
|
const lastStep = sortedSteps[sortedSteps.length - 1];
|
|
13302
|
-
if (lastStep !== void 0 &&
|
|
13779
|
+
if (lastStep !== void 0 && isAwaitingReview(item, lastStep)) {
|
|
13303
13780
|
return { bucket: "column", stepKey: lastStep.key };
|
|
13304
13781
|
}
|
|
13305
13782
|
return { bucket: "done", stepKey: null };
|
|
13306
13783
|
}
|
|
13307
13784
|
return { bucket: "column", stepKey: currentStep.key };
|
|
13308
13785
|
}
|
|
13309
|
-
function deriveAwaitingReview(step, item) {
|
|
13310
|
-
if (!step) return false;
|
|
13311
|
-
return step.reviewMode !== "none" && item.reviewedAt === null;
|
|
13312
|
-
}
|
|
13313
13786
|
function deriveContentBoard(items, pipeline, now) {
|
|
13314
13787
|
const sortedSteps = sortPipelineSteps(pipeline.steps);
|
|
13315
13788
|
const stepsByKey = new Map(sortedSteps.map((step) => [step.key, step]));
|
|
@@ -13323,7 +13796,7 @@ function deriveContentBoard(items, pipeline, now) {
|
|
|
13323
13796
|
item,
|
|
13324
13797
|
stepKey: placement.stepKey,
|
|
13325
13798
|
ageMs: now - Date.parse(item.updatedAt),
|
|
13326
|
-
awaitingReview:
|
|
13799
|
+
awaitingReview: isAwaitingReview(item, step)
|
|
13327
13800
|
};
|
|
13328
13801
|
if (placement.bucket === "done") {
|
|
13329
13802
|
done.push(card);
|
|
@@ -13347,9 +13820,9 @@ function deriveContentBoard(items, pipeline, now) {
|
|
|
13347
13820
|
const columns = sortedSteps.map((step) => {
|
|
13348
13821
|
const cards = cardsByStepKey.get(step.key) ?? [];
|
|
13349
13822
|
const column = { step, cards };
|
|
13350
|
-
if (step.
|
|
13823
|
+
if (step.reviewVenue !== "none") {
|
|
13351
13824
|
column.gate = {
|
|
13352
|
-
|
|
13825
|
+
venue: step.reviewVenue,
|
|
13353
13826
|
waitingCount: cards.filter((card) => card.awaitingReview).length
|
|
13354
13827
|
};
|
|
13355
13828
|
}
|
|
@@ -13444,15 +13917,18 @@ function MyReviewQueuePanel({ onItemClick, onSeeAll, showSectionLabel = true })
|
|
|
13444
13917
|
const { navigate } = useRouterContext();
|
|
13445
13918
|
const handleItemClick = (item) => {
|
|
13446
13919
|
const pipeline = pipelines.find((candidate) => candidate.id === item.pipelineId);
|
|
13447
|
-
const
|
|
13448
|
-
|
|
13449
|
-
|
|
13450
|
-
navigate(workspaceRoute);
|
|
13920
|
+
const target = resolveReviewTarget(item, pipeline, pipeline?.steps ?? []);
|
|
13921
|
+
if (target.kind === "workspace") {
|
|
13922
|
+
navigate(target.route);
|
|
13451
13923
|
return;
|
|
13452
13924
|
}
|
|
13453
13925
|
onItemClick(item.id);
|
|
13454
13926
|
};
|
|
13455
|
-
const pending = (data?.data ?? []).filter((item) =>
|
|
13927
|
+
const pending = (data?.data ?? []).filter((item) => {
|
|
13928
|
+
const pipeline = pipelines.find((candidate) => candidate.id === item.pipelineId);
|
|
13929
|
+
const step = resolveCurrentContentStep(item, pipeline?.steps ?? []);
|
|
13930
|
+
return isAwaitingReview(item, step);
|
|
13931
|
+
}).sort((a, b) => Date.parse(a.updatedAt) - Date.parse(b.updatedAt));
|
|
13456
13932
|
const total = pending.length;
|
|
13457
13933
|
const visible = pending.slice(0, VISIBLE_LIMIT);
|
|
13458
13934
|
return /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsxs(Stack, { gap: 4, children: [
|
|
@@ -16705,4 +17181,4 @@ function createTestSystemsProvider({
|
|
|
16705
17181
|
};
|
|
16706
17182
|
}
|
|
16707
17183
|
|
|
16708
|
-
export { APIErrorAlert, AccessGuard, AccessKeys, ActivityTimeline, ActivityTrendChart, AgentResourceEntrySchema, ApiKeyService, AppearanceContext, AppearanceProvider, CONTENT_ITEMS, CRM_ITEMS, CenteredErrorState, ChartFrame, CheckpointGroup, CollapsibleSection, CombinedTrendChart, CommandQueueSidebar, CommandQueueSidebarMiddle, CommandQueueSidebarTop, ConfirmationInputModal, ConfirmationModal, ContentSidebar, ContentSidebarMiddle, ContextViewer, CostTrendChart, CredentialSchemas, CredentialService, CrmActionsProvider, CrmSidebarMiddle, CustomModal, CustomSelector, CyberAreaChart, CyberDonut, CyberDonutTooltip, CyberLegendItem, DEFAULT_CONTENT_VOCABULARY, DEFAULT_ORGANIZATION_GRAPH_FILTERS, DEFAULT_WAIT_FOR_ORGANIZATION, DeploymentService, DetailCardSkeleton, EMPTY_LIST_ACTIONS, ElevasisCoreProvider, ElevasisLoader, ElevasisSystemsProvider, ElevasisUIProvider, EmptyState, FILTERABLE_DOMAIN_KEYS, FeatureUnavailableState, GlowDot, HeroStatsRow, IdentityDomainSchema, IntegrationResourceEntrySchema, JsonViewer, KNOWLEDGE_DOMAINS_WITH_PANELS, KNOWLEDGE_ICON_TOKEN_BY_KIND, KnowledgeSearchBar, KnowledgeTree, LEAD_GEN_ITEMS, LeadGenSidebarMiddle, ListActionsProvider, ListSkeleton, MEMBERSHIP_STATUS_COLORS, MyReviewQueuePanel, MyTasksPanel, NavigationButton, NotificationProvider, OM_NESTED_TREE_GROUPS, OM_TREE_GROUPS, ORGANIZATION_GRAPH_EDGE_KIND_LABELS, ORGANIZATION_GRAPH_EDGE_KIND_MEANINGS, ORGANIZATION_GRAPH_NODE_KIND_DETAIL_LABELS, ORGANIZATION_GRAPH_NODE_KIND_LABELS, ORGANIZATION_GRAPH_NODE_KIND_MEANINGS, ORGANIZATION_GRAPH_NODE_KIND_ORDER, OperationsService, OperationsSidebar, OperationsSidebarMiddle, OperationsSidebarTop, OrganizationMembershipService, OrganizationModelDriftActionIcon, PROVISIONING_STATE_DISPLAY, PageNotFound, PageTitleCaption, ProtectedRoute, QuickCreateActions, RequestActionIcon, RequestModal, ResourceCard, ResourcesSidebar, RoleSchema, SAVED_VIEW_PRESETS, SYSTEM_RESOURCE_KINDS, SavedViewsPanel, ScriptResourceEntrySchema, SemanticIcon, SessionListItem, SessionsSidebar, StatCard, StatCardSkeleton, StatsCardSkeleton, StatusBadge, SubshellContainer, SubshellContentContainer, SubshellRightSideContainer, SubshellSidebar, SubshellSidebarLoader, SurfaceDefinitionSchema, SystemShell, TabCountBadge, TimeRangeSelector, TrendIndicator, WebhookEndpointService, WorkflowResourceEntrySchema, acquisitionListKeys, aggregateSystemMetrics, buildKnowledgeOmTreeData, buildOrganizationGraph, clientsKeys, clientsManifest, collectResourceFilterFacets, companyKeys, computeProtectedRouteGate, contactKeys, contentKeys, contentManifest, createTestSystemsProvider, crmManifest, dealKeys, dealNoteKeys, dealTaskKeys, deliveryManifest, deriveActions, deriveContentBoard, executionsKeys, extendSemanticIconRegistry, filterByDomainFilters, findKnowledgeTreeNodeByValue, findListActionByAction, findOmTreeGroup, formatResourceAttribution, getAllBuildTemplates, getConceptDefinition, getContentItemIdentity, getCrmPipelineCatalog, getKnowledgeDomainFolderCommand, getKnowledgeGraphNodeCommand, getKnowledgeIconToken, getKnowledgeNodeReadCommand, getKnowledgeOntologyProjection, getKnowledgeTreeFolderCommand, getLeadGenStageCatalog, getListActionWorkflowId, getOntologyDomainLabel,
|
|
17184
|
+
export { APIErrorAlert, AccessGuard, AccessKeys, ActivityTimeline, ActivityTrendChart, AgentResourceEntrySchema, ApiKeyService, AppearanceContext, AppearanceProvider, CONTENT_ITEMS, CRM_ITEMS, CenteredErrorState, ChartFrame, CheckpointGroup, CollapsibleSection, CombinedTrendChart, CommandQueueSidebar, CommandQueueSidebarMiddle, CommandQueueSidebarTop, ConfirmationInputModal, ConfirmationModal, ContentSidebar, ContentSidebarMiddle, ContextViewer, CostTrendChart, CredentialSchemas, CredentialService, CrmActionsProvider, CrmSidebarMiddle, CustomModal, CustomSelector, CyberAreaChart, CyberDonut, CyberDonutTooltip, CyberLegendItem, DEFAULT_CONTENT_VOCABULARY, DEFAULT_ORGANIZATION_GRAPH_FILTERS, DEFAULT_WAIT_FOR_ORGANIZATION, DeploymentService, DetailCardSkeleton, EMPTY_LIST_ACTIONS, ElevasisCoreProvider, ElevasisLoader, ElevasisSystemsProvider, ElevasisUIProvider, EmptyState, FILTERABLE_DOMAIN_KEYS, FeatureUnavailableState, GlowDot, HeroStatsRow, IdentityDomainSchema, IntegrationResourceEntrySchema, JsonViewer, KNOWLEDGE_DOMAINS_WITH_PANELS, KNOWLEDGE_ICON_TOKEN_BY_KIND, KnowledgeSearchBar, KnowledgeTree, LEAD_GEN_ITEMS, LeadGenSidebarMiddle, ListActionsProvider, ListSkeleton, MEMBERSHIP_STATUS_COLORS, MyReviewQueuePanel, MyTasksPanel, NavigationButton, NotificationProvider, OM_NESTED_TREE_GROUPS, OM_TREE_GROUPS, ORGANIZATION_GRAPH_EDGE_KIND_LABELS, ORGANIZATION_GRAPH_EDGE_KIND_MEANINGS, ORGANIZATION_GRAPH_NODE_KIND_DETAIL_LABELS, ORGANIZATION_GRAPH_NODE_KIND_LABELS, ORGANIZATION_GRAPH_NODE_KIND_MEANINGS, ORGANIZATION_GRAPH_NODE_KIND_ORDER, OperationsService, OperationsSidebar, OperationsSidebarMiddle, OperationsSidebarTop, OrganizationMembershipService, OrganizationModelDriftActionIcon, PROVISIONING_STATE_DISPLAY, PageNotFound, PageTitleCaption, ProtectedRoute, QuickCreateActions, RequestActionIcon, RequestModal, ResourceCard, ResourcesSidebar, RoleSchema, SAVED_VIEW_PRESETS, SIGNED_URL_EXPIRES_IN_SECONDS, SYSTEM_RESOURCE_KINDS, SavedViewsPanel, ScriptResourceEntrySchema, SemanticIcon, SessionListItem, SessionsSidebar, StatCard, StatCardSkeleton, StatsCardSkeleton, StatusBadge, SubshellContainer, SubshellContentContainer, SubshellRightSideContainer, SubshellSidebar, SubshellSidebarLoader, SurfaceDefinitionSchema, SystemShell, TEMPORARY_LINK_STALE_MS, THUMBNAIL_BATCH_SIZE, TabCountBadge, TimeRangeSelector, TrendIndicator, WebhookEndpointService, WorkflowResourceEntrySchema, acquisitionListKeys, aggregateSystemMetrics, buildKnowledgeOmTreeData, buildOrganizationGraph, chunkIntoBatches, clientsKeys, clientsManifest, cloudStorageKeys, collectResourceFilterFacets, companyKeys, computeProtectedRouteGate, contactKeys, contentKeys, contentManifest, createTestSystemsProvider, crmManifest, dealKeys, dealNoteKeys, dealTaskKeys, deliveryManifest, deriveActions, deriveContentBoard, executionsKeys, extendSemanticIconRegistry, filterByDomainFilters, findKnowledgeTreeNodeByValue, findListActionByAction, findOmTreeGroup, formatResourceAttribution, getAllBuildTemplates, getConceptDefinition, getContentItemIdentity, getCrmPipelineCatalog, getKnowledgeDomainFolderCommand, getKnowledgeGraphNodeCommand, getKnowledgeIconToken, getKnowledgeNodeReadCommand, getKnowledgeOntologyProjection, getKnowledgeTreeFolderCommand, getLeadGenStageCatalog, getListActionWorkflowId, getOntologyDomainLabel, getPrimaryOntologyItemsForDomain, getResourceFilterFacetIds, getSemanticIconComponent, getSeriesColor, getSessionView, getSharedOrganizationGraph, isAwaitingReview, isSessionCapable, joinSourceAssetDetails, knowledgeManifest, labelResourceFilterFacet, leadGenArtifactKeys, leadGenListCompanyKeys, leadGenListMemberKeys, leadGenManifest, measureImageDimensions, mergeThumbnailBatches, monitoringManifest, normaliseConceptKey, observabilityKeys, operationsKeys, operationsManifest, pickCoverSourceAsset, pickLatestRunAt, projectActivityKeys, projectNavigationGroups, projectNavigationSurfaces, readItemSourceAssets, requestTopbarActionManifest, requestsKeys, resolveContentStepResource, resolveContentVocabulary, resolveContentWorkspaceRoute, resolveCurrentContentStep, resolveReviewTarget, resolveSemanticIconComponent, scheduleKeys, sessionsKeys, settingsManifest, sortData, storageKeys, storageObjectRefKey, submittedRequestsManifest, sumStatusCounts, transformMembershipToTableRow, useAccess, useActivateDeployment, useActivities, useActivitiesRealtime, useActivityFilters, useActivityTrend, useAddCompaniesToList, useAddContactsToList, useAddContentItemSourceAsset, useAppearance, useArchiveSession, useArchivedLogs, useArtifacts, useAssignRole, useBatchDelete, useBatchTelemetry, useBatchedResourcesHealth, useBulkDeleteExecutions, useBusinessImpact, useCancelExecution, useCancelSchedule, useCheckpointTasks, useClient, useClientStatus, useClients, useCloudStorageFolder, useCloudStorageImageDimensions, useCloudStorageTemporaryLinks, useCloudStorageThumbnails, useCommandQueue, useCommandQueueTask, useCommandQueueTotals, useCommandViewData, useCommandViewDomainFilters, useCommandViewStats, useCommandViewStore, useCompanies, useCompany, useCompanyFacets, useCompleteDealTask, useContact, useContacts, useContentConfig, useContentDistribution, useContentDistributions, useContentItem, useContentItemAttempts, useContentItemSourceAssetDetails, useContentItemSourceAssets, useContentItems, useContentPipelineSummary, useContentSourceAsset, useContentSourceAssets, useCostBreakdown, useCostByModel, useCostSummary, useCostTrends, useCreateApiKey, useCreateArtifact, useCreateClient, useCreateCompany, useCreateContact, useCreateContentDistribution, useCreateContentItem, useCreateContentSourceAsset, useCreateCredential, useCreateDealNote, useCreateDealTask, useCreateList, useCreateOrgRole, useCreateSchedule, useCreateSession, useCreateWebhookEndpoint, useCredentials, useCrmActions, useCyberColors, useDashboardMetrics, useDeactivateDeployment, useDeactivateMembership, useDealDetail, useDealNotes, useDealTasks, useDealTasksDue, useDeals, useDealsLookup, useDealsSummary, useDeleteApiKey, useDeleteClient, useDeleteCompanies, useDeleteContacts, useDeleteCredential, useDeleteDeal, useDeleteDeployment, useDeleteExecution, useDeleteList, useDeleteOrgRole, useDeleteRequest, useDeleteSchedule, useDeleteSession, useDeleteTask, useDeleteWebhookEndpoint, useDeriveActions, useEffectivePermissions, useElevasisSystems, useEndSession, useErrorAnalysis, useErrorDetail, useErrorDetails, useErrorDistribution, useErrorNotification, useErrorTrends, useExecuteAction, useExecuteAsync, useExecuteResource, useExecution, useExecutionHealth, useExecutionLogSSE, useExecutionLogs, useExecutionLogsFilters, useExecutionPanelState, useExecutionSSE, useExecutions, useGetExecutionHistory, useGetSchedule, useInFlightExecutions, useLeadGenActionRegistry, useLeadGenBulkActions, useLeadGenHeaderActions, useLeadGenRowActions, useList, useListActions, useListApiKeys, useListDeployments, useListExecutions, useListMember, useListMembers, useListProgress, useListRecords, useListSchedules, useListWebhookEndpoints, useLists, useListsTelemetry, useMarkAllAsRead, useMarkAsRead, useNotificationAdapter, useNotificationCount, useNotifications, useOptionalElevasisSystems, useOrgRoles, useOrganizationMembers, useOrganizationModelDrift, usePaginationState, usePatchTask, usePauseSchedule, usePermissionCatalog, useProjectActivities, useProjectRealtime, useReactivateMembership, useRecentExecutionsByResource, useRemoveCompaniesFromList, useRemoveContentItemSourceAsset, useReorderContentItemSourceAssets, useRequest, useRequestsList, useResolveAllErrors, useResolveError, useResolveErrorsByExecution, useResolvedOrganizationModel, useResourceDefinition, useResourceErrors, useResourceExecutions, useResourceSearch, useResources, useResourcesDomainFilters, useResourcesHealth, useResumeSchedule, useRetryExecution, useReviewContentItem, useRevokeRole, useSSEConnection, useScheduledTasks, useSession, useSessionCheck, useSessionExecution, useSessionExecutions, useSessionMessages, useSessionWebSocket, useSessions, useSortedData, useStableAccessToken, useStatusFilter, useStorageSignedUrls, useSubmitAction, useSubmitRequest, useSuccessNotification, useSystemHealth, useSystemsViewState, useTableSelection, useTableSort, useTestNotification, useTimeRangeDates, useTopFailingResources, useTransitionItem, useTransitionListCompany, useTransitionListMember, useTransitionState, useUnresolveError, useUnresolvedErrors, useUpdateAnchor, useUpdateApiKey, useUpdateClient, useUpdateCompany, useUpdateContact, useUpdateContentDistribution, useUpdateContentItem, useUpdateContentItemSourceAsset, useUpdateContentSourceAsset, useUpdateCredential, useUpdateList, useUpdateListConfig, useUpdateListStatus, useUpdateOrgRole, useUpdateRequestStatus, useUpdateSchedule, useUpdateWebhookEndpoint, useUploadStorageFile, useUserMemberships, useVerifyCredential, useVisibleResources, useWarningNotification, useWorkflowExecution };
|