@workflow/web-shared 4.1.0 → 4.1.2
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/components/event-list-view.d.ts +3 -1
- package/dist/components/event-list-view.d.ts.map +1 -1
- package/dist/components/event-list-view.js +76 -70
- package/dist/components/event-list-view.js.map +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/index.js.map +1 -1
- package/dist/components/sidebar/attribute-panel.d.ts +5 -1
- package/dist/components/sidebar/attribute-panel.d.ts.map +1 -1
- package/dist/components/sidebar/attribute-panel.js +37 -25
- package/dist/components/sidebar/attribute-panel.js.map +1 -1
- package/dist/components/sidebar/entity-detail-panel.d.ts +3 -1
- package/dist/components/sidebar/entity-detail-panel.d.ts.map +1 -1
- package/dist/components/sidebar/entity-detail-panel.js +4 -3
- package/dist/components/sidebar/entity-detail-panel.js.map +1 -1
- package/dist/components/sidebar/events-list.d.ts +1 -1
- package/dist/components/sidebar/events-list.d.ts.map +1 -1
- package/dist/components/sidebar/events-list.js +26 -18
- package/dist/components/sidebar/events-list.js.map +1 -1
- package/dist/components/ui/data-inspector.d.ts +14 -1
- package/dist/components/ui/data-inspector.d.ts.map +1 -1
- package/dist/components/ui/data-inspector.js +36 -11
- package/dist/components/ui/data-inspector.js.map +1 -1
- package/dist/components/workflow-trace-view.d.ts +3 -1
- package/dist/components/workflow-trace-view.d.ts.map +1 -1
- package/dist/components/workflow-trace-view.js +2 -2
- package/dist/components/workflow-trace-view.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/hydration.d.ts +8 -1
- package/dist/lib/hydration.d.ts.map +1 -1
- package/dist/lib/hydration.js +36 -12
- package/dist/lib/hydration.js.map +1 -1
- package/package.json +2 -2
- package/src/components/event-list-view.tsx +207 -193
- package/src/components/index.ts +6 -1
- package/src/components/sidebar/attribute-panel.tsx +150 -106
- package/src/components/sidebar/entity-detail-panel.tsx +13 -7
- package/src/components/sidebar/events-list.tsx +42 -32
- package/src/components/ui/data-inspector.tsx +91 -19
- package/src/components/workflow-trace-view.tsx +4 -0
- package/src/index.ts +1 -0
- package/src/lib/hydration.ts +39 -13
package/src/lib/hydration.ts
CHANGED
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
observabilityRevivers,
|
|
15
15
|
type Revivers,
|
|
16
16
|
} from '@workflow/core/serialization-format';
|
|
17
|
+
import { EVENT_DATA_REF_FIELDS } from '@workflow/world';
|
|
17
18
|
|
|
18
19
|
// Re-export types and utilities that consumers need
|
|
19
20
|
export {
|
|
@@ -274,9 +275,14 @@ function replaceEncryptedAndExpiredWithMarkers<T>(resource: T): T {
|
|
|
274
275
|
}
|
|
275
276
|
|
|
276
277
|
if (result.eventData && typeof result.eventData === 'object') {
|
|
278
|
+
const eventType =
|
|
279
|
+
typeof result.eventType === 'string' ? result.eventType : '';
|
|
280
|
+
const refKeys = EVENT_DATA_REF_FIELDS[eventType] ?? [];
|
|
277
281
|
const ed = { ...(result.eventData as Record<string, unknown>) };
|
|
278
|
-
for (const key of
|
|
279
|
-
|
|
282
|
+
for (const key of refKeys) {
|
|
283
|
+
if (key in ed) {
|
|
284
|
+
ed[key] = toDisplayMarker(ed[key]);
|
|
285
|
+
}
|
|
280
286
|
}
|
|
281
287
|
result.eventData = ed;
|
|
282
288
|
}
|
|
@@ -284,15 +290,6 @@ function replaceEncryptedAndExpiredWithMarkers<T>(resource: T): T {
|
|
|
284
290
|
return result as T;
|
|
285
291
|
}
|
|
286
292
|
|
|
287
|
-
/** Known serialized subfields within eventData, matching hydrateEventData in core */
|
|
288
|
-
const EVENT_DATA_SERIALIZED_FIELDS = [
|
|
289
|
-
'result',
|
|
290
|
-
'input',
|
|
291
|
-
'output',
|
|
292
|
-
'metadata',
|
|
293
|
-
'payload',
|
|
294
|
-
];
|
|
295
|
-
|
|
296
293
|
/**
|
|
297
294
|
* Hydrate resource data with decryption support.
|
|
298
295
|
*
|
|
@@ -300,7 +297,7 @@ const EVENT_DATA_SERIALIZED_FIELDS = [
|
|
|
300
297
|
* This is the async version used when the user clicks "Decrypt" in the web UI.
|
|
301
298
|
*
|
|
302
299
|
* Handles both top-level fields (input, output, metadata) and nested
|
|
303
|
-
* eventData subfields
|
|
300
|
+
* eventData subfields per `EVENT_DATA_REF_FIELDS` from `@workflow/world` for that event type.
|
|
304
301
|
*/
|
|
305
302
|
export async function hydrateResourceIOWithKey<T>(
|
|
306
303
|
resource: T,
|
|
@@ -344,8 +341,11 @@ export async function hydrateResourceIOWithKey<T>(
|
|
|
344
341
|
|
|
345
342
|
// Decrypt + hydrate eventData subfields (events)
|
|
346
343
|
if (result.eventData && typeof result.eventData === 'object') {
|
|
344
|
+
const eventType =
|
|
345
|
+
typeof result.eventType === 'string' ? result.eventType : '';
|
|
346
|
+
const refKeys = EVENT_DATA_REF_FIELDS[eventType] ?? [];
|
|
347
347
|
const eventData = { ...(result.eventData as Record<string, unknown>) };
|
|
348
|
-
for (const field of
|
|
348
|
+
for (const field of refKeys) {
|
|
349
349
|
if (field in eventData) {
|
|
350
350
|
eventData[field] = await decryptField(
|
|
351
351
|
eventData[field],
|
|
@@ -359,3 +359,29 @@ export async function hydrateResourceIOWithKey<T>(
|
|
|
359
359
|
|
|
360
360
|
return result as T;
|
|
361
361
|
}
|
|
362
|
+
|
|
363
|
+
/**
|
|
364
|
+
* Check whether a hydrated resource (event, step, run, etc.) contains any
|
|
365
|
+
* encrypted display markers. Inspects the standard top-level fields
|
|
366
|
+
* (`input`, `output`, `error`, `metadata`) as well as the event-type-specific
|
|
367
|
+
* `eventData` ref fields.
|
|
368
|
+
*/
|
|
369
|
+
export function hasEncryptedFields(resource: unknown): boolean {
|
|
370
|
+
if (!resource || typeof resource !== 'object') return false;
|
|
371
|
+
const r = resource as Record<string, unknown>;
|
|
372
|
+
|
|
373
|
+
for (const key of ['input', 'output', 'metadata', 'error']) {
|
|
374
|
+
if (isEncryptedMarker(r[key])) return true;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
if (r.eventData && typeof r.eventData === 'object') {
|
|
378
|
+
const eventType = typeof r.eventType === 'string' ? r.eventType : '';
|
|
379
|
+
const refKeys = EVENT_DATA_REF_FIELDS[eventType] ?? [];
|
|
380
|
+
const ed = r.eventData as Record<string, unknown>;
|
|
381
|
+
for (const key of refKeys) {
|
|
382
|
+
if (key in ed && isEncryptedMarker(ed[key])) return true;
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
return false;
|
|
387
|
+
}
|