@wildo-ai/saas-frontend-lib 1.1.12 → 1.1.14

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.
Files changed (145) hide show
  1. package/dist/esm/components/data-display/DisplayValueDispatcher.d.ts.map +1 -1
  2. package/dist/esm/components/data-display/DisplayValueDispatcher.js +17 -1
  3. package/dist/esm/components/data-display/DisplayValueDispatcher.js.map +1 -1
  4. package/dist/esm/components/data-display/approval-seal.d.ts +97 -0
  5. package/dist/esm/components/data-display/approval-seal.d.ts.map +1 -0
  6. package/dist/esm/components/data-display/approval-seal.js +208 -0
  7. package/dist/esm/components/data-display/approval-seal.js.map +1 -0
  8. package/dist/esm/components/data-display/external-data-provenance/external-data-provenance.frontend.d.ts.map +1 -1
  9. package/dist/esm/components/data-display/external-data-provenance/external-data-provenance.frontend.js +5 -2
  10. package/dist/esm/components/data-display/external-data-provenance/external-data-provenance.frontend.js.map +1 -1
  11. package/dist/esm/components/data-display/formatters/display-field-file.d.ts.map +1 -1
  12. package/dist/esm/components/data-display/formatters/display-field-file.js +16 -2
  13. package/dist/esm/components/data-display/formatters/display-field-file.js.map +1 -1
  14. package/dist/esm/components/flows-actors/approval.d.ts.map +1 -1
  15. package/dist/esm/components/flows-actors/approval.js +48 -18
  16. package/dist/esm/components/flows-actors/approval.js.map +1 -1
  17. package/dist/esm/components/form/automated/ResourceAutomatedForm.d.ts.map +1 -1
  18. package/dist/esm/components/form/automated/ResourceAutomatedForm.js +20 -1
  19. package/dist/esm/components/form/automated/ResourceAutomatedForm.js.map +1 -1
  20. package/dist/esm/components/form/chromes/FormFieldChrome.js +1 -1
  21. package/dist/esm/components/form/chromes/FormFieldChrome.js.map +1 -1
  22. package/dist/esm/components/form/chromes/field-control-aria.d.ts +8 -1
  23. package/dist/esm/components/form/chromes/field-control-aria.d.ts.map +1 -1
  24. package/dist/esm/components/form/chromes/field-control-aria.js +19 -2
  25. package/dist/esm/components/form/chromes/field-control-aria.js.map +1 -1
  26. package/dist/esm/components/form/validation-errors/validate-field-url.frontend.d.ts +5 -0
  27. package/dist/esm/components/form/validation-errors/validate-field-url.frontend.d.ts.map +1 -1
  28. package/dist/esm/components/form/validation-errors/validate-field-url.frontend.js +6 -2
  29. package/dist/esm/components/form/validation-errors/validate-field-url.frontend.js.map +1 -1
  30. package/dist/esm/components/resources/ResourceCollectionBody_Table.d.ts.map +1 -1
  31. package/dist/esm/components/resources/ResourceCollectionBody_Table.js +8 -1
  32. package/dist/esm/components/resources/ResourceCollectionBody_Table.js.map +1 -1
  33. package/dist/esm/components/resources/ResourceLayout_DangerZone.d.ts.map +1 -1
  34. package/dist/esm/components/resources/ResourceLayout_DangerZone.js +2 -2
  35. package/dist/esm/components/resources/ResourceLayout_DangerZone.js.map +1 -1
  36. package/dist/esm/components/resources/ResourceLayout_RecordSharing.js +2 -2
  37. package/dist/esm/components/resources/ResourceLayout_RecordSharing.js.map +1 -1
  38. package/dist/esm/components/resources/ResourceListItemRenderer.d.ts.map +1 -1
  39. package/dist/esm/components/resources/ResourceListItemRenderer.js +6 -1
  40. package/dist/esm/components/resources/ResourceListItemRenderer.js.map +1 -1
  41. package/dist/esm/components/resources/collection/calendar/ResourceCollectionBody_Calendar.d.ts.map +1 -1
  42. package/dist/esm/components/resources/collection/calendar/ResourceCollectionBody_Calendar.js +5 -1
  43. package/dist/esm/components/resources/collection/calendar/ResourceCollectionBody_Calendar.js.map +1 -1
  44. package/dist/esm/components/resources/skeleton/DisplayLayout.js +2 -2
  45. package/dist/esm/components/resources/skeleton/DisplayLayout.js.map +1 -1
  46. package/dist/esm/components/resources-fields/_presets/resource-reference/ResourceFieldDisplayPreset_ResourceReference_Default.d.ts.map +1 -1
  47. package/dist/esm/components/resources-fields/_presets/resource-reference/ResourceFieldDisplayPreset_ResourceReference_Default.js +71 -16
  48. package/dist/esm/components/resources-fields/_presets/resource-reference/ResourceFieldDisplayPreset_ResourceReference_Default.js.map +1 -1
  49. package/dist/esm/components/sections/surface.d.ts +12 -0
  50. package/dist/esm/components/sections/surface.d.ts.map +1 -1
  51. package/dist/esm/components/sections/surface.js +14 -0
  52. package/dist/esm/components/sections/surface.js.map +1 -1
  53. package/dist/esm/components/views/chart-dashboard/ChartDashboard.d.ts +27 -24
  54. package/dist/esm/components/views/chart-dashboard/ChartDashboard.d.ts.map +1 -1
  55. package/dist/esm/components/views/chart-dashboard/ChartDashboard.js +27 -33
  56. package/dist/esm/components/views/chart-dashboard/ChartDashboard.js.map +1 -1
  57. package/dist/esm/components/views/chart-dashboard/ChartDashboardLayoutEditor.d.ts +37 -0
  58. package/dist/esm/components/views/chart-dashboard/ChartDashboardLayoutEditor.d.ts.map +1 -0
  59. package/dist/esm/components/views/chart-dashboard/ChartDashboardLayoutEditor.js +100 -0
  60. package/dist/esm/components/views/chart-dashboard/ChartDashboardLayoutEditor.js.map +1 -0
  61. package/dist/esm/components/views/chart-dashboard/ChartDashboardLayoutEditor.labels.d.ts +3 -0
  62. package/dist/esm/components/views/chart-dashboard/ChartDashboardLayoutEditor.labels.d.ts.map +1 -0
  63. package/dist/esm/components/views/chart-dashboard/ChartDashboardLayoutEditor.labels.js +34 -0
  64. package/dist/esm/components/views/chart-dashboard/ChartDashboardLayoutEditor.labels.js.map +1 -0
  65. package/dist/esm/components/views/chart-dashboard/chart-dashboard-layout.utils.d.ts +47 -0
  66. package/dist/esm/components/views/chart-dashboard/chart-dashboard-layout.utils.d.ts.map +1 -0
  67. package/dist/esm/components/views/chart-dashboard/chart-dashboard-layout.utils.js +94 -0
  68. package/dist/esm/components/views/chart-dashboard/chart-dashboard-layout.utils.js.map +1 -0
  69. package/dist/esm/components/views/chart-dashboard/useChartDashboardLayout.d.ts +39 -0
  70. package/dist/esm/components/views/chart-dashboard/useChartDashboardLayout.d.ts.map +1 -0
  71. package/dist/esm/components/views/chart-dashboard/useChartDashboardLayout.js +155 -0
  72. package/dist/esm/components/views/chart-dashboard/useChartDashboardLayout.js.map +1 -0
  73. package/dist/esm/core/app-shell/shell-motion/shell-motion-origins.d.ts.map +1 -1
  74. package/dist/esm/core/app-shell/shell-motion/shell-motion-origins.js +3 -2
  75. package/dist/esm/core/app-shell/shell-motion/shell-motion-origins.js.map +1 -1
  76. package/dist/esm/core/app-shell/shell-motion/shell-motion-vocabulary.d.ts +15 -0
  77. package/dist/esm/core/app-shell/shell-motion/shell-motion-vocabulary.d.ts.map +1 -1
  78. package/dist/esm/core/app-shell/shell-motion/shell-motion-vocabulary.js +29 -0
  79. package/dist/esm/core/app-shell/shell-motion/shell-motion-vocabulary.js.map +1 -1
  80. package/dist/esm/core/app-shell/shell-motion/use-shell-motion.d.ts.map +1 -1
  81. package/dist/esm/core/app-shell/shell-motion/use-shell-motion.js +2 -2
  82. package/dist/esm/core/app-shell/shell-motion/use-shell-motion.js.map +1 -1
  83. package/dist/esm/core/branding/useBrandPresentation.d.ts.map +1 -1
  84. package/dist/esm/core/branding/useBrandPresentation.js +17 -6
  85. package/dist/esm/core/branding/useBrandPresentation.js.map +1 -1
  86. package/dist/esm/core/components-registry/assert-registry-completeness.frontend.helper.d.ts.map +1 -1
  87. package/dist/esm/core/components-registry/assert-registry-completeness.frontend.helper.js +2 -0
  88. package/dist/esm/core/components-registry/assert-registry-completeness.frontend.helper.js.map +1 -1
  89. package/dist/esm/core/execution/useExecutionResourceOperationContextBuilder.d.ts.map +1 -1
  90. package/dist/esm/core/execution/useExecutionResourceOperationContextBuilder.js +11 -1
  91. package/dist/esm/core/execution/useExecutionResourceOperationContextBuilder.js.map +1 -1
  92. package/dist/esm/core/i18n/I18nContext.d.ts.map +1 -1
  93. package/dist/esm/core/i18n/I18nContext.js +8 -2
  94. package/dist/esm/core/i18n/I18nContext.js.map +1 -1
  95. package/dist/esm/core/i18n/component-label-resolution.utils.d.ts.map +1 -1
  96. package/dist/esm/core/i18n/component-label-resolution.utils.js +6 -1
  97. package/dist/esm/core/i18n/component-label-resolution.utils.js.map +1 -1
  98. package/dist/esm/core/monitoring/analytics/AnalyticsContext.d.ts +0 -15
  99. package/dist/esm/core/monitoring/analytics/AnalyticsContext.d.ts.map +1 -1
  100. package/dist/esm/core/monitoring/analytics/AnalyticsContext.js +71 -6
  101. package/dist/esm/core/monitoring/analytics/AnalyticsContext.js.map +1 -1
  102. package/dist/esm/core/monitoring/analytics/AnalyticsEventBridge.d.ts.map +1 -1
  103. package/dist/esm/core/monitoring/analytics/AnalyticsEventBridge.js +12 -3
  104. package/dist/esm/core/monitoring/analytics/AnalyticsEventBridge.js.map +1 -1
  105. package/dist/esm/core/navigation/NavigationContext.d.ts.map +1 -1
  106. package/dist/esm/core/navigation/NavigationContext.js +60 -17
  107. package/dist/esm/core/navigation/NavigationContext.js.map +1 -1
  108. package/dist/esm/core/navigation/launcher-resolution.d.ts +29 -0
  109. package/dist/esm/core/navigation/launcher-resolution.d.ts.map +1 -1
  110. package/dist/esm/core/navigation/launcher-resolution.js +31 -0
  111. package/dist/esm/core/navigation/launcher-resolution.js.map +1 -1
  112. package/dist/esm/core/navigation/navigation-controller-internals.d.ts +48 -0
  113. package/dist/esm/core/navigation/navigation-controller-internals.d.ts.map +1 -1
  114. package/dist/esm/core/navigation/navigation-controller-internals.js +56 -3
  115. package/dist/esm/core/navigation/navigation-controller-internals.js.map +1 -1
  116. package/dist/esm/core/navigation/useNavigationRouterSync.d.ts.map +1 -1
  117. package/dist/esm/core/navigation/useNavigationRouterSync.js +30 -2
  118. package/dist/esm/core/navigation/useNavigationRouterSync.js.map +1 -1
  119. package/dist/esm/core/requests/wildo-http-client-manual-calls.frontend.service.d.ts +34 -1
  120. package/dist/esm/core/requests/wildo-http-client-manual-calls.frontend.service.d.ts.map +1 -1
  121. package/dist/esm/core/requests/wildo-http-client-manual-calls.frontend.service.js +41 -0
  122. package/dist/esm/core/requests/wildo-http-client-manual-calls.frontend.service.js.map +1 -1
  123. package/dist/esm/core/resources/route-parent-relocation.frontend.utils.d.ts +44 -0
  124. package/dist/esm/core/resources/route-parent-relocation.frontend.utils.d.ts.map +1 -0
  125. package/dist/esm/core/resources/route-parent-relocation.frontend.utils.js +63 -0
  126. package/dist/esm/core/resources/route-parent-relocation.frontend.utils.js.map +1 -0
  127. package/dist/esm/core/resources/useOperationDirectExecution.d.ts.map +1 -1
  128. package/dist/esm/core/resources/useOperationDirectExecution.js +45 -6
  129. package/dist/esm/core/resources/useOperationDirectExecution.js.map +1 -1
  130. package/dist/esm/core/runtime/AppRouter.d.ts.map +1 -1
  131. package/dist/esm/core/runtime/AppRouter.js +18 -1
  132. package/dist/esm/core/runtime/AppRouter.js.map +1 -1
  133. package/dist/esm/core/security/UserOrgsContext.d.ts.map +1 -1
  134. package/dist/esm/core/security/UserOrgsContext.js +61 -8
  135. package/dist/esm/core/security/UserOrgsContext.js.map +1 -1
  136. package/dist/esm/core/ui/inner-control-activation.utils.d.ts +16 -0
  137. package/dist/esm/core/ui/inner-control-activation.utils.d.ts.map +1 -0
  138. package/dist/esm/core/ui/inner-control-activation.utils.js +44 -0
  139. package/dist/esm/core/ui/inner-control-activation.utils.js.map +1 -0
  140. package/dist/esm/index.d.ts +4 -0
  141. package/dist/esm/index.d.ts.map +1 -1
  142. package/dist/esm/index.js +4 -0
  143. package/dist/esm/index.js.map +1 -1
  144. package/dist/tsconfig.build.tsbuildinfo +1 -1
  145. package/package.json +8 -8
@@ -0,0 +1,97 @@
1
+ import React from 'react';
2
+ import { type ApprovalSealCheckOutcome, type ApprovalSealOnRecordView } from '@wildo-ai/saas-models';
3
+ import type { ComponentPresetProps } from '../../core/components-registry/component-registry.frontend.schemas';
4
+ /** Where the read of a record's approval seal stands. */
5
+ export declare enum ApprovalSealReadState {
6
+ /** Asked, not answered yet. */
7
+ LOADING = "loading",
8
+ /** Answered: `view` says how the record shows its seal. */
9
+ READY = "ready",
10
+ /** The read failed: said so, never shown as a record with no seal. */
11
+ FAILED = "failed"
12
+ }
13
+ /** Where a check of the seal (the public verifier, run on demand) stands. */
14
+ export declare enum ApprovalSealCheckState {
15
+ /** Not asked. */
16
+ IDLE = "idle",
17
+ CHECKING = "checking",
18
+ /** Answered: `checkOutcome` says what the verifier found. */
19
+ DONE = "done",
20
+ /** The check could not be made (the request failed): not a verdict on the seal. */
21
+ FAILED = "failed"
22
+ }
23
+ /**
24
+ * What the preset draws (#2913). Presentational: the wrapper reads the seal, labels the moved fields in the record's own
25
+ * words and runs the actions; the preset never decides what a reader may see, the door already did.
26
+ */
27
+ export interface ApprovalSealProps {
28
+ readonly readState: ApprovalSealReadState;
29
+ /** Present when `readState` is READY. */
30
+ readonly view?: ApprovalSealOnRecordView;
31
+ /** The record's own labels of `view.currency.movedFields`, in the same order. Never their values. */
32
+ readonly movedFieldLabels?: readonly string[];
33
+ /** The approval's meaning, in its vocabulary's words (`system_enums.ApprovalSealMeaning`). */
34
+ readonly meaningLabel?: string;
35
+ /** The decision's outcome, in its vocabulary's words (`system_enums.HumanDecision_Outcome`). */
36
+ readonly outcomeLabel?: string;
37
+ readonly checkState?: ApprovalSealCheckState;
38
+ /** Present when `checkState` is DONE. */
39
+ readonly checkOutcome?: ApprovalSealCheckOutcome;
40
+ /** Runs the public verifier on the seal; offered only for a signed seal. */
41
+ readonly onCheck?: () => void;
42
+ /** Downloads the deliverable's manifested copy; offered only when the seal holds one that can be served. */
43
+ readonly onDownloadManifestedCopy?: () => void;
44
+ readonly downloadingManifestedCopy?: boolean;
45
+ /** What the seal is about, when the surface does not already say it (a decided card: the decision's title). */
46
+ readonly description?: string;
47
+ readonly className?: string;
48
+ }
49
+ /** The preset, resolved from the registry: an application may replace how a seal is drawn. */
50
+ export declare function ApprovalSeal({ preset, ...props }: ApprovalSealProps & ComponentPresetProps): React.JSX.Element;
51
+ export interface RecordApprovalSealProps {
52
+ /**
53
+ * The record's field holding the seal's id (`signOffApprovalSealId`). A top-level field: the door checks that the record
54
+ * stores this seal there, so a seal whose approved effect failed (one the record does not name) is never shown.
55
+ */
56
+ readonly field: string;
57
+ /** Draw nothing when the record names no seal in the field, instead of saying it has none. */
58
+ readonly hideWhenNone?: boolean;
59
+ readonly className?: string;
60
+ }
61
+ /**
62
+ * The approval seal the record on this display surface stores in `field` (#2913): who approved it, when, with what
63
+ * meaning, whether the approval still describes the record, its deliverable's manifested copy and a check of the seal.
64
+ *
65
+ * Place it in a resource's DISPLAY template (`*.ui-behavior.tsx`), where the record and its resource are in context. It
66
+ * asks `GET /approval-seals/:sealId/records/:resourceType/:resourceId/:field`, which admits exactly the readers the
67
+ * record's own READ admits, and asks again when the record changes, since whether the approval is current depends on it.
68
+ * Moved fields are labelled with the record's own field labels; their values are never shown.
69
+ */
70
+ export declare function RecordApprovalSeal({ field, hideWhenNone, className }: RecordApprovalSealProps): React.JSX.Element | null;
71
+ export interface FileApprovalSealProps {
72
+ /** The file a seal may attest: the deliverable a person approved by its hash (a close report's PDF). */
73
+ readonly fileId: string;
74
+ readonly className?: string;
75
+ }
76
+ /**
77
+ * The approval seal that attests a file, under the file (#2913): drawn by `DisplayFieldFile` on a DISPLAY surface, and
78
+ * nothing at all for the many files no seal attests. It asks `GET /approval-seals/files/:fileId`, admitted by the READ
79
+ * of the record the file belongs to, and only for a seal its own record still names (an approval whose effect failed
80
+ * shows nothing). Currency is not drawn here: it is a statement about the record the approval is about.
81
+ */
82
+ export declare function FileApprovalSeal({ fileId, className }: FileApprovalSealProps): React.JSX.Element | null;
83
+ export interface DecisionApprovalSealProps {
84
+ /** The decision the signed-in person just answered. */
85
+ readonly decisionRef: string;
86
+ /** What the decision was about, in the card's own words (the title the inbox showed). */
87
+ readonly description?: string;
88
+ readonly className?: string;
89
+ }
90
+ /**
91
+ * The seal of a decision the signed-in person answered (#2913), for a decision card once it is decided: asked of
92
+ * `GET /approval-seals/decisions/:decisionRef`, which answers the decider only. The seal is signed seconds after the
93
+ * decision, so a PENDING seal is asked again until it is signed (about a minute at most); a decision that sealed nothing
94
+ * draws nothing.
95
+ */
96
+ export declare function DecisionApprovalSeal({ decisionRef, description, className }: DecisionApprovalSealProps): React.JSX.Element | null;
97
+ //# sourceMappingURL=approval-seal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"approval-seal.d.ts","sourceRoot":"","sources":["../../../../src/components/data-display/approval-seal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAA;AACvE,OAAO,EAML,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC9B,MAAM,uBAAuB,CAAA;AAG9B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kFAAkF,CAAA;AAW5H,yDAAyD;AACzD,oBAAY,qBAAqB;IAC/B,+BAA+B;IAC/B,OAAO,YAAY;IACnB,2DAA2D;IAC3D,KAAK,UAAU;IACf,sEAAsE;IACtE,MAAM,WAAW;CAClB;AAED,6EAA6E;AAC7E,oBAAY,sBAAsB;IAChC,iBAAiB;IACjB,IAAI,SAAS;IACb,QAAQ,aAAa;IACrB,6DAA6D;IAC7D,IAAI,SAAS;IACb,mFAAmF;IACnF,MAAM,WAAW;CAClB;AAID;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,SAAS,EAAE,qBAAqB,CAAA;IACzC,yCAAyC;IACzC,QAAQ,CAAC,IAAI,CAAC,EAAE,wBAAwB,CAAA;IACxC,qGAAqG;IACrG,QAAQ,CAAC,gBAAgB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IAC7C,8FAA8F;IAC9F,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAA;IAC9B,gGAAgG;IAChG,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAA;IAC9B,QAAQ,CAAC,UAAU,CAAC,EAAE,sBAAsB,CAAA;IAC5C,yCAAyC;IACzC,QAAQ,CAAC,YAAY,CAAC,EAAE,wBAAwB,CAAA;IAChD,4EAA4E;IAC5E,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IAC7B,4GAA4G;IAC5G,QAAQ,CAAC,wBAAwB,CAAC,EAAE,MAAM,IAAI,CAAA;IAC9C,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,EAAE,WAAW,EAAE,SAAS,EAAE,EAAE,yBAAyB,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,GAAG,IAAI,CAWjI"}
@@ -0,0 +1,208 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useCallback, useEffect, useRef, useState } from 'react';
3
+ import { ApprovalSealOnRecordState, ApprovalSealSchema, CoreResourceType, ErrorType, approvalSealCheckOutcomeOf, } from '@wildo-ai/saas-models';
4
+ import { FrontendComponentType, CorePresetNames } from '@wildo-ai/presets-components-models';
5
+ import { createComponentResolver } from '../../core/components-registry/component-resolver.frontend.helper.js';
6
+ import { getManualCallsHttpClient } from '../../core/requests/wildo-http-client-manual-calls.frontend.service.js';
7
+ import { saveBlobAsFile } from '../../core/commons/save-blob-as-file.frontend.utils.js';
8
+ import { useResourceDisplayContext } from '../../components/data-display/automatic-displayer.utils.js';
9
+ import { useOptionalDisplayTemplateContext } from '../../components/data-display/DisplayTemplateContext.js';
10
+ import { useI18n } from '../../core/i18n/useI18n.js';
11
+ import { isBackendRefusal } from '../../core/errors/backend-refusal.frontend.js';
12
+ /** The seal's own resource, whose fields declare the vocabularies the meaning and the outcome are worded from. */
13
+ const APPROVAL_SEALS = CoreResourceType.APPROVAL_SEALS;
14
+ /** Where the read of a record's approval seal stands. */
15
+ export var ApprovalSealReadState;
16
+ (function (ApprovalSealReadState) {
17
+ /** Asked, not answered yet. */
18
+ ApprovalSealReadState["LOADING"] = "loading";
19
+ /** Answered: `view` says how the record shows its seal. */
20
+ ApprovalSealReadState["READY"] = "ready";
21
+ /** The read failed: said so, never shown as a record with no seal. */
22
+ ApprovalSealReadState["FAILED"] = "failed";
23
+ })(ApprovalSealReadState || (ApprovalSealReadState = {}));
24
+ /** Where a check of the seal (the public verifier, run on demand) stands. */
25
+ export var ApprovalSealCheckState;
26
+ (function (ApprovalSealCheckState) {
27
+ /** Not asked. */
28
+ ApprovalSealCheckState["IDLE"] = "idle";
29
+ ApprovalSealCheckState["CHECKING"] = "checking";
30
+ /** Answered: `checkOutcome` says what the verifier found. */
31
+ ApprovalSealCheckState["DONE"] = "done";
32
+ /** The check could not be made (the request failed): not a verdict on the seal. */
33
+ ApprovalSealCheckState["FAILED"] = "failed";
34
+ })(ApprovalSealCheckState || (ApprovalSealCheckState = {}));
35
+ // --- Wrapper ---
36
+ /** The preset, resolved from the registry: an application may replace how a seal is drawn. */
37
+ export function ApprovalSeal({ preset = CorePresetNames.DEFAULT, ...props }) {
38
+ const Component = createComponentResolver(FrontendComponentType.LOW_LEVEL_APPROVAL_SEAL, 'ApprovalSeal')(preset);
39
+ return _jsx(Component, { ...props });
40
+ }
41
+ /** A stored id as a string; anything else is not an id. */
42
+ function sealIdOf(value) {
43
+ return typeof value === 'string' && value.length > 0 ? value : undefined;
44
+ }
45
+ /** How often, and how many times, a PENDING seal is asked again after a decision (about a minute in all). */
46
+ const PENDING_SEAL_POLL_INTERVAL_MS = 3_000;
47
+ const PENDING_SEAL_POLL_MAX = 20;
48
+ /** Whether a failed read is the door answering "nothing here" (404), never a failure the reader should see. */
49
+ function isNotFound(error) {
50
+ return isBackendRefusal(error) && error.errorType === ErrorType.NOT_FOUND;
51
+ }
52
+ /** The state shared by every seal wrapper: the read, the check, the download. */
53
+ function useApprovalSealView(source) {
54
+ const [read, setRead] = useState({ state: ApprovalSealReadState.LOADING });
55
+ const [none, setNone] = useState(false);
56
+ const [check, setCheck] = useState({ state: ApprovalSealCheckState.IDLE });
57
+ const [downloading, setDownloading] = useState(false);
58
+ const key = source?.key;
59
+ useEffect(() => {
60
+ if (!source)
61
+ return;
62
+ let current = true;
63
+ let polls = 0;
64
+ let timer;
65
+ setRead({ state: ApprovalSealReadState.LOADING });
66
+ setNone(false);
67
+ setCheck({ state: ApprovalSealCheckState.IDLE });
68
+ const ask = () => {
69
+ // Through a promise, so a load that throws before it returns one is a failed read like any other.
70
+ Promise.resolve().then(source.load)
71
+ .then((view) => {
72
+ if (!current)
73
+ return;
74
+ setRead({ state: ApprovalSealReadState.READY, view });
75
+ if (source.pollWhilePending && view.state === ApprovalSealOnRecordState.PENDING && polls < PENDING_SEAL_POLL_MAX) {
76
+ polls += 1;
77
+ timer = setTimeout(ask, PENDING_SEAL_POLL_INTERVAL_MS);
78
+ }
79
+ })
80
+ .catch((error) => {
81
+ if (!current)
82
+ return;
83
+ if (source.notFoundIsNone && isNotFound(error))
84
+ setNone(true);
85
+ else
86
+ setRead({ state: ApprovalSealReadState.FAILED });
87
+ });
88
+ };
89
+ ask();
90
+ return () => { current = false; if (timer)
91
+ clearTimeout(timer); };
92
+ // `key` names what is asked; the source object itself is rebuilt on every render.
93
+ }, [key]);
94
+ const jws = read.view?.jws;
95
+ const onCheck = useCallback(() => {
96
+ if (!jws)
97
+ return;
98
+ setCheck({ state: ApprovalSealCheckState.CHECKING });
99
+ getManualCallsHttpClient().checkApprovalSeal(jws)
100
+ .then((verdict) => setCheck({ state: ApprovalSealCheckState.DONE, outcome: approvalSealCheckOutcomeOf(verdict) }))
101
+ .catch(() => setCheck({ state: ApprovalSealCheckState.FAILED }));
102
+ }, [jws]);
103
+ const onDownloadManifestedCopy = useCallback(() => {
104
+ if (!source?.download)
105
+ return;
106
+ setDownloading(true);
107
+ source.download()
108
+ .then((blob) => saveBlobAsFile(blob, source.downloadName))
109
+ .catch(() => undefined)
110
+ .finally(() => setDownloading(false));
111
+ }, [key]);
112
+ return { read, none, check, onCheck, onDownloadManifestedCopy, downloading };
113
+ }
114
+ /** Draws one seal view through the preset, with the meaning and outcome in their vocabularies' words. */
115
+ function ApprovalSealOf({ state, offersCopy = true, movedFieldLabels, description, className }) {
116
+ const { tResourceFieldEnumValue } = useI18n();
117
+ const { read, check, onCheck, onDownloadManifestedCopy, downloading } = state;
118
+ const view = read.view;
119
+ const shape = ApprovalSealSchema.shape;
120
+ return (_jsx(ApprovalSeal, { readState: read.state, ...(view ? { view } : {}), ...(movedFieldLabels ? { movedFieldLabels } : {}), ...(description ? { description } : {}), ...(view?.meaning ? { meaningLabel: tResourceFieldEnumValue(APPROVAL_SEALS, 'meaning', view.meaning, shape.meaning) } : {}), ...(view?.outcome ? { outcomeLabel: tResourceFieldEnumValue(APPROVAL_SEALS, 'outcome', view.outcome, shape.outcome) } : {}), checkState: check.state, ...(check.outcome ? { checkOutcome: check.outcome } : {}), ...(view?.jws ? { onCheck } : {}), ...(offersCopy && view?.deliverable?.manifestedCopyAvailable ? { onDownloadManifestedCopy, downloadingManifestedCopy: downloading } : {}), ...(className ? { className } : {}) }));
121
+ }
122
+ /**
123
+ * The approval seal the record on this display surface stores in `field` (#2913): who approved it, when, with what
124
+ * meaning, whether the approval still describes the record, its deliverable's manifested copy and a check of the seal.
125
+ *
126
+ * Place it in a resource's DISPLAY template (`*.ui-behavior.tsx`), where the record and its resource are in context. It
127
+ * asks `GET /approval-seals/:sealId/records/:resourceType/:resourceId/:field`, which admits exactly the readers the
128
+ * record's own READ admits, and asks again when the record changes, since whether the approval is current depends on it.
129
+ * Moved fields are labelled with the record's own field labels; their values are never shown.
130
+ */
131
+ export function RecordApprovalSeal({ field, hideWhenNone, className }) {
132
+ const { resourceType, resourceId } = useResourceDisplayContext();
133
+ const template = useOptionalDisplayTemplateContext();
134
+ const record = template?.data;
135
+ const sealId = sealIdOf(record?.[field]);
136
+ const recordVersion = useRecordVersion(record);
137
+ const target = sealId && resourceType && resourceId ? { sealId, resourceType: String(resourceType), resourceId: String(resourceId), field } : undefined;
138
+ const state = useApprovalSealView(target ? {
139
+ // The record is part of what is asked: a value the approval covers may have moved.
140
+ key: `${target.sealId}|${target.resourceType}|${target.resourceId}|${field}|${recordVersion}`,
141
+ load: () => getManualCallsHttpClient().readApprovalSealOnRecord(target),
142
+ download: () => getManualCallsHttpClient().downloadApprovalSealManifestedCopy(target),
143
+ downloadName: `approval-${target.sealId}.pdf`,
144
+ } : undefined);
145
+ if (!record)
146
+ return null;
147
+ if (!target) {
148
+ if (hideWhenNone || !resourceType)
149
+ return null;
150
+ return _jsx(ApprovalSeal, { readState: ApprovalSealReadState.READY, view: { sealId: '', state: ApprovalSealOnRecordState.NO_SEAL }, ...(className ? { className } : {}) });
151
+ }
152
+ const movedFieldLabels = state.read.view?.currency?.movedFields.map((name) => template?.fieldLabels?.[name] ?? name);
153
+ return _jsx(ApprovalSealOf, { state: state, ...(movedFieldLabels ? { movedFieldLabels } : {}), ...(className ? { className } : {}) });
154
+ }
155
+ /** A record's identity in time, so the record's seal is asked again when the record changes. */
156
+ function useRecordVersion(record) {
157
+ const updatedAt = record?.updatedAt;
158
+ const stamp = updatedAt instanceof Date ? updatedAt.toISOString() : typeof updatedAt === 'string' ? updatedAt : '';
159
+ // Without a stamp, the object's identity is the version: a re-read hands a new object.
160
+ const [identity, setIdentity] = useState(0);
161
+ const last = useRef(record);
162
+ useEffect(() => {
163
+ if (last.current !== record) {
164
+ last.current = record;
165
+ if (!stamp)
166
+ setIdentity((value) => value + 1);
167
+ }
168
+ }, [record, stamp]);
169
+ return stamp || String(identity);
170
+ }
171
+ /**
172
+ * The approval seal that attests a file, under the file (#2913): drawn by `DisplayFieldFile` on a DISPLAY surface, and
173
+ * nothing at all for the many files no seal attests. It asks `GET /approval-seals/files/:fileId`, admitted by the READ
174
+ * of the record the file belongs to, and only for a seal its own record still names (an approval whose effect failed
175
+ * shows nothing). Currency is not drawn here: it is a statement about the record the approval is about.
176
+ */
177
+ export function FileApprovalSeal({ fileId, className }) {
178
+ const state = useApprovalSealView({
179
+ key: fileId,
180
+ load: () => getManualCallsHttpClient().readApprovalSealOnFile(fileId),
181
+ download: () => getManualCallsHttpClient().downloadApprovalSealFileManifestedCopy(fileId),
182
+ downloadName: `approval-${fileId}.pdf`,
183
+ notFoundIsNone: true,
184
+ });
185
+ if (state.none || state.read.state === ApprovalSealReadState.LOADING)
186
+ return null;
187
+ return _jsx(ApprovalSealOf, { state: state, ...(className ? { className } : {}) });
188
+ }
189
+ /**
190
+ * The seal of a decision the signed-in person answered (#2913), for a decision card once it is decided: asked of
191
+ * `GET /approval-seals/decisions/:decisionRef`, which answers the decider only. The seal is signed seconds after the
192
+ * decision, so a PENDING seal is asked again until it is signed (about a minute at most); a decision that sealed nothing
193
+ * draws nothing.
194
+ */
195
+ export function DecisionApprovalSeal({ decisionRef, description, className }) {
196
+ const state = useApprovalSealView({
197
+ key: decisionRef,
198
+ load: () => getManualCallsHttpClient().readApprovalSealOfDecision(decisionRef),
199
+ downloadName: `approval-${decisionRef}.pdf`,
200
+ notFoundIsNone: true,
201
+ pollWhilePending: true,
202
+ });
203
+ if (state.none)
204
+ return null;
205
+ // The decider's view offers no copy: the deliverable is the record's, downloaded where the record is read.
206
+ return _jsx(ApprovalSealOf, { state: state, offersCopy: false, ...(description ? { description } : {}), ...(className ? { className } : {}) });
207
+ }
208
+ //# sourceMappingURL=approval-seal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"approval-seal.js","sourceRoot":"","sources":["../../../../src/components/data-display/approval-seal.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACvE,OAAO,EACL,yBAAyB,EACzB,kBAAkB,EAClB,gBAAgB,EAChB,SAAS,EACT,0BAA0B,GAG3B,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAA;AAC5F,OAAO,EAAE,uBAAuB,EAAE,MAAM,iFAAiF,CAAA;AAEzH,OAAO,EAAE,wBAAwB,EAAE,MAAM,mFAAmF,CAAA;AAC5H,OAAO,EAAE,cAAc,EAAE,MAAM,mEAAmE,CAAA;AAClG,OAAO,EAAE,yBAAyB,EAAE,MAAM,uEAAuE,CAAA;AACjH,OAAO,EAAE,iCAAiC,EAAE,MAAM,oEAAoE,CAAA;AACtH,OAAO,EAAE,OAAO,EAAE,MAAM,uCAAuC,CAAA;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0DAA0D,CAAA;AAE3F,kHAAkH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,CAAC,CAAC,CAAC,EAAE,CAAC,GAAI,CAAA;AAC5I,CAAC","sourcesContent":["import React, { useCallback, useEffect, useRef, useState } from 'react'\nimport {\n ApprovalSealOnRecordState,\n ApprovalSealSchema,\n CoreResourceType,\n ErrorType,\n approvalSealCheckOutcomeOf,\n type ApprovalSealCheckOutcome,\n type ApprovalSealOnRecordView,\n} from '@wildo-ai/saas-models'\nimport { FrontendComponentType, CorePresetNames } from '@wildo-ai/presets-components-models'\nimport { createComponentResolver } from '~wildo-frontend-lib/core/components-registry/component-resolver.frontend.helper'\nimport type { ComponentPresetProps } from '~wildo-frontend-lib/core/components-registry/component-registry.frontend.schemas'\nimport { getManualCallsHttpClient } from '~wildo-frontend-lib/core/requests/wildo-http-client-manual-calls.frontend.service'\nimport { saveBlobAsFile } from '~wildo-frontend-lib/core/commons/save-blob-as-file.frontend.utils'\nimport { useResourceDisplayContext } from '~wildo-frontend-lib/components/data-display/automatic-displayer.utils'\nimport { useOptionalDisplayTemplateContext } from '~wildo-frontend-lib/components/data-display/DisplayTemplateContext'\nimport { useI18n } from '~wildo-frontend-lib/core/i18n/useI18n'\nimport { isBackendRefusal } from '~wildo-frontend-lib/core/errors/backend-refusal.frontend'\n\n/** The seal's own resource, whose fields declare the vocabularies the meaning and the outcome are worded from. */\nconst APPROVAL_SEALS = CoreResourceType.APPROVAL_SEALS\n\n/** Where the read of a record's approval seal stands. */\nexport enum ApprovalSealReadState {\n /** Asked, not answered yet. */\n LOADING = 'loading',\n /** Answered: `view` says how the record shows its seal. */\n READY = 'ready',\n /** The read failed: said so, never shown as a record with no seal. */\n FAILED = 'failed',\n}\n\n/** Where a check of the seal (the public verifier, run on demand) stands. */\nexport enum ApprovalSealCheckState {\n /** Not asked. */\n IDLE = 'idle',\n CHECKING = 'checking',\n /** Answered: `checkOutcome` says what the verifier found. */\n DONE = 'done',\n /** The check could not be made (the request failed): not a verdict on the seal. */\n FAILED = 'failed',\n}\n\n// --- Contract ---\n\n/**\n * What the preset draws (#2913). Presentational: the wrapper reads the seal, labels the moved fields in the record's own\n * words and runs the actions; the preset never decides what a reader may see, the door already did.\n */\nexport interface ApprovalSealProps {\n readonly readState: ApprovalSealReadState\n /** Present when `readState` is READY. */\n readonly view?: ApprovalSealOnRecordView\n /** The record's own labels of `view.currency.movedFields`, in the same order. Never their values. */\n readonly movedFieldLabels?: readonly string[]\n /** The approval's meaning, in its vocabulary's words (`system_enums.ApprovalSealMeaning`). */\n readonly meaningLabel?: string\n /** The decision's outcome, in its vocabulary's words (`system_enums.HumanDecision_Outcome`). */\n readonly outcomeLabel?: string\n readonly checkState?: ApprovalSealCheckState\n /** Present when `checkState` is DONE. */\n readonly checkOutcome?: ApprovalSealCheckOutcome\n /** Runs the public verifier on the seal; offered only for a signed seal. */\n readonly onCheck?: () => void\n /** Downloads the deliverable's manifested copy; offered only when the seal holds one that can be served. */\n readonly onDownloadManifestedCopy?: () => void\n readonly downloadingManifestedCopy?: boolean\n /** What the seal is about, when the surface does not already say it (a decided card: the decision's title). */\n readonly description?: string\n readonly className?: string\n}\n\n// --- Wrapper ---\n\n/** The preset, resolved from the registry: an application may replace how a seal is drawn. */\nexport function ApprovalSeal({ preset = CorePresetNames.DEFAULT, ...props }: ApprovalSealProps & ComponentPresetProps): React.JSX.Element {\n const Component = createComponentResolver<ApprovalSealProps>(FrontendComponentType.LOW_LEVEL_APPROVAL_SEAL, 'ApprovalSeal')(preset)\n return <Component {...props} />\n}\n\n/** A stored id as a string; anything else is not an id. */\nfunction sealIdOf(value: unknown): string | undefined {\n return typeof value === 'string' && value.length > 0 ? value : undefined\n}\n\nexport interface RecordApprovalSealProps {\n /**\n * The record's field holding the seal's id (`signOffApprovalSealId`). A top-level field: the door checks that the record\n * stores this seal there, so a seal whose approved effect failed (one the record does not name) is never shown.\n */\n readonly field: string\n /** Draw nothing when the record names no seal in the field, instead of saying it has none. */\n readonly hideWhenNone?: boolean\n readonly className?: string\n}\n\n/** How a wrapper reads one seal view, downloads its copy, and whether a missing seal is an answer or a failure. */\ninterface ApprovalSealSource {\n /** Changes when what is asked changes (and, for a record, when the record does). */\n readonly key: string\n readonly load: () => Promise<ApprovalSealOnRecordView>\n /** Absent where the view offers no copy (the decider's view: the deliverable is downloaded where its record is read). */\n readonly download?: () => Promise<Blob>\n readonly downloadName: string\n /** A 404 means \"no seal here\" (a file nothing attests, a decision that sealed nothing): draw nothing, not a failure. */\n readonly notFoundIsNone?: boolean\n /** Ask again while the seal is PENDING: a decision just made is signed seconds later. */\n readonly pollWhilePending?: boolean\n}\n\n/** How often, and how many times, a PENDING seal is asked again after a decision (about a minute in all). */\nconst PENDING_SEAL_POLL_INTERVAL_MS = 3_000\nconst PENDING_SEAL_POLL_MAX = 20\n\n/** Whether a failed read is the door answering \"nothing here\" (404), never a failure the reader should see. */\nfunction isNotFound(error: unknown): boolean {\n return isBackendRefusal(error) && error.errorType === ErrorType.NOT_FOUND\n}\n\n/** The state shared by every seal wrapper: the read, the check, the download. */\nfunction useApprovalSealView(source: ApprovalSealSource | undefined): {\n readonly read: { readonly state: ApprovalSealReadState; readonly view?: ApprovalSealOnRecordView }\n readonly none: boolean\n readonly check: { readonly state: ApprovalSealCheckState; readonly outcome?: ApprovalSealCheckOutcome }\n readonly onCheck: () => void\n readonly onDownloadManifestedCopy: () => void\n readonly downloading: boolean\n} {\n const [read, setRead] = useState<{ readonly state: ApprovalSealReadState; readonly view?: ApprovalSealOnRecordView }>({ state: ApprovalSealReadState.LOADING })\n const [none, setNone] = useState(false)\n const [check, setCheck] = useState<{ readonly state: ApprovalSealCheckState; readonly outcome?: ApprovalSealCheckOutcome }>({ state: ApprovalSealCheckState.IDLE })\n const [downloading, setDownloading] = useState(false)\n const key = source?.key\n\n useEffect(() => {\n if (!source) return\n let current = true\n let polls = 0\n let timer: ReturnType<typeof setTimeout> | undefined\n setRead({ state: ApprovalSealReadState.LOADING })\n setNone(false)\n setCheck({ state: ApprovalSealCheckState.IDLE })\n const ask = (): void => {\n // Through a promise, so a load that throws before it returns one is a failed read like any other.\n Promise.resolve().then(source.load)\n .then((view) => {\n if (!current) return\n setRead({ state: ApprovalSealReadState.READY, view })\n if (source.pollWhilePending && view.state === ApprovalSealOnRecordState.PENDING && polls < PENDING_SEAL_POLL_MAX) {\n polls += 1\n timer = setTimeout(ask, PENDING_SEAL_POLL_INTERVAL_MS)\n }\n })\n .catch((error: unknown) => {\n if (!current) return\n if (source.notFoundIsNone && isNotFound(error)) setNone(true)\n else setRead({ state: ApprovalSealReadState.FAILED })\n })\n }\n ask()\n return () => { current = false; if (timer) clearTimeout(timer) }\n // `key` names what is asked; the source object itself is rebuilt on every render.\n }, [key])\n\n const jws = read.view?.jws\n const onCheck = useCallback(() => {\n if (!jws) return\n setCheck({ state: ApprovalSealCheckState.CHECKING })\n getManualCallsHttpClient().checkApprovalSeal(jws)\n .then((verdict) => setCheck({ state: ApprovalSealCheckState.DONE, outcome: approvalSealCheckOutcomeOf(verdict) }))\n .catch(() => setCheck({ state: ApprovalSealCheckState.FAILED }))\n }, [jws])\n\n const onDownloadManifestedCopy = useCallback(() => {\n if (!source?.download) return\n setDownloading(true)\n source.download()\n .then((blob) => saveBlobAsFile(blob, source.downloadName))\n .catch(() => undefined)\n .finally(() => setDownloading(false))\n }, [key])\n\n return { read, none, check, onCheck, onDownloadManifestedCopy, downloading }\n}\n\n/** Draws one seal view through the preset, with the meaning and outcome in their vocabularies' words. */\nfunction ApprovalSealOf({ state, offersCopy = true, movedFieldLabels, description, className }: {\n readonly state: ReturnType<typeof useApprovalSealView>\n readonly offersCopy?: boolean\n readonly movedFieldLabels?: readonly string[]\n readonly description?: string\n readonly className?: string\n}): React.JSX.Element {\n const { tResourceFieldEnumValue } = useI18n()\n const { read, check, onCheck, onDownloadManifestedCopy, downloading } = state\n const view = read.view\n const shape = ApprovalSealSchema.shape\n return (\n <ApprovalSeal\n readState={read.state}\n {...(view ? { view } : {})}\n {...(movedFieldLabels ? { movedFieldLabels } : {})}\n {...(description ? { description } : {})}\n {...(view?.meaning ? { meaningLabel: tResourceFieldEnumValue(APPROVAL_SEALS, 'meaning', view.meaning, shape.meaning) } : {})}\n {...(view?.outcome ? { outcomeLabel: tResourceFieldEnumValue(APPROVAL_SEALS, 'outcome', view.outcome, shape.outcome) } : {})}\n checkState={check.state}\n {...(check.outcome ? { checkOutcome: check.outcome } : {})}\n {...(view?.jws ? { onCheck } : {})}\n {...(offersCopy && view?.deliverable?.manifestedCopyAvailable ? { onDownloadManifestedCopy, downloadingManifestedCopy: downloading } : {})}\n {...(className ? { className } : {})}\n />\n )\n}\n\n/**\n * The approval seal the record on this display surface stores in `field` (#2913): who approved it, when, with what\n * meaning, whether the approval still describes the record, its deliverable's manifested copy and a check of the seal.\n *\n * Place it in a resource's DISPLAY template (`*.ui-behavior.tsx`), where the record and its resource are in context. It\n * asks `GET /approval-seals/:sealId/records/:resourceType/:resourceId/:field`, which admits exactly the readers the\n * record's own READ admits, and asks again when the record changes, since whether the approval is current depends on it.\n * Moved fields are labelled with the record's own field labels; their values are never shown.\n */\nexport function RecordApprovalSeal({ field, hideWhenNone, className }: RecordApprovalSealProps): React.JSX.Element | null {\n const { resourceType, resourceId } = useResourceDisplayContext()\n const template = useOptionalDisplayTemplateContext()\n const record = template?.data\n const sealId = sealIdOf(record?.[field])\n const recordVersion = useRecordVersion(record)\n const target = sealId && resourceType && resourceId ? { sealId, resourceType: String(resourceType), resourceId: String(resourceId), field } : undefined\n const state = useApprovalSealView(target ? {\n // The record is part of what is asked: a value the approval covers may have moved.\n key: `${target.sealId}|${target.resourceType}|${target.resourceId}|${field}|${recordVersion}`,\n load: () => getManualCallsHttpClient().readApprovalSealOnRecord(target),\n download: () => getManualCallsHttpClient().downloadApprovalSealManifestedCopy(target),\n downloadName: `approval-${target.sealId}.pdf`,\n } : undefined)\n\n if (!record) return null\n if (!target) {\n if (hideWhenNone || !resourceType) return null\n return <ApprovalSeal readState={ApprovalSealReadState.READY} view={{ sealId: '', state: ApprovalSealOnRecordState.NO_SEAL }} {...(className ? { className } : {})} />\n }\n const movedFieldLabels = state.read.view?.currency?.movedFields.map((name) => template?.fieldLabels?.[name] ?? name)\n return <ApprovalSealOf state={state} {...(movedFieldLabels ? { movedFieldLabels } : {})} {...(className ? { className } : {})} />\n}\n\n/** A record's identity in time, so the record's seal is asked again when the record changes. */\nfunction useRecordVersion(record: Record<string, unknown> | undefined): string {\n const updatedAt = record?.updatedAt\n const stamp = updatedAt instanceof Date ? updatedAt.toISOString() : typeof updatedAt === 'string' ? updatedAt : ''\n // Without a stamp, the object's identity is the version: a re-read hands a new object.\n const [identity, setIdentity] = useState(0)\n const last = useRef(record)\n useEffect(() => {\n if (last.current !== record) { last.current = record; if (!stamp) setIdentity((value) => value + 1) }\n }, [record, stamp])\n return stamp || String(identity)\n}\n\nexport interface FileApprovalSealProps {\n /** The file a seal may attest: the deliverable a person approved by its hash (a close report's PDF). */\n readonly fileId: string\n readonly className?: string\n}\n\n/**\n * The approval seal that attests a file, under the file (#2913): drawn by `DisplayFieldFile` on a DISPLAY surface, and\n * nothing at all for the many files no seal attests. It asks `GET /approval-seals/files/:fileId`, admitted by the READ\n * of the record the file belongs to, and only for a seal its own record still names (an approval whose effect failed\n * shows nothing). Currency is not drawn here: it is a statement about the record the approval is about.\n */\nexport function FileApprovalSeal({ fileId, className }: FileApprovalSealProps): React.JSX.Element | null {\n const state = useApprovalSealView({\n key: fileId,\n load: () => getManualCallsHttpClient().readApprovalSealOnFile(fileId),\n download: () => getManualCallsHttpClient().downloadApprovalSealFileManifestedCopy(fileId),\n downloadName: `approval-${fileId}.pdf`,\n notFoundIsNone: true,\n })\n if (state.none || state.read.state === ApprovalSealReadState.LOADING) return null\n return <ApprovalSealOf state={state} {...(className ? { className } : {})} />\n}\n\nexport interface DecisionApprovalSealProps {\n /** The decision the signed-in person just answered. */\n readonly decisionRef: string\n /** What the decision was about, in the card's own words (the title the inbox showed). */\n readonly description?: string\n readonly className?: string\n}\n\n/**\n * The seal of a decision the signed-in person answered (#2913), for a decision card once it is decided: asked of\n * `GET /approval-seals/decisions/:decisionRef`, which answers the decider only. The seal is signed seconds after the\n * decision, so a PENDING seal is asked again until it is signed (about a minute at most); a decision that sealed nothing\n * draws nothing.\n */\nexport function DecisionApprovalSeal({ decisionRef, description, className }: DecisionApprovalSealProps): React.JSX.Element | null {\n const state = useApprovalSealView({\n key: decisionRef,\n load: () => getManualCallsHttpClient().readApprovalSealOfDecision(decisionRef),\n downloadName: `approval-${decisionRef}.pdf`,\n notFoundIsNone: true,\n pollWhilePending: true,\n })\n if (state.none) return null\n // The decider's view offers no copy: the deliverable is the record's, downloaded where the record is read.\n return <ApprovalSealOf state={state} offersCopy={false} {...(description ? { description } : {})} {...(className ? { className } : {})} />\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"external-data-provenance.frontend.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/external-data-provenance/external-data-provenance.frontend.ts"],"names":[],"mappings":"AA4BA,OAAO,EAIL,KAAK,+BAA+B,EACpC,KAAK,8BAA8B,EACpC,MAAM,qCAAqC,CAAC;AAI7C,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,+DAA+D,CAAC;AACtH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sEAAsE,CAAC;AAEnH,qHAAqH;AACrH,eAAO,MAAM,+BAA+B,QAAgB,CAAC;AAE7D;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,+GAA+G;IAC/G,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,6GAA6G;IAC7G,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAID,+FAA+F;AAC/F,wBAAgB,0BAA0B,CAAC,WAAW,EAAE,+BAA+B,GAAG,WAAW,CAAC,MAAM,CAAC,CAO5G;AAED;;;;;;;;GAQG;AACH,wBAAgB,+BAA+B,CAAC,MAAM,EAAE;IACtD,qBAAqB,EAAE,gCAAgC,CAAC;IACxD,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;CACvD,GAAG,MAAM,GAAG,SAAS,CAiBrB;AAOD,4EAA4E;AAC5E,KAAK,gBAAgB,GAAG,IAAI,CAAC,sBAAsB,EAAE,KAAK,CAAC,CAAC;AAwB5D,2CAA2C;AAC3C,wBAAgB,+BAA+B,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAGhF;AAED;;;GAGG;AACH,wBAAgB,oCAAoC,CAClD,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,MAAM,EAAE,gBAAgB,GAAG,SAAS,EACpC,GAAG,GAAE,MAAmB,GACvB,MAAM,GAAG,SAAS,CAGpB;AAED,+GAA+G;AAC/G,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,MAAM,EAAE,gBAAgB,GAAG,SAAS,GAAG,8BAA8B,GAAG,IAAI,GAAG,SAAS,CAG5J;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,gBAAgB,EAAE,GAAG,GAAE,MAAmB,GAAG,IAAI,CAkBvH;AAED,6CAA6C;AAC7C,wBAAgB,gCAAgC,IAAI,IAAI,CAGvD"}
1
+ {"version":3,"file":"external-data-provenance.frontend.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/external-data-provenance/external-data-provenance.frontend.ts"],"names":[],"mappings":"AA2BA,OAAO,EAIL,KAAK,+BAA+B,EACpC,KAAK,8BAA8B,EACpC,MAAM,qCAAqC,CAAC;AAI7C,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,+DAA+D,CAAC;AACtH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sEAAsE,CAAC;AAEnH,qHAAqH;AACrH,eAAO,MAAM,+BAA+B,QAAgB,CAAC;AAE7D;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,+GAA+G;IAC/G,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,6GAA6G;IAC7G,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAID,+FAA+F;AAC/F,wBAAgB,0BAA0B,CAAC,WAAW,EAAE,+BAA+B,GAAG,WAAW,CAAC,MAAM,CAAC,CAO5G;AAED;;;;;;;;GAQG;AACH,wBAAgB,+BAA+B,CAAC,MAAM,EAAE;IACtD,qBAAqB,EAAE,gCAAgC,CAAC;IACxD,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;CACvD,GAAG,MAAM,GAAG,SAAS,CAoBrB;AAOD,4EAA4E;AAC5E,KAAK,gBAAgB,GAAG,IAAI,CAAC,sBAAsB,EAAE,KAAK,CAAC,CAAC;AAwB5D,2CAA2C;AAC3C,wBAAgB,+BAA+B,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAGhF;AAED;;;GAGG;AACH,wBAAgB,oCAAoC,CAClD,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,MAAM,EAAE,gBAAgB,GAAG,SAAS,EACpC,GAAG,GAAE,MAAmB,GACvB,MAAM,GAAG,SAAS,CAGpB;AAED,+GAA+G;AAC/G,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,MAAM,EAAE,gBAAgB,GAAG,SAAS,GAAG,8BAA8B,GAAG,IAAI,GAAG,SAAS,CAG5J;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,gBAAgB,EAAE,GAAG,GAAE,MAAmB,GAAG,IAAI,CAkBvH;AAED,6CAA6C;AAC7C,wBAAgB,gCAAgC,IAAI,IAAI,CAGvD"}
@@ -20,7 +20,7 @@
20
20
  * about a value that renders correctly without it; a failed read must not become an error on the field, and must not be
21
21
  * retried on every render of every synced field.
22
22
  */
23
- import { MAIN_API_BASE_PATH, CoreResourceOperation, isDefaultUrlBearingOperation, } from '@wildo-ai/saas-models';
23
+ import { CoreResourceOperation, isDefaultUrlBearingOperation, } from '@wildo-ai/saas-models';
24
24
  import { EXTERNAL_DATA_PROVENANCE_ROUTE_SEGMENT, ExternalDataProvenanceResponseSchema, listExternalDataPipelineSyncedLocalFields, } from '@wildo-ai/saas-models/external-data';
25
25
  import { NavigationUtils } from '../../../core/navigation/navigation.utils.js';
26
26
  import { FrontendResourceUtils } from '../../../core/resources/frontend-resource.utils.js';
@@ -61,7 +61,10 @@ export function buildExternalDataProvenancePath(params) {
61
61
  });
62
62
  if (!initiatorInfo)
63
63
  return undefined;
64
- const resolved = NavigationUtils.resolveUrlPath(`${MAIN_API_BASE_PATH}${initiatorInfo.url}`, contextualParameters);
64
+ // The initiator URL is the API route the backend mounts verbatim, and it already begins with `/api/v1`
65
+ // (`buildUrlForParentCombination` with `isFrontend: false`), so it is resolved as it is. Prefixing it again
66
+ // doubled the base path, the defect #3858 found on the validate-field sibling of this composition.
67
+ const resolved = NavigationUtils.resolveUrlPath(initiatorInfo.url, contextualParameters);
65
68
  if (!resolved || NavigationUtils.hasUnresolvedPlaceholders(resolved))
66
69
  return undefined;
67
70
  return `${resolved}/${EXTERNAL_DATA_PROVENANCE_ROUTE_SEGMENT}`;
@@ -1 +1 @@
1
- {"version":3,"file":"external-data-provenance.frontend.js","sourceRoot":"","sources":["../../../../../src/components/data-display/external-data-provenance/external-data-provenance.frontend.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,EACL,kBAAkB,EAElB,qBAAqB,EACrB,4BAA4B,GAC7B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,sCAAsC,EACtC,oCAAoC,EACpC,yCAAyC,GAG1C,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EAAE,eAAe,EAAE,MAAM,sDAAsD,CAAC;AACvF,OAAO,EAAE,qBAAqB,EAAE,MAAM,4DAA4D,CAAC;AAInG,qHAAqH;AACrH,MAAM,CAAC,MAAM,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,KAAK,GAAG,IAAI,CAAC;QACf,CAAC;QACD,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QAClD,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACtB,MAAM,EAAE,CAAC;IACX,CAAC,CAAC,EAAE,CAAC;IACL,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAC3B,CAAC;AAED,6CAA6C;AAC7C,MAAM,UAAU,gCAAgC;IAC9C,MAAM,GAAG,IAAI,OAAO,EAAE,CAAC;IACvB,MAAM,EAAE,CAAC;AACX,CAAC","sourcesContent":["/**\n * Reading a pipeline destination's provenance for the display chrome (#1997) — which fields a pipeline writes, the URL\n * of the destination's provenance route, and a small cache so a record with six synced fields asks once.\n *\n * ## Why a module cache and not a provider in the context tree\n *\n * The answer is per DESTINATION and per ORGANIZATION (the route is scoped by the destination's LIST URL, which carries\n * the organization), it changes at most once per pipeline pass, and only a handful of surfaces ever need it. A provider\n * would have to sit in every application's tree for a read most of them never make. So the cache is keyed by the HTTP\n * CLIENT and the RESOLVED URL (#2109). The URL already names the organization, so switching organizations reads a\n * different entry and never shows another tenant's answer; the client names the BACKEND, because a path is relative to\n * `/api/v1` and two applications rendered in one page (a workbench, a test harness) share paths but not backends. A path\n * alone handed the second application the first one's answer. Entries expire after {@link EXTERNAL_DATA_PROVENANCE_TTL_MS}: the hook schedules\n * a re-read at the expiry of the answer it shows, so a page left open across a pipeline pass does not keep saying\n * \"as of\" an instant the copy has since moved past.\n *\n * ## Failure reads as silence\n *\n * A refused or failed read caches `null` for the same period, and the cue then renders nothing. The cue is a courtesy\n * about a value that renders correctly without it; a failed read must not become an error on the field, and must not be\n * retried on every render of every synced field.\n */\nimport {\n MAIN_API_BASE_PATH,\n type ResourceConfiguration_Operation_UrlInitiatorInfo,\n CoreResourceOperation,\n isDefaultUrlBearingOperation,\n} from '@wildo-ai/saas-models';\nimport {\n EXTERNAL_DATA_PROVENANCE_ROUTE_SEGMENT,\n ExternalDataProvenanceResponseSchema,\n listExternalDataPipelineSyncedLocalFields,\n type ExternalDataPipelineDeclaration,\n type ExternalDataProvenanceResponse,\n} from '@wildo-ai/saas-models/external-data';\n\nimport { NavigationUtils } from '~wildo-frontend-lib/core/navigation/navigation.utils';\nimport { FrontendResourceUtils } from '~wildo-frontend-lib/core/resources/frontend-resource.utils';\nimport type { AnyFrontendResourceConfiguration } from '~wildo-frontend-lib/core/resources/resources.frontend.schemas';\nimport type { WildoBackendHttpClient } from '~wildo-frontend-lib/core/requests/wildo-http-client.frontend.service';\n\n/** How long one answer is trusted: well under a pipeline's shortest sensible interval, well over one page's life. */\nexport const EXTERNAL_DATA_PROVENANCE_TTL_MS = 5 * 60 * 1000;\n\n/**\n * What the display chrome is handed for a synced field — the provenance answer once a pass has COMPLETED. A pipeline\n * that never completed one produces no cue at all rather than an \"as of\" nobody can state.\n */\nexport interface DisplayFieldProvenance {\n /** The declared system-of-record instance NAME; its words come from `systems_of_record.<name>.displayName`. */\n readonly system: string;\n /** When the most recent completed pass BEGAN reading (ISO 8601) — the instant its rows are current as of. */\n readonly currentAsOf: string;\n}\n\nconst syncedFieldsByDeclaration = new WeakMap<ExternalDataPipelineDeclaration, ReadonlySet<string>>();\n\n/** The pipeline-written local fields of a destination, derived once per declaration object. */\nexport function externalDataSyncedFieldSet(declaration: ExternalDataPipelineDeclaration): ReadonlySet<string> {\n let fields = syncedFieldsByDeclaration.get(declaration);\n if (!fields) {\n fields = new Set(listExternalDataPipelineSyncedLocalFields(declaration));\n syncedFieldsByDeclaration.set(declaration, fields);\n }\n return fields;\n}\n\n/**\n * The provenance route of a destination, composed from its default LIST operation's initiator URL. The LIST operation is\n * selected with `isDefaultUrlBearingOperation`, the same predicate the backend mounts the route with\n * (`external-data-provenance-route.backend.ts`), and exactly one must match there too — so the two sides select one\n * operation and describe one path, rather than two selections that happen to agree.\n *\n * @returns a path under `/api/v1` for the HTTP client, or `undefined` when the destination has no LIST initiator whose\n * parameters the current context can fill — in which case no request is made and no cue is shown.\n */\nexport function buildExternalDataProvenancePath(params: {\n resourceConfiguration: AnyFrontendResourceConfiguration;\n contextualParameters: Record<string, string | number>;\n}): string | undefined {\n const { resourceConfiguration, contextualParameters } = params;\n const listOperations = (resourceConfiguration.operations ?? []).filter((operation) =>\n isDefaultUrlBearingOperation(operation, CoreResourceOperation.LIST));\n if (listOperations.length !== 1) return undefined;\n const initiatorInfos = (listOperations[0]!.initiatorInfos ?? []) as ResourceConfiguration_Operation_UrlInitiatorInfo[];\n if (initiatorInfos.length === 0) return undefined;\n const initiatorInfo = FrontendResourceUtils.selectOperationUrlInitiatorInfo({\n initiatorInfos,\n contextualParameters,\n targetResourceType: resourceConfiguration.resourceIdentifier,\n targetDefaultFieldIdentifier: resourceConfiguration.resourceFieldIdentifier,\n });\n if (!initiatorInfo) return undefined;\n const resolved = NavigationUtils.resolveUrlPath(`${MAIN_API_BASE_PATH}${initiatorInfo.url}`, contextualParameters);\n if (!resolved || NavigationUtils.hasUnresolvedPlaceholders(resolved)) return undefined;\n return `${resolved}/${EXTERNAL_DATA_PROVENANCE_ROUTE_SEGMENT}`;\n}\n\ninterface CacheEntry {\n readonly value: ExternalDataProvenanceResponse | null;\n readonly fetchedAt: number;\n}\n\n/** The client a read goes through; only its identity and `get` are used. */\ntype ProvenanceClient = Pick<WildoBackendHttpClient, 'get'>;\n\ninterface ClientStore {\n readonly cache: Map<string, CacheEntry>;\n readonly inFlight: Map<string, Promise<void>>;\n}\n\n/** One store per client, so an answer read through one backend is never shown for another (#2109). */\nlet stores = new WeakMap<ProvenanceClient, ClientStore>();\nconst listeners = new Set<() => void>();\n\nfunction storeOf(client: ProvenanceClient): ClientStore {\n let store = stores.get(client);\n if (!store) {\n store = { cache: new Map(), inFlight: new Map() };\n stores.set(client, store);\n }\n return store;\n}\n\nfunction notify(): void {\n for (const listener of listeners) listener();\n}\n\n/** `useSyncExternalStore` subscription. */\nexport function subscribeExternalDataProvenance(listener: () => void): () => void {\n listeners.add(listener);\n return () => { listeners.delete(listener); };\n}\n\n/**\n * How long until the cached answer for a path expires (ms, never negative), or `undefined` when nothing is cached — the\n * hook's cue to schedule its re-read.\n */\nexport function msUntilExternalDataProvenanceExpires(\n path: string | undefined,\n client: ProvenanceClient | undefined,\n now: number = Date.now(),\n): number | undefined {\n const entry = path && client ? stores.get(client)?.cache.get(path) : undefined;\n return entry ? Math.max(0, entry.fetchedAt + EXTERNAL_DATA_PROVENANCE_TTL_MS - now) : undefined;\n}\n\n/** The cached answer for a path: the response, `null` for a refused/failed read, `undefined` while unknown. */\nexport function peekExternalDataProvenance(path: string | undefined, client: ProvenanceClient | undefined): ExternalDataProvenanceResponse | null | undefined {\n if (!path || !client) return undefined;\n return stores.get(client)?.cache.get(path)?.value;\n}\n\n/**\n * Read the path unless a fresh answer is cached or a read is already on its way. Every synced field of a record calls\n * this; exactly one request leaves.\n */\nexport function ensureExternalDataProvenance(path: string, httpClient: ProvenanceClient, now: number = Date.now()): void {\n const { cache, inFlight } = storeOf(httpClient);\n const entry = cache.get(path);\n if (entry && now - entry.fetchedAt < EXTERNAL_DATA_PROVENANCE_TTL_MS) return;\n if (inFlight.has(path)) return;\n const read = (async () => {\n let value: ExternalDataProvenanceResponse | null;\n try {\n const parsed = ExternalDataProvenanceResponseSchema.safeParse(await httpClient.get<unknown>(path, { silent: true }));\n value = parsed.success ? parsed.data : null;\n } catch {\n value = null;\n }\n cache.set(path, { value, fetchedAt: Date.now() });\n inFlight.delete(path);\n notify();\n })();\n inFlight.set(path, read);\n}\n\n/** Test seam: forget every cached answer. */\nexport function resetExternalDataProvenanceCache(): void {\n stores = new WeakMap();\n notify();\n}\n"]}
1
+ {"version":3,"file":"external-data-provenance.frontend.js","sourceRoot":"","sources":["../../../../../src/components/data-display/external-data-provenance/external-data-provenance.frontend.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;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AI,EAAE;QACvB,IAAI,KAA4C,CAAC;QACjD,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,oCAAoC,CAAC,SAAS,CAAC,MAAM,UAAU,CAAC,GAAG,CAAU,IAAI,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;YACrH,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;QAC9C,CAAC;QAAC,MAAM,CAAC;YACP,KAAK,GAAG,IAAI,CAAC;QACf,CAAC;QACD,KAAK,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QAClD,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACtB,MAAM,EAAE,CAAC;IACX,CAAC,CAAC,EAAE,CAAC;IACL,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAC3B,CAAC;AAED,6CAA6C;AAC7C,MAAM,UAAU,gCAAgC;IAC9C,MAAM,GAAG,IAAI,OAAO,EAAE,CAAC;IACvB,MAAM,EAAE,CAAC;AACX,CAAC","sourcesContent":["/**\n * Reading a pipeline destination's provenance for the display chrome (#1997) — which fields a pipeline writes, the URL\n * of the destination's provenance route, and a small cache so a record with six synced fields asks once.\n *\n * ## Why a module cache and not a provider in the context tree\n *\n * The answer is per DESTINATION and per ORGANIZATION (the route is scoped by the destination's LIST URL, which carries\n * the organization), it changes at most once per pipeline pass, and only a handful of surfaces ever need it. A provider\n * would have to sit in every application's tree for a read most of them never make. So the cache is keyed by the HTTP\n * CLIENT and the RESOLVED URL (#2109). The URL already names the organization, so switching organizations reads a\n * different entry and never shows another tenant's answer; the client names the BACKEND, because a path is relative to\n * `/api/v1` and two applications rendered in one page (a workbench, a test harness) share paths but not backends. A path\n * alone handed the second application the first one's answer. Entries expire after {@link EXTERNAL_DATA_PROVENANCE_TTL_MS}: the hook schedules\n * a re-read at the expiry of the answer it shows, so a page left open across a pipeline pass does not keep saying\n * \"as of\" an instant the copy has since moved past.\n *\n * ## Failure reads as silence\n *\n * A refused or failed read caches `null` for the same period, and the cue then renders nothing. The cue is a courtesy\n * about a value that renders correctly without it; a failed read must not become an error on the field, and must not be\n * retried on every render of every synced field.\n */\nimport {\n type ResourceConfiguration_Operation_UrlInitiatorInfo,\n CoreResourceOperation,\n isDefaultUrlBearingOperation,\n} from '@wildo-ai/saas-models';\nimport {\n EXTERNAL_DATA_PROVENANCE_ROUTE_SEGMENT,\n ExternalDataProvenanceResponseSchema,\n listExternalDataPipelineSyncedLocalFields,\n type ExternalDataPipelineDeclaration,\n type ExternalDataProvenanceResponse,\n} from '@wildo-ai/saas-models/external-data';\n\nimport { NavigationUtils } from '~wildo-frontend-lib/core/navigation/navigation.utils';\nimport { FrontendResourceUtils } from '~wildo-frontend-lib/core/resources/frontend-resource.utils';\nimport type { AnyFrontendResourceConfiguration } from '~wildo-frontend-lib/core/resources/resources.frontend.schemas';\nimport type { WildoBackendHttpClient } from '~wildo-frontend-lib/core/requests/wildo-http-client.frontend.service';\n\n/** How long one answer is trusted: well under a pipeline's shortest sensible interval, well over one page's life. */\nexport const EXTERNAL_DATA_PROVENANCE_TTL_MS = 5 * 60 * 1000;\n\n/**\n * What the display chrome is handed for a synced field — the provenance answer once a pass has COMPLETED. A pipeline\n * that never completed one produces no cue at all rather than an \"as of\" nobody can state.\n */\nexport interface DisplayFieldProvenance {\n /** The declared system-of-record instance NAME; its words come from `systems_of_record.<name>.displayName`. */\n readonly system: string;\n /** When the most recent completed pass BEGAN reading (ISO 8601) — the instant its rows are current as of. */\n readonly currentAsOf: string;\n}\n\nconst syncedFieldsByDeclaration = new WeakMap<ExternalDataPipelineDeclaration, ReadonlySet<string>>();\n\n/** The pipeline-written local fields of a destination, derived once per declaration object. */\nexport function externalDataSyncedFieldSet(declaration: ExternalDataPipelineDeclaration): ReadonlySet<string> {\n let fields = syncedFieldsByDeclaration.get(declaration);\n if (!fields) {\n fields = new Set(listExternalDataPipelineSyncedLocalFields(declaration));\n syncedFieldsByDeclaration.set(declaration, fields);\n }\n return fields;\n}\n\n/**\n * The provenance route of a destination, composed from its default LIST operation's initiator URL. The LIST operation is\n * selected with `isDefaultUrlBearingOperation`, the same predicate the backend mounts the route with\n * (`external-data-provenance-route.backend.ts`), and exactly one must match there too — so the two sides select one\n * operation and describe one path, rather than two selections that happen to agree.\n *\n * @returns a path under `/api/v1` for the HTTP client, or `undefined` when the destination has no LIST initiator whose\n * parameters the current context can fill — in which case no request is made and no cue is shown.\n */\nexport function buildExternalDataProvenancePath(params: {\n resourceConfiguration: AnyFrontendResourceConfiguration;\n contextualParameters: Record<string, string | number>;\n}): string | undefined {\n const { resourceConfiguration, contextualParameters } = params;\n const listOperations = (resourceConfiguration.operations ?? []).filter((operation) =>\n isDefaultUrlBearingOperation(operation, CoreResourceOperation.LIST));\n if (listOperations.length !== 1) return undefined;\n const initiatorInfos = (listOperations[0]!.initiatorInfos ?? []) as ResourceConfiguration_Operation_UrlInitiatorInfo[];\n if (initiatorInfos.length === 0) return undefined;\n const initiatorInfo = FrontendResourceUtils.selectOperationUrlInitiatorInfo({\n initiatorInfos,\n contextualParameters,\n targetResourceType: resourceConfiguration.resourceIdentifier,\n targetDefaultFieldIdentifier: resourceConfiguration.resourceFieldIdentifier,\n });\n if (!initiatorInfo) return undefined;\n // The initiator URL is the API route the backend mounts verbatim, and it already begins with `/api/v1`\n // (`buildUrlForParentCombination` with `isFrontend: false`), so it is resolved as it is. Prefixing it again\n // doubled the base path, the defect #3858 found on the validate-field sibling of this composition.\n const resolved = NavigationUtils.resolveUrlPath(initiatorInfo.url, contextualParameters);\n if (!resolved || NavigationUtils.hasUnresolvedPlaceholders(resolved)) return undefined;\n return `${resolved}/${EXTERNAL_DATA_PROVENANCE_ROUTE_SEGMENT}`;\n}\n\ninterface CacheEntry {\n readonly value: ExternalDataProvenanceResponse | null;\n readonly fetchedAt: number;\n}\n\n/** The client a read goes through; only its identity and `get` are used. */\ntype ProvenanceClient = Pick<WildoBackendHttpClient, 'get'>;\n\ninterface ClientStore {\n readonly cache: Map<string, CacheEntry>;\n readonly inFlight: Map<string, Promise<void>>;\n}\n\n/** One store per client, so an answer read through one backend is never shown for another (#2109). */\nlet stores = new WeakMap<ProvenanceClient, ClientStore>();\nconst listeners = new Set<() => void>();\n\nfunction storeOf(client: ProvenanceClient): ClientStore {\n let store = stores.get(client);\n if (!store) {\n store = { cache: new Map(), inFlight: new Map() };\n stores.set(client, store);\n }\n return store;\n}\n\nfunction notify(): void {\n for (const listener of listeners) listener();\n}\n\n/** `useSyncExternalStore` subscription. */\nexport function subscribeExternalDataProvenance(listener: () => void): () => void {\n listeners.add(listener);\n return () => { listeners.delete(listener); };\n}\n\n/**\n * How long until the cached answer for a path expires (ms, never negative), or `undefined` when nothing is cached — the\n * hook's cue to schedule its re-read.\n */\nexport function msUntilExternalDataProvenanceExpires(\n path: string | undefined,\n client: ProvenanceClient | undefined,\n now: number = Date.now(),\n): number | undefined {\n const entry = path && client ? stores.get(client)?.cache.get(path) : undefined;\n return entry ? Math.max(0, entry.fetchedAt + EXTERNAL_DATA_PROVENANCE_TTL_MS - now) : undefined;\n}\n\n/** The cached answer for a path: the response, `null` for a refused/failed read, `undefined` while unknown. */\nexport function peekExternalDataProvenance(path: string | undefined, client: ProvenanceClient | undefined): ExternalDataProvenanceResponse | null | undefined {\n if (!path || !client) return undefined;\n return stores.get(client)?.cache.get(path)?.value;\n}\n\n/**\n * Read the path unless a fresh answer is cached or a read is already on its way. Every synced field of a record calls\n * this; exactly one request leaves.\n */\nexport function ensureExternalDataProvenance(path: string, httpClient: ProvenanceClient, now: number = Date.now()): void {\n const { cache, inFlight } = storeOf(httpClient);\n const entry = cache.get(path);\n if (entry && now - entry.fetchedAt < EXTERNAL_DATA_PROVENANCE_TTL_MS) return;\n if (inFlight.has(path)) return;\n const read = (async () => {\n let value: ExternalDataProvenanceResponse | null;\n try {\n const parsed = ExternalDataProvenanceResponseSchema.safeParse(await httpClient.get<unknown>(path, { silent: true }));\n value = parsed.success ? parsed.data : null;\n } catch {\n value = null;\n }\n cache.set(path, { value, fetchedAt: Date.now() });\n inFlight.delete(path);\n notify();\n })();\n inFlight.set(path, read);\n}\n\n/** Test seam: forget every cached answer. */\nexport function resetExternalDataProvenanceCache(): void {\n stores = new WeakMap();\n notify();\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"display-field-file.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/formatters/display-field-file.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAA;AACtC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,OAAO,EAAE,oBAAoB,EAAE,MAAM,kFAAkF,CAAA;AAEvH,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAGlF,UAAU,qBAAqB,CAAC,OAAO,SAAS,CAAC,CAAC,UAAU,GAAG,CAAC,CAAC,UAAU;IACzE,MAAM,EAAE,OAAO,CAAA;IACf,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS,CAAA;IAC1C,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,uBAAuB,CAAC,EAAE,OAAO,CAAA;IACjC,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,oBAAoB,CAAC,EAAE,OAAO,CAAA;CAC/B;AAED,MAAM,WAAW,qBAAsB,SAAQ,IAAI,CAAC,qBAAqB,CAAC,CAAC,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAC/F;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,KAAK,EAAE,SAAS,GAAG,IAAI,GAAG,SAAS,CAAA;IAGnC,SAAS,EAAE,IAAI,CAAC,kBAAkB,EAAE,aAAa,GAAG,OAAO,CAAC,CAAA;IAC5D,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,cAAc,CAAC,EAAE;QACf,GAAG,EAAE,CAAC,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;QAC1C,gEAAgE;QAChE,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;YAAE,MAAM,CAAC,EAAE,WAAW,CAAA;SAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;KAC9E,CAAA;CACF;AAGD;;;;;;;;;GASG;AACH,KAAK,4BAA4B,GAAG,IAAI,CAAC,qBAAqB,EAAE,gBAAgB,CAAC,GAAG,oBAAoB,CAAA;AAExG,wBAAgB,gBAAgB,CAAC,EAAE,MAAgC,EAAE,GAAG,KAAK,EAAE,EAAE,4BAA4B,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAiBhI"}
1
+ {"version":3,"file":"display-field-file.d.ts","sourceRoot":"","sources":["../../../../../src/components/data-display/formatters/display-field-file.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAA;AACtC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,OAAO,EAAE,oBAAoB,EAAE,MAAM,kFAAkF,CAAA;AAEvH,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAMlF,UAAU,qBAAqB,CAAC,OAAO,SAAS,CAAC,CAAC,UAAU,GAAG,CAAC,CAAC,UAAU;IACzE,MAAM,EAAE,OAAO,CAAA;IACf,KAAK,EAAE,CAAC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CAAC,GAAG,CAAC,OAAO,CAgChI"}
@@ -1,8 +1,11 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useMemo } from 'react';
3
3
  import { createComponentResolver } from '../../../core/components-registry/component-resolver.frontend.helper.js';
4
4
  import { FrontendComponentType, CorePresetNames } from '@wildo-ai/presets-components-models';
5
5
  import { useApplication } from '../../../core/runtime/useApplication.js';
6
+ import { FileApprovalSeal } from '../../../components/data-display/approval-seal.js';
7
+ import { DisplayContextKind, useDisplayContextKind } from '../../../components/data-display/DisplayContextKindContext.js';
8
+ import { useOptionalDisplayTemplateContext } from '../../../components/data-display/DisplayTemplateContext.js';
6
9
  export function DisplayFieldFile({ preset = CorePresetNames.DEFAULT, ...props }) {
7
10
  const { httpClient } = useApplication();
8
11
  const httpOperations = useMemo(() => ({
@@ -17,6 +20,17 @@ export function DisplayFieldFile({ preset = CorePresetNames.DEFAULT, ...props })
17
20
  },
18
21
  }), [httpClient]);
19
22
  const Component = createComponentResolver(FrontendComponentType.LOW_LEVEL_DISPLAY_FIELD_FILE, 'DisplayFieldFile')(preset);
20
- return _jsx(Component, { ...props, httpOperations: httpOperations });
23
+ // #2913: on a record's DISPLAY surface, the approval seal that attests this file (the deliverable a person approved by
24
+ // its hash), drawn under it. Not on a SUMMARY (a list card would ask once per row) nor outside a display template; a
25
+ // file no seal attests draws nothing, since the door answers it exactly as a file the reader may not read.
26
+ const displayKind = useDisplayContextKind();
27
+ const template = useOptionalDisplayTemplateContext();
28
+ const sealed = displayKind === DisplayContextKind.DISPLAY && template !== null;
29
+ // A single file only: a field holding several (`fileIds`) is not a deliverable a seal binds.
30
+ const single = props.value && 'fileId' in props.value ? props.value.fileId : undefined;
31
+ const fileId = typeof single === 'string' && single.length > 0 ? single : undefined;
32
+ if (!sealed || !fileId)
33
+ return _jsx(Component, { ...props, httpOperations: httpOperations });
34
+ return (_jsxs(_Fragment, { children: [_jsx(Component, { ...props, httpOperations: httpOperations }), _jsx(FileApprovalSeal, { fileId: fileId })] }));
21
35
  }
22
36
  //# sourceMappingURL=display-field-file.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"display-field-file.js","sourceRoot":"","sources":["../../../../../src/components/data-display/formatters/display-field-file.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAEtC,OAAO,EAAE,uBAAuB,EAAE,MAAM,iFAAiF,CAAA;AACzH,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAA;AAE5F,OAAO,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAA;AAiDhF,MAAM,UAAU,gBAAgB,CAAC,EAAE,MAAM,GAAG,eAAe,CAAC,OAAO,EAAE,GAAG,KAAK,EAAgC;IAC3G,MAAM,EAAE,UAAU,EAAE,GAAG,cAAc,EAAE,CAAA;IAEvC,MAAM,cAAc,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QACpC,GAAG,EAAE,KAAK,EAAM,GAAW,EAAc,EAAE;YACzC,OAAO,UAAU,CAAC,GAAG,CAAI,GAAG,CAAC,CAAA;QAC/B,CAAC;QACD,8EAA8E;QAC9E,+EAA+E;QAC/E,gFAAgF;QAChF,OAAO,EAAE,CAAC,GAAW,EAAE,OAAkC,EAAiB,EAAE;YAC1E,OAAO,UAAU,CAAC,aAAa,CAAC,GAAG,EAAE,OAAO,CAAC,CAAA;QAC/C,CAAC;KACF,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAA;IAEjB,MAAM,SAAS,GAAG,uBAAuB,CAAwB,qBAAqB,CAAC,4BAA4B,EAAE,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAA;IAChJ,OAAO,KAAC,SAAS,OAAK,KAAK,EAAE,cAAc,EAAE,cAAc,GAAI,CAAA;AACjE,CAAC","sourcesContent":["import React, { useMemo } from 'react'\nimport { z } from 'zod'\nimport { createComponentResolver } from '~wildo-frontend-lib/core/components-registry/component-resolver.frontend.helper'\nimport { FrontendComponentType, CorePresetNames } from '@wildo-ai/presets-components-models'\nimport { ComponentPresetProps } from '~wildo-frontend-lib/core/components-registry/component-registry.frontend.schemas'\nimport { useApplication } from '~wildo-frontend-lib/core/runtime/useApplication'\nimport { type FileValue, type FileFieldEndpoints } from '@wildo-ai/zod-decorators'\n\n// --- Contract ---\ninterface DisplayFieldBaseProps<TSchema extends z.ZodTypeAny = z.ZodTypeAny> {\n schema: TSchema\n value: z.infer<TSchema> | null | undefined\n label?: string\n description?: string\n className?: string\n forceDisplayLabel?: boolean\n forceDisplayDescription?: boolean\n forceHideLabel?: boolean\n forceHideDescription?: boolean\n}\n\nexport interface DisplayFieldFileProps extends Omit<DisplayFieldBaseProps<z.ZodTypeAny>, 'value'> {\n /**\n * Resolved field path as rendered. Travels with a `FileActivationPolicy.CUSTOM`\n * activation so the dispatched operation knows WHICH field's file was activated.\n */\n fieldName?: string\n value: FileValue | null | undefined\n // `getMetadata` loads file metadata; `serve` is the resource-integrated authenticated\n // byte-serve base for inline previews (the consumer appends `/{fileId}`).\n endpoints: Pick<FileFieldEndpoints, 'getMetadata' | 'serve'>\n showSize?: boolean\n showType?: boolean\n showDownload?: boolean\n httpOperations?: {\n get: <T = any>(url: string) => Promise<T>;\n /** Authenticated byte fetch for inline previews (image/PDF). */\n getBlob?: (url: string, options?: { signal?: AbortSignal }) => Promise<Blob>;\n }\n}\n\n// --- Wrapper ---\n/**\n * Schema-aware DisplayFieldFile component.\n *\n * This wrapper sits between DisplayField and the preset component.\n * It injects authenticated HTTP operations from the app's HTTP client,\n * following the same pattern as the FormFieldFile wrapper.\n *\n * Without this, the preset would use raw `fetch` for metadata requests,\n * bypassing auth headers, retry logic, and centralized error handling.\n */\ntype DisplayFieldFileWrapperProps = Omit<DisplayFieldFileProps, 'httpOperations'> & ComponentPresetProps\n\nexport function DisplayFieldFile({ preset = CorePresetNames.DEFAULT, ...props }: DisplayFieldFileWrapperProps): React.JSX.Element {\n const { httpClient } = useApplication()\n\n const httpOperations = useMemo(() => ({\n get: async <T,>(url: string): Promise<T> => {\n return httpClient.get<T>(url)\n },\n // Authenticated byte fetch for inline previews (image/PDF): the browser can't\n // attach the bearer to an <img>/embed src, so we fetch the bytes and wrap them\n // in an object URL. The backend serve route authorizes via the linked resource.\n getBlob: (url: string, options?: { signal?: AbortSignal }): Promise<Blob> => {\n return httpClient.fetchFileBlob(url, options)\n },\n }), [httpClient])\n\n const Component = createComponentResolver<DisplayFieldFileProps>(FrontendComponentType.LOW_LEVEL_DISPLAY_FIELD_FILE, 'DisplayFieldFile')(preset)\n return <Component {...props} httpOperations={httpOperations} />\n}\n"]}
1
+ {"version":3,"file":"display-field-file.js","sourceRoot":"","sources":["../../../../../src/components/data-display/formatters/display-field-file.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAEtC,OAAO,EAAE,uBAAuB,EAAE,MAAM,iFAAiF,CAAA;AACzH,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAA;AAE5F,OAAO,EAAE,cAAc,EAAE,MAAM,iDAAiD,CAAA;AAEhF,OAAO,EAAE,gBAAgB,EAAE,MAAM,2DAA2D,CAAA;AAC5F,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,uEAAuE,CAAA;AACjI,OAAO,EAAE,iCAAiC,EAAE,MAAM,oEAAoE,CAAA;AAgDtH,MAAM,UAAU,gBAAgB,CAAC,EAAE,MAAM,GAAG,eAAe,CAAC,OAAO,EAAE,GAAG,KAAK,EAAgC;IAC3G,MAAM,EAAE,UAAU,EAAE,GAAG,cAAc,EAAE,CAAA;IAEvC,MAAM,cAAc,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QACpC,GAAG,EAAE,KAAK,EAAM,GAAW,EAAc,EAAE;YACzC,OAAO,UAAU,CAAC,GAAG,CAAI,GAA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from '~wildo-frontend-lib/core/components-registry/component-resolver.frontend.helper'\nimport { FrontendComponentType, CorePresetNames } from '@wildo-ai/presets-components-models'\nimport { ComponentPresetProps } from '~wildo-frontend-lib/core/components-registry/component-registry.frontend.schemas'\nimport { useApplication } from '~wildo-frontend-lib/core/runtime/useApplication'\nimport { type FileValue, type FileFieldEndpoints } from '@wildo-ai/zod-decorators'\nimport { FileApprovalSeal } from '~wildo-frontend-lib/components/data-display/approval-seal'\nimport { DisplayContextKind, useDisplayContextKind } from '~wildo-frontend-lib/components/data-display/DisplayContextKindContext'\nimport { useOptionalDisplayTemplateContext } from '~wildo-frontend-lib/components/data-display/DisplayTemplateContext'\n\n// --- Contract ---\ninterface DisplayFieldBaseProps<TSchema extends z.ZodTypeAny = z.ZodTypeAny> {\n schema: TSchema\n value: z.infer<TSchema> | null | undefined\n label?: string\n description?: string\n className?: string\n forceDisplayLabel?: boolean\n forceDisplayDescription?: boolean\n forceHideLabel?: boolean\n forceHideDescription?: boolean\n}\n\nexport interface DisplayFieldFileProps extends Omit<DisplayFieldBaseProps<z.ZodTypeAny>, 'value'> {\n /**\n * Resolved field path as rendered. Travels with a `FileActivationPolicy.CUSTOM`\n * activation so the dispatched operation knows WHICH field's file was activated.\n */\n fieldName?: string\n value: FileValue | null | undefined\n // `getMetadata` loads file metadata; `serve` is the resource-integrated authenticated\n // byte-serve base for inline previews (the consumer appends `/{fileId}`).\n endpoints: Pick<FileFieldEndpoints, 'getMetadata' | 'serve'>\n showSize?: boolean\n showType?: boolean\n showDownload?: boolean\n httpOperations?: {\n get: <T = any>(url: string) => Promise<T>;\n /** Authenticated byte fetch for inline previews (image/PDF). */\n getBlob?: (url: string, options?: { signal?: AbortSignal }) => Promise<Blob>;\n }\n}\n\n// --- Wrapper ---\n/**\n * Schema-aware DisplayFieldFile component.\n *\n * This wrapper sits between DisplayField and the preset component.\n * It injects authenticated HTTP operations from the app's HTTP client,\n * following the same pattern as the FormFieldFile wrapper.\n *\n * Without this, the preset would use raw `fetch` for metadata requests,\n * bypassing auth headers, retry logic, and centralized error handling.\n */\ntype DisplayFieldFileWrapperProps = Omit<DisplayFieldFileProps, 'httpOperations'> & ComponentPresetProps\n\nexport function DisplayFieldFile({ preset = CorePresetNames.DEFAULT, ...props }: DisplayFieldFileWrapperProps): React.JSX.Element {\n const { httpClient } = useApplication()\n\n const httpOperations = useMemo(() => ({\n get: async <T,>(url: string): Promise<T> => {\n return httpClient.get<T>(url)\n },\n // Authenticated byte fetch for inline previews (image/PDF): the browser can't\n // attach the bearer to an <img>/embed src, so we fetch the bytes and wrap them\n // in an object URL. The backend serve route authorizes via the linked resource.\n getBlob: (url: string, options?: { signal?: AbortSignal }): Promise<Blob> => {\n return httpClient.fetchFileBlob(url, options)\n },\n }), [httpClient])\n\n const Component = createComponentResolver<DisplayFieldFileProps>(FrontendComponentType.LOW_LEVEL_DISPLAY_FIELD_FILE, 'DisplayFieldFile')(preset)\n // #2913: on a record's DISPLAY surface, the approval seal that attests this file (the deliverable a person approved by\n // its hash), drawn under it. Not on a SUMMARY (a list card would ask once per row) nor outside a display template; a\n // file no seal attests draws nothing, since the door answers it exactly as a file the reader may not read.\n const displayKind = useDisplayContextKind()\n const template = useOptionalDisplayTemplateContext()\n const sealed = displayKind === DisplayContextKind.DISPLAY && template !== null\n // A single file only: a field holding several (`fileIds`) is not a deliverable a seal binds.\n const single = props.value && 'fileId' in props.value ? props.value.fileId : undefined\n const fileId = typeof single === 'string' && single.length > 0 ? single : undefined\n if (!sealed || !fileId) return <Component {...props} httpOperations={httpOperations} />\n return (\n <>\n <Component {...props} httpOperations={httpOperations} />\n <FileApprovalSeal fileId={fileId} />\n </>\n )\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"approval.d.ts","sourceRoot":"","sources":["../../../../src/components/flows-actors/approval.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAIL,KAAK,2BAA2B,EAEhC,KAAK,uBAA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