@allma/core-types 1.6.0 → 1.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.
- package/dist/flow/core.d.ts +52 -0
- package/dist/flow/core.d.ts.map +1 -1
- package/dist/flow/core.js +70 -26
- package/dist/flow/core.js.map +1 -1
- package/dist/steps/system/data-transformers.d.ts +222 -0
- package/dist/steps/system/data-transformers.d.ts.map +1 -0
- package/dist/steps/system/data-transformers.js +92 -0
- package/dist/steps/system/data-transformers.js.map +1 -0
- package/dist/steps/system/ddb-query-to-s3-manifest.d.ts +78 -0
- package/dist/steps/system/ddb-query-to-s3-manifest.d.ts.map +1 -0
- package/dist/steps/system/ddb-query-to-s3-manifest.js +25 -0
- package/dist/steps/system/ddb-query-to-s3-manifest.js.map +1 -0
- package/dist/steps/system/dynamodb-savers.d.ts +118 -0
- package/dist/steps/system/dynamodb-savers.d.ts.map +1 -0
- package/dist/steps/system/dynamodb-savers.js +40 -0
- package/dist/steps/system/dynamodb-savers.js.map +1 -0
- package/dist/steps/system/index.d.ts +6 -0
- package/dist/steps/system/index.d.ts.map +1 -1
- package/dist/steps/system/index.js +6 -0
- package/dist/steps/system/index.js.map +1 -1
- package/dist/steps/system/module-config-registry.d.ts +586 -0
- package/dist/steps/system/module-config-registry.d.ts.map +1 -0
- package/dist/steps/system/module-config-registry.js +113 -0
- package/dist/steps/system/module-config-registry.js.map +1 -0
- package/dist/steps/system/s3-list-files.d.ts +21 -0
- package/dist/steps/system/s3-list-files.d.ts.map +1 -0
- package/dist/steps/system/s3-list-files.js +12 -0
- package/dist/steps/system/s3-list-files.js.map +1 -0
- package/dist/steps/system/sqs-modules.d.ts +46 -0
- package/dist/steps/system/sqs-modules.d.ts.map +1 -0
- package/dist/steps/system/sqs-modules.js +50 -0
- package/dist/steps/system/sqs-modules.js.map +1 -0
- package/dist/steps/system-module-identifiers.d.ts +6 -0
- package/dist/steps/system-module-identifiers.d.ts.map +1 -1
- package/package.json +4 -1
package/dist/flow/core.d.ts
CHANGED
|
@@ -58,15 +58,67 @@ export type FlowDefinition = {
|
|
|
58
58
|
defaultErrorHandler?: StepErrorHandler;
|
|
59
59
|
} | null;
|
|
60
60
|
onCompletionActions?: OnCompletionAction[];
|
|
61
|
+
/**
|
|
62
|
+
* Which authoring surface owns this flow. `'code'` flows are managed by the
|
|
63
|
+
* `@allma/flow-builder` toolchain and the Visual Editor opens them read-only;
|
|
64
|
+
* `'visual'` (the default for existing flows) are editor-owned. See RFC §6.
|
|
65
|
+
*/
|
|
66
|
+
authoringSource?: 'code' | 'visual';
|
|
61
67
|
createdAt: string;
|
|
62
68
|
updatedAt: string;
|
|
63
69
|
publishedAt?: string | null;
|
|
64
70
|
[key: string]: any;
|
|
65
71
|
};
|
|
72
|
+
/**
|
|
73
|
+
* The author-facing shape of a flow: a {@link FlowDefinition} without the
|
|
74
|
+
* server-owned bookkeeping fields (`createdAt`/`updatedAt`/`publishedAt`/
|
|
75
|
+
* `isPublished`). `version` is retained because the importer needs it as the
|
|
76
|
+
* target version slot. This is what a code-authored or hand-written flow emits;
|
|
77
|
+
* the importer stamps the server-owned fields at import time. It is hand-written
|
|
78
|
+
* for the same TS7056 reason as {@link FlowDefinition}.
|
|
79
|
+
*/
|
|
80
|
+
export type FlowAuthoringFormat = {
|
|
81
|
+
id: string;
|
|
82
|
+
version: number;
|
|
83
|
+
steps: Record<string, StepInstance>;
|
|
84
|
+
startStepInstanceId: string;
|
|
85
|
+
enableExecutionLogs?: boolean;
|
|
86
|
+
description?: string | null;
|
|
87
|
+
flowVariables?: Record<string, any>;
|
|
88
|
+
defaultStepConfig?: {
|
|
89
|
+
defaultInferenceParameters?: LlmParameters;
|
|
90
|
+
defaultCustomConfig?: Record<string, any>;
|
|
91
|
+
defaultErrorHandler?: StepErrorHandler;
|
|
92
|
+
} | null;
|
|
93
|
+
onCompletionActions?: OnCompletionAction[];
|
|
94
|
+
/** See {@link FlowDefinition.authoringSource}. The builder stamps `'code'`. */
|
|
95
|
+
authoringSource?: 'code' | 'visual';
|
|
96
|
+
[key: string]: any;
|
|
97
|
+
};
|
|
66
98
|
/**
|
|
67
99
|
* Defines an immutable version of an Allma flow.
|
|
68
100
|
* It is cast to `z.ZodType<FlowDefinition>` to use the explicit type and
|
|
69
101
|
* prevent TypeScript's inference chain from exceeding serialization limits.
|
|
70
102
|
*/
|
|
71
103
|
export declare const FlowDefinitionSchema: z.ZodType<FlowDefinition>;
|
|
104
|
+
/**
|
|
105
|
+
* The authoring schema: {@link FlowDefinitionSchema} without the server-owned
|
|
106
|
+
* fields (`createdAt`/`updatedAt`/`publishedAt`/`isPublished`), with `version`
|
|
107
|
+
* defaulting to `1`. Hand-authored and code-generated flows are validated
|
|
108
|
+
* against this; the importer stamps the omitted server-owned fields. Inherits
|
|
109
|
+
* the same cross-reference and JSONPath validation as the full schema.
|
|
110
|
+
*/
|
|
111
|
+
export declare const FlowAuthoringSchema: z.ZodType<FlowAuthoringFormat>;
|
|
112
|
+
/**
|
|
113
|
+
* Fills in the server-owned bookkeeping fields that an authoring-format flow
|
|
114
|
+
* omits (`createdAt`/`updatedAt`) and defaults `version` to `1`, so a flow
|
|
115
|
+
* authored without those fields validates and imports cleanly. Existing values
|
|
116
|
+
* are always preserved, so a full {@link FlowDefinition} passes through
|
|
117
|
+
* unchanged — keeping import fully backward compatible. Mirrors the way the
|
|
118
|
+
* importer strips/stamps `createdAt`/`updatedAt` for connections and agents.
|
|
119
|
+
*
|
|
120
|
+
* @param flow The raw, unparsed flow object (authoring or full format).
|
|
121
|
+
* @param nowIso The ISO-8601 timestamp to stamp when a field is missing.
|
|
122
|
+
*/
|
|
123
|
+
export declare function applyFlowImportDefaults(flow: Record<string, unknown>, nowIso: string): Record<string, unknown>;
|
|
72
124
|
//# sourceMappingURL=core.d.ts.map
|
package/dist/flow/core.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../src/flow/core.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,EAI+E,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;AAE1I;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,EAIgF,CAAC,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAE/I;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,MAAM,EAAE,MAAM,GACb,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAOzB"}
|
package/dist/flow/core.js
CHANGED
|
@@ -32,33 +32,11 @@ const checkJsonPath = (path, value, ctx) => {
|
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
34
|
/**
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
35
|
+
* CROSS-FIELD validation shared by {@link FlowDefinitionSchema} and
|
|
36
|
+
* {@link FlowAuthoringSchema}: the per-step structure is already validated by
|
|
37
|
+
* the object schema, so this only checks references and JSONPath well-formedness.
|
|
38
38
|
*/
|
|
39
|
-
|
|
40
|
-
id: z.string().min(1, "Flow definition ID is required."),
|
|
41
|
-
version: z.number().int().positive({ message: "Version must be a positive integer." }),
|
|
42
|
-
isPublished: z.boolean().default(false),
|
|
43
|
-
steps: z.record(z.string().min(1), StepInstanceSchema),
|
|
44
|
-
startStepInstanceId: z.string().min(1, "Start step instance ID is required."),
|
|
45
|
-
enableExecutionLogs: z.boolean().optional().default(false),
|
|
46
|
-
description: z.string().optional().nullable(),
|
|
47
|
-
flowVariables: z.record(z.any()).optional().default({}),
|
|
48
|
-
defaultStepConfig: z.object({
|
|
49
|
-
defaultInferenceParameters: LlmParametersSchema.optional(),
|
|
50
|
-
defaultCustomConfig: z.record(z.any()).optional(),
|
|
51
|
-
defaultErrorHandler: StepErrorHandlerSchema.optional(),
|
|
52
|
-
}).optional().nullable(),
|
|
53
|
-
onCompletionActions: z.array(OnCompletionActionSchema).optional(),
|
|
54
|
-
createdAt: z.string().datetime(),
|
|
55
|
-
updatedAt: z.string().datetime(),
|
|
56
|
-
publishedAt: z.string().datetime().nullable().optional(),
|
|
57
|
-
})
|
|
58
|
-
.passthrough()
|
|
59
|
-
.superRefine((data, ctx) => {
|
|
60
|
-
// This refinement block is only responsible for CROSS-FIELD validation,
|
|
61
|
-
// as the structure of each step is already validated by the main schema.
|
|
39
|
+
const validateFlowCrossReferences = (data, ctx) => {
|
|
62
40
|
if (data.startStepInstanceId && !data.steps[data.startStepInstanceId]) {
|
|
63
41
|
ctx.addIssue({ code: z.ZodIssueCode.custom, message: `startStepInstanceId '${data.startStepInstanceId}' does not exist in the steps map.`, path: ["startStepInstanceId"] });
|
|
64
42
|
}
|
|
@@ -105,5 +83,71 @@ export const FlowDefinitionSchema = z.object({
|
|
|
105
83
|
if (action.actionType === 'SNS_SEND' && action.messageAttributesTemplate)
|
|
106
84
|
Object.entries(action.messageAttributesTemplate).forEach(([k, v]) => checkJsonPath(['onCompletionActions', index, 'messageAttributesTemplate', k], v, ctx));
|
|
107
85
|
});
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* The object shape shared by the full-definition and authoring schemas. Kept
|
|
89
|
+
* private (and un-exported) so its heavy inferred type is never serialized into
|
|
90
|
+
* a `.d.ts`; the public schemas below are cast to their hand-written types.
|
|
91
|
+
*/
|
|
92
|
+
const FlowDefinitionObjectSchema = z.object({
|
|
93
|
+
id: z.string().min(1, "Flow definition ID is required."),
|
|
94
|
+
version: z.number().int().positive({ message: "Version must be a positive integer." }),
|
|
95
|
+
isPublished: z.boolean().default(false),
|
|
96
|
+
steps: z.record(z.string().min(1), StepInstanceSchema),
|
|
97
|
+
startStepInstanceId: z.string().min(1, "Start step instance ID is required."),
|
|
98
|
+
enableExecutionLogs: z.boolean().optional().default(false),
|
|
99
|
+
description: z.string().optional().nullable(),
|
|
100
|
+
flowVariables: z.record(z.any()).optional().default({}),
|
|
101
|
+
defaultStepConfig: z.object({
|
|
102
|
+
defaultInferenceParameters: LlmParametersSchema.optional(),
|
|
103
|
+
defaultCustomConfig: z.record(z.any()).optional(),
|
|
104
|
+
defaultErrorHandler: StepErrorHandlerSchema.optional(),
|
|
105
|
+
}).optional().nullable(),
|
|
106
|
+
onCompletionActions: z.array(OnCompletionActionSchema).optional(),
|
|
107
|
+
authoringSource: z.enum(['code', 'visual']).optional().default('visual'),
|
|
108
|
+
createdAt: z.string().datetime(),
|
|
109
|
+
updatedAt: z.string().datetime(),
|
|
110
|
+
publishedAt: z.string().datetime().nullable().optional(),
|
|
108
111
|
});
|
|
112
|
+
/**
|
|
113
|
+
* Defines an immutable version of an Allma flow.
|
|
114
|
+
* It is cast to `z.ZodType<FlowDefinition>` to use the explicit type and
|
|
115
|
+
* prevent TypeScript's inference chain from exceeding serialization limits.
|
|
116
|
+
*/
|
|
117
|
+
export const FlowDefinitionSchema = FlowDefinitionObjectSchema
|
|
118
|
+
.passthrough()
|
|
119
|
+
// The runtime shape matches `FlowCrossReferenceTarget`; cast through `unknown`
|
|
120
|
+
// to share the refinement without forcing TS to serialize the inferred type.
|
|
121
|
+
.superRefine((data, ctx) => validateFlowCrossReferences(data, ctx));
|
|
122
|
+
/**
|
|
123
|
+
* The authoring schema: {@link FlowDefinitionSchema} without the server-owned
|
|
124
|
+
* fields (`createdAt`/`updatedAt`/`publishedAt`/`isPublished`), with `version`
|
|
125
|
+
* defaulting to `1`. Hand-authored and code-generated flows are validated
|
|
126
|
+
* against this; the importer stamps the omitted server-owned fields. Inherits
|
|
127
|
+
* the same cross-reference and JSONPath validation as the full schema.
|
|
128
|
+
*/
|
|
129
|
+
export const FlowAuthoringSchema = FlowDefinitionObjectSchema
|
|
130
|
+
.omit({ createdAt: true, updatedAt: true, publishedAt: true, isPublished: true })
|
|
131
|
+
.extend({ version: z.number().int().positive({ message: "Version must be a positive integer." }).default(1) })
|
|
132
|
+
.passthrough()
|
|
133
|
+
.superRefine((data, ctx) => validateFlowCrossReferences(data, ctx));
|
|
134
|
+
/**
|
|
135
|
+
* Fills in the server-owned bookkeeping fields that an authoring-format flow
|
|
136
|
+
* omits (`createdAt`/`updatedAt`) and defaults `version` to `1`, so a flow
|
|
137
|
+
* authored without those fields validates and imports cleanly. Existing values
|
|
138
|
+
* are always preserved, so a full {@link FlowDefinition} passes through
|
|
139
|
+
* unchanged — keeping import fully backward compatible. Mirrors the way the
|
|
140
|
+
* importer strips/stamps `createdAt`/`updatedAt` for connections and agents.
|
|
141
|
+
*
|
|
142
|
+
* @param flow The raw, unparsed flow object (authoring or full format).
|
|
143
|
+
* @param nowIso The ISO-8601 timestamp to stamp when a field is missing.
|
|
144
|
+
*/
|
|
145
|
+
export function applyFlowImportDefaults(flow, nowIso) {
|
|
146
|
+
return {
|
|
147
|
+
...flow,
|
|
148
|
+
version: typeof flow.version === 'number' ? flow.version : 1,
|
|
149
|
+
createdAt: typeof flow.createdAt === 'string' ? flow.createdAt : nowIso,
|
|
150
|
+
updatedAt: typeof flow.updatedAt === 'string' ? flow.updatedAt : nowIso,
|
|
151
|
+
};
|
|
152
|
+
}
|
|
109
153
|
//# sourceMappingURL=core.js.map
|
package/dist/flow/core.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.js","sourceRoot":"","sources":["../../src/flow/core.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAiB,MAAM,iBAAiB,CAAC;AACrE,OAAO,EAAE,wBAAwB,EAAsB,MAAM,cAAc,CAAC;AAC5E,OAAO,EAAE,sBAAsB,EAAoB,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAAE,kBAAkB,EAAgB,MAAM,yBAAyB,CAAC;AAE3E;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CA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I,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAC5D,SAAS,EAAE,OAAO,IAAI,CAAC,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM;QACvE,SAAS,EAAE,OAAO,IAAI,CAAC,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM;KACxE,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Config schemas for the `DATA_TRANSFORMATION` system modules, centralized from
|
|
4
|
+
* the runtime handlers in `allma-app-logic` so the importer, admin save API,
|
|
5
|
+
* Visual Editor, and flow builder all validate them from one source of truth.
|
|
6
|
+
*
|
|
7
|
+
* Each schema describes the module's fully-resolved input (the merged
|
|
8
|
+
* `customConfig` + input mappings + literals that the handler parses at
|
|
9
|
+
* runtime). A field may legitimately be supplied via an input mapping rather
|
|
10
|
+
* than statically in `customConfig`, which is why warn-mode lint treats a
|
|
11
|
+
* missing field as advisory rather than fatal.
|
|
12
|
+
*/
|
|
13
|
+
/** Config for `system/array-aggregator`: reduce an array to min/max/sum/avg. */
|
|
14
|
+
export declare const ArrayAggregatorCustomConfigSchema: z.ZodObject<{
|
|
15
|
+
array: z.ZodArray<z.ZodAny, "many">;
|
|
16
|
+
path: z.ZodOptional<z.ZodString>;
|
|
17
|
+
operation: z.ZodEnum<["min", "max", "sum", "avg"]>;
|
|
18
|
+
}, "strip", z.ZodTypeAny, {
|
|
19
|
+
array: any[];
|
|
20
|
+
operation: "min" | "max" | "sum" | "avg";
|
|
21
|
+
path?: string | undefined;
|
|
22
|
+
}, {
|
|
23
|
+
array: any[];
|
|
24
|
+
operation: "min" | "max" | "sum" | "avg";
|
|
25
|
+
path?: string | undefined;
|
|
26
|
+
}>;
|
|
27
|
+
export type ArrayAggregatorCustomConfig = z.infer<typeof ArrayAggregatorCustomConfigSchema>;
|
|
28
|
+
/**
|
|
29
|
+
* Config for `system/compose-object-from-input`: the handler simply packages
|
|
30
|
+
* its entire input into a single output object, so its config is intentionally
|
|
31
|
+
* open-ended. Registered as a permissive record (rather than left opaque) so the
|
|
32
|
+
* module is centrally classified; it accepts any object shape by design.
|
|
33
|
+
*/
|
|
34
|
+
export declare const ComposeObjectFromInputCustomConfigSchema: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
35
|
+
export type ComposeObjectFromInputCustomConfig = z.infer<typeof ComposeObjectFromInputCustomConfigSchema>;
|
|
36
|
+
/** Config for `system/date-time-calculator`: add/subtract seconds from a base ISO timestamp. */
|
|
37
|
+
export declare const DateTimeCalculatorCustomConfigSchema: z.ZodObject<{
|
|
38
|
+
baseTime: z.ZodString;
|
|
39
|
+
offsetSeconds: z.ZodNumber;
|
|
40
|
+
operation: z.ZodEnum<["add", "subtract"]>;
|
|
41
|
+
}, "strip", z.ZodTypeAny, {
|
|
42
|
+
operation: "add" | "subtract";
|
|
43
|
+
baseTime: string;
|
|
44
|
+
offsetSeconds: number;
|
|
45
|
+
}, {
|
|
46
|
+
operation: "add" | "subtract";
|
|
47
|
+
baseTime: string;
|
|
48
|
+
offsetSeconds: number;
|
|
49
|
+
}>;
|
|
50
|
+
export type DateTimeCalculatorCustomConfig = z.infer<typeof DateTimeCalculatorCustomConfigSchema>;
|
|
51
|
+
/** Config for `system/flatten-array`: flatten an array, optionally extracting a property first. */
|
|
52
|
+
export declare const FlattenArrayCustomConfigSchema: z.ZodObject<{
|
|
53
|
+
array: z.ZodArray<z.ZodAny, "many">;
|
|
54
|
+
path: z.ZodOptional<z.ZodString>;
|
|
55
|
+
}, "strip", z.ZodTypeAny, {
|
|
56
|
+
array: any[];
|
|
57
|
+
path?: string | undefined;
|
|
58
|
+
}, {
|
|
59
|
+
array: any[];
|
|
60
|
+
path?: string | undefined;
|
|
61
|
+
}>;
|
|
62
|
+
export type FlattenArrayCustomConfig = z.infer<typeof FlattenArrayCustomConfigSchema>;
|
|
63
|
+
/** Config for `system/generate-array`: produce `[0..count-1]`. */
|
|
64
|
+
export declare const GenerateArrayCustomConfigSchema: z.ZodObject<{
|
|
65
|
+
count: z.ZodNumber;
|
|
66
|
+
}, "strip", z.ZodTypeAny, {
|
|
67
|
+
count: number;
|
|
68
|
+
}, {
|
|
69
|
+
count: number;
|
|
70
|
+
}>;
|
|
71
|
+
export type GenerateArrayCustomConfig = z.infer<typeof GenerateArrayCustomConfigSchema>;
|
|
72
|
+
/** A mapping between a left-dataset key and a differently-named right-dataset key. */
|
|
73
|
+
export declare const JoinKeyMappingSchema: z.ZodObject<{
|
|
74
|
+
left: z.ZodString;
|
|
75
|
+
right: z.ZodString;
|
|
76
|
+
}, "strip", z.ZodTypeAny, {
|
|
77
|
+
left: string;
|
|
78
|
+
right: string;
|
|
79
|
+
}, {
|
|
80
|
+
left: string;
|
|
81
|
+
right: string;
|
|
82
|
+
}>;
|
|
83
|
+
export type JoinKeyMapping = z.infer<typeof JoinKeyMappingSchema>;
|
|
84
|
+
/** Config for `system/join-data`: join two CSV/JSON datasets. */
|
|
85
|
+
export declare const JoinDataCustomConfigSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodObject<{
|
|
86
|
+
left_source: z.ZodAny;
|
|
87
|
+
left_format: z.ZodEnum<["csv", "json"]>;
|
|
88
|
+
right_source: z.ZodAny;
|
|
89
|
+
right_format: z.ZodEnum<["csv", "json"]>;
|
|
90
|
+
join_keys: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
91
|
+
key_mappings: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
92
|
+
left: z.ZodString;
|
|
93
|
+
right: z.ZodString;
|
|
94
|
+
}, "strip", z.ZodTypeAny, {
|
|
95
|
+
left: string;
|
|
96
|
+
right: string;
|
|
97
|
+
}, {
|
|
98
|
+
left: string;
|
|
99
|
+
right: string;
|
|
100
|
+
}>, "many">>;
|
|
101
|
+
join_type: z.ZodEnum<["inner", "left", "right", "outer"]>;
|
|
102
|
+
right_select_columns: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
103
|
+
output_format: z.ZodEnum<["csv", "json"]>;
|
|
104
|
+
}, "strip", z.ZodTypeAny, {
|
|
105
|
+
left_format: "csv" | "json";
|
|
106
|
+
right_format: "csv" | "json";
|
|
107
|
+
join_type: "left" | "right" | "inner" | "outer";
|
|
108
|
+
output_format: "csv" | "json";
|
|
109
|
+
left_source?: any;
|
|
110
|
+
right_source?: any;
|
|
111
|
+
join_keys?: string[] | undefined;
|
|
112
|
+
key_mappings?: {
|
|
113
|
+
left: string;
|
|
114
|
+
right: string;
|
|
115
|
+
}[] | undefined;
|
|
116
|
+
right_select_columns?: string[] | null | undefined;
|
|
117
|
+
}, {
|
|
118
|
+
left_format: "csv" | "json";
|
|
119
|
+
right_format: "csv" | "json";
|
|
120
|
+
join_type: "left" | "right" | "inner" | "outer";
|
|
121
|
+
output_format: "csv" | "json";
|
|
122
|
+
left_source?: any;
|
|
123
|
+
right_source?: any;
|
|
124
|
+
join_keys?: string[] | undefined;
|
|
125
|
+
key_mappings?: {
|
|
126
|
+
left: string;
|
|
127
|
+
right: string;
|
|
128
|
+
}[] | undefined;
|
|
129
|
+
right_select_columns?: string[] | null | undefined;
|
|
130
|
+
}>, {
|
|
131
|
+
left_format: "csv" | "json";
|
|
132
|
+
right_format: "csv" | "json";
|
|
133
|
+
join_type: "left" | "right" | "inner" | "outer";
|
|
134
|
+
output_format: "csv" | "json";
|
|
135
|
+
left_source?: any;
|
|
136
|
+
right_source?: any;
|
|
137
|
+
join_keys?: string[] | undefined;
|
|
138
|
+
key_mappings?: {
|
|
139
|
+
left: string;
|
|
140
|
+
right: string;
|
|
141
|
+
}[] | undefined;
|
|
142
|
+
right_select_columns?: string[] | null | undefined;
|
|
143
|
+
}, {
|
|
144
|
+
left_format: "csv" | "json";
|
|
145
|
+
right_format: "csv" | "json";
|
|
146
|
+
join_type: "left" | "right" | "inner" | "outer";
|
|
147
|
+
output_format: "csv" | "json";
|
|
148
|
+
left_source?: any;
|
|
149
|
+
right_source?: any;
|
|
150
|
+
join_keys?: string[] | undefined;
|
|
151
|
+
key_mappings?: {
|
|
152
|
+
left: string;
|
|
153
|
+
right: string;
|
|
154
|
+
}[] | undefined;
|
|
155
|
+
right_select_columns?: string[] | null | undefined;
|
|
156
|
+
}>, {
|
|
157
|
+
left_format: "csv" | "json";
|
|
158
|
+
right_format: "csv" | "json";
|
|
159
|
+
join_type: "left" | "right" | "inner" | "outer";
|
|
160
|
+
output_format: "csv" | "json";
|
|
161
|
+
left_source?: any;
|
|
162
|
+
right_source?: any;
|
|
163
|
+
join_keys?: string[] | undefined;
|
|
164
|
+
key_mappings?: {
|
|
165
|
+
left: string;
|
|
166
|
+
right: string;
|
|
167
|
+
}[] | undefined;
|
|
168
|
+
right_select_columns?: string[] | null | undefined;
|
|
169
|
+
}, {
|
|
170
|
+
left_format: "csv" | "json";
|
|
171
|
+
right_format: "csv" | "json";
|
|
172
|
+
join_type: "left" | "right" | "inner" | "outer";
|
|
173
|
+
output_format: "csv" | "json";
|
|
174
|
+
left_source?: any;
|
|
175
|
+
right_source?: any;
|
|
176
|
+
join_keys?: string[] | undefined;
|
|
177
|
+
key_mappings?: {
|
|
178
|
+
left: string;
|
|
179
|
+
right: string;
|
|
180
|
+
}[] | undefined;
|
|
181
|
+
right_select_columns?: string[] | null | undefined;
|
|
182
|
+
}>, {
|
|
183
|
+
left_format: "csv" | "json";
|
|
184
|
+
right_format: "csv" | "json";
|
|
185
|
+
join_type: "left" | "right" | "inner" | "outer";
|
|
186
|
+
output_format: "csv" | "json";
|
|
187
|
+
left_source?: any;
|
|
188
|
+
right_source?: any;
|
|
189
|
+
join_keys?: string[] | undefined;
|
|
190
|
+
key_mappings?: {
|
|
191
|
+
left: string;
|
|
192
|
+
right: string;
|
|
193
|
+
}[] | undefined;
|
|
194
|
+
right_select_columns?: string[] | null | undefined;
|
|
195
|
+
}, {
|
|
196
|
+
left_format: "csv" | "json";
|
|
197
|
+
right_format: "csv" | "json";
|
|
198
|
+
join_type: "left" | "right" | "inner" | "outer";
|
|
199
|
+
output_format: "csv" | "json";
|
|
200
|
+
left_source?: any;
|
|
201
|
+
right_source?: any;
|
|
202
|
+
join_keys?: string[] | undefined;
|
|
203
|
+
key_mappings?: {
|
|
204
|
+
left: string;
|
|
205
|
+
right: string;
|
|
206
|
+
}[] | undefined;
|
|
207
|
+
right_select_columns?: string[] | null | undefined;
|
|
208
|
+
}>;
|
|
209
|
+
export type JoinDataCustomConfig = z.infer<typeof JoinDataCustomConfigSchema>;
|
|
210
|
+
/** Config for `system/generate-uuid`: a v4 UUID with optional prefix/suffix. */
|
|
211
|
+
export declare const GenerateUuidCustomConfigSchema: z.ZodObject<{
|
|
212
|
+
prefix: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
213
|
+
suffix: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
214
|
+
}, "strip", z.ZodTypeAny, {
|
|
215
|
+
prefix: string;
|
|
216
|
+
suffix: string;
|
|
217
|
+
}, {
|
|
218
|
+
prefix?: string | undefined;
|
|
219
|
+
suffix?: string | undefined;
|
|
220
|
+
}>;
|
|
221
|
+
export type GenerateUuidCustomConfig = z.infer<typeof GenerateUuidCustomConfigSchema>;
|
|
222
|
+
//# sourceMappingURL=data-transformers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-transformers.d.ts","sourceRoot":"","sources":["../../../src/steps/system/data-transformers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;GAUG;AAEH,gFAAgF;AAChF,eAAO,MAAM,iCAAiC;;;;;;;;;;;;EAI5C,CAAC;AACH,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC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zod';
|
|
2
|
+
/**
|
|
3
|
+
* Config schemas for the `DATA_TRANSFORMATION` system modules, centralized from
|
|
4
|
+
* the runtime handlers in `allma-app-logic` so the importer, admin save API,
|
|
5
|
+
* Visual Editor, and flow builder all validate them from one source of truth.
|
|
6
|
+
*
|
|
7
|
+
* Each schema describes the module's fully-resolved input (the merged
|
|
8
|
+
* `customConfig` + input mappings + literals that the handler parses at
|
|
9
|
+
* runtime). A field may legitimately be supplied via an input mapping rather
|
|
10
|
+
* than statically in `customConfig`, which is why warn-mode lint treats a
|
|
11
|
+
* missing field as advisory rather than fatal.
|
|
12
|
+
*/
|
|
13
|
+
/** Config for `system/array-aggregator`: reduce an array to min/max/sum/avg. */
|
|
14
|
+
export const ArrayAggregatorCustomConfigSchema = z.object({
|
|
15
|
+
array: z.array(z.any()),
|
|
16
|
+
path: z.string().optional().describe('A simple property name to extract numeric/boolean values from objects in the array.'),
|
|
17
|
+
operation: z.enum(['min', 'max', 'sum', 'avg']),
|
|
18
|
+
});
|
|
19
|
+
/**
|
|
20
|
+
* Config for `system/compose-object-from-input`: the handler simply packages
|
|
21
|
+
* its entire input into a single output object, so its config is intentionally
|
|
22
|
+
* open-ended. Registered as a permissive record (rather than left opaque) so the
|
|
23
|
+
* module is centrally classified; it accepts any object shape by design.
|
|
24
|
+
*/
|
|
25
|
+
export const ComposeObjectFromInputCustomConfigSchema = z.record(z.any());
|
|
26
|
+
/** Config for `system/date-time-calculator`: add/subtract seconds from a base ISO timestamp. */
|
|
27
|
+
export const DateTimeCalculatorCustomConfigSchema = z.object({
|
|
28
|
+
baseTime: z.string().datetime({ message: 'baseTime must be a valid ISO 8601 string.' }),
|
|
29
|
+
offsetSeconds: z.number({ required_error: 'offsetSeconds (number) is required.' }),
|
|
30
|
+
operation: z.enum(['add', 'subtract'], { required_error: "operation must be 'add' or 'subtract'." }),
|
|
31
|
+
});
|
|
32
|
+
/** Config for `system/flatten-array`: flatten an array, optionally extracting a property first. */
|
|
33
|
+
export const FlattenArrayCustomConfigSchema = z.object({
|
|
34
|
+
array: z.array(z.any()).describe('The array to process.'),
|
|
35
|
+
path: z
|
|
36
|
+
.string()
|
|
37
|
+
.min(1)
|
|
38
|
+
.optional()
|
|
39
|
+
.describe('If provided, the property name to extract from each object in the input array. If the extracted value is an array, its elements will be flattened into the result. If it is a single value, it will be added directly.'),
|
|
40
|
+
});
|
|
41
|
+
/** Config for `system/generate-array`: produce `[0..count-1]`. */
|
|
42
|
+
export const GenerateArrayCustomConfigSchema = z.object({
|
|
43
|
+
count: z.number().int().min(0),
|
|
44
|
+
});
|
|
45
|
+
/** A mapping between a left-dataset key and a differently-named right-dataset key. */
|
|
46
|
+
export const JoinKeyMappingSchema = z.object({
|
|
47
|
+
left: z.string().min(1, 'Left key name cannot be empty.'),
|
|
48
|
+
right: z.string().min(1, 'Right key name cannot be empty.'),
|
|
49
|
+
});
|
|
50
|
+
/** Config for `system/join-data`: join two CSV/JSON datasets. */
|
|
51
|
+
export const JoinDataCustomConfigSchema = z
|
|
52
|
+
.object({
|
|
53
|
+
left_source: z.any().describe('The first dataset to join. Provided via Input Mappings. Can be a JSON array or a raw CSV string.'),
|
|
54
|
+
left_format: z.enum(['csv', 'json']).describe('The format of the left data source.'),
|
|
55
|
+
right_source: z.any().describe('The second dataset to join. Provided via Input Mappings.'),
|
|
56
|
+
right_format: z.enum(['csv', 'json']).describe('The format of the right data source.'),
|
|
57
|
+
join_keys: z.array(z.string()).min(1).optional().describe('For simple joins. An array of column names to join on that are IDENTICAL in both datasets (e.g., ["user_id"]).'),
|
|
58
|
+
key_mappings: z.array(JoinKeyMappingSchema).min(1).optional().describe('For advanced joins. An array of objects for mapping keys with DIFFERENT names (e.g., [{ "left": "manager_id", "right": "id" }]).'),
|
|
59
|
+
join_type: z.enum(['inner', 'left', 'right', 'outer']).describe('The type of join to perform.'),
|
|
60
|
+
right_select_columns: z.array(z.string()).optional().nullable().describe('Optional array of column names from the right dataset to include in the output. If empty, all non-key columns are included.'),
|
|
61
|
+
output_format: z.enum(['csv', 'json']).describe('The desired format for the joined data.'),
|
|
62
|
+
})
|
|
63
|
+
.refine((data) => !!data.join_keys !== !!data.key_mappings, {
|
|
64
|
+
message: 'Exactly one of `join_keys` (for same-name keys) or `key_mappings` (for different-name keys) must be provided.',
|
|
65
|
+
path: ['join_keys'],
|
|
66
|
+
})
|
|
67
|
+
.refine((data) => {
|
|
68
|
+
if (data.left_format === 'csv')
|
|
69
|
+
return typeof data.left_source === 'string';
|
|
70
|
+
if (data.left_format === 'json')
|
|
71
|
+
return Array.isArray(data.left_source);
|
|
72
|
+
return false;
|
|
73
|
+
}, {
|
|
74
|
+
message: 'left_source data type does not match left_format. Expected string for csv, array for json.',
|
|
75
|
+
path: ['left_source'],
|
|
76
|
+
})
|
|
77
|
+
.refine((data) => {
|
|
78
|
+
if (data.right_format === 'csv')
|
|
79
|
+
return typeof data.right_source === 'string';
|
|
80
|
+
if (data.right_format === 'json')
|
|
81
|
+
return Array.isArray(data.right_source);
|
|
82
|
+
return false;
|
|
83
|
+
}, {
|
|
84
|
+
message: 'right_source data type does not match right_format. Expected string for csv, array for json.',
|
|
85
|
+
path: ['right_source'],
|
|
86
|
+
});
|
|
87
|
+
/** Config for `system/generate-uuid`: a v4 UUID with optional prefix/suffix. */
|
|
88
|
+
export const GenerateUuidCustomConfigSchema = z.object({
|
|
89
|
+
prefix: z.string().optional().default(''),
|
|
90
|
+
suffix: z.string().optional().default(''),
|
|
91
|
+
});
|
|
92
|
+
//# sourceMappingURL=data-transformers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-transformers.js","sourceRoot":"","sources":["../../../src/steps/system/data-transformers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;GAUG;AAEH,gFAAgF;AAChF,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,CAAC,MAAM,CAAC;IACxD,KAAK,EAAE,CAAC,C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AM,CAAC;IACrD,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;IACzC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC;CAC1C,CAAC,CAAC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Configuration for the `system/ddb-query-to-s3-manifest` data-loader module,
|
|
4
|
+
* which queries DynamoDB and writes the resulting items (or pointers to them)
|
|
5
|
+
* as a manifest object in S3. Centralized from the runtime handler so the
|
|
6
|
+
* importer, admin save API, Visual Editor, and flow builder validate it from a
|
|
7
|
+
* single source of truth.
|
|
8
|
+
*/
|
|
9
|
+
export declare const DdbQueryToS3ManifestCustomConfigSchema: z.ZodObject<{
|
|
10
|
+
query: z.ZodObject<{
|
|
11
|
+
tableName: z.ZodString;
|
|
12
|
+
indexName: z.ZodOptional<z.ZodString>;
|
|
13
|
+
keyConditionExpression: z.ZodString;
|
|
14
|
+
expressionAttributeValues: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
15
|
+
expressionAttributeNames: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
16
|
+
filterExpression: z.ZodOptional<z.ZodString>;
|
|
17
|
+
projectionExpression: z.ZodOptional<z.ZodString>;
|
|
18
|
+
}, "strip", z.ZodTypeAny, {
|
|
19
|
+
tableName: string;
|
|
20
|
+
keyConditionExpression: string;
|
|
21
|
+
expressionAttributeValues: Record<string, string | number | boolean>;
|
|
22
|
+
projectionExpression?: string | undefined;
|
|
23
|
+
expressionAttributeNames?: Record<string, string> | undefined;
|
|
24
|
+
indexName?: string | undefined;
|
|
25
|
+
filterExpression?: string | undefined;
|
|
26
|
+
}, {
|
|
27
|
+
tableName: string;
|
|
28
|
+
keyConditionExpression: string;
|
|
29
|
+
expressionAttributeValues: Record<string, string | number | boolean>;
|
|
30
|
+
projectionExpression?: string | undefined;
|
|
31
|
+
expressionAttributeNames?: Record<string, string> | undefined;
|
|
32
|
+
indexName?: string | undefined;
|
|
33
|
+
filterExpression?: string | undefined;
|
|
34
|
+
}>;
|
|
35
|
+
destination: z.ZodObject<{
|
|
36
|
+
bucketName: z.ZodString;
|
|
37
|
+
key: z.ZodString;
|
|
38
|
+
}, "strip", z.ZodTypeAny, {
|
|
39
|
+
key: string;
|
|
40
|
+
bucketName: string;
|
|
41
|
+
}, {
|
|
42
|
+
key: string;
|
|
43
|
+
bucketName: string;
|
|
44
|
+
}>;
|
|
45
|
+
enableItemOffloading: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
46
|
+
}, "strip", z.ZodTypeAny, {
|
|
47
|
+
query: {
|
|
48
|
+
tableName: string;
|
|
49
|
+
keyConditionExpression: string;
|
|
50
|
+
expressionAttributeValues: Record<string, string | number | boolean>;
|
|
51
|
+
projectionExpression?: string | undefined;
|
|
52
|
+
expressionAttributeNames?: Record<string, string> | undefined;
|
|
53
|
+
indexName?: string | undefined;
|
|
54
|
+
filterExpression?: string | undefined;
|
|
55
|
+
};
|
|
56
|
+
destination: {
|
|
57
|
+
key: string;
|
|
58
|
+
bucketName: string;
|
|
59
|
+
};
|
|
60
|
+
enableItemOffloading: boolean;
|
|
61
|
+
}, {
|
|
62
|
+
query: {
|
|
63
|
+
tableName: string;
|
|
64
|
+
keyConditionExpression: string;
|
|
65
|
+
expressionAttributeValues: Record<string, string | number | boolean>;
|
|
66
|
+
projectionExpression?: string | undefined;
|
|
67
|
+
expressionAttributeNames?: Record<string, string> | undefined;
|
|
68
|
+
indexName?: string | undefined;
|
|
69
|
+
filterExpression?: string | undefined;
|
|
70
|
+
};
|
|
71
|
+
destination: {
|
|
72
|
+
key: string;
|
|
73
|
+
bucketName: string;
|
|
74
|
+
};
|
|
75
|
+
enableItemOffloading?: boolean | undefined;
|
|
76
|
+
}>;
|
|
77
|
+
export type DdbQueryToS3ManifestCustomConfig = z.infer<typeof DdbQueryToS3ManifestCustomConfigSchema>;
|
|
78
|
+
//# sourceMappingURL=ddb-query-to-s3-manifest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ddb-query-to-s3-manifest.d.ts","sourceRoot":"","sources":["../../../src/steps/system/ddb-query-to-s3-manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;GAMG;AACH,eAAO,MAAM,sCAAsC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAejD,CAAC;AACH,MAAM,MAAM,gCAAgC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sCAAsC,CAAC,CAAC"}
|