@epistola.app/valtimo-plugin 0.3.2 → 0.3.3

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.
@@ -32,7 +32,10 @@ export declare class GenerateDocumentConfigurationComponent implements FunctionC
32
32
  variantAttributeEntries: {
33
33
  key: string;
34
34
  value: string;
35
+ required: boolean;
36
+ _customKey?: boolean;
35
37
  }[];
38
+ availableAttributeKeys: string[];
36
39
  caseDefinitionKey: string | null;
37
40
  processVariables: string[];
38
41
  requiredFieldsStatus: {
@@ -58,6 +61,18 @@ export declare class GenerateDocumentConfigurationComponent implements FunctionC
58
61
  addAttributeEntry(): void;
59
62
  removeAttributeEntry(index: number): void;
60
63
  onAttributeEntryChange(): void;
64
+ onKeySelected(entry: {
65
+ key: string;
66
+ value: string;
67
+ required: boolean;
68
+ _customKey?: boolean;
69
+ }, value: string): void;
70
+ cancelCustomKey(entry: {
71
+ key: string;
72
+ value: string;
73
+ required: boolean;
74
+ _customKey?: boolean;
75
+ }): void;
61
76
  private revalidate;
62
77
  private formatAttributes;
63
78
  private initContext;
@@ -65,6 +80,7 @@ export declare class GenerateDocumentConfigurationComponent implements FunctionC
65
80
  private initPluginConfiguration;
66
81
  private initTemplatesLoading;
67
82
  private initEnvironmentsLoading;
83
+ private initAttributesLoading;
68
84
  private initVariantsLoading;
69
85
  private initTemplateFieldsLoading;
70
86
  private loadProcessVariables;
@@ -10,6 +10,16 @@ export interface EpistolaPluginConfig extends PluginConfigurationData {
10
10
  defaultEnvironmentId?: string;
11
11
  templateSyncEnabled?: boolean;
12
12
  }
13
+ /**
14
+ * A single variant attribute entry for attribute-based variant selection.
15
+ * When required is true, the variant MUST match this attribute.
16
+ * When required is false, it is a preference (preferred but not mandatory).
17
+ */
18
+ export interface VariantAttributeEntry {
19
+ key: string;
20
+ value: string;
21
+ required: boolean;
22
+ }
13
23
  /**
14
24
  * Action configuration for the generate-document action.
15
25
  * Contains all parameters needed to generate a document.
@@ -21,7 +31,7 @@ export interface EpistolaPluginConfig extends PluginConfigurationData {
21
31
  export interface GenerateDocumentConfig {
22
32
  templateId: string;
23
33
  variantId?: string;
24
- variantAttributes?: Record<string, string>;
34
+ variantAttributes?: VariantAttributeEntry[];
25
35
  environmentId?: string;
26
36
  dataMapping: Record<string, any>;
27
37
  outputFormat: 'PDF' | 'HTML';
@@ -61,3 +61,10 @@ export interface VariantInfo {
61
61
  name: string;
62
62
  attributes: Record<string, string>;
63
63
  }
64
+ /**
65
+ * An attribute definition for variant selection within a tenant.
66
+ */
67
+ export interface AttributeDefinition {
68
+ key: string;
69
+ description?: string;
70
+ }
@@ -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 { EnvironmentInfo, PreviewSource, TemplateDetails, TemplateInfo, ValidationResult, VariantInfo } from '../models';
4
+ import { AttributeDefinition, EnvironmentInfo, PreviewSource, TemplateDetails, TemplateInfo, ValidationResult, VariantInfo } from '../models';
5
5
  import * as i0 from "@angular/core";
6
6
  /**
7
7
  * Service for interacting with Epistola plugin API endpoints.
@@ -21,6 +21,10 @@ export declare class EpistolaPluginService {
21
21
  * Get template details including its fields.
22
22
  */
23
23
  getTemplateDetails(pluginConfigurationId: string, templateId: string): Observable<TemplateDetails>;
24
+ /**
25
+ * Get all attribute definitions for a plugin configuration's tenant.
26
+ */
27
+ getAttributes(pluginConfigurationId: string): Observable<AttributeDefinition[]>;
24
28
  /**
25
29
  * Get all available environments for a plugin configuration.
26
30
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epistola.app/valtimo-plugin",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
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.21.0",
27
26
  "@valtimo/components": "^13.21.0",
28
- "@valtimo/shared": "^13.21.0",
29
- "@valtimo/process-link": "^13.21.0"
27
+ "@valtimo/plugin": "^13.21.0",
28
+ "@valtimo/process-link": "^13.21.0",
29
+ "@valtimo/shared": "^13.21.0"
30
30
  },
31
31
  "dependencies": {
32
32
  "tslib": "^2.6.0"