@elementumai/edk 0.9.10 → 0.9.12
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/README.md +39 -5
- package/dist-sdk/src/catalog/factories.d.ts +42 -14
- package/dist-sdk/src/catalog/factories.js +77 -14
- package/dist-sdk/src/catalog/from-authoring.js +4 -4
- package/dist-sdk/src/catalog/index.d.ts +2 -2
- package/dist-sdk/src/catalog/index.js +1 -1
- package/dist-sdk/src/catalog/org.js +3 -2
- package/dist-sdk/src/catalog/token.js +4 -0
- package/dist-sdk/src/catalog/types.d.ts +32 -5
- package/dist-sdk/src/catalog/types.js +1 -0
- package/dist-sdk/src/core/triggers/on-demand.d.ts +4 -28
- package/dist-sdk/src/core/triggers/on-demand.js +2 -4
- package/dist-sdk/src/engine/build/context.d.ts +3 -0
- package/dist-sdk/src/engine/entity.d.ts +2 -0
- package/dist-sdk/src/engine/logging.d.ts +90 -0
- package/dist-sdk/src/engine/logging.js +124 -0
- package/dist-sdk/src/engine/progress.d.ts +119 -0
- package/dist-sdk/src/engine/progress.js +647 -0
- package/dist-sdk/src/engine/pull/result-output.d.ts +24 -0
- package/dist-sdk/src/engine/pull/result-output.js +48 -0
- package/dist-sdk/src/entities/access-policy/from-tf.d.ts +3 -3
- package/dist-sdk/src/entities/access-policy/from-tf.js +27 -8
- package/dist-sdk/src/entities/access-policy/to-tf.d.ts +13 -0
- package/dist-sdk/src/entities/access-policy/to-tf.js +34 -3
- package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.js +13 -7
- package/dist-sdk/src/entities/agent/tools.d.ts +2 -2
- package/dist-sdk/src/entities/agent-tool/to-tf.js +13 -0
- package/dist-sdk/src/entities/app/build.d.ts +22 -2
- package/dist-sdk/src/entities/app/build.js +6 -0
- package/dist-sdk/src/entities/app/deserializer/normalize.d.ts +13 -3
- package/dist-sdk/src/entities/app/from-tf.js +10 -7
- package/dist-sdk/src/entities/app/to-tf.js +14 -14
- package/dist-sdk/src/entities/automation/build.d.ts +11 -16
- package/dist-sdk/src/entities/automation/build.js +38 -8
- package/dist-sdk/src/entities/automation/catalog-render.js +1 -1
- package/dist-sdk/src/entities/automation/deserializer/ast.d.ts +1 -2
- package/dist-sdk/src/entities/automation/deserializer/print-automation.d.ts +23 -5
- package/dist-sdk/src/entities/automation/deserializer/print-automation.js +239 -34
- package/dist-sdk/src/entities/automation/from-tf.js +276 -19
- package/dist-sdk/src/entities/automation/index.d.ts +2 -2
- package/dist-sdk/src/entities/automation/module.js +3 -2
- package/dist-sdk/src/entities/automation/output-field-types.js +25 -13
- package/dist-sdk/src/entities/automation/script-code.d.ts +12 -4
- package/dist-sdk/src/entities/automation/script-code.js +659 -101
- package/dist-sdk/src/entities/automation/tasks.d.ts +60 -28
- package/dist-sdk/src/entities/automation/tasks.js +48 -15
- package/dist-sdk/src/entities/automation/to-tf.d.ts +8 -0
- package/dist-sdk/src/entities/automation/to-tf.js +514 -103
- package/dist-sdk/src/entities/automation/triggers.d.ts +15 -9
- package/dist-sdk/src/entities/automation/triggers.js +4 -2
- package/dist-sdk/src/entities/automation/types.js +1 -0
- package/dist-sdk/src/entities/chart/build.d.ts +15 -3
- package/dist-sdk/src/entities/chart/build.js +6 -1
- package/dist-sdk/src/entities/chart/from-tf.d.ts +8 -2
- package/dist-sdk/src/entities/chart/from-tf.js +71 -8
- package/dist-sdk/src/entities/chart/index.d.ts +1 -1
- package/dist-sdk/src/entities/chart/index.js +1 -1
- package/dist-sdk/src/entities/chart/printer.js +27 -7
- package/dist-sdk/src/entities/chart/to-tf.js +56 -2
- package/dist-sdk/src/entities/dashboard/from-tf.js +11 -2
- package/dist-sdk/src/entities/datamine/from-tf.js +11 -1
- package/dist-sdk/src/entities/dynamic-layout/build.d.ts +2 -1
- package/dist-sdk/src/entities/dynamic-layout/dialect.d.ts +8 -0
- package/dist-sdk/src/entities/dynamic-layout/dialect.js +12 -0
- package/dist-sdk/src/entities/dynamic-layout/from-tf.d.ts +7 -0
- package/dist-sdk/src/entities/dynamic-layout/from-tf.js +64 -10
- package/dist-sdk/src/entities/dynamic-layout/to-tf.js +54 -6
- package/dist-sdk/src/entities/element/build.d.ts +8 -0
- package/dist-sdk/src/entities/element/from-tf.js +4 -3
- package/dist-sdk/src/entities/element/module.js +1 -0
- package/dist-sdk/src/entities/element/to-tf.d.ts +4 -1
- package/dist-sdk/src/entities/element/to-tf.js +28 -2
- package/dist-sdk/src/entities/field/build.d.ts +10 -1
- package/dist-sdk/src/entities/field/build.js +2 -1
- package/dist-sdk/src/entities/field/calc/index.js +7 -7
- package/dist-sdk/src/entities/field/calc/runtime.d.ts +19 -0
- package/dist-sdk/src/entities/field/calc/runtime.js +32 -0
- package/dist-sdk/src/entities/field/calc/types.d.ts +6 -0
- package/dist-sdk/src/entities/field/from-tf.d.ts +24 -0
- package/dist-sdk/src/entities/field/from-tf.js +73 -1
- package/dist-sdk/src/entities/field/metadata.d.ts +18 -0
- package/dist-sdk/src/entities/field/metadata.js +34 -0
- package/dist-sdk/src/entities/file-reader/to-tf.js +10 -2
- package/dist-sdk/src/entities/relationship/build.d.ts +27 -9
- package/dist-sdk/src/entities/relationship/column-contract.d.ts +24 -0
- package/dist-sdk/src/entities/relationship/column-contract.js +41 -0
- package/dist-sdk/src/entities/relationship/from-tf.js +33 -48
- package/dist-sdk/src/entities/relationship/to-tf.d.ts +1 -0
- package/dist-sdk/src/entities/relationship/to-tf.js +33 -2
- package/dist-sdk/src/entities/shared/aspect-target-from-tf.d.ts +15 -0
- package/dist-sdk/src/entities/shared/aspect-target-from-tf.js +21 -0
- package/dist-sdk/src/entities/shared/context.d.ts +6 -3
- package/dist-sdk/src/entities/shared/context.js +19 -1
- package/dist-sdk/src/entities/shared/filters/index.d.ts +7 -0
- package/dist-sdk/src/entities/shared/filters/index.js +28 -0
- package/dist-sdk/src/entities/shared/filters/print.js +2 -0
- package/dist-sdk/src/entities/shared/filters/tf-codec.d.ts +8 -1
- package/dist-sdk/src/entities/shared/filters/tf-codec.js +10 -6
- package/dist-sdk/src/entities/shared/filters/types.d.ts +1 -1
- package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.d.ts +5 -0
- package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.js +52 -27
- package/dist-sdk/src/entities/skill/module.js +1 -0
- package/dist-sdk/src/entities/skill/to-tf.d.ts +1 -1
- package/dist-sdk/src/entities/skill/to-tf.js +17 -0
- package/dist-sdk/src/entities/skill/tools.d.ts +48 -12
- package/dist-sdk/src/entities/skill/tools.js +12 -1
- package/dist-sdk/src/entities/skill-tool/from-tf.d.ts +15 -12
- package/dist-sdk/src/entities/skill-tool/from-tf.js +50 -46
- package/dist-sdk/src/entities/skill-tool/to-tf.d.ts +4 -0
- package/dist-sdk/src/entities/skill-tool/to-tf.js +66 -7
- package/dist-sdk/src/entities/table/build.js +10 -2
- package/dist-sdk/src/entities/table/catalog-render.js +2 -1
- package/dist-sdk/src/entities/view/from-tf.js +9 -0
- package/dist-sdk/src/entities/view/to-tf.d.ts +7 -0
- package/dist-sdk/src/entities/view/to-tf.js +39 -12
- package/dist-sdk/src/entities/widget/build.d.ts +43 -7
- package/dist-sdk/src/entities/widget/from-tf.d.ts +1 -1
- package/dist-sdk/src/entities/widget/from-tf.js +162 -23
- package/dist-sdk/src/entities/widget/to-tf.d.ts +17 -0
- package/dist-sdk/src/entities/widget/to-tf.js +150 -6
- package/dist-sdk/src/graph/types.d.ts +13 -0
- package/package.json +1 -1
- package/dist-sdk/src/core/types/platform.d.ts +0 -2
- package/dist-sdk/src/core/types/platform.js +0 -1
|
@@ -79,6 +79,8 @@ export interface ActionDef<TOutput> {
|
|
|
79
79
|
readonly __output?: TOutput;
|
|
80
80
|
/** The owning app's refName, when this task's `record`/`records` output is app-field-typed. */
|
|
81
81
|
readonly __recordApp?: string;
|
|
82
|
+
/** Product kind of `__recordApp` — app vs element. Used to pick live FIND_PARENT refs keys. */
|
|
83
|
+
readonly __recordKind?: "app" | "element";
|
|
82
84
|
}
|
|
83
85
|
/** Placeholder `forEachTaskRefKey` the forEach item proxy emits; replaced with the real refKey. */
|
|
84
86
|
export declare const FOR_EACH_PLACEHOLDER = "__forEach__";
|
|
@@ -173,9 +175,10 @@ interface ActionMethods<TTrigger, TActions extends Record<string, unknown>, TVar
|
|
|
173
175
|
readonly inputs?: (ctx: NestedActionContext<TTrigger, TActions, TVars, TItem>) => I;
|
|
174
176
|
readonly code: (input: ScriptInput<ResolvedRefs<NoInfer<I>>>) => R;
|
|
175
177
|
/**
|
|
176
|
-
* Override the inferred output schema: property name →
|
|
177
|
-
*
|
|
178
|
-
*
|
|
178
|
+
* Override the inferred output schema: property name → scalar type or a
|
|
179
|
+
* recursive `{ type: "array", items }` / `{ type: "object", properties }`
|
|
180
|
+
* descriptor; the object form may also carry `name` for the root.
|
|
181
|
+
* `null`
|
|
179
182
|
* explicitly means "no schema" and suppresses inference; omitting the
|
|
180
183
|
* option infers from the code body.
|
|
181
184
|
*/
|
|
@@ -207,7 +210,7 @@ interface ActionMethods<TTrigger, TActions extends Record<string, unknown>, TVar
|
|
|
207
210
|
updateField<TName extends string, A extends AppOrElementRef, const Fields extends readonly import("./tasks.js").FieldAssignment[]>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").UpdateFieldOptions<A, Fields>>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, {
|
|
208
211
|
record: RecordShape<A>;
|
|
209
212
|
}>;
|
|
210
|
-
findRelatedRecords<TName extends string, A extends AppOrElementRef>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").FindRelatedRecordsOptions<A>>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, import("./tasks.js").
|
|
213
|
+
findRelatedRecords<TName extends string, A extends AppOrElementRef>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").FindRelatedRecordsOptions<A>>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, import("./tasks.js").FindRelatedRecordsOutput<A>>;
|
|
211
214
|
relateRecords<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").RelateRecordsOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
|
|
212
215
|
sendEmail<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").SendEmailOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
|
|
213
216
|
postComment<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").PostCommentOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
|
|
@@ -219,9 +222,7 @@ interface ActionMethods<TTrigger, TActions extends Record<string, unknown>, TVar
|
|
|
219
222
|
aiSummarize<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").AiSummarizeOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, {
|
|
220
223
|
output: unknown;
|
|
221
224
|
}>;
|
|
222
|
-
aiTransform<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").AiTransformOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName,
|
|
223
|
-
output: unknown;
|
|
224
|
-
}>;
|
|
225
|
+
aiTransform<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").AiTransformOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, Record<string, unknown>>;
|
|
225
226
|
aiSearchTable<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").AiSearchTableOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, import("./tasks.js").AiSearchTableOutput>;
|
|
226
227
|
aiFileAnalysis<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").AiFileAnalysisOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, {
|
|
227
228
|
output: unknown;
|
|
@@ -234,16 +235,10 @@ interface ActionMethods<TTrigger, TActions extends Record<string, unknown>, TVar
|
|
|
234
235
|
}>;
|
|
235
236
|
calculation<TName extends string, const Values extends import("./tasks.js").CalculationValues>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").CalculationOptions<Values>>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, import("./tasks.js").CalculationValueOutputs<Values>>;
|
|
236
237
|
calculation<TName extends string, const Entries extends readonly import("./tasks.js").CalculationEntry[]>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").LegacyCalculationOptions<Entries>>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, import("./tasks.js").CalculationOutputs<Entries>>;
|
|
237
|
-
procedure<TName extends string, const Parameters extends readonly import("../../catalog/types.js").ProcedureParameterType[]>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").TypedProcedureOptions<Parameters>>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName,
|
|
238
|
-
|
|
239
|
-
}>;
|
|
240
|
-
procedure<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").LegacyProcedureOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, {
|
|
241
|
-
output: unknown;
|
|
242
|
-
}>;
|
|
238
|
+
procedure<TName extends string, const Parameters extends readonly import("../../catalog/types.js").ProcedureParameterType[]>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").TypedProcedureOptions<Parameters>>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, Record<string, unknown>>;
|
|
239
|
+
procedure<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").LegacyProcedureOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, Record<string, unknown>>;
|
|
243
240
|
runAutomation<TName extends string, const A extends AutomationCatalogRef>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").RunAutomationOptions<A>>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, import("./tasks.js").RunAutomationOutput<A>>;
|
|
244
|
-
readFile<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").ReadFileOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName,
|
|
245
|
-
output: unknown;
|
|
246
|
-
}>;
|
|
241
|
+
readFile<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").ReadFileOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, Record<string, unknown>>;
|
|
247
242
|
approvalChain<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").ApprovalChainOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
|
|
248
243
|
approvalStatusUpdate<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").ApprovalStatusUpdateOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
|
|
249
244
|
addWatcher<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").AddWatcherOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
|
|
@@ -134,7 +134,6 @@ function collectExecuteScriptOutputSchemas(tasks) {
|
|
|
134
134
|
* unrecognized, including `"object"`), which is real for the wire's own
|
|
135
135
|
* default but would be a wrong guess if promoted to `OutputPropertyRef.valueType`.
|
|
136
136
|
*/
|
|
137
|
-
const KNOWN_SCRIPT_OUTPUT_KINDS = new Set(["bool", "integer", "number", "string"]);
|
|
138
137
|
/**
|
|
139
138
|
* Resolve an automation-level output's `valueType` from its (already
|
|
140
139
|
* serialized) value: only when it's a plain ref to an executeScript task's
|
|
@@ -157,9 +156,9 @@ function resolveOutputValueType(value, scriptSchemas) {
|
|
|
157
156
|
if (schema === undefined)
|
|
158
157
|
return undefined;
|
|
159
158
|
const resolved = outputFieldTypesFromScriptSchema(schema)?.get(name);
|
|
160
|
-
if (resolved === undefined || !
|
|
159
|
+
if (resolved === undefined || !["bool", "integer", "number", "string", "array"].includes(resolved.kind))
|
|
161
160
|
return undefined;
|
|
162
|
-
return resolved.fieldType;
|
|
161
|
+
return { fieldType: resolved.fieldType, multiple: resolved.multiple };
|
|
163
162
|
}
|
|
164
163
|
/**
|
|
165
164
|
* Map every record-bearing task's refKey to the app refName that owns its
|
|
@@ -181,16 +180,39 @@ function collectRecordApps(tasks) {
|
|
|
181
180
|
visit(tasks);
|
|
182
181
|
return out;
|
|
183
182
|
}
|
|
183
|
+
function collectRecordKinds(tasks) {
|
|
184
|
+
const out = {};
|
|
185
|
+
const visit = (entries) => {
|
|
186
|
+
for (const { name, def } of entries) {
|
|
187
|
+
if (def.__recordKind !== undefined)
|
|
188
|
+
out[name] = def.__recordKind;
|
|
189
|
+
for (const child of def.operatorChildren ?? [])
|
|
190
|
+
visit(child.tasks);
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
visit(tasks);
|
|
194
|
+
return out;
|
|
195
|
+
}
|
|
184
196
|
/**
|
|
185
197
|
* Tasks whose output carries a `.record` sub-object. Mirrors the deserializer's
|
|
186
198
|
* `RECORD_BEARING_TASK_TYPES` — kept local to avoid a builder → pull-path import.
|
|
187
199
|
*/
|
|
188
200
|
const RECORD_BEARING_TASK_KEYS = new Set(["recordSearch", "createRecord", "findRelatedRecords"]);
|
|
201
|
+
const FIND_RELATED_RECORDS_COUNT_REF_NAMES = new Set(["totalCount", "Records Size", "count"]);
|
|
202
|
+
function findRelatedRecordsTotalCountError(taskRefKey) {
|
|
203
|
+
const task = taskRefKey === undefined ? "findRelatedRecords" : `findRelatedRecords task "${taskRefKey}"`;
|
|
204
|
+
return new EntityTfError(`${task} does not expose totalCount. That output is recordSearch-only ` +
|
|
205
|
+
`(platform refs["Records Size"]). Use ctx.actions.<recordSearchTask>.totalCount ` +
|
|
206
|
+
`for a match count, or ctx.actions.${taskRefKey ?? "<findRelatedRecordsTask>"}.record / .records ` +
|
|
207
|
+
`for related rows. Do not invent a count ref.`);
|
|
208
|
+
}
|
|
189
209
|
/**
|
|
190
210
|
* Forward output-name rewrites, the inverse of the deserializer's read-side
|
|
191
211
|
* normalization (`applyOutputNameInverseRewrites` in
|
|
192
212
|
* `materialize/ref-deserializer.ts` — keep the two in sync):
|
|
193
213
|
* - recordSearch: `totalCount` → the platform's `Records Size`.
|
|
214
|
+
* findRelatedRecords does **not** expose this key — reject it instead of
|
|
215
|
+
* emitting a fake `refs["totalCount"]` / `refs["Records Size"]`.
|
|
194
216
|
* - aiSearchTable: `records` → the platform's `All Records` (NOT
|
|
195
217
|
* recordSearch's `All found records` — #398.1).
|
|
196
218
|
* - tableRecordsSearch interpolations map `records` → `All matching table
|
|
@@ -212,7 +234,10 @@ const RECORD_BEARING_TASK_KEYS = new Set(["recordSearch", "createRecord", "findR
|
|
|
212
234
|
* - single-scalar-output tasks (see `OUTPUT_KEY_WIRE_NAME`): `output` →
|
|
213
235
|
* the platform's actual output name for that task kind.
|
|
214
236
|
*/
|
|
215
|
-
function rewriteForwardTaskRefName(taskKey, name) {
|
|
237
|
+
function rewriteForwardTaskRefName(taskKey, name, taskRefKey) {
|
|
238
|
+
if (taskKey === "findRelatedRecords" && FIND_RELATED_RECORDS_COUNT_REF_NAMES.has(name.split(".")[0])) {
|
|
239
|
+
throw findRelatedRecordsTotalCountError(taskRefKey);
|
|
240
|
+
}
|
|
216
241
|
if (taskKey === "api") {
|
|
217
242
|
return API_TASK_REF_WIRE_NAMES[name] ?? name;
|
|
218
243
|
}
|
|
@@ -265,10 +290,10 @@ function rewriteTaskOutputRefs(node, taskKindByRefKey) {
|
|
|
265
290
|
const rec = node;
|
|
266
291
|
const ref = rec.taskReference;
|
|
267
292
|
if (ref && typeof ref.taskRefKey === "string" && typeof ref.name === "string") {
|
|
268
|
-
ref.name = rewriteForwardTaskRefName(taskKindByRefKey.get(ref.taskRefKey), ref.name);
|
|
293
|
+
ref.name = rewriteForwardTaskRefName(taskKindByRefKey.get(ref.taskRefKey), ref.name, ref.taskRefKey);
|
|
269
294
|
}
|
|
270
295
|
if (rec.type === "TASK" && typeof rec.taskRefKey === "string" && typeof rec.name === "string") {
|
|
271
|
-
rec.name = rewriteForwardTaskRefName(taskKindByRefKey.get(rec.taskRefKey), rec.name);
|
|
296
|
+
rec.name = rewriteForwardTaskRefName(taskKindByRefKey.get(rec.taskRefKey), rec.name, rec.taskRefKey);
|
|
272
297
|
}
|
|
273
298
|
for (const v of Object.values(rec))
|
|
274
299
|
rewriteTaskOutputRefs(v, taskKindByRefKey);
|
|
@@ -496,10 +521,12 @@ function makeActionBuilder(state, mode = "root", item) {
|
|
|
496
521
|
resolveVariableParamMarkers(outputs, variableIdMap);
|
|
497
522
|
}
|
|
498
523
|
const taskAppRefNameByRefKey = collectRecordApps(state.tasks);
|
|
524
|
+
const taskAppKindByRefKey = collectRecordKinds(state.tasks);
|
|
499
525
|
const recordFieldContext = state.trigger.__recordApp !== undefined || Object.keys(taskAppRefNameByRefKey).length > 0
|
|
500
526
|
? {
|
|
501
527
|
...(state.trigger.__recordApp !== undefined ? { triggerAppRefName: state.trigger.__recordApp } : {}),
|
|
502
528
|
...(Object.keys(taskAppRefNameByRefKey).length > 0 ? { taskAppRefNameByRefKey } : {}),
|
|
529
|
+
...(Object.keys(taskAppKindByRefKey).length > 0 ? { taskAppKindByRefKey } : {}),
|
|
503
530
|
}
|
|
504
531
|
: undefined;
|
|
505
532
|
return {
|
|
@@ -566,7 +593,7 @@ export function automation(opts) {
|
|
|
566
593
|
: undefined;
|
|
567
594
|
const outputs = outputEntries.length > 0
|
|
568
595
|
? Object.fromEntries(outputEntries.map(({ name: n, value }) => {
|
|
569
|
-
const
|
|
596
|
+
const resolvedOutput = resolveOutputValueType(value, scriptSchemas);
|
|
570
597
|
return [
|
|
571
598
|
n,
|
|
572
599
|
{
|
|
@@ -574,7 +601,10 @@ export function automation(opts) {
|
|
|
574
601
|
refName: n,
|
|
575
602
|
name: n,
|
|
576
603
|
parent: refName,
|
|
577
|
-
...(
|
|
604
|
+
...(resolvedOutput !== undefined ? {
|
|
605
|
+
valueType: resolvedOutput.fieldType,
|
|
606
|
+
...(resolvedOutput.multiple ? { multiple: true } : {}),
|
|
607
|
+
} : {}),
|
|
578
608
|
},
|
|
579
609
|
];
|
|
580
610
|
}))
|
|
@@ -29,7 +29,7 @@ export function renderAutomationCatalogEntry(args) {
|
|
|
29
29
|
lines.push(`${baseIndent} outputs: {`);
|
|
30
30
|
for (const key of outputKeys) {
|
|
31
31
|
const prop = ref.outputs[key];
|
|
32
|
-
lines.push(`${baseIndent} ${safeCatalogKey(key)}: outputPropertyRef({ name: ${JSON.stringify(prop.name)}, parent: ${JSON.stringify(prop.parent ?? "")}${prop.valueType !== undefined ? `, valueType: ${JSON.stringify(prop.valueType)}` : ""} }),`);
|
|
32
|
+
lines.push(`${baseIndent} ${safeCatalogKey(key)}: outputPropertyRef({ name: ${JSON.stringify(prop.name)}, parent: ${JSON.stringify(prop.parent ?? "")}${prop.valueType !== undefined ? `, valueType: ${JSON.stringify(prop.valueType)}` : ""}${prop.multiple === true ? ", multiple: true" : ""} }),`);
|
|
33
33
|
}
|
|
34
34
|
lines.push(`${baseIndent} },`);
|
|
35
35
|
}
|
|
@@ -72,8 +72,6 @@ export type TriggerAst = {
|
|
|
72
72
|
defaultValue?: unknown;
|
|
73
73
|
description?: string;
|
|
74
74
|
}>;
|
|
75
|
-
/** Round-tripped from the wire's `onDemand.showTriggeredBy` flag. */
|
|
76
|
-
showTriggeredBy?: boolean;
|
|
77
75
|
} | {
|
|
78
76
|
kind: "recordCreate" | "recordUpdate" | "attachment";
|
|
79
77
|
/** The owning app — `{kind: "unresolved", ...}` when the aspect never made it into the pull's catalog. */
|
|
@@ -90,6 +88,7 @@ export type TriggerAst = {
|
|
|
90
88
|
kind: "conversationEnd";
|
|
91
89
|
app: AppRefAst | UnresolvedRefAst;
|
|
92
90
|
conversationType: string;
|
|
91
|
+
filter?: Filter<RefExpr, RefExpr>;
|
|
93
92
|
} | {
|
|
94
93
|
kind: "webhook";
|
|
95
94
|
authenticated: boolean;
|
|
@@ -34,14 +34,32 @@ import type { AutomationAst } from "./ast.js";
|
|
|
34
34
|
import type { UnresolvedReferenceDiagnostic } from "../../../graph/types.js";
|
|
35
35
|
/** Keep the authored publish token across pull; live workflow versions are not author intent. */
|
|
36
36
|
export declare function preserveAuthoredAutomationRevision(freshSource: string, existingSource: string): string;
|
|
37
|
+
/**
|
|
38
|
+
* Extract a string-literal (or `+`-concatenated literals) description from
|
|
39
|
+
* authored automation source. Pull reprints often omit description entirely
|
|
40
|
+
* because Go export cannot read it back from the platform today.
|
|
41
|
+
*/
|
|
42
|
+
export declare function extractAuthoredAutomationDescription(source: string): string | undefined;
|
|
43
|
+
/**
|
|
44
|
+
* Keep a non-empty authored `description` across pull.
|
|
45
|
+
*
|
|
46
|
+
* Platform discovery historically omitted automation description (and the TF
|
|
47
|
+
* provider still does not round-trip it through GraphQL), so Go HCL export
|
|
48
|
+
* drops the attribute. Without this merge, pull → reprint → build clears
|
|
49
|
+
* description from config while state still has it, forcing an adopt update.
|
|
50
|
+
* Prefer a freshly pulled description when present; only reinstate the
|
|
51
|
+
* authored value when the fresh source omitted it.
|
|
52
|
+
*/
|
|
53
|
+
export declare function preserveAuthoredAutomationDescription(freshSource: string, existingSource: string): string;
|
|
54
|
+
/** Pull merge: preserve authored revision + description across live reprint. */
|
|
55
|
+
export declare function preserveAuthoredAutomationPullMeta(freshSource: string, existingSource: string): string;
|
|
37
56
|
export interface PrintAutomationV2Options {
|
|
38
57
|
readonly refName?: string;
|
|
39
58
|
/**
|
|
40
|
-
* The owning app's
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
* source app.
|
|
59
|
+
* The owning app's authored catalog key. Defaults to `ast.ownerHandle`.
|
|
60
|
+
* Pull passes the on-disk refName (`eDKCloudBuilder`) when extract used
|
|
61
|
+
* the export label (`edkcloudbuilder`); every owner catalog path
|
|
62
|
+
* (`app:`, `.fields`, `.agents`, …) follows this key.
|
|
45
63
|
*/
|
|
46
64
|
readonly appRefName?: string;
|
|
47
65
|
/**
|