@epistola.app/valtimo-plugin 0.2.3 → 0.3.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.
@@ -27,7 +27,6 @@ export declare class DataMappingTreeComponent implements OnInit, OnDestroy {
27
27
  onFieldValueChange(fieldName: string, value: any): void;
28
28
  getFieldValue(fieldName: string): any;
29
29
  private emitRequiredFieldsStatus;
30
- private countRequiredMapped;
31
30
  static ɵfac: i0.ɵɵFactoryDeclaration<DataMappingTreeComponent, never>;
32
31
  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>;
33
32
  }
@@ -0,0 +1,35 @@
1
+ import { EventEmitter, OnDestroy } from '@angular/core';
2
+ import { HttpClient } from '@angular/common/http';
3
+ import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';
4
+ import { FormioCustomComponent } from '@valtimo/components';
5
+ import { ConfigService } from '@valtimo/shared';
6
+ import * as i0 from "@angular/core";
7
+ export interface PreviewButtonData {
8
+ documentId: string;
9
+ tenantId: string;
10
+ }
11
+ export declare class EpistolaPreviewButtonComponent implements FormioCustomComponent<PreviewButtonData>, OnDestroy {
12
+ private readonly http;
13
+ private readonly sanitizer;
14
+ private readonly configService;
15
+ value: PreviewButtonData;
16
+ valueChange: EventEmitter<PreviewButtonData>;
17
+ disabled: boolean;
18
+ label: string;
19
+ modalOpen: boolean;
20
+ loading: boolean;
21
+ previewLoading: boolean;
22
+ previewError: string | null;
23
+ previewUrl: SafeResourceUrl | null;
24
+ private currentBlobUrl;
25
+ private readonly apiEndpoint;
26
+ get buttonLabel(): string;
27
+ constructor(http: HttpClient, sanitizer: DomSanitizer, configService: ConfigService);
28
+ ngOnDestroy(): void;
29
+ hasRequiredData(): boolean;
30
+ openPreview(): void;
31
+ closePreview(): void;
32
+ private revokeBlobUrl;
33
+ static ɵfac: i0.ɵɵFactoryDeclaration<EpistolaPreviewButtonComponent, never>;
34
+ static ɵcmp: i0.ɵɵComponentDeclaration<EpistolaPreviewButtonComponent, "epistola-preview-button-component", never, { "value": { "alias": "value"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "label": { "alias": "label"; "required": false; }; }, { "valueChange": "valueChange"; }, never, never, true, never>;
35
+ }
@@ -0,0 +1,4 @@
1
+ import { Injector } from '@angular/core';
2
+ import { FormioCustomComponentInfo } from '@valtimo/components';
3
+ export declare const EPISTOLA_PREVIEW_BUTTON_OPTIONS: FormioCustomComponentInfo;
4
+ export declare function registerEpistolaPreviewButtonComponent(injector: Injector): void;
@@ -0,0 +1,46 @@
1
+ import { ChangeDetectorRef, EventEmitter, OnChanges, OnDestroy, SimpleChanges } from '@angular/core';
2
+ import { HttpClient } from '@angular/common/http';
3
+ import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser';
4
+ import { FormioCustomComponent, FormIoStateService } from '@valtimo/components';
5
+ import { ConfigService } from '@valtimo/shared';
6
+ import { EpistolaPluginService } from '../../services';
7
+ import * as i0 from "@angular/core";
8
+ export declare class EpistolaRetryFormComponent implements FormioCustomComponent<string>, OnChanges, OnDestroy {
9
+ private readonly epistolaPluginService;
10
+ private readonly formIoStateService;
11
+ private readonly cdr;
12
+ private readonly http;
13
+ private readonly sanitizer;
14
+ private readonly configService;
15
+ value: string;
16
+ valueChange: EventEmitter<string>;
17
+ disabled: boolean;
18
+ label: string;
19
+ sourceActivityId?: string;
20
+ formDefinition: any;
21
+ submission: any;
22
+ loading: boolean;
23
+ error: string | null;
24
+ previewUrl: SafeResourceUrl | null;
25
+ previewLoading: boolean;
26
+ previewError: string | null;
27
+ previewExpanded: boolean;
28
+ private loaded;
29
+ private loadSubscription?;
30
+ private previewSubscription?;
31
+ private previewSubject;
32
+ private currentBlobUrl;
33
+ private resolvedSourceActivityId?;
34
+ private processDefinitionKey?;
35
+ private readonly apiEndpoint;
36
+ formOptions: any;
37
+ constructor(epistolaPluginService: EpistolaPluginService, formIoStateService: FormIoStateService, cdr: ChangeDetectorRef, http: HttpClient, sanitizer: DomSanitizer, configService: ConfigService);
38
+ ngOnChanges(changes: SimpleChanges): void;
39
+ ngOnDestroy(): void;
40
+ togglePreview(): void;
41
+ onFormChange(event: any): void;
42
+ private loadPreview;
43
+ private loadForm;
44
+ static ɵfac: i0.ɵɵFactoryDeclaration<EpistolaRetryFormComponent, never>;
45
+ static ɵcmp: i0.ɵɵComponentDeclaration<EpistolaRetryFormComponent, "epistola-retry-form-component", never, { "value": { "alias": "value"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "label": { "alias": "label"; "required": false; }; "sourceActivityId": { "alias": "sourceActivityId"; "required": false; }; }, { "valueChange": "valueChange"; }, never, never, true, never>;
46
+ }
@@ -0,0 +1,4 @@
1
+ import { Injector } from '@angular/core';
2
+ import { FormioCustomComponentInfo } from '@valtimo/components';
3
+ export declare const EPISTOLA_RETRY_FORM_OPTIONS: FormioCustomComponentInfo;
4
+ export declare function registerEpistolaRetryFormComponent(injector: Injector): void;
@@ -67,7 +67,6 @@ export declare class FieldTreeComponent implements OnChanges {
67
67
  private updateSourceValue;
68
68
  private updateCompleteness;
69
69
  private updateArrayCompleteness;
70
- private countRequiredMapped;
71
70
  private detectInputMode;
72
71
  private isResolvableValue;
73
72
  static ɵfac: i0.ɵɵFactoryDeclaration<FieldTreeComponent, never>;
@@ -1,4 +1,4 @@
1
- import { EventEmitter, OnDestroy, OnInit } from '@angular/core';
1
+ import { ChangeDetectorRef, EventEmitter, OnDestroy, OnInit } from '@angular/core';
2
2
  import { FunctionConfigurationComponent, PluginConfigurationData } from '@valtimo/plugin';
3
3
  import { FormOutput, SelectItem } from '@valtimo/components';
4
4
  import { CaseManagementParams, ManagementContext } from '@valtimo/shared';
@@ -11,6 +11,7 @@ export type VariantSelectionMode = 'explicit' | 'attributes';
11
11
  export declare class GenerateDocumentConfigurationComponent implements FunctionConfigurationComponent, OnInit, OnDestroy {
12
12
  private readonly epistolaPluginService;
13
13
  private readonly processLinkStateService;
14
+ private readonly cdr;
14
15
  save$: Observable<void>;
15
16
  disabled$: Observable<boolean>;
16
17
  pluginId: string;
@@ -21,12 +22,16 @@ export declare class GenerateDocumentConfigurationComponent implements FunctionC
21
22
  configuration: EventEmitter<GenerateDocumentConfig>;
22
23
  templateOptions$: BehaviorSubject<SelectItem[]>;
23
24
  templatesLoading$: BehaviorSubject<boolean>;
25
+ templatesError$: BehaviorSubject<string>;
24
26
  variantOptions$: BehaviorSubject<SelectItem[]>;
25
27
  variantsLoading$: BehaviorSubject<boolean>;
28
+ variantsError$: BehaviorSubject<string>;
26
29
  environmentOptions$: BehaviorSubject<SelectItem[]>;
27
30
  environmentsLoading$: BehaviorSubject<boolean>;
31
+ environmentsError$: BehaviorSubject<string>;
28
32
  templateFields$: BehaviorSubject<TemplateField[]>;
29
33
  templateFieldsLoading$: BehaviorSubject<boolean>;
34
+ templateFieldsError$: BehaviorSubject<string>;
30
35
  dataMapping$: BehaviorSubject<Record<string, any>>;
31
36
  prefillDataMapping$: Observable<Record<string, any>>;
32
37
  outputFormatOptions: SelectItem[];
@@ -48,7 +53,7 @@ export declare class GenerateDocumentConfigurationComponent implements FunctionC
48
53
  private readonly formValue$;
49
54
  private readonly valid$;
50
55
  private pluginConfigurationId$;
51
- constructor(epistolaPluginService: EpistolaPluginService, processLinkStateService: ProcessLinkStateService);
56
+ constructor(epistolaPluginService: EpistolaPluginService, processLinkStateService: ProcessLinkStateService, cdr: ChangeDetectorRef);
52
57
  ngOnInit(): void;
53
58
  ngOnDestroy(): void;
54
59
  formValueChange(formOutput: FormOutput): void;
@@ -10,8 +10,10 @@ import * as i8 from "./components/download-document-configuration/download-docum
10
10
  import * as i9 from "./components/data-mapping-tree/data-mapping-tree.component";
11
11
  import * as i10 from "./components/field-tree/field-tree.component";
12
12
  import * as i11 from "./components/epistola-download/epistola-download.component";
13
+ import * as i12 from "./components/epistola-retry-form/epistola-retry-form.component";
14
+ import * as i13 from "./components/epistola-preview-button/epistola-preview-button.component";
13
15
  export declare class EpistolaPluginModule {
14
16
  static ɵfac: i0.ɵɵFactoryDeclaration<EpistolaPluginModule, never>;
15
- 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.FieldTreeComponent, typeof i11.EpistolaDownloadComponent], [typeof i5.EpistolaConfigurationComponent, typeof i6.GenerateDocumentConfigurationComponent, typeof i7.CheckJobStatusConfigurationComponent, typeof i8.DownloadDocumentConfigurationComponent, typeof i9.DataMappingTreeComponent, typeof i10.FieldTreeComponent, typeof i11.EpistolaDownloadComponent]>;
17
+ 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.FieldTreeComponent, typeof i11.EpistolaDownloadComponent, typeof i12.EpistolaRetryFormComponent, typeof i13.EpistolaPreviewButtonComponent], [typeof i5.EpistolaConfigurationComponent, typeof i6.GenerateDocumentConfigurationComponent, typeof i7.CheckJobStatusConfigurationComponent, typeof i8.DownloadDocumentConfigurationComponent, typeof i9.DataMappingTreeComponent, typeof i10.FieldTreeComponent, typeof i11.EpistolaDownloadComponent, typeof i12.EpistolaRetryFormComponent, typeof i13.EpistolaPreviewButtonComponent]>;
16
18
  static ɵinj: i0.ɵɵInjectorDeclaration<EpistolaPluginModule>;
17
19
  }
@@ -37,6 +37,15 @@ export declare class EpistolaPluginService {
37
37
  * Validate that a data mapping covers all required template fields.
38
38
  */
39
39
  validateMapping(pluginConfigurationId: string, templateId: string, dataMapping: Record<string, any>): Observable<ValidationResult>;
40
+ /**
41
+ * Get a dynamically generated Formio form for retrying a failed document generation.
42
+ */
43
+ getRetryForm(processInstanceId: string, documentId?: string, sourceActivityId?: string): Observable<any>;
44
+ /**
45
+ * Preview a document by dry-running the generate-document process link.
46
+ * Returns the resolved data as a mock preview (Phase 1).
47
+ */
48
+ previewDocument(documentId: string, processDefinitionKey: string, sourceActivityId: string, processInstanceId?: string, overrides?: Record<string, any>): Observable<any>;
40
49
  static ɵfac: i0.ɵɵFactoryDeclaration<EpistolaPluginService, never>;
41
50
  static ɵprov: i0.ɵɵInjectableDeclaration<EpistolaPluginService>;
42
51
  }
@@ -0,0 +1,6 @@
1
+ import { TemplateField } from '../models';
2
+ export interface RequiredFieldsStatus {
3
+ mapped: number;
4
+ total: number;
5
+ }
6
+ export declare function countRequiredMapped(fields: TemplateField[], mapping: Record<string, any>): RequiredFieldsStatus;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epistola.app/valtimo-plugin",
3
- "version": "0.2.3",
3
+ "version": "0.3.0",
4
4
  "description": "Epistola document generation plugin for Valtimo",
5
5
  "license": "EUPL-1.2",
6
6
  "repository": {
@@ -23,10 +23,10 @@
23
23
  "@angular/common": ">=17.0.0",
24
24
  "@angular/core": ">=17.0.0",
25
25
  "@angular/forms": ">=17.0.0",
26
- "@valtimo/plugin": "^13.0.0",
27
- "@valtimo/components": "^13.0.0",
28
- "@valtimo/shared": "^13.0.0",
29
- "@valtimo/process-link": "^13.0.0"
26
+ "@valtimo/plugin": "^13.21.0",
27
+ "@valtimo/components": "^13.21.0",
28
+ "@valtimo/shared": "^13.21.0",
29
+ "@valtimo/process-link": "^13.21.0"
30
30
  },
31
31
  "dependencies": {
32
32
  "tslib": "^2.6.0"
package/public_api.d.ts CHANGED
@@ -10,3 +10,7 @@ export * from './lib/components/field-tree/field-tree.component';
10
10
  export * from './lib/components/data-mapping-tree/data-mapping-tree.component';
11
11
  export * from './lib/components/epistola-download/epistola-download.component';
12
12
  export * from './lib/components/epistola-download/epistola-download.formio';
13
+ export * from './lib/components/epistola-retry-form/epistola-retry-form.component';
14
+ export * from './lib/components/epistola-retry-form/epistola-retry-form.formio';
15
+ export * from './lib/components/epistola-preview-button/epistola-preview-button.component';
16
+ export * from './lib/components/epistola-preview-button/epistola-preview-button.formio';