@epistola.app/valtimo-plugin 0.5.1 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/epistola.app-valtimo-plugin.mjs +1622 -508
- package/fesm2022/epistola.app-valtimo-plugin.mjs.map +1 -1
- package/lib/components/epistola-admin-page/epistola-admin-page.component.d.ts +52 -0
- package/lib/components/expected-structure/expected-structure.component.d.ts +11 -0
- package/lib/components/generate-document-configuration/generate-document-configuration.component.d.ts +10 -3
- package/lib/components/jsonata-editor/jsonata-editor.component.d.ts +29 -0
- package/lib/components/mapping-builder/builder-field/builder-field.component.d.ts +21 -0
- package/lib/components/mapping-builder/mapping-builder.component.d.ts +37 -0
- package/lib/components/mapping-preview/mapping-preview.component.d.ts +26 -0
- package/lib/epistola-admin-routing.module.d.ts +7 -0
- package/lib/epistola.module.d.ts +11 -14
- package/lib/models/admin.d.ts +49 -0
- package/lib/models/config.d.ts +10 -1
- package/lib/models/expression.d.ts +13 -0
- package/lib/models/index.d.ts +2 -0
- package/lib/models/template.d.ts +0 -6
- package/lib/services/epistola-admin.service.d.ts +37 -0
- package/lib/services/epistola-menu.service.d.ts +13 -0
- package/lib/services/epistola-plugin.service.d.ts +11 -3
- package/lib/services/index.d.ts +2 -0
- package/lib/utils/jsonata-converter.d.ts +26 -0
- package/lib/utils/jsonata-monaco.d.ts +14 -0
- package/package.json +7 -5
- package/public_api.d.ts +4 -5
- package/lib/components/array-field/array-field.component.d.ts +0 -27
- package/lib/components/data-mapping-tree/data-mapping-tree.component.d.ts +0 -27
- package/lib/components/field-tree/field-tree.component.d.ts +0 -27
- package/lib/components/scalar-field/scalar-field.component.d.ts +0 -16
- package/lib/components/value-input/value-input.component.d.ts +0 -34
- package/lib/utils/template-field-utils.d.ts +0 -6
|
@@ -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 {};
|
|
@@ -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, 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,7 +25,10 @@ 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<
|
|
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" */
|
|
@@ -41,6 +44,8 @@ export declare class GenerateDocumentConfigurationComponent implements FunctionC
|
|
|
41
44
|
availableAttributeKeys: string[];
|
|
42
45
|
caseDefinitionKey: string | null;
|
|
43
46
|
processVariables: string[];
|
|
47
|
+
expressionFunctions: ExpressionFunctionInfo[];
|
|
48
|
+
variableSuggestions: VariableSuggestions | null;
|
|
44
49
|
requiredFieldsStatus: {
|
|
45
50
|
mapped: number;
|
|
46
51
|
total: number;
|
|
@@ -57,7 +62,7 @@ export declare class GenerateDocumentConfigurationComponent implements FunctionC
|
|
|
57
62
|
ngOnInit(): void;
|
|
58
63
|
ngOnDestroy(): void;
|
|
59
64
|
formValueChange(formOutput: FormOutput): void;
|
|
60
|
-
onDataMappingChange(
|
|
65
|
+
onDataMappingChange(expression: string): void;
|
|
61
66
|
onRequiredFieldsStatusChange(status: {
|
|
62
67
|
mapped: number;
|
|
63
68
|
total: number;
|
|
@@ -99,7 +104,9 @@ export declare class GenerateDocumentConfigurationComponent implements FunctionC
|
|
|
99
104
|
* prefill + templateFields loaded → seed dataMapping
|
|
100
105
|
*/
|
|
101
106
|
private initCascade;
|
|
107
|
+
private loadExpressionFunctions;
|
|
102
108
|
private loadProcessVariables;
|
|
109
|
+
private loadVariableSuggestions;
|
|
103
110
|
private handleValid;
|
|
104
111
|
private openSaveSubscription;
|
|
105
112
|
static ɵfac: i0.ɵɵFactoryDeclaration<GenerateDocumentConfigurationComponent, never>;
|
|
@@ -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,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
|
+
}
|
package/lib/epistola.module.d.ts
CHANGED
|
@@ -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 "./
|
|
8
|
-
import * as i6 from "./components/
|
|
9
|
-
import * as i7 from "./components/
|
|
10
|
-
import * as i8 from "./components/
|
|
11
|
-
import * as i9 from "./components/
|
|
12
|
-
import * as i10 from "./components/
|
|
13
|
-
import * as i11 from "./components/
|
|
14
|
-
import * as i12 from "./components/
|
|
15
|
-
import * as i13 from "./components/
|
|
16
|
-
import * as i14 from "./components/epistola-
|
|
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.
|
|
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
|
+
}
|
package/lib/models/config.d.ts
CHANGED
|
@@ -34,7 +34,7 @@ export interface GenerateDocumentConfig {
|
|
|
34
34
|
variantId?: string;
|
|
35
35
|
variantAttributes?: VariantAttributeEntry[];
|
|
36
36
|
environmentId?: string;
|
|
37
|
-
dataMapping:
|
|
37
|
+
dataMapping: string;
|
|
38
38
|
outputFormat: 'PDF' | 'HTML';
|
|
39
39
|
filename: string;
|
|
40
40
|
correlationId?: string;
|
|
@@ -68,3 +68,12 @@ 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
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface ExpressionFunctionInfo {
|
|
2
|
+
name: string;
|
|
3
|
+
description: string;
|
|
4
|
+
overloads: OverloadInfo[];
|
|
5
|
+
}
|
|
6
|
+
export interface OverloadInfo {
|
|
7
|
+
arguments: ArgumentInfo[];
|
|
8
|
+
returnType: string;
|
|
9
|
+
}
|
|
10
|
+
export interface ArgumentInfo {
|
|
11
|
+
name: string;
|
|
12
|
+
type: string;
|
|
13
|
+
}
|
package/lib/models/index.d.ts
CHANGED
package/lib/models/template.d.ts
CHANGED
|
@@ -41,12 +41,6 @@ export interface DataMappingEntry {
|
|
|
41
41
|
*/
|
|
42
42
|
export type DataSourceType = 'document' | 'processVariable' | 'manual';
|
|
43
43
|
/**
|
|
44
|
-
* Validation result from the backend.
|
|
45
|
-
*/
|
|
46
|
-
export interface ValidationResult {
|
|
47
|
-
valid: boolean;
|
|
48
|
-
missingRequiredFields: string[];
|
|
49
|
-
}
|
|
50
44
|
/**
|
|
51
45
|
* Information about an Epistola environment.
|
|
52
46
|
*/
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { HttpClient } from '@angular/common/http';
|
|
2
|
+
import { ConfigService } from '@valtimo/shared';
|
|
3
|
+
import { Observable } from 'rxjs';
|
|
4
|
+
import { ConnectionStatus, PendingJob, PluginUsageEntry, VersionInfo } from '../models';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
/**
|
|
7
|
+
* Service for Epistola plugin administrative operations.
|
|
8
|
+
* Provides health checks, version info, and usage overview.
|
|
9
|
+
*/
|
|
10
|
+
export declare class EpistolaAdminService {
|
|
11
|
+
private readonly http;
|
|
12
|
+
private readonly configService;
|
|
13
|
+
private readonly apiEndpoint;
|
|
14
|
+
constructor(http: HttpClient, configService: ConfigService);
|
|
15
|
+
/**
|
|
16
|
+
* Check connectivity to Epistola for all plugin configurations.
|
|
17
|
+
*/
|
|
18
|
+
getConnectionStatus(): Observable<ConnectionStatus[]>;
|
|
19
|
+
/**
|
|
20
|
+
* Get version information for the plugin and connected Epistola server.
|
|
21
|
+
*/
|
|
22
|
+
getVersions(): Observable<VersionInfo>;
|
|
23
|
+
/**
|
|
24
|
+
* Get an overview of all Epistola plugin usages across process definitions.
|
|
25
|
+
*/
|
|
26
|
+
getPluginUsage(): Observable<PluginUsageEntry[]>;
|
|
27
|
+
/**
|
|
28
|
+
* Get all process instances currently waiting for an Epistola document generation result.
|
|
29
|
+
*/
|
|
30
|
+
getPendingJobs(): Observable<PendingJob[]>;
|
|
31
|
+
/**
|
|
32
|
+
* Export a single process link as a .process-link.json file.
|
|
33
|
+
*/
|
|
34
|
+
exportProcessLink(processLinkId: string): Observable<Blob>;
|
|
35
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EpistolaAdminService, never>;
|
|
36
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<EpistolaAdminService>;
|
|
37
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { MenuService } from '@valtimo/components';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* Registers the Epistola admin page menu item under the Admin > Other section.
|
|
5
|
+
* Instantiated eagerly via ENVIRONMENT_INITIALIZER so the menu item
|
|
6
|
+
* appears without any manual configuration in the host application.
|
|
7
|
+
*/
|
|
8
|
+
export declare class EpistolaMenuService {
|
|
9
|
+
private readonly menuService;
|
|
10
|
+
constructor(menuService: MenuService);
|
|
11
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EpistolaMenuService, never>;
|
|
12
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<EpistolaMenuService>;
|
|
13
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { HttpClient } from '@angular/common/http';
|
|
2
2
|
import { ConfigService } from '@valtimo/shared';
|
|
3
3
|
import { Observable } from 'rxjs';
|
|
4
|
-
import { AttributeDefinition, CatalogInfo, EnvironmentInfo, PreviewSource, TemplateDetails, TemplateInfo,
|
|
4
|
+
import { AttributeDefinition, CatalogInfo, EnvironmentInfo, ExpressionFunctionInfo, PreviewSource, TemplateDetails, TemplateInfo, EvaluationResult, VariableSuggestions, VariantInfo } from '../models';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
6
|
/**
|
|
7
7
|
* Service for interacting with Epistola plugin API endpoints.
|
|
@@ -42,13 +42,21 @@ export declare class EpistolaPluginService {
|
|
|
42
42
|
*/
|
|
43
43
|
getProcessVariables(processDefinitionKey: string): Observable<string[]>;
|
|
44
44
|
/**
|
|
45
|
-
*
|
|
45
|
+
* Get variable suggestions for JSONata autocompletion.
|
|
46
46
|
*/
|
|
47
|
-
|
|
47
|
+
getVariableSuggestions(caseDefinitionKey?: string, processDefinitionKey?: string): Observable<VariableSuggestions>;
|
|
48
|
+
/**
|
|
49
|
+
* Evaluate a JSONata expression against a real document.
|
|
50
|
+
*/
|
|
51
|
+
evaluateMapping(expression: string, documentId: string, processInstanceId?: string): Observable<EvaluationResult>;
|
|
48
52
|
/**
|
|
49
53
|
* Get a dynamically generated Formio form for retrying a failed document generation.
|
|
50
54
|
*/
|
|
51
55
|
getRetryForm(processInstanceId: string, documentId?: string, sourceActivityId?: string): Observable<any>;
|
|
56
|
+
/**
|
|
57
|
+
* List all available expression functions for expr: data mapping values.
|
|
58
|
+
*/
|
|
59
|
+
getExpressionFunctions(): Observable<ExpressionFunctionInfo[]>;
|
|
52
60
|
/**
|
|
53
61
|
* Discover all previewable document sources for a given Valtimo document.
|
|
54
62
|
*/
|
package/lib/services/index.d.ts
CHANGED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a field in the visual builder.
|
|
3
|
+
* - mode 'ref': a simple $doc/$pv/$case path reference
|
|
4
|
+
* - mode 'raw': raw JSONata text the builder can't represent visually
|
|
5
|
+
*/
|
|
6
|
+
export interface BuilderField {
|
|
7
|
+
name: string;
|
|
8
|
+
mode: 'ref' | 'raw';
|
|
9
|
+
value: string;
|
|
10
|
+
children?: BuilderField[];
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Parse a JSONata expression into BuilderField array.
|
|
14
|
+
* Only supports top-level object literals with simple path references or nested objects.
|
|
15
|
+
* Anything else is stored as raw JSONata text.
|
|
16
|
+
*/
|
|
17
|
+
export declare function parseJsonataToBuilder(expression: string): BuilderField[];
|
|
18
|
+
/**
|
|
19
|
+
* Convert BuilderField array back to a JSONata expression string.
|
|
20
|
+
*/
|
|
21
|
+
export declare function builderToJsonata(fields: BuilderField[]): string;
|
|
22
|
+
/**
|
|
23
|
+
* Check if a JSONata expression can be fully represented by the builder
|
|
24
|
+
* (i.e., all fields are simple refs or nested objects of simple refs).
|
|
25
|
+
*/
|
|
26
|
+
export declare function isBuilderCompatible(expression: string): boolean;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ExpressionFunctionInfo, VariableSuggestions } from '../models';
|
|
2
|
+
/**
|
|
3
|
+
* Shared state for the JSONata completion provider.
|
|
4
|
+
* Updated by the editor component when suggestions/functions change.
|
|
5
|
+
*/
|
|
6
|
+
export declare const jsonataCompletionData: {
|
|
7
|
+
suggestions: VariableSuggestions | null;
|
|
8
|
+
functions: ExpressionFunctionInfo[];
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Register the JSONata language in Monaco editor.
|
|
12
|
+
* Call this once when Monaco is available (e.g., in editor component OnInit).
|
|
13
|
+
*/
|
|
14
|
+
export declare function registerJsonataLanguage(monaco: any): void;
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epistola.app/valtimo-plugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Epistola document generation plugin for Valtimo",
|
|
5
5
|
"license": "EUPL-1.2",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "https://github.com/epistola-app/valtimo-epistola-plugin"
|
|
9
9
|
},
|
|
10
|
+
"sideEffects": false,
|
|
10
11
|
"module": "fesm2022/epistola.app-valtimo-plugin.mjs",
|
|
11
12
|
"typings": "index.d.ts",
|
|
12
13
|
"exports": {
|
|
@@ -18,17 +19,18 @@
|
|
|
18
19
|
"default": "./fesm2022/epistola.app-valtimo-plugin.mjs"
|
|
19
20
|
}
|
|
20
21
|
},
|
|
21
|
-
"
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"tslib": "^2.6.0"
|
|
24
|
+
},
|
|
22
25
|
"peerDependencies": {
|
|
23
26
|
"@angular/common": ">=17.0.0",
|
|
24
27
|
"@angular/core": ">=17.0.0",
|
|
25
28
|
"@angular/forms": ">=17.0.0",
|
|
29
|
+
"@angular/router": ">=17.0.0",
|
|
26
30
|
"@valtimo/components": "^13.21.0",
|
|
27
31
|
"@valtimo/plugin": "^13.21.0",
|
|
28
32
|
"@valtimo/process-link": "^13.21.0",
|
|
33
|
+
"@valtimo/security": "^13.21.0",
|
|
29
34
|
"@valtimo/shared": "^13.21.0"
|
|
30
|
-
},
|
|
31
|
-
"dependencies": {
|
|
32
|
-
"tslib": "^2.6.0"
|
|
33
35
|
}
|
|
34
36
|
}
|
package/public_api.d.ts
CHANGED
|
@@ -2,15 +2,14 @@ export * from './lib/models';
|
|
|
2
2
|
export * from './lib/services';
|
|
3
3
|
export * from './lib/epistola.module';
|
|
4
4
|
export * from './lib/epistola.specification';
|
|
5
|
+
export * from './lib/epistola-admin-routing.module';
|
|
6
|
+
export * from './lib/components/epistola-admin-page/epistola-admin-page.component';
|
|
5
7
|
export * from './lib/components/epistola-configuration/epistola-configuration.component';
|
|
6
8
|
export * from './lib/components/generate-document-configuration/generate-document-configuration.component';
|
|
7
9
|
export * from './lib/components/check-job-status-configuration/check-job-status-configuration.component';
|
|
8
10
|
export * from './lib/components/download-document-configuration/download-document-configuration.component';
|
|
9
|
-
export * from './lib/components/
|
|
10
|
-
export * from './lib/components/
|
|
11
|
-
export * from './lib/components/array-field/array-field.component';
|
|
12
|
-
export * from './lib/components/field-tree/field-tree.component';
|
|
13
|
-
export * from './lib/components/data-mapping-tree/data-mapping-tree.component';
|
|
11
|
+
export * from './lib/components/jsonata-editor/jsonata-editor.component';
|
|
12
|
+
export * from './lib/components/mapping-builder/mapping-builder.component';
|
|
14
13
|
export * from './lib/components/epistola-download/epistola-download.component';
|
|
15
14
|
export * from './lib/components/epistola-download/epistola-download.formio';
|
|
16
15
|
export * from './lib/components/epistola-retry-form/epistola-retry-form.component';
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { EventEmitter, OnChanges, SimpleChanges } from '@angular/core';
|
|
2
|
-
import { TemplateField } from '../../models';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class ArrayFieldComponent implements OnChanges {
|
|
5
|
-
field: TemplateField;
|
|
6
|
-
value: any;
|
|
7
|
-
pluginId: string;
|
|
8
|
-
caseDefinitionKey: string | null;
|
|
9
|
-
processVariables: string[];
|
|
10
|
-
disabled: boolean;
|
|
11
|
-
valueChange: EventEmitter<any>;
|
|
12
|
-
expanded: boolean;
|
|
13
|
-
arrayPerFieldMode: boolean;
|
|
14
|
-
mappedCount: number;
|
|
15
|
-
totalRequired: number;
|
|
16
|
-
ngOnChanges(changes: SimpleChanges): void;
|
|
17
|
-
toggleExpanded(): void;
|
|
18
|
-
getSourceValue(): string;
|
|
19
|
-
onSourceValueChange(newValue: string): void;
|
|
20
|
-
toggleArrayPerFieldMode(): void;
|
|
21
|
-
onItemFieldChange(childName: string, sourceFieldName: string): void;
|
|
22
|
-
getItemFieldValue(childName: string): string;
|
|
23
|
-
hasArrayChildren(): boolean;
|
|
24
|
-
private updateCompleteness;
|
|
25
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ArrayFieldComponent, never>;
|
|
26
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ArrayFieldComponent, "epistola-array-field", never, { "field": { "alias": "field"; "required": false; }; "value": { "alias": "value"; "required": false; }; "pluginId": { "alias": "pluginId"; "required": false; }; "caseDefinitionKey": { "alias": "caseDefinitionKey"; "required": false; }; "processVariables": { "alias": "processVariables"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "valueChange": "valueChange"; }, never, never, true, never>;
|
|
27
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { EventEmitter, OnChanges, SimpleChanges } from '@angular/core';
|
|
2
|
-
import { TemplateField } from '../../models';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
/**
|
|
5
|
-
* Top-level wrapper that hosts FieldTreeComponent instances for each top-level template field.
|
|
6
|
-
* Manages the full nested mapping object, completeness tracking, and emits mapping changes.
|
|
7
|
-
*/
|
|
8
|
-
export declare class DataMappingTreeComponent implements OnChanges {
|
|
9
|
-
pluginId: string;
|
|
10
|
-
templateFields: TemplateField[];
|
|
11
|
-
prefillMapping: Record<string, any>;
|
|
12
|
-
disabled: boolean;
|
|
13
|
-
caseDefinitionKey: string | null;
|
|
14
|
-
processVariables: string[];
|
|
15
|
-
mappingChange: EventEmitter<Record<string, any>>;
|
|
16
|
-
requiredFieldsStatus: EventEmitter<{
|
|
17
|
-
mapped: number;
|
|
18
|
-
total: number;
|
|
19
|
-
}>;
|
|
20
|
-
mapping: Record<string, any>;
|
|
21
|
-
ngOnChanges(changes: SimpleChanges): void;
|
|
22
|
-
onFieldValueChange(fieldName: string, value: any): void;
|
|
23
|
-
getFieldValue(fieldName: string): any;
|
|
24
|
-
private emitRequiredFieldsStatus;
|
|
25
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<DataMappingTreeComponent, never>;
|
|
26
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<DataMappingTreeComponent, "epistola-data-mapping-tree", never, { "pluginId": { "alias": "pluginId"; "required": false; }; "templateFields": { "alias": "templateFields"; "required": false; }; "prefillMapping": { "alias": "prefillMapping"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "caseDefinitionKey": { "alias": "caseDefinitionKey"; "required": false; }; "processVariables": { "alias": "processVariables"; "required": false; }; }, { "mappingChange": "mappingChange"; "requiredFieldsStatus": "requiredFieldsStatus"; }, never, never, true, never>;
|
|
27
|
-
}
|