@octaviaflow/flow-rules 0.10.0 → 0.11.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/dist/catalog/ai/ai-agent/config.d.ts +68 -0
- package/dist/catalog/ai/idp-extract/config.d.ts +55 -0
- package/dist/catalog/logic/group/config.d.ts +21 -0
- package/dist/catalog/storage/csv-action/config.d.ts +136 -0
- package/dist/catalog/storage/dropbox-action/config.d.ts +85 -0
- package/dist/catalog/storage/excel-action/config.d.ts +127 -0
- package/dist/catalog/storage/file-action/config.d.ts +197 -0
- package/dist/catalog/storage/fileEditContract.d.ts +127 -0
- package/dist/catalog/storage/ftp-action/config.d.ts +85 -0
- package/dist/catalog/storage/google-drive-action/config.d.ts +135 -0
- package/dist/catalog/storage/json-action/config.d.ts +131 -0
- package/dist/catalog/storage/onedrive-action/config.d.ts +94 -0
- package/dist/catalog/storage/s3-action/config.d.ts +122 -0
- package/dist/catalog/storage/storage-action/config.d.ts +78 -0
- package/dist/catalog/storage/xml-action/config.d.ts +123 -0
- package/dist/catalog/triggers/connector-trigger/config.d.ts +110 -0
- package/dist/index.cjs +605 -6
- package/dist/index.d.ts +16 -0
- package/dist/index.js +605 -6
- package/dist/rules/configContracts.d.ts +6 -7
- package/package.json +1 -1
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI Agent Action Configuration
|
|
3
|
+
*
|
|
4
|
+
* What AIAgentActionPanel / AIAgentConfigureModal write and the Engine's
|
|
5
|
+
* ai_agent case forwards to the Backend (`POST /internal/ai-agent/execute`).
|
|
6
|
+
*
|
|
7
|
+
* The editor also keeps `_dataRefs` (short prompt tokens → step bindings),
|
|
8
|
+
* `_outputSchema`, `_outputSchemaHash` and `_lastPreviewAt` beside these. They
|
|
9
|
+
* are the editor's own (`isEditorPrivateKey`) and are not part of the contract.
|
|
10
|
+
*/
|
|
11
|
+
export type AiAgentReasoningEffort = 'none' | 'minimal' | 'low' | 'medium' | 'high';
|
|
12
|
+
export type AiAgentVerbosity = 'low' | 'medium' | 'high';
|
|
13
|
+
/** Per-step overrides of the saved agent, sent as `body.overrides` as-is. */
|
|
14
|
+
export interface AiAgentOverrides {
|
|
15
|
+
/** Model id; empty means the agent's own. */
|
|
16
|
+
model?: string;
|
|
17
|
+
temperature?: number;
|
|
18
|
+
topP?: number;
|
|
19
|
+
maxTokens?: number;
|
|
20
|
+
reasoningEffort?: AiAgentReasoningEffort;
|
|
21
|
+
verbosity?: AiAgentVerbosity;
|
|
22
|
+
/** Rows per call on the ETL path (integer ≥ 1). */
|
|
23
|
+
batchSize?: number;
|
|
24
|
+
/** Extra instructions; `instructionsMode` says whether they append or replace. */
|
|
25
|
+
instructions?: string;
|
|
26
|
+
instructionsMode?: 'append' | 'replace';
|
|
27
|
+
/** JSON Schema the agent must answer in; the Engine derives one from downstream bindings when absent. */
|
|
28
|
+
expectedSchema?: Record<string, unknown>;
|
|
29
|
+
/** Set by the Engine on the ETL path — the typed prompt with `{{row.<field>}}` refs. */
|
|
30
|
+
userPromptTemplate?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface AiAgentConfigType {
|
|
33
|
+
/** Public id of a saved agent (`agt_…`). */
|
|
34
|
+
agentId: string;
|
|
35
|
+
/**
|
|
36
|
+
* The prompt. May carry short `{{slug.path}}` tokens (bound through the
|
|
37
|
+
* editor's `_dataRefs`) or `{{ods://…}}` refs. When empty, the first
|
|
38
|
+
* upstream output is the input.
|
|
39
|
+
*/
|
|
40
|
+
input?: string;
|
|
41
|
+
overrides?: AiAgentOverrides;
|
|
42
|
+
}
|
|
43
|
+
export declare const AiAgentConfig: {
|
|
44
|
+
defaults: AiAgentConfigType;
|
|
45
|
+
schema: {
|
|
46
|
+
agentId: {
|
|
47
|
+
type: string;
|
|
48
|
+
required: boolean;
|
|
49
|
+
description: string;
|
|
50
|
+
};
|
|
51
|
+
input: {
|
|
52
|
+
type: string;
|
|
53
|
+
required: boolean;
|
|
54
|
+
description: string;
|
|
55
|
+
};
|
|
56
|
+
overrides: {
|
|
57
|
+
type: string;
|
|
58
|
+
required: boolean;
|
|
59
|
+
description: string;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
validate: (config: Partial<AiAgentConfigType>) => {
|
|
63
|
+
valid: boolean;
|
|
64
|
+
errors: string[];
|
|
65
|
+
};
|
|
66
|
+
merge: (userConfig: Partial<AiAgentConfigType>) => AiAgentConfigType;
|
|
67
|
+
getLabel: (config: AiAgentConfigType) => string;
|
|
68
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* IDP Extract Action Configuration
|
|
3
|
+
*
|
|
4
|
+
* What IdpExtractConfigPanel writes and the Engine's idp_extract case reads.
|
|
5
|
+
* The Backend adds `_resolvedLlmConnection` (the connector's credentials) at
|
|
6
|
+
* dispatch; the files come from the upstream step's output, not from config.
|
|
7
|
+
*/
|
|
8
|
+
export type IdpExtractStrategy = 'vision-direct' | 'auto';
|
|
9
|
+
export declare const IDP_EXTRACT_STRATEGIES: readonly IdpExtractStrategy[];
|
|
10
|
+
export interface IdpExtractConfigType {
|
|
11
|
+
/** The AI connector instance whose key and model run the extraction. */
|
|
12
|
+
llmConnectorId: string;
|
|
13
|
+
/** Model id offered by that connector. */
|
|
14
|
+
model: string;
|
|
15
|
+
/** JSON Schema of the fields to extract — as an object or a JSON string. Empty extracts every field. */
|
|
16
|
+
expectedSchema?: Record<string, unknown> | string;
|
|
17
|
+
systemPromptOverride?: string;
|
|
18
|
+
/** `vision-direct` (default) or `auto`. */
|
|
19
|
+
strategy?: IdpExtractStrategy;
|
|
20
|
+
}
|
|
21
|
+
export declare const IdpExtractConfig: {
|
|
22
|
+
defaults: IdpExtractConfigType;
|
|
23
|
+
schema: {
|
|
24
|
+
llmConnectorId: {
|
|
25
|
+
type: string;
|
|
26
|
+
required: boolean;
|
|
27
|
+
description: string;
|
|
28
|
+
};
|
|
29
|
+
model: {
|
|
30
|
+
type: string;
|
|
31
|
+
required: boolean;
|
|
32
|
+
description: string;
|
|
33
|
+
};
|
|
34
|
+
expectedSchema: {
|
|
35
|
+
type: string;
|
|
36
|
+
required: boolean;
|
|
37
|
+
description: string;
|
|
38
|
+
};
|
|
39
|
+
systemPromptOverride: {
|
|
40
|
+
type: string;
|
|
41
|
+
required: boolean;
|
|
42
|
+
};
|
|
43
|
+
strategy: {
|
|
44
|
+
type: string;
|
|
45
|
+
required: boolean;
|
|
46
|
+
options: readonly IdpExtractStrategy[];
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
validate: (config: Partial<IdpExtractConfigType>) => {
|
|
50
|
+
valid: boolean;
|
|
51
|
+
errors: string[];
|
|
52
|
+
};
|
|
53
|
+
merge: (userConfig: Partial<IdpExtractConfigType>) => IdpExtractConfigType;
|
|
54
|
+
getLabel: (config: IdpExtractConfigType) => string;
|
|
55
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Group Configuration
|
|
3
|
+
*
|
|
4
|
+
* A group has no configuration of its own: the editor shows only a Metadata
|
|
5
|
+
* tab (`description` and `disabled` are top-level step fields, not config),
|
|
6
|
+
* and the Engine flattens the group's `branches` before running and executes
|
|
7
|
+
* the group step itself as a no-op. The contract is therefore empty — which
|
|
8
|
+
* is a statement, not an omission: every key under a group's `config` is
|
|
9
|
+
* undeclared.
|
|
10
|
+
*/
|
|
11
|
+
export type GroupConfigType = Record<string, never>;
|
|
12
|
+
export declare const GroupConfig: {
|
|
13
|
+
defaults: GroupConfigType;
|
|
14
|
+
schema: {};
|
|
15
|
+
validate: (_config: Partial<GroupConfigType>) => {
|
|
16
|
+
valid: boolean;
|
|
17
|
+
errors: string[];
|
|
18
|
+
};
|
|
19
|
+
merge: (_userConfig: Partial<GroupConfigType>) => GroupConfigType;
|
|
20
|
+
getLabel: () => string;
|
|
21
|
+
};
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CSV Action Configuration
|
|
3
|
+
*
|
|
4
|
+
* What CsvConfigPanel writes and the Engine's csv_action case reads.
|
|
5
|
+
*/
|
|
6
|
+
import { type FileEditConfigType, type FileFormatOperation } from '../fileEditContract';
|
|
7
|
+
export interface CsvActionConfigType extends FileEditConfigType {
|
|
8
|
+
/** `parse` (default when absent) | `generate` | `edit`. */
|
|
9
|
+
operation: FileFormatOperation;
|
|
10
|
+
/** Legacy alias for `operation` — the Engine reads `operation || mode`. */
|
|
11
|
+
mode?: string;
|
|
12
|
+
/** CSV text, or an FX token from an upstream step. */
|
|
13
|
+
content?: string;
|
|
14
|
+
/** Legacy alias for `content` — the Engine reads `content || inlineContent`. */
|
|
15
|
+
inlineContent?: string;
|
|
16
|
+
delimiter?: ',' | ';' | '\t' | '|';
|
|
17
|
+
/** 1-based row that holds the column headers. */
|
|
18
|
+
headerRow?: number;
|
|
19
|
+
encoding?: string;
|
|
20
|
+
/** `generate`: write the header row (true unless exactly false). */
|
|
21
|
+
includeHeader?: boolean;
|
|
22
|
+
/** `generate`: name of the produced file. */
|
|
23
|
+
fileName?: string;
|
|
24
|
+
}
|
|
25
|
+
export declare const CsvActionConfig: {
|
|
26
|
+
defaults: CsvActionConfigType;
|
|
27
|
+
schema: {
|
|
28
|
+
editOperation: {
|
|
29
|
+
readonly type: "select";
|
|
30
|
+
readonly required: false;
|
|
31
|
+
readonly options: readonly import("../fileEditContract").FileEditOperation[];
|
|
32
|
+
readonly description: "How the file is edited: append rows, update rows by key, upsert, or set fields on matching rows";
|
|
33
|
+
};
|
|
34
|
+
keyField: {
|
|
35
|
+
readonly type: "string";
|
|
36
|
+
readonly required: false;
|
|
37
|
+
readonly description: "Match key column for update / upsert";
|
|
38
|
+
};
|
|
39
|
+
mergeUpdate: {
|
|
40
|
+
readonly type: "boolean";
|
|
41
|
+
readonly required: false;
|
|
42
|
+
readonly description: "false replaces the whole matched row; default merges";
|
|
43
|
+
};
|
|
44
|
+
matchField: {
|
|
45
|
+
readonly type: "string";
|
|
46
|
+
readonly required: false;
|
|
47
|
+
readonly description: "set_fields: column the row filter reads";
|
|
48
|
+
};
|
|
49
|
+
matchOp: {
|
|
50
|
+
readonly type: "select";
|
|
51
|
+
readonly required: false;
|
|
52
|
+
readonly options: readonly import("../fileEditContract").FileEditMatchOp[];
|
|
53
|
+
readonly description: "set_fields: comparison; \"=\" by default";
|
|
54
|
+
};
|
|
55
|
+
matchValue: {
|
|
56
|
+
readonly type: "string";
|
|
57
|
+
readonly required: false;
|
|
58
|
+
readonly description: "set_fields: value compared against";
|
|
59
|
+
};
|
|
60
|
+
setFields: {
|
|
61
|
+
readonly type: "object";
|
|
62
|
+
readonly required: false;
|
|
63
|
+
readonly description: "set_fields: { column: newValue } applied to matching rows";
|
|
64
|
+
};
|
|
65
|
+
destination: {
|
|
66
|
+
readonly type: "select";
|
|
67
|
+
readonly required: false;
|
|
68
|
+
readonly options: readonly import("../fileEditContract").FileEditDestination[];
|
|
69
|
+
readonly description: "\"new\" writes an edited copy (default); \"in_place\" overwrites an S3 source";
|
|
70
|
+
};
|
|
71
|
+
outputFileName: {
|
|
72
|
+
readonly type: "string";
|
|
73
|
+
readonly required: false;
|
|
74
|
+
readonly description: "Name of the edited copy when destination is \"new\"";
|
|
75
|
+
};
|
|
76
|
+
source: {
|
|
77
|
+
readonly type: "select";
|
|
78
|
+
readonly required: false;
|
|
79
|
+
readonly options: readonly import("../fileEditContract").FileEditSource[];
|
|
80
|
+
readonly description: "Where the file to edit comes from; inferred from content when absent";
|
|
81
|
+
};
|
|
82
|
+
s3Key: {
|
|
83
|
+
readonly type: "string";
|
|
84
|
+
readonly required: false;
|
|
85
|
+
readonly description: "source \"s3\": platform-bucket key of the file to edit";
|
|
86
|
+
};
|
|
87
|
+
url: {
|
|
88
|
+
readonly type: "url";
|
|
89
|
+
readonly required: false;
|
|
90
|
+
readonly description: "source \"url\": the file to edit is fetched from here";
|
|
91
|
+
};
|
|
92
|
+
operation: {
|
|
93
|
+
type: string;
|
|
94
|
+
required: boolean;
|
|
95
|
+
options: readonly FileFormatOperation[];
|
|
96
|
+
description: string;
|
|
97
|
+
};
|
|
98
|
+
content: {
|
|
99
|
+
type: string;
|
|
100
|
+
required: boolean;
|
|
101
|
+
description: string;
|
|
102
|
+
};
|
|
103
|
+
delimiter: {
|
|
104
|
+
type: string;
|
|
105
|
+
required: boolean;
|
|
106
|
+
options: string[];
|
|
107
|
+
};
|
|
108
|
+
headerRow: {
|
|
109
|
+
type: string;
|
|
110
|
+
required: boolean;
|
|
111
|
+
min: number;
|
|
112
|
+
description: string;
|
|
113
|
+
};
|
|
114
|
+
encoding: {
|
|
115
|
+
type: string;
|
|
116
|
+
required: boolean;
|
|
117
|
+
description: string;
|
|
118
|
+
};
|
|
119
|
+
includeHeader: {
|
|
120
|
+
type: string;
|
|
121
|
+
required: boolean;
|
|
122
|
+
description: string;
|
|
123
|
+
};
|
|
124
|
+
fileName: {
|
|
125
|
+
type: string;
|
|
126
|
+
required: boolean;
|
|
127
|
+
description: string;
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
validate: (config: Partial<CsvActionConfigType>) => {
|
|
131
|
+
valid: boolean;
|
|
132
|
+
errors: string[];
|
|
133
|
+
};
|
|
134
|
+
merge: (userConfig: Partial<CsvActionConfigType>) => CsvActionConfigType;
|
|
135
|
+
getLabel: (config: CsvActionConfigType) => string;
|
|
136
|
+
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dropbox Action Configuration (deprecated — `storage_action` replaces it)
|
|
3
|
+
*
|
|
4
|
+
* What DropboxConfigPanel writes and the Engine's `runDropbox` reads. The
|
|
5
|
+
* Backend adds `_resolvedStorageCredentials` from `connector` at dispatch.
|
|
6
|
+
*/
|
|
7
|
+
export type DropboxOperation = 'list' | 'download' | 'upload' | 'delete' | 'move' | 'copy';
|
|
8
|
+
export declare const DROPBOX_OPERATIONS: readonly DropboxOperation[];
|
|
9
|
+
export interface DropboxActionConfigType {
|
|
10
|
+
/** The Dropbox connector instance (a connection id). */
|
|
11
|
+
connector: string;
|
|
12
|
+
/** `download` when absent. */
|
|
13
|
+
operation?: DropboxOperation;
|
|
14
|
+
/** File path, or the folder to list (root when empty). */
|
|
15
|
+
path?: string;
|
|
16
|
+
/** upload: the body. */
|
|
17
|
+
content?: string;
|
|
18
|
+
/** upload: name when `path` is a folder. */
|
|
19
|
+
fileName?: string;
|
|
20
|
+
/** move / copy: the destination path. */
|
|
21
|
+
destPath?: string;
|
|
22
|
+
/** upload: Dropbox write mode — `overwrite` (default) or `add` (keep both). */
|
|
23
|
+
mode?: 'overwrite' | 'add';
|
|
24
|
+
/** list: keep only these extensions. */
|
|
25
|
+
fileTypes?: string[];
|
|
26
|
+
/** list: keep only names matching this glob. */
|
|
27
|
+
filePattern?: string;
|
|
28
|
+
}
|
|
29
|
+
export declare const DropboxActionConfig: {
|
|
30
|
+
defaults: DropboxActionConfigType;
|
|
31
|
+
schema: {
|
|
32
|
+
connector: {
|
|
33
|
+
type: string;
|
|
34
|
+
required: boolean;
|
|
35
|
+
description: string;
|
|
36
|
+
};
|
|
37
|
+
operation: {
|
|
38
|
+
type: string;
|
|
39
|
+
required: boolean;
|
|
40
|
+
options: readonly DropboxOperation[];
|
|
41
|
+
};
|
|
42
|
+
path: {
|
|
43
|
+
type: string;
|
|
44
|
+
required: boolean;
|
|
45
|
+
description: string;
|
|
46
|
+
};
|
|
47
|
+
content: {
|
|
48
|
+
type: string;
|
|
49
|
+
required: boolean;
|
|
50
|
+
description: string;
|
|
51
|
+
};
|
|
52
|
+
fileName: {
|
|
53
|
+
type: string;
|
|
54
|
+
required: boolean;
|
|
55
|
+
description: string;
|
|
56
|
+
};
|
|
57
|
+
destPath: {
|
|
58
|
+
type: string;
|
|
59
|
+
required: boolean;
|
|
60
|
+
description: string;
|
|
61
|
+
};
|
|
62
|
+
mode: {
|
|
63
|
+
type: string;
|
|
64
|
+
required: boolean;
|
|
65
|
+
options: string[];
|
|
66
|
+
description: string;
|
|
67
|
+
};
|
|
68
|
+
fileTypes: {
|
|
69
|
+
type: string;
|
|
70
|
+
required: boolean;
|
|
71
|
+
description: string;
|
|
72
|
+
};
|
|
73
|
+
filePattern: {
|
|
74
|
+
type: string;
|
|
75
|
+
required: boolean;
|
|
76
|
+
description: string;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
validate: (config: Partial<DropboxActionConfigType>) => {
|
|
80
|
+
valid: boolean;
|
|
81
|
+
errors: string[];
|
|
82
|
+
};
|
|
83
|
+
merge: (userConfig: Partial<DropboxActionConfigType>) => DropboxActionConfigType;
|
|
84
|
+
getLabel: (config: DropboxActionConfigType) => string;
|
|
85
|
+
};
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Excel Action Configuration
|
|
3
|
+
*
|
|
4
|
+
* What ExcelConfigPanel writes and the Engine's excel_action case reads.
|
|
5
|
+
*/
|
|
6
|
+
import { type FileEditConfigType, type FileFormatOperation } from '../fileEditContract';
|
|
7
|
+
export interface ExcelActionConfigType extends FileEditConfigType {
|
|
8
|
+
/** `parse` (default when absent) | `generate` | `edit`. */
|
|
9
|
+
operation: FileFormatOperation;
|
|
10
|
+
/** Legacy alias for `operation`. */
|
|
11
|
+
mode?: string;
|
|
12
|
+
/**
|
|
13
|
+
* The workbook: a platform-bucket key (contains `/` or ends .xlsx/.xls),
|
|
14
|
+
* base64 bytes, or an FX token from an upstream step.
|
|
15
|
+
*/
|
|
16
|
+
content?: string;
|
|
17
|
+
/** Legacy alias for `content`. */
|
|
18
|
+
inlineContent?: string;
|
|
19
|
+
/** Sheet to read; the first sheet when absent. */
|
|
20
|
+
sheetName?: string;
|
|
21
|
+
/** 1-based row that holds the column headers. */
|
|
22
|
+
headerRow?: number;
|
|
23
|
+
/** `generate`: name of the produced file. */
|
|
24
|
+
fileName?: string;
|
|
25
|
+
}
|
|
26
|
+
export declare const ExcelActionConfig: {
|
|
27
|
+
defaults: ExcelActionConfigType;
|
|
28
|
+
schema: {
|
|
29
|
+
editOperation: {
|
|
30
|
+
readonly type: "select";
|
|
31
|
+
readonly required: false;
|
|
32
|
+
readonly options: readonly import("../fileEditContract").FileEditOperation[];
|
|
33
|
+
readonly description: "How the file is edited: append rows, update rows by key, upsert, or set fields on matching rows";
|
|
34
|
+
};
|
|
35
|
+
keyField: {
|
|
36
|
+
readonly type: "string";
|
|
37
|
+
readonly required: false;
|
|
38
|
+
readonly description: "Match key column for update / upsert";
|
|
39
|
+
};
|
|
40
|
+
mergeUpdate: {
|
|
41
|
+
readonly type: "boolean";
|
|
42
|
+
readonly required: false;
|
|
43
|
+
readonly description: "false replaces the whole matched row; default merges";
|
|
44
|
+
};
|
|
45
|
+
matchField: {
|
|
46
|
+
readonly type: "string";
|
|
47
|
+
readonly required: false;
|
|
48
|
+
readonly description: "set_fields: column the row filter reads";
|
|
49
|
+
};
|
|
50
|
+
matchOp: {
|
|
51
|
+
readonly type: "select";
|
|
52
|
+
readonly required: false;
|
|
53
|
+
readonly options: readonly import("../fileEditContract").FileEditMatchOp[];
|
|
54
|
+
readonly description: "set_fields: comparison; \"=\" by default";
|
|
55
|
+
};
|
|
56
|
+
matchValue: {
|
|
57
|
+
readonly type: "string";
|
|
58
|
+
readonly required: false;
|
|
59
|
+
readonly description: "set_fields: value compared against";
|
|
60
|
+
};
|
|
61
|
+
setFields: {
|
|
62
|
+
readonly type: "object";
|
|
63
|
+
readonly required: false;
|
|
64
|
+
readonly description: "set_fields: { column: newValue } applied to matching rows";
|
|
65
|
+
};
|
|
66
|
+
destination: {
|
|
67
|
+
readonly type: "select";
|
|
68
|
+
readonly required: false;
|
|
69
|
+
readonly options: readonly import("../fileEditContract").FileEditDestination[];
|
|
70
|
+
readonly description: "\"new\" writes an edited copy (default); \"in_place\" overwrites an S3 source";
|
|
71
|
+
};
|
|
72
|
+
outputFileName: {
|
|
73
|
+
readonly type: "string";
|
|
74
|
+
readonly required: false;
|
|
75
|
+
readonly description: "Name of the edited copy when destination is \"new\"";
|
|
76
|
+
};
|
|
77
|
+
source: {
|
|
78
|
+
readonly type: "select";
|
|
79
|
+
readonly required: false;
|
|
80
|
+
readonly options: readonly import("../fileEditContract").FileEditSource[];
|
|
81
|
+
readonly description: "Where the file to edit comes from; inferred from content when absent";
|
|
82
|
+
};
|
|
83
|
+
s3Key: {
|
|
84
|
+
readonly type: "string";
|
|
85
|
+
readonly required: false;
|
|
86
|
+
readonly description: "source \"s3\": platform-bucket key of the file to edit";
|
|
87
|
+
};
|
|
88
|
+
url: {
|
|
89
|
+
readonly type: "url";
|
|
90
|
+
readonly required: false;
|
|
91
|
+
readonly description: "source \"url\": the file to edit is fetched from here";
|
|
92
|
+
};
|
|
93
|
+
operation: {
|
|
94
|
+
type: string;
|
|
95
|
+
required: boolean;
|
|
96
|
+
options: readonly FileFormatOperation[];
|
|
97
|
+
description: string;
|
|
98
|
+
};
|
|
99
|
+
content: {
|
|
100
|
+
type: string;
|
|
101
|
+
required: boolean;
|
|
102
|
+
description: string;
|
|
103
|
+
};
|
|
104
|
+
sheetName: {
|
|
105
|
+
type: string;
|
|
106
|
+
required: boolean;
|
|
107
|
+
description: string;
|
|
108
|
+
};
|
|
109
|
+
headerRow: {
|
|
110
|
+
type: string;
|
|
111
|
+
required: boolean;
|
|
112
|
+
min: number;
|
|
113
|
+
description: string;
|
|
114
|
+
};
|
|
115
|
+
fileName: {
|
|
116
|
+
type: string;
|
|
117
|
+
required: boolean;
|
|
118
|
+
description: string;
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
validate: (config: Partial<ExcelActionConfigType>) => {
|
|
122
|
+
valid: boolean;
|
|
123
|
+
errors: string[];
|
|
124
|
+
};
|
|
125
|
+
merge: (userConfig: Partial<ExcelActionConfigType>) => ExcelActionConfigType;
|
|
126
|
+
getLabel: (config: ExcelActionConfigType) => string;
|
|
127
|
+
};
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* File Action Configuration (generic parse / generate / edit)
|
|
3
|
+
*
|
|
4
|
+
* `file_action` has no editor panel and is not in the add palette; the Engine
|
|
5
|
+
* still executes it (`executeFileAction`). This is what that executor reads.
|
|
6
|
+
* Where the same key is shared with the format-specific actions it is the
|
|
7
|
+
* shared entry from `fileEditContract`; `source` and `outputFileName` are
|
|
8
|
+
* redeclared because this action accepts more sources.
|
|
9
|
+
*/
|
|
10
|
+
import { type FileEditConfigType } from '../fileEditContract';
|
|
11
|
+
export type FileActionMode = 'parse' | 'generate' | 'convert' | 'edit';
|
|
12
|
+
export type FileActionSource = 'inline' | 's3' | 'url' | 'previous_step' | 'upload';
|
|
13
|
+
export type FileActionFormat = 'auto' | 'csv' | 'tsv' | 'json' | 'jsonl' | 'xml' | 'excel';
|
|
14
|
+
export type FileActionOutputFormat = 'csv' | 'json' | 'excel' | 'xml' | 'tsv';
|
|
15
|
+
export declare const FILE_ACTION_MODES: readonly FileActionMode[];
|
|
16
|
+
export declare const FILE_ACTION_SOURCES: readonly FileActionSource[];
|
|
17
|
+
export declare const FILE_ACTION_FORMATS: readonly FileActionFormat[];
|
|
18
|
+
export declare const FILE_ACTION_OUTPUT_FORMATS: readonly FileActionOutputFormat[];
|
|
19
|
+
export interface FileActionConfigType extends Omit<FileEditConfigType, 'source'> {
|
|
20
|
+
/** `parse` (default) | `generate` | `convert` | `edit`. */
|
|
21
|
+
mode?: FileActionMode;
|
|
22
|
+
/** Alias the Engine reads first: `operation || mode`. */
|
|
23
|
+
operation?: FileActionMode;
|
|
24
|
+
/** Where the file comes from; `inline` by default. `upload` is not supported at run time. */
|
|
25
|
+
source?: FileActionSource;
|
|
26
|
+
/** Format of the file; detected from the name, then the content, when `auto` or absent. */
|
|
27
|
+
format?: FileActionFormat;
|
|
28
|
+
/** `source: 'inline'` — the text (base64 for Excel). */
|
|
29
|
+
inlineContent?: string;
|
|
30
|
+
/** Alias for `inlineContent`. */
|
|
31
|
+
content?: string;
|
|
32
|
+
/** `source: 's3'` — platform-bucket key. */
|
|
33
|
+
s3Key?: string;
|
|
34
|
+
/** `source: 'url'` — fetched with a 60 s timeout. */
|
|
35
|
+
url?: string;
|
|
36
|
+
/** `generate` / `convert`: format to write. */
|
|
37
|
+
outputFormat?: FileActionOutputFormat;
|
|
38
|
+
/** `generate` / `convert`: name of the produced file. */
|
|
39
|
+
outputFileName?: string;
|
|
40
|
+
/** Name used to detect the format when `format` is `auto`. */
|
|
41
|
+
fileName?: string;
|
|
42
|
+
encoding?: string;
|
|
43
|
+
delimiter?: string;
|
|
44
|
+
headerRow?: number;
|
|
45
|
+
rowElement?: string;
|
|
46
|
+
sheetName?: string;
|
|
47
|
+
includeHeader?: boolean;
|
|
48
|
+
/** Parser options (`delimiter`, `headerRow`, …) read ahead of the top-level keys. */
|
|
49
|
+
options?: Record<string, unknown>;
|
|
50
|
+
}
|
|
51
|
+
export declare const FileActionConfig: {
|
|
52
|
+
defaults: FileActionConfigType;
|
|
53
|
+
schema: {
|
|
54
|
+
mode: {
|
|
55
|
+
type: string;
|
|
56
|
+
required: boolean;
|
|
57
|
+
options: readonly FileActionMode[];
|
|
58
|
+
description: string;
|
|
59
|
+
};
|
|
60
|
+
operation: {
|
|
61
|
+
type: string;
|
|
62
|
+
required: boolean;
|
|
63
|
+
options: readonly FileActionMode[];
|
|
64
|
+
description: string;
|
|
65
|
+
};
|
|
66
|
+
source: {
|
|
67
|
+
type: string;
|
|
68
|
+
required: boolean;
|
|
69
|
+
options: readonly FileActionSource[];
|
|
70
|
+
description: string;
|
|
71
|
+
};
|
|
72
|
+
format: {
|
|
73
|
+
type: string;
|
|
74
|
+
required: boolean;
|
|
75
|
+
options: readonly FileActionFormat[];
|
|
76
|
+
description: string;
|
|
77
|
+
};
|
|
78
|
+
inlineContent: {
|
|
79
|
+
type: string;
|
|
80
|
+
required: boolean;
|
|
81
|
+
description: string;
|
|
82
|
+
};
|
|
83
|
+
content: {
|
|
84
|
+
type: string;
|
|
85
|
+
required: boolean;
|
|
86
|
+
description: string;
|
|
87
|
+
};
|
|
88
|
+
outputFormat: {
|
|
89
|
+
type: string;
|
|
90
|
+
required: boolean;
|
|
91
|
+
options: readonly FileActionOutputFormat[];
|
|
92
|
+
description: string;
|
|
93
|
+
};
|
|
94
|
+
outputFileName: {
|
|
95
|
+
type: string;
|
|
96
|
+
required: boolean;
|
|
97
|
+
description: string;
|
|
98
|
+
};
|
|
99
|
+
fileName: {
|
|
100
|
+
type: string;
|
|
101
|
+
required: boolean;
|
|
102
|
+
description: string;
|
|
103
|
+
};
|
|
104
|
+
encoding: {
|
|
105
|
+
type: string;
|
|
106
|
+
required: boolean;
|
|
107
|
+
};
|
|
108
|
+
delimiter: {
|
|
109
|
+
type: string;
|
|
110
|
+
required: boolean;
|
|
111
|
+
description: string;
|
|
112
|
+
};
|
|
113
|
+
headerRow: {
|
|
114
|
+
type: string;
|
|
115
|
+
required: boolean;
|
|
116
|
+
min: number;
|
|
117
|
+
};
|
|
118
|
+
rowElement: {
|
|
119
|
+
type: string;
|
|
120
|
+
required: boolean;
|
|
121
|
+
description: string;
|
|
122
|
+
};
|
|
123
|
+
sheetName: {
|
|
124
|
+
type: string;
|
|
125
|
+
required: boolean;
|
|
126
|
+
description: string;
|
|
127
|
+
};
|
|
128
|
+
includeHeader: {
|
|
129
|
+
type: string;
|
|
130
|
+
required: boolean;
|
|
131
|
+
};
|
|
132
|
+
options: {
|
|
133
|
+
type: string;
|
|
134
|
+
required: boolean;
|
|
135
|
+
description: string;
|
|
136
|
+
};
|
|
137
|
+
editOperation: {
|
|
138
|
+
readonly type: "select";
|
|
139
|
+
readonly required: false;
|
|
140
|
+
readonly options: readonly import("../fileEditContract").FileEditOperation[];
|
|
141
|
+
readonly description: "How the file is edited: append rows, update rows by key, upsert, or set fields on matching rows";
|
|
142
|
+
};
|
|
143
|
+
keyField: {
|
|
144
|
+
readonly type: "string";
|
|
145
|
+
readonly required: false;
|
|
146
|
+
readonly description: "Match key column for update / upsert";
|
|
147
|
+
};
|
|
148
|
+
mergeUpdate: {
|
|
149
|
+
readonly type: "boolean";
|
|
150
|
+
readonly required: false;
|
|
151
|
+
readonly description: "false replaces the whole matched row; default merges";
|
|
152
|
+
};
|
|
153
|
+
matchField: {
|
|
154
|
+
readonly type: "string";
|
|
155
|
+
readonly required: false;
|
|
156
|
+
readonly description: "set_fields: column the row filter reads";
|
|
157
|
+
};
|
|
158
|
+
matchOp: {
|
|
159
|
+
readonly type: "select";
|
|
160
|
+
readonly required: false;
|
|
161
|
+
readonly options: readonly import("../fileEditContract").FileEditMatchOp[];
|
|
162
|
+
readonly description: "set_fields: comparison; \"=\" by default";
|
|
163
|
+
};
|
|
164
|
+
matchValue: {
|
|
165
|
+
readonly type: "string";
|
|
166
|
+
readonly required: false;
|
|
167
|
+
readonly description: "set_fields: value compared against";
|
|
168
|
+
};
|
|
169
|
+
setFields: {
|
|
170
|
+
readonly type: "object";
|
|
171
|
+
readonly required: false;
|
|
172
|
+
readonly description: "set_fields: { column: newValue } applied to matching rows";
|
|
173
|
+
};
|
|
174
|
+
destination: {
|
|
175
|
+
readonly type: "select";
|
|
176
|
+
readonly required: false;
|
|
177
|
+
readonly options: readonly import("../fileEditContract").FileEditDestination[];
|
|
178
|
+
readonly description: "\"new\" writes an edited copy (default); \"in_place\" overwrites an S3 source";
|
|
179
|
+
};
|
|
180
|
+
s3Key: {
|
|
181
|
+
readonly type: "string";
|
|
182
|
+
readonly required: false;
|
|
183
|
+
readonly description: "source \"s3\": platform-bucket key of the file to edit";
|
|
184
|
+
};
|
|
185
|
+
url: {
|
|
186
|
+
readonly type: "url";
|
|
187
|
+
readonly required: false;
|
|
188
|
+
readonly description: "source \"url\": the file to edit is fetched from here";
|
|
189
|
+
};
|
|
190
|
+
};
|
|
191
|
+
validate: (config: Partial<FileActionConfigType>) => {
|
|
192
|
+
valid: boolean;
|
|
193
|
+
errors: string[];
|
|
194
|
+
};
|
|
195
|
+
merge: (userConfig: Partial<FileActionConfigType>) => FileActionConfigType;
|
|
196
|
+
getLabel: (config: FileActionConfigType) => string;
|
|
197
|
+
};
|