@epistola.app/valtimo-plugin 0.5.2 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/fesm2022/epistola.app-valtimo-plugin.mjs +2531 -561
  2. package/fesm2022/epistola.app-valtimo-plugin.mjs.map +1 -1
  3. package/lib/assets/epistola-logo.d.ts +1 -1
  4. package/lib/components/epistola-admin-page/epistola-admin-page.component.d.ts +52 -0
  5. package/lib/components/epistola-document-preview/epistola-document-preview.component.d.ts +28 -5
  6. package/lib/components/epistola-document-preview/preview-utils.d.ts +18 -0
  7. package/lib/components/expected-structure/expected-structure.component.d.ts +11 -0
  8. package/lib/components/generate-document-configuration/generate-document-configuration.component.d.ts +29 -3
  9. package/lib/components/jsonata-editor/jsonata-editor.component.d.ts +29 -0
  10. package/lib/components/mapping-builder/builder-field/builder-field.component.d.ts +21 -0
  11. package/lib/components/mapping-builder/mapping-builder.component.d.ts +37 -0
  12. package/lib/components/mapping-preview/mapping-preview.component.d.ts +26 -0
  13. package/lib/components/override-builder/override-builder.component.d.ts +42 -0
  14. package/lib/components/override-builder/override-builder.formio.d.ts +4 -0
  15. package/lib/components/process-link-selector/process-link-selector.component.d.ts +31 -0
  16. package/lib/components/process-link-selector/process-link-selector.formio.d.ts +4 -0
  17. package/lib/epistola-admin-routing.module.d.ts +7 -0
  18. package/lib/epistola-enabled.guard.d.ts +2 -0
  19. package/lib/epistola-runtime-config.d.ts +28 -0
  20. package/lib/epistola.module.d.ts +11 -14
  21. package/lib/models/admin.d.ts +49 -0
  22. package/lib/models/config.d.ts +30 -2
  23. package/lib/models/expression.d.ts +13 -0
  24. package/lib/models/index.d.ts +2 -0
  25. package/lib/models/template.d.ts +0 -6
  26. package/lib/services/epistola-admin.service.d.ts +37 -0
  27. package/lib/services/epistola-menu.service.d.ts +13 -0
  28. package/lib/services/epistola-plugin.service.d.ts +16 -3
  29. package/lib/services/index.d.ts +2 -0
  30. package/lib/utils/jsonata-converter.d.ts +26 -0
  31. package/lib/utils/jsonata-monaco.d.ts +14 -0
  32. package/package.json +10 -6
  33. package/public_api.d.ts +9 -5
  34. package/lib/components/array-field/array-field.component.d.ts +0 -27
  35. package/lib/components/data-mapping-tree/data-mapping-tree.component.d.ts +0 -27
  36. package/lib/components/field-tree/field-tree.component.d.ts +0 -27
  37. package/lib/components/scalar-field/scalar-field.component.d.ts +0 -16
  38. package/lib/components/value-input/value-input.component.d.ts +0 -34
  39. package/lib/utils/template-field-utils.d.ts +0 -6
@@ -1 +1 @@
1
- export declare const EPISTOLA_PLUGIN_LOGO_BASE64 = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0iIzMzNjZjYyI+PHBhdGggZD0iTTE0IDJINmMtMS4xIDAtMiAuOS0yIDJ2MTZjMCAxLjEuOSAyIDIgMmgxMmMxLjEgMCAyLS45IDItMlY4bC02LTZ6bTQgMThINlY0aDd2NWg1djExeiIvPjxwYXRoIGQ9Ik04IDEyaDh2Mkg4em0wIDRoOHYtMkg4em0wLThWNmg0djJ6Ii8+PC9zdmc+";
1
+ export declare const EPISTOLA_PLUGIN_LOGO_BASE64 = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMjAgMTIwIiB3aWR0aD0iMTIwIiBoZWlnaHQ9IjEyMCI+CiAgPCEtLSBTdGFjayBiYXNlIC0tPgogIDxyZWN0IHg9IjM2IiB5PSIxNiIgd2lkdGg9IjU0IiBoZWlnaHQ9IjcwIiByeD0iMyIgZmlsbD0iI2U2YzJiMCIgc3Ryb2tlPSIjNGYyZjJiIiBzdHJva2Utd2lkdGg9IjIiIHRyYW5zZm9ybT0icm90YXRlKDUgNjMgNTEpIi8+CiAgPHJlY3QgeD0iMzIiIHk9IjIyIiB3aWR0aD0iNTQiIGhlaWdodD0iNzAiIHJ4PSIzIiBmaWxsPSIjZjBkOGM4IiBzdHJva2U9IiM0ZjJmMmIiIHN0cm9rZS13aWR0aD0iMiIvPgogIDxyZWN0IHg9IjI4IiB5PSIyOCIgd2lkdGg9IjU0IiBoZWlnaHQ9IjcwIiByeD0iMyIgZmlsbD0iI2Y1ZWJlMyIgc3Ryb2tlPSIjNGYyZjJiIiBzdHJva2Utd2lkdGg9IjIuNSIvPgogIDxsaW5lIHgxPSIzOCIgeTE9IjQ0IiB4Mj0iNzIiIHkyPSI0NCIgc3Ryb2tlPSIjYzRhODgyIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIvPgogIDxsaW5lIHgxPSIzOCIgeTE9IjU0IiB4Mj0iNzIiIHkyPSI1NCIgc3Ryb2tlPSIjYzRhODgyIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIvPgogIDxsaW5lIHgxPSIzOCIgeTE9IjY0IiB4Mj0iNTgiIHkyPSI2NCIgc3Ryb2tlPSIjYzRhODgyIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIvPgogIDwhLS0gV2F4IHNlYWwgd2l0aCBjaGVja21hcmsgLS0+CiAgPGNpcmNsZSBjeD0iNTUiIGN5PSI4NCIgcj0iMTUiIGZpbGw9IiNiODVjM2MiIHN0cm9rZT0iIzRmMmYyYiIgc3Ryb2tlLXdpZHRoPSIyIi8+CiAgPGNpcmNsZSBjeD0iNTUiIGN5PSI4NCIgcj0iMTAuNSIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjZDQ4MzZhIiBzdHJva2Utd2lkdGg9IjEiLz4KICA8cG9seWxpbmUgcG9pbnRzPSI0OSw4NCA1Myw4OSA2Miw3OCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjNGYyZjJiIiBzdHJva2Utd2lkdGg9IjIuNSIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+Cjwvc3ZnPgo=";
@@ -0,0 +1,52 @@
1
+ import { OnInit } from '@angular/core';
2
+ import { ActivatedRoute, Router } from '@angular/router';
3
+ import { EpistolaAdminService } from '../../services/epistola-admin.service';
4
+ import { PendingJob, PluginUsageEntry } from '../../models';
5
+ import * as i0 from "@angular/core";
6
+ /**
7
+ * Combined view model for a single plugin configuration card.
8
+ */
9
+ interface ConfigurationCard {
10
+ configurationId: string;
11
+ configurationTitle: string;
12
+ tenantId: string;
13
+ reachable: boolean;
14
+ latencyMs: number;
15
+ errorMessage?: string;
16
+ serverVersion?: string;
17
+ usageCount: number;
18
+ problemCount: number;
19
+ usageEntries: PluginUsageEntry[];
20
+ pendingJobs: PendingJob[];
21
+ }
22
+ export declare class EpistolaAdminPageComponent implements OnInit {
23
+ private readonly adminService;
24
+ private readonly route;
25
+ private readonly router;
26
+ cards: ConfigurationCard[];
27
+ selectedCard: ConfigurationCard | null;
28
+ activeTab: 'actions' | 'pending';
29
+ loading: boolean;
30
+ pluginVersion: string | null;
31
+ private connectionStatuses;
32
+ private usageEntries;
33
+ private pendingJobs;
34
+ private connectionLoaded;
35
+ private usageLoaded;
36
+ private pendingLoaded;
37
+ private deepLinkConfigId;
38
+ constructor(adminService: EpistolaAdminService, route: ActivatedRoute, router: Router);
39
+ ngOnInit(): void;
40
+ selectConfiguration(card: ConfigurationCard): void;
41
+ backToOverview(): void;
42
+ setActiveTab(tab: 'actions' | 'pending'): void;
43
+ refresh(): void;
44
+ exportProcessLink(entry: PluginUsageEntry): void;
45
+ private updateUrl;
46
+ private loadData;
47
+ private tryBuildCards;
48
+ private loadPluginVersion;
49
+ static ɵfac: i0.ɵɵFactoryDeclaration<EpistolaAdminPageComponent, never>;
50
+ static ɵcmp: i0.ɵɵComponentDeclaration<EpistolaAdminPageComponent, "epistola-admin-page", never, {}, {}, never, never, true, never>;
51
+ }
52
+ export {};
@@ -6,36 +6,59 @@ import { ConfigService } from '@valtimo/shared';
6
6
  import { PreviewSource } from '../../models';
7
7
  import { EpistolaPluginService } from '../../services';
8
8
  import * as i0 from "@angular/core";
9
- export declare class EpistolaDocumentPreviewComponent implements FormioCustomComponent<null>, OnChanges, OnDestroy {
9
+ export declare class EpistolaDocumentPreviewComponent implements FormioCustomComponent<Record<string, any> | null>, OnChanges, OnDestroy {
10
10
  private readonly epistolaPluginService;
11
11
  private readonly http;
12
12
  private readonly sanitizer;
13
13
  private readonly configService;
14
14
  private readonly formIoStateService;
15
15
  private readonly cdr;
16
- value: null;
17
- valueChange: EventEmitter<null>;
16
+ value: Record<string, any> | null;
17
+ valueChange: EventEmitter<Record<string, any>>;
18
18
  disabled: boolean;
19
19
  label: string;
20
+ processDefinitionKey?: string;
21
+ sourceActivityId?: string;
22
+ overrideMapping?: Record<string, any>;
20
23
  sources: PreviewSource[];
21
24
  selectedIndex: number;
22
25
  discovering: boolean;
23
26
  loading: boolean;
24
27
  error: string | null;
25
28
  previewUrl: SafeResourceUrl | null;
29
+ designMode: boolean;
26
30
  private initialized;
27
31
  private currentBlobUrl;
28
32
  private discoverSubscription?;
29
33
  private previewSubscription?;
30
34
  private readonly apiEndpoint;
35
+ /** Whether the component is in configured mode (explicit process link) vs auto-discover mode */
36
+ private get configuredMode();
31
37
  constructor(epistolaPluginService: EpistolaPluginService, http: HttpClient, sanitizer: DomSanitizer, configService: ConfigService, formIoStateService: FormIoStateService, cdr: ChangeDetectorRef);
38
+ get overrideMappingScopes(): string[];
39
+ overrideMappingEntries(scope: string): {
40
+ path: string;
41
+ field: string;
42
+ }[];
32
43
  ngOnChanges(changes: SimpleChanges): void;
33
44
  ngOnDestroy(): void;
34
45
  onSourceChange(event: Event): void;
35
46
  refresh(): void;
47
+ /**
48
+ * Configured mode: preview using the explicitly configured process link + input overrides.
49
+ */
50
+ private loadConfiguredPreview;
51
+ /**
52
+ * Auto-discover mode: discover sources from running process instances.
53
+ */
36
54
  private discoverSources;
37
- private loadPreview;
55
+ /**
56
+ * Auto-discover mode: load preview for the selected discovered source.
57
+ */
58
+ private loadDiscoveredPreview;
59
+ private handlePreviewSuccess;
60
+ private handlePreviewError;
38
61
  private revokeBlobUrl;
39
62
  static ɵfac: i0.ɵɵFactoryDeclaration<EpistolaDocumentPreviewComponent, never>;
40
- static ɵcmp: i0.ɵɵComponentDeclaration<EpistolaDocumentPreviewComponent, "epistola-document-preview-component", never, { "value": { "alias": "value"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "label": { "alias": "label"; "required": false; }; }, { "valueChange": "valueChange"; }, never, never, true, never>;
63
+ static ɵcmp: i0.ɵɵComponentDeclaration<EpistolaDocumentPreviewComponent, "epistola-document-preview-component", never, { "value": { "alias": "value"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "label": { "alias": "label"; "required": false; }; "processDefinitionKey": { "alias": "processDefinitionKey"; "required": false; }; "sourceActivityId": { "alias": "sourceActivityId"; "required": false; }; "overrideMapping": { "alias": "overrideMapping"; "required": false; }; }, { "valueChange": "valueChange"; }, never, never, true, never>;
41
64
  }
@@ -0,0 +1,18 @@
1
+ import { OverrideMapping } from '../override-builder/override-builder.component';
2
+ export declare const FORM_REF_PREFIX = "form:";
3
+ /**
4
+ * Detect if a string value is a JSONata expression (vs a plain literal).
5
+ * Checks for characters that indicate JSONata operators: $, &, (, {, ?, [
6
+ */
7
+ export declare function isExpression(value: string): boolean;
8
+ /**
9
+ * Expand dot-notation keys into nested objects.
10
+ * e.g. { "beslissing.tekst": "value" } -> { beslissing: { tekst: "value" } }
11
+ */
12
+ export declare function expandDotNotation(flat: Record<string, any>): Record<string, any>;
13
+ /**
14
+ * Given an override mapping (scope -> { inputPath -> "form:<componentKey>" })
15
+ * and form data, produce the inputOverrides object for the backend.
16
+ * The "form:" prefix identifies form field references; the remainder is the Formio component key.
17
+ */
18
+ export declare function computeInputOverrides(mapping: OverrideMapping, formData: Record<string, any>): Record<string, any>;
@@ -0,0 +1,11 @@
1
+ import { OnChanges, SimpleChanges } from '@angular/core';
2
+ import { TemplateField } from '../../models';
3
+ import * as i0 from "@angular/core";
4
+ export declare class ExpectedStructureComponent implements OnChanges {
5
+ templateFields: TemplateField[];
6
+ structureText: string;
7
+ ngOnChanges(changes: SimpleChanges): void;
8
+ private buildStructure;
9
+ static ɵfac: i0.ɵɵFactoryDeclaration<ExpectedStructureComponent, never>;
10
+ static ɵcmp: i0.ɵɵComponentDeclaration<ExpectedStructureComponent, "epistola-expected-structure", never, { "templateFields": { "alias": "templateFields"; "required": false; }; }, {}, never, never, true, never>;
11
+ }
@@ -4,7 +4,7 @@ import { FormOutput, SelectItem } from '@valtimo/components';
4
4
  import { CaseManagementParams, ManagementContext } from '@valtimo/shared';
5
5
  import { ProcessLinkStateService } from '@valtimo/process-link';
6
6
  import { BehaviorSubject, Observable } from 'rxjs';
7
- import { AsyncResource, GenerateDocumentConfig, TemplateField } from '../../models';
7
+ import { AsyncResource, ExpressionFunctionInfo, GenerateDocumentConfig, JsonataFieldError, TemplateField, VariableSuggestions } from '../../models';
8
8
  import { EpistolaPluginService } from '../../services';
9
9
  import * as i0 from "@angular/core";
10
10
  export type VariantSelectionMode = 'explicit' | 'attributes';
@@ -25,27 +25,38 @@ export declare class GenerateDocumentConfigurationComponent implements FunctionC
25
25
  variants$: BehaviorSubject<AsyncResource<SelectItem[]>>;
26
26
  environments$: BehaviorSubject<AsyncResource<SelectItem[]>>;
27
27
  templateFields$: BehaviorSubject<AsyncResource<TemplateField[]>>;
28
- dataMapping$: BehaviorSubject<Record<string, any>>;
28
+ dataMapping$: BehaviorSubject<string>;
29
+ mappingMode: 'simple' | 'advanced';
30
+ toolsCollapsed: boolean;
31
+ activeToolTab: 'schema' | 'preview';
29
32
  outputFormatOptions: SelectItem[];
30
33
  readonly selectedCatalogId$: BehaviorSubject<string>;
31
34
  /** Composite ID: "catalogId/templateId" */
32
35
  readonly selectedTemplateId$: BehaviorSubject<string>;
33
36
  readonly selectedVariantId$: BehaviorSubject<string>;
34
37
  variantSelectionMode: VariantSelectionMode;
38
+ variantIdExpressionMode: boolean;
39
+ variantIdExpression: string;
40
+ filenameExpressionMode: boolean;
41
+ filenameExpression: string;
35
42
  variantAttributeEntries: {
36
43
  key: string;
37
44
  value: string;
38
45
  required: boolean;
39
46
  _customKey?: boolean;
47
+ _expressionMode?: boolean;
40
48
  }[];
41
49
  availableAttributeKeys: string[];
42
50
  caseDefinitionKey: string | null;
43
51
  processVariables: string[];
52
+ expressionFunctions: ExpressionFunctionInfo[];
53
+ variableSuggestions: VariableSuggestions | null;
44
54
  requiredFieldsStatus: {
45
55
  mapped: number;
46
56
  total: number;
47
57
  };
48
58
  prefillDataMapping: Record<string, any>;
59
+ validationErrors$: BehaviorSubject<JsonataFieldError[]>;
49
60
  private readonly destroy$;
50
61
  private saveSubscription;
51
62
  private readonly formValue$;
@@ -57,7 +68,7 @@ export declare class GenerateDocumentConfigurationComponent implements FunctionC
57
68
  ngOnInit(): void;
58
69
  ngOnDestroy(): void;
59
70
  formValueChange(formOutput: FormOutput): void;
60
- onDataMappingChange(mapping: Record<string, any>): void;
71
+ onDataMappingChange(expression: string): void;
61
72
  onRequiredFieldsStatusChange(status: {
62
73
  mapped: number;
63
74
  total: number;
@@ -66,6 +77,8 @@ export declare class GenerateDocumentConfigurationComponent implements FunctionC
66
77
  addAttributeEntry(): void;
67
78
  removeAttributeEntry(index: number): void;
68
79
  onAttributeEntryChange(): void;
80
+ onVariantIdExpressionChange(): void;
81
+ onFilenameExpressionChange(): void;
69
82
  onKeySelected(entry: {
70
83
  key: string;
71
84
  value: string;
@@ -99,9 +112,22 @@ export declare class GenerateDocumentConfigurationComponent implements FunctionC
99
112
  * prefill + templateFields loaded → seed dataMapping
100
113
  */
101
114
  private initCascade;
115
+ private loadExpressionFunctions;
102
116
  private loadProcessVariables;
117
+ private loadVariableSuggestions;
103
118
  private handleValid;
104
119
  private openSaveSubscription;
120
+ /**
121
+ * Build a JSONata validation request from the config and call the backend.
122
+ * Only fields that are JSONata expressions get validated:
123
+ * - dataMapping is always JSONata
124
+ * - filename / variantId only when their `fx` toggle is on
125
+ * - variant attribute values only when isExpression() reports true
126
+ * On invalid response, surface errors and abort the emit.
127
+ * If the validator endpoint itself fails (network/server), proceed with the
128
+ * emit — the validation is a quality-of-life check, not a hard gate.
129
+ */
130
+ private validateAndEmit;
105
131
  static ɵfac: i0.ɵɵFactoryDeclaration<GenerateDocumentConfigurationComponent, never>;
106
132
  static ɵcmp: i0.ɵɵComponentDeclaration<GenerateDocumentConfigurationComponent, "epistola-generate-document-configuration", never, { "save$": { "alias": "save$"; "required": false; }; "disabled$": { "alias": "disabled$"; "required": false; }; "pluginId": { "alias": "pluginId"; "required": false; }; "prefillConfiguration$": { "alias": "prefillConfiguration$"; "required": false; }; "selectedPluginConfigurationData$": { "alias": "selectedPluginConfigurationData$"; "required": false; }; "context$": { "alias": "context$"; "required": false; }; }, { "valid": "valid"; "configuration": "configuration"; }, never, never, true, never>;
107
133
  }
@@ -0,0 +1,29 @@
1
+ import { EventEmitter, OnChanges, OnDestroy, SimpleChanges } from '@angular/core';
2
+ import { ExpressionFunctionInfo, VariableSuggestions } from '../../models';
3
+ import * as i0 from "@angular/core";
4
+ export declare class JsonataEditorComponent implements OnChanges, OnDestroy {
5
+ expression: string;
6
+ disabled: boolean;
7
+ suggestions: VariableSuggestions | null;
8
+ functions: ExpressionFunctionInfo[];
9
+ expressionChange: EventEmitter<string>;
10
+ validChange: EventEmitter<boolean>;
11
+ editorModel: {
12
+ value: string;
13
+ language: string;
14
+ };
15
+ editorOptions: Record<string, any>;
16
+ error: string | null;
17
+ private destroy$;
18
+ private validate$;
19
+ private suppressChange;
20
+ private languageRegistered;
21
+ constructor();
22
+ ngOnChanges(changes: SimpleChanges): void;
23
+ ngOnDestroy(): void;
24
+ onEditorValueChange(value: string): void;
25
+ private tryRegisterLanguage;
26
+ private validateExpression;
27
+ static ɵfac: i0.ɵɵFactoryDeclaration<JsonataEditorComponent, never>;
28
+ static ɵcmp: i0.ɵɵComponentDeclaration<JsonataEditorComponent, "epistola-jsonata-editor", never, { "expression": { "alias": "expression"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "suggestions": { "alias": "suggestions"; "required": false; }; "functions": { "alias": "functions"; "required": false; }; }, { "expressionChange": "expressionChange"; "validChange": "validChange"; }, never, never, true, never>;
29
+ }
@@ -0,0 +1,21 @@
1
+ import { EventEmitter } from '@angular/core';
2
+ import { BuilderField } from '../../../utils/jsonata-converter';
3
+ import * as i0 from "@angular/core";
4
+ export declare class BuilderFieldComponent {
5
+ field: BuilderField;
6
+ path: number[];
7
+ suggestions: string[];
8
+ disabled: boolean;
9
+ collapsed: boolean;
10
+ required: boolean;
11
+ collapsedPaths: Set<string>;
12
+ valueChange: EventEmitter<{
13
+ path: number[];
14
+ value: string;
15
+ }>;
16
+ modeToggle: EventEmitter<number[]>;
17
+ collapseToggle: EventEmitter<number[]>;
18
+ isChildCollapsed(childIndex: number): boolean;
19
+ static ɵfac: i0.ɵɵFactoryDeclaration<BuilderFieldComponent, never>;
20
+ static ɵcmp: i0.ɵɵComponentDeclaration<BuilderFieldComponent, "epistola-builder-field", never, { "field": { "alias": "field"; "required": false; }; "path": { "alias": "path"; "required": false; }; "suggestions": { "alias": "suggestions"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "collapsed": { "alias": "collapsed"; "required": false; }; "required": { "alias": "required"; "required": false; }; "collapsedPaths": { "alias": "collapsedPaths"; "required": false; }; }, { "valueChange": "valueChange"; "modeToggle": "modeToggle"; "collapseToggle": "collapseToggle"; }, never, never, true, never>;
21
+ }
@@ -0,0 +1,37 @@
1
+ import { EventEmitter, OnChanges, SimpleChanges } from '@angular/core';
2
+ import { TemplateField, VariableSuggestions } from '../../models';
3
+ import { BuilderField } from '../../utils/jsonata-converter';
4
+ import * as i0 from "@angular/core";
5
+ export declare class MappingBuilderComponent implements OnChanges {
6
+ expression: string;
7
+ templateFields: TemplateField[];
8
+ suggestions: VariableSuggestions | null;
9
+ disabled: boolean;
10
+ expressionChange: EventEmitter<string>;
11
+ fields: BuilderField[];
12
+ allSuggestions: string[];
13
+ collapsedPaths: Set<string>;
14
+ private initialCollapseApplied;
15
+ ngOnChanges(changes: SimpleChanges): void;
16
+ onNestedValueChange(path: number[], value: string): void;
17
+ onNestedModeToggle(path: number[]): void;
18
+ isRequired(fieldName: string): boolean;
19
+ isCollapsed(path: number[]): boolean;
20
+ toggleCollapse(path: number[]): void;
21
+ private collapseAll;
22
+ private collapseChildren;
23
+ private getFieldAtPath;
24
+ private emit;
25
+ /**
26
+ * Ensure all template fields have a corresponding builder field.
27
+ * Adds missing fields with empty values.
28
+ */
29
+ private buildSuggestionList;
30
+ /**
31
+ * Rebuild fields using template fields as the source of truth.
32
+ * Expression values fill in where available; unmapped fields show empty.
33
+ */
34
+ private rebuildFields;
35
+ static ɵfac: i0.ɵɵFactoryDeclaration<MappingBuilderComponent, never>;
36
+ static ɵcmp: i0.ɵɵComponentDeclaration<MappingBuilderComponent, "epistola-mapping-builder", never, { "expression": { "alias": "expression"; "required": false; }; "templateFields": { "alias": "templateFields"; "required": false; }; "suggestions": { "alias": "suggestions"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "expressionChange": "expressionChange"; }, never, never, true, never>;
37
+ }
@@ -0,0 +1,26 @@
1
+ import { OnChanges, OnDestroy, SimpleChanges } from '@angular/core';
2
+ import { EvaluationResult, TemplateField } from '../../models';
3
+ import { EpistolaPluginService } from '../../services';
4
+ import * as i0 from "@angular/core";
5
+ export declare class MappingPreviewComponent implements OnChanges, OnDestroy {
6
+ private readonly epistolaPluginService;
7
+ expression: string;
8
+ templateFields: TemplateField[];
9
+ caseDefinitionKey: string | null;
10
+ documentId: string;
11
+ loading: boolean;
12
+ result: EvaluationResult | null;
13
+ expectedJson: string;
14
+ missingRequired: string[];
15
+ private destroy$;
16
+ private evaluate$;
17
+ constructor(epistolaPluginService: EpistolaPluginService);
18
+ ngOnChanges(changes: SimpleChanges): void;
19
+ ngOnDestroy(): void;
20
+ runPreview(): void;
21
+ private doEvaluate;
22
+ private buildExpectedJson;
23
+ private checkMissingRequired;
24
+ static ɵfac: i0.ɵɵFactoryDeclaration<MappingPreviewComponent, never>;
25
+ static ɵcmp: i0.ɵɵComponentDeclaration<MappingPreviewComponent, "epistola-mapping-preview", never, { "expression": { "alias": "expression"; "required": false; }; "templateFields": { "alias": "templateFields"; "required": false; }; "caseDefinitionKey": { "alias": "caseDefinitionKey"; "required": false; }; }, {}, never, never, true, never>;
26
+ }
@@ -0,0 +1,42 @@
1
+ import { ChangeDetectorRef, EventEmitter } from '@angular/core';
2
+ import { FormioCustomComponent } from '@valtimo/components';
3
+ import * as i0 from "@angular/core";
4
+ interface OverrideRow {
5
+ scope: 'doc' | 'pv';
6
+ inputPath: string;
7
+ formFieldKey: string;
8
+ }
9
+ export interface FormFieldOption {
10
+ key: string;
11
+ label: string;
12
+ }
13
+ /**
14
+ * Override mapping format: scope → { inputPath → "form:<componentKey>" }
15
+ * The "form:" prefix identifies this as a reference to a Formio component.
16
+ */
17
+ export type OverrideMapping = Record<string, Record<string, string>>;
18
+ export declare class EpistolaOverrideBuilderComponent implements FormioCustomComponent<OverrideMapping | null> {
19
+ private readonly cdr;
20
+ value: OverrideMapping | null;
21
+ valueChange: EventEmitter<OverrideMapping>;
22
+ disabled: boolean;
23
+ label: string;
24
+ availableFields: FormFieldOption[];
25
+ rows: OverrideRow[];
26
+ advancedMode: boolean;
27
+ jsonText: string;
28
+ jsonError: string | null;
29
+ private initialized;
30
+ constructor(cdr: ChangeDetectorRef);
31
+ ngOnChanges(): void;
32
+ toggleMode(): void;
33
+ addRow(): void;
34
+ removeRow(index: number): void;
35
+ emitChange(): void;
36
+ onJsonChange(text: string): void;
37
+ private rowsToMapping;
38
+ private mappingToRows;
39
+ static ɵfac: i0.ɵɵFactoryDeclaration<EpistolaOverrideBuilderComponent, never>;
40
+ static ɵcmp: i0.ɵɵComponentDeclaration<EpistolaOverrideBuilderComponent, "epistola-override-builder-component", never, { "value": { "alias": "value"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "label": { "alias": "label"; "required": false; }; "availableFields": { "alias": "availableFields"; "required": false; }; }, { "valueChange": "valueChange"; }, never, never, true, never>;
41
+ }
42
+ export {};
@@ -0,0 +1,4 @@
1
+ import { Injector } from '@angular/core';
2
+ import { FormioCustomComponentInfo } from '@valtimo/components';
3
+ export declare const EPISTOLA_OVERRIDE_BUILDER_OPTIONS: FormioCustomComponentInfo;
4
+ export declare function registerEpistolaOverrideBuilderComponent(injector: Injector): void;
@@ -0,0 +1,31 @@
1
+ import { ChangeDetectorRef, EventEmitter, OnChanges, OnDestroy, SimpleChanges } from '@angular/core';
2
+ import { FormioCustomComponent } from '@valtimo/components';
3
+ import { EpistolaAdminService } from '../../services';
4
+ import { PluginUsageEntry } from '../../models';
5
+ import * as i0 from "@angular/core";
6
+ export interface ProcessLinkSelection {
7
+ processDefinitionKey: string;
8
+ sourceActivityId: string;
9
+ }
10
+ export declare class EpistolaProcessLinkSelectorComponent implements FormioCustomComponent<ProcessLinkSelection | null>, OnChanges, OnDestroy {
11
+ private readonly adminService;
12
+ private readonly cdr;
13
+ value: ProcessLinkSelection | null;
14
+ valueChange: EventEmitter<ProcessLinkSelection>;
15
+ disabled: boolean;
16
+ label: string;
17
+ filteredEntries: PluginUsageEntry[];
18
+ selectedKey: string;
19
+ loading: boolean;
20
+ error: string | null;
21
+ private initialized;
22
+ private loadSubscription?;
23
+ constructor(adminService: EpistolaAdminService, cdr: ChangeDetectorRef);
24
+ ngOnChanges(changes: SimpleChanges): void;
25
+ ngOnDestroy(): void;
26
+ onSelect(key: string): void;
27
+ entryKey(entry: PluginUsageEntry): string;
28
+ private loadEntries;
29
+ static ɵfac: i0.ɵɵFactoryDeclaration<EpistolaProcessLinkSelectorComponent, never>;
30
+ static ɵcmp: i0.ɵɵComponentDeclaration<EpistolaProcessLinkSelectorComponent, "epistola-process-link-selector-component", never, { "value": { "alias": "value"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "label": { "alias": "label"; "required": false; }; }, { "valueChange": "valueChange"; }, never, never, true, never>;
31
+ }
@@ -0,0 +1,4 @@
1
+ import { Injector } from '@angular/core';
2
+ import { FormioCustomComponentInfo } from '@valtimo/components';
3
+ export declare const EPISTOLA_PROCESS_LINK_SELECTOR_OPTIONS: FormioCustomComponentInfo;
4
+ export declare function registerEpistolaProcessLinkSelectorComponent(injector: Injector): void;
@@ -0,0 +1,7 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "@angular/router";
3
+ export declare class EpistolaAdminRoutingModule {
4
+ static ɵfac: i0.ɵɵFactoryDeclaration<EpistolaAdminRoutingModule, never>;
5
+ static ɵmod: i0.ɵɵNgModuleDeclaration<EpistolaAdminRoutingModule, never, [typeof i1.RouterModule], [typeof i1.RouterModule]>;
6
+ static ɵinj: i0.ɵɵInjectorDeclaration<EpistolaAdminRoutingModule>;
7
+ }
@@ -0,0 +1,2 @@
1
+ import { CanActivateFn } from '@angular/router';
2
+ export declare const epistolaEnabledGuard: CanActivateFn;
@@ -0,0 +1,28 @@
1
+ export interface EpistolaRuntimeEnv {
2
+ epistolaEnabled?: boolean | string;
3
+ }
4
+ interface EpistolaRuntimeWindow {
5
+ env?: EpistolaRuntimeEnv;
6
+ }
7
+ declare global {
8
+ interface Window extends EpistolaRuntimeWindow {
9
+ }
10
+ }
11
+ /**
12
+ * Reads the runtime feature flag that decides whether the Epistola plugin
13
+ * surfaces (admin menu, /epistola route, plugin specification, Formio
14
+ * components) should activate in the host Valtimo app.
15
+ *
16
+ * The flag is sourced from `window['env']['epistolaEnabled']`, populated at
17
+ * container start by `envsubst` against `assets/config.template.js` (the
18
+ * standard Valtimo runtime-config pattern). Defaults to enabled — only the
19
+ * literal `false` or string `'false'` disables the plugin, matching the
20
+ * backend's `epistola.enabled` `matchIfMissing = true` semantics.
21
+ *
22
+ * Exposed as a runtime helper rather than evaluated directly in `@NgModule`
23
+ * decorator metadata because Angular's AOT compiler cannot statically resolve
24
+ * `window` accesses (NG1010). Read from runtime code such as specification
25
+ * property getters, route guards, or the environment initializer instead.
26
+ */
27
+ export declare function isEpistolaEnabled(): boolean;
28
+ export {};
@@ -4,22 +4,19 @@ import * as i1 from "@angular/common";
4
4
  import * as i2 from "@angular/common/http";
5
5
  import * as i3 from "@valtimo/plugin";
6
6
  import * as i4 from "@valtimo/components";
7
- import * as i5 from "./components/epistola-configuration/epistola-configuration.component";
8
- import * as i6 from "./components/generate-document-configuration/generate-document-configuration.component";
9
- import * as i7 from "./components/check-job-status-configuration/check-job-status-configuration.component";
10
- import * as i8 from "./components/download-document-configuration/download-document-configuration.component";
11
- import * as i9 from "./components/data-mapping-tree/data-mapping-tree.component";
12
- import * as i10 from "./components/value-input/value-input.component";
13
- import * as i11 from "./components/scalar-field/scalar-field.component";
14
- import * as i12 from "./components/array-field/array-field.component";
15
- import * as i13 from "./components/field-tree/field-tree.component";
16
- import * as i14 from "./components/epistola-download/epistola-download.component";
17
- import * as i15 from "./components/epistola-retry-form/epistola-retry-form.component";
18
- import * as i16 from "./components/epistola-preview-button/epistola-preview-button.component";
19
- import * as i17 from "./components/epistola-document-preview/epistola-document-preview.component";
7
+ import * as i5 from "./epistola-admin-routing.module";
8
+ import * as i6 from "./components/epistola-configuration/epistola-configuration.component";
9
+ import * as i7 from "./components/generate-document-configuration/generate-document-configuration.component";
10
+ import * as i8 from "./components/check-job-status-configuration/check-job-status-configuration.component";
11
+ import * as i9 from "./components/download-document-configuration/download-document-configuration.component";
12
+ import * as i10 from "./components/epistola-download/epistola-download.component";
13
+ import * as i11 from "./components/epistola-retry-form/epistola-retry-form.component";
14
+ import * as i12 from "./components/epistola-preview-button/epistola-preview-button.component";
15
+ import * as i13 from "./components/epistola-document-preview/epistola-document-preview.component";
16
+ import * as i14 from "./components/epistola-admin-page/epistola-admin-page.component";
20
17
  export declare class EpistolaPluginModule {
21
18
  static forRoot(): ModuleWithProviders<EpistolaPluginModule>;
22
19
  static ɵfac: i0.ɵɵFactoryDeclaration<EpistolaPluginModule, never>;
23
- static ɵmod: i0.ɵɵNgModuleDeclaration<EpistolaPluginModule, never, [typeof i1.CommonModule, typeof i2.HttpClientModule, typeof i3.PluginTranslatePipeModule, typeof i4.FormModule, typeof i4.InputModule, typeof i4.SelectModule, typeof i5.EpistolaConfigurationComponent, typeof i6.GenerateDocumentConfigurationComponent, typeof i7.CheckJobStatusConfigurationComponent, typeof i8.DownloadDocumentConfigurationComponent, typeof i9.DataMappingTreeComponent, typeof i10.ValueInputComponent, typeof i11.ScalarFieldComponent, typeof i12.ArrayFieldComponent, typeof i13.FieldTreeComponent, typeof i14.EpistolaDownloadComponent, typeof i15.EpistolaRetryFormComponent, typeof i16.EpistolaPreviewButtonComponent, typeof i17.EpistolaDocumentPreviewComponent], [typeof i5.EpistolaConfigurationComponent, typeof i6.GenerateDocumentConfigurationComponent, typeof i7.CheckJobStatusConfigurationComponent, typeof i8.DownloadDocumentConfigurationComponent, typeof i9.DataMappingTreeComponent, typeof i10.ValueInputComponent, typeof i11.ScalarFieldComponent, typeof i12.ArrayFieldComponent, typeof i13.FieldTreeComponent, typeof i14.EpistolaDownloadComponent, typeof i15.EpistolaRetryFormComponent, typeof i16.EpistolaPreviewButtonComponent, typeof i17.EpistolaDocumentPreviewComponent]>;
20
+ static ɵmod: i0.ɵɵNgModuleDeclaration<EpistolaPluginModule, never, [typeof i1.CommonModule, typeof i2.HttpClientModule, typeof i3.PluginTranslatePipeModule, typeof i4.FormModule, typeof i4.InputModule, typeof i4.SelectModule, typeof i5.EpistolaAdminRoutingModule, typeof i6.EpistolaConfigurationComponent, typeof i7.GenerateDocumentConfigurationComponent, typeof i8.CheckJobStatusConfigurationComponent, typeof i9.DownloadDocumentConfigurationComponent, typeof i10.EpistolaDownloadComponent, typeof i11.EpistolaRetryFormComponent, typeof i12.EpistolaPreviewButtonComponent, typeof i13.EpistolaDocumentPreviewComponent, typeof i14.EpistolaAdminPageComponent], [typeof i6.EpistolaConfigurationComponent, typeof i7.GenerateDocumentConfigurationComponent, typeof i8.CheckJobStatusConfigurationComponent, typeof i9.DownloadDocumentConfigurationComponent, typeof i10.EpistolaDownloadComponent, typeof i11.EpistolaRetryFormComponent, typeof i12.EpistolaPreviewButtonComponent, typeof i13.EpistolaDocumentPreviewComponent, typeof i14.EpistolaAdminPageComponent]>;
24
21
  static ɵinj: i0.ɵɵInjectorDeclaration<EpistolaPluginModule>;
25
22
  }
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Connection health check result for a single Epistola plugin configuration.
3
+ */
4
+ export interface ConnectionStatus {
5
+ configurationId: string;
6
+ configurationTitle: string;
7
+ tenantId: string;
8
+ reachable: boolean;
9
+ latencyMs: number;
10
+ errorMessage?: string;
11
+ serverVersion?: string;
12
+ }
13
+ /**
14
+ * Version information for the Epistola plugin and connected server.
15
+ */
16
+ export interface VersionInfo {
17
+ pluginVersion: string;
18
+ epistolaServerVersion?: string;
19
+ }
20
+ /**
21
+ * Describes a single usage of an Epistola plugin action within a process definition.
22
+ */
23
+ /**
24
+ * A process instance currently waiting for an Epistola document generation result.
25
+ */
26
+ export interface PendingJob {
27
+ executionId: string;
28
+ processInstanceId: string;
29
+ processDefinitionKey: string;
30
+ processDefinitionName: string;
31
+ activityId: string;
32
+ activityName: string;
33
+ tenantId: string;
34
+ requestId: string;
35
+ configurationTitle: string;
36
+ }
37
+ export interface PluginUsageEntry {
38
+ processLinkId: string;
39
+ caseDefinitionKey?: string;
40
+ caseDefinitionVersionTag?: string;
41
+ processDefinitionKey: string;
42
+ processDefinitionName: string;
43
+ activityId: string;
44
+ activityName: string;
45
+ actionKey: string;
46
+ configurationId: string;
47
+ configurationTitle: string;
48
+ problems: string[];
49
+ }
@@ -26,7 +26,7 @@ export interface VariantAttributeEntry {
26
26
  *
27
27
  * Variant selection supports two modes:
28
28
  * - Explicit: set variantId directly
29
- * - By attributes: set variantAttributes with key-value pairs (values can be value resolver expressions)
29
+ * - By attributes: set variantAttributes with key-value pairs (values can be JSONata expressions)
30
30
  */
31
31
  export interface GenerateDocumentConfig {
32
32
  catalogId: string;
@@ -34,7 +34,7 @@ export interface GenerateDocumentConfig {
34
34
  variantId?: string;
35
35
  variantAttributes?: VariantAttributeEntry[];
36
36
  environmentId?: string;
37
- dataMapping: Record<string, any>;
37
+ dataMapping: string;
38
38
  outputFormat: 'PDF' | 'HTML';
39
39
  filename: string;
40
40
  correlationId?: string;
@@ -68,3 +68,31 @@ export interface PreviewSource {
68
68
  templateName: string;
69
69
  processInstanceId: string;
70
70
  }
71
+ export interface VariableSuggestions {
72
+ doc: string[];
73
+ pv: string[];
74
+ }
75
+ export interface EvaluationResult {
76
+ success: boolean;
77
+ result: Record<string, any> | null;
78
+ error: string | null;
79
+ }
80
+ /**
81
+ * Request body for the JSONata save-time validation endpoint.
82
+ * All fields are optional; null/blank values are skipped.
83
+ */
84
+ export interface ValidateJsonataRequest {
85
+ dataMapping?: string | null;
86
+ filename?: string | null;
87
+ variantId?: string | null;
88
+ variantAttributeValues?: Record<string, string> | null;
89
+ }
90
+ export interface JsonataFieldError {
91
+ field: string;
92
+ expression: string;
93
+ message: string;
94
+ }
95
+ export interface JsonataValidationResult {
96
+ valid: boolean;
97
+ errors: JsonataFieldError[];
98
+ }