@elementumai/edk 0.12.0 → 0.13.1
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 +8 -2
- package/dist-sdk/src/catalog/factories.d.ts +7 -1
- package/dist-sdk/src/catalog/factories.js +10 -2
- 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 +79 -34
- package/dist-sdk/src/catalog/token.js +5 -0
- package/dist-sdk/src/catalog/types.d.ts +12 -1
- package/dist-sdk/src/catalog/types.js +3 -0
- package/dist-sdk/src/core/system-fields.d.ts +1 -1
- package/dist-sdk/src/core/system-fields.js +1 -1
- package/dist-sdk/src/core/types/app.d.ts +6 -0
- package/dist-sdk/src/engine/build/context.d.ts +3 -0
- package/dist-sdk/src/engine/coverage-gaps.d.ts +2 -0
- package/dist-sdk/src/engine/coverage-gaps.js +4 -0
- package/dist-sdk/src/engine/ei/run.d.ts +8 -0
- package/dist-sdk/src/engine/ei/run.js +46 -7
- package/dist-sdk/src/engine/pull/authored-address.js +42 -6
- package/dist-sdk/src/engine/pull/authored-root.d.ts +88 -0
- package/dist-sdk/src/engine/pull/authored-root.js +306 -0
- package/dist-sdk/src/engine/pull/context.d.ts +34 -0
- package/dist-sdk/src/engine/pull/field-refs-registry.d.ts +114 -0
- package/dist-sdk/src/engine/pull/field-refs-registry.js +501 -0
- package/dist-sdk/src/engine/pull/org.d.ts +1 -0
- package/dist-sdk/src/engine/pull/org.js +2 -0
- package/dist-sdk/src/engine/pull/partition.d.ts +8 -0
- package/dist-sdk/src/engine/pull/partition.js +43 -0
- package/dist-sdk/src/engine/pull/pulled-roots.d.ts +89 -0
- package/dist-sdk/src/engine/pull/pulled-roots.js +203 -0
- package/dist-sdk/src/engine/pull/ref-only.d.ts +4 -0
- package/dist-sdk/src/engine/pull/ref-only.js +7 -1
- package/dist-sdk/src/engine/pull/source-resources.d.ts +39 -0
- package/dist-sdk/src/engine/pull/source-resources.js +110 -0
- package/dist-sdk/src/engine/pull/stream-root.d.ts +159 -0
- package/dist-sdk/src/engine/pull/stream-root.js +579 -0
- package/dist-sdk/src/engine/workspace/authoring-layout.js +16 -2
- package/dist-sdk/src/engine/workspace/reserved-catalog-keys.d.ts +47 -0
- package/dist-sdk/src/engine/workspace/reserved-catalog-keys.js +115 -0
- package/dist-sdk/src/entities/access-policy/build.d.ts +2 -1
- package/dist-sdk/src/entities/access-policy/from-tf.d.ts +7 -0
- package/dist-sdk/src/entities/access-policy/from-tf.js +17 -5
- package/dist-sdk/src/entities/access-policy/to-tf.d.ts +19 -0
- package/dist-sdk/src/entities/access-policy/to-tf.js +65 -8
- package/dist-sdk/src/entities/agent/build.d.ts +52 -1
- package/dist-sdk/src/entities/agent/build.js +34 -0
- package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.js +70 -1
- package/dist-sdk/src/entities/agent/from-tf.d.ts +36 -1
- package/dist-sdk/src/entities/agent/from-tf.js +289 -2
- package/dist-sdk/src/entities/agent/index.d.ts +1 -1
- package/dist-sdk/src/entities/agent/module.js +1 -0
- package/dist-sdk/src/entities/agent/to-tf.d.ts +11 -11
- package/dist-sdk/src/entities/agent/to-tf.js +179 -17
- package/dist-sdk/src/entities/agent-tool/from-tf.js +6 -0
- package/dist-sdk/src/entities/agent-tool/to-tf.d.ts +2 -2
- package/dist-sdk/src/entities/agent-tool/to-tf.js +2 -2
- package/dist-sdk/src/entities/app/build.d.ts +33 -13
- package/dist-sdk/src/entities/app/build.js +14 -12
- package/dist-sdk/src/entities/app/from-tf.d.ts +1 -0
- package/dist-sdk/src/entities/app/from-tf.js +7 -9
- package/dist-sdk/src/entities/app/index.d.ts +1 -0
- package/dist-sdk/src/entities/app/index.js +1 -0
- package/dist-sdk/src/entities/app/module.js +3 -0
- package/dist-sdk/src/entities/app/stage-keys.d.ts +2 -2
- package/dist-sdk/src/entities/app/stage-keys.js +3 -3
- package/dist-sdk/src/entities/app/to-tf.js +1 -0
- package/dist-sdk/src/entities/approval-chain/build.d.ts +46 -11
- package/dist-sdk/src/entities/approval-chain/build.js +120 -8
- package/dist-sdk/src/entities/approval-chain/from-tf.d.ts +24 -2
- package/dist-sdk/src/entities/approval-chain/from-tf.js +148 -6
- package/dist-sdk/src/entities/approval-chain/index.d.ts +4 -1
- package/dist-sdk/src/entities/approval-chain/index.js +4 -1
- package/dist-sdk/src/entities/approval-chain/module.js +23 -5
- package/dist-sdk/src/entities/approval-chain/printer.d.ts +1 -1
- package/dist-sdk/src/entities/approval-chain/printer.js +91 -5
- package/dist-sdk/src/entities/approval-chain/steps-tf.d.ts +77 -0
- package/dist-sdk/src/entities/approval-chain/steps-tf.js +255 -0
- package/dist-sdk/src/entities/approval-chain/steps.d.ts +71 -0
- package/dist-sdk/src/entities/approval-chain/steps.js +83 -0
- package/dist-sdk/src/entities/approval-chain/to-tf.d.ts +16 -6
- package/dist-sdk/src/entities/approval-chain/to-tf.js +37 -4
- package/dist-sdk/src/entities/automation/build.d.ts +10 -1
- package/dist-sdk/src/entities/automation/build.js +70 -27
- package/dist-sdk/src/entities/automation/deserializer/print-automation.js +21 -5
- package/dist-sdk/src/entities/automation/from-tf.d.ts +26 -5
- package/dist-sdk/src/entities/automation/from-tf.js +665 -112
- package/dist-sdk/src/entities/automation/index.d.ts +2 -1
- package/dist-sdk/src/entities/automation/index.js +1 -0
- package/dist-sdk/src/entities/automation/module.d.ts +4 -3
- package/dist-sdk/src/entities/automation/module.js +45 -12
- package/dist-sdk/src/entities/automation/refs-read.d.ts +19 -0
- package/dist-sdk/src/entities/automation/refs-read.js +48 -0
- package/dist-sdk/src/entities/automation/slack-message-refs.d.ts +9 -0
- package/dist-sdk/src/entities/automation/slack-message-refs.js +75 -0
- package/dist-sdk/src/entities/automation/system-ref-name.d.ts +23 -3
- package/dist-sdk/src/entities/automation/system-ref-name.js +86 -4
- package/dist-sdk/src/entities/automation/task-output-labels.d.ts +11 -0
- package/dist-sdk/src/entities/automation/task-output-labels.js +23 -0
- package/dist-sdk/src/entities/automation/tasks.d.ts +29 -4
- package/dist-sdk/src/entities/automation/tasks.js +34 -11
- package/dist-sdk/src/entities/automation/to-tf.d.ts +8 -1
- package/dist-sdk/src/entities/automation/to-tf.js +563 -103
- package/dist-sdk/src/entities/automation/triggers.d.ts +0 -8
- package/dist-sdk/src/entities/automation/triggers.js +26 -11
- package/dist-sdk/src/entities/automation/unsafe-script-output.d.ts +50 -0
- package/dist-sdk/src/entities/automation/unsafe-script-output.js +92 -0
- package/dist-sdk/src/entities/chart/build.d.ts +9 -1
- package/dist-sdk/src/entities/chart/from-tf.js +3 -0
- package/dist-sdk/src/entities/chart/to-tf.js +19 -2
- package/dist-sdk/src/entities/dashboard/from-tf.d.ts +3 -1
- package/dist-sdk/src/entities/dashboard/from-tf.js +42 -2
- package/dist-sdk/src/entities/dashboard/to-tf.js +9 -1
- package/dist-sdk/src/entities/dashboard-widget-order/module.d.ts +10 -0
- package/dist-sdk/src/entities/dashboard-widget-order/module.js +25 -0
- package/dist-sdk/src/entities/dashboard-widget-order/order.d.ts +31 -0
- package/dist-sdk/src/entities/dashboard-widget-order/order.js +102 -0
- package/dist-sdk/src/entities/dynamic-layout/build.d.ts +2 -0
- package/dist-sdk/src/entities/dynamic-layout/from-tf.js +44 -5
- package/dist-sdk/src/entities/dynamic-layout/to-tf.js +46 -12
- package/dist-sdk/src/entities/element/audit-field-guard.d.ts +9 -0
- package/dist-sdk/src/entities/element/audit-field-guard.js +88 -0
- package/dist-sdk/src/entities/element/build.js +2 -1
- package/dist-sdk/src/entities/element/from-tf.d.ts +1 -0
- package/dist-sdk/src/entities/element/from-tf.js +4 -7
- package/dist-sdk/src/entities/element/module.js +5 -0
- package/dist-sdk/src/entities/element/system-fields.d.ts +13 -0
- package/dist-sdk/src/entities/element/system-fields.js +23 -0
- package/dist-sdk/src/entities/element/to-tf.js +1 -0
- package/dist-sdk/src/entities/field/build.d.ts +9 -0
- package/dist-sdk/src/entities/field/from-tf.d.ts +52 -1
- package/dist-sdk/src/entities/field/from-tf.js +212 -14
- package/dist-sdk/src/entities/field/module.js +4 -0
- package/dist-sdk/src/entities/field/to-tf.d.ts +5 -1
- package/dist-sdk/src/entities/field/to-tf.js +33 -12
- package/dist-sdk/src/entities/org/category.js +1 -0
- package/dist-sdk/src/entities/org/index.d.ts +1 -0
- package/dist-sdk/src/entities/org/index.js +1 -0
- package/dist-sdk/src/entities/org/voice-auth.d.ts +5 -0
- package/dist-sdk/src/entities/org/voice-auth.js +33 -0
- package/dist-sdk/src/entities/organization/build.d.ts +3 -0
- package/dist-sdk/src/entities/organization/build.js +2 -0
- package/dist-sdk/src/entities/organization/index.d.ts +1 -0
- package/dist-sdk/src/entities/organization/index.js +1 -0
- package/dist-sdk/src/entities/organization/to-tf.d.ts +2 -0
- package/dist-sdk/src/entities/organization/to-tf.js +59 -1
- package/dist-sdk/src/entities/organization/voice-auth.d.ts +60 -0
- package/dist-sdk/src/entities/organization/voice-auth.js +60 -0
- package/dist-sdk/src/entities/phone-service/build.d.ts +9 -1
- package/dist-sdk/src/entities/phone-service/build.js +1 -0
- package/dist-sdk/src/entities/phone-service/deserializer/print-phone-service.js +3 -0
- package/dist-sdk/src/entities/phone-service/from-tf.d.ts +1 -0
- package/dist-sdk/src/entities/phone-service/from-tf.js +8 -1
- package/dist-sdk/src/entities/phone-service/to-tf.js +16 -0
- package/dist-sdk/src/entities/record-create-form/from-tf.js +2 -2
- package/dist-sdk/src/entities/relationship/from-tf.js +9 -4
- package/dist-sdk/src/entities/relationship/module.js +2 -2
- package/dist-sdk/src/entities/relationship/pair-check.d.ts +6 -2
- package/dist-sdk/src/entities/relationship/pair-check.js +105 -18
- package/dist-sdk/src/entities/relationship/to-tf.js +5 -2
- package/dist-sdk/src/entities/role/build.d.ts +3 -4
- package/dist-sdk/src/entities/role/permission-levels.d.ts +7 -0
- package/dist-sdk/src/entities/role/permission-levels.js +78 -0
- package/dist-sdk/src/entities/role/to-tf.js +32 -2
- package/dist-sdk/src/entities/search-table/build.d.ts +9 -3
- package/dist-sdk/src/entities/search-table/build.js +4 -4
- package/dist-sdk/src/entities/search-table/printer.js +3 -1
- package/dist-sdk/src/entities/search-table/to-tf.js +20 -2
- package/dist-sdk/src/entities/service-account/module.d.ts +2 -1
- package/dist-sdk/src/entities/service-account/module.js +4 -1
- package/dist-sdk/src/entities/service-account/resource-type.d.ts +2 -0
- package/dist-sdk/src/entities/service-account/resource-type.js +2 -0
- package/dist-sdk/src/entities/service-account/role-membership-check.d.ts +20 -0
- package/dist-sdk/src/entities/service-account/role-membership-check.js +80 -0
- 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 +36 -0
- package/dist-sdk/src/entities/shared/context.d.ts +14 -1
- package/dist-sdk/src/entities/shared/filters/ast.d.ts +2 -0
- package/dist-sdk/src/entities/shared/filters/index.d.ts +97 -15
- package/dist-sdk/src/entities/shared/filters/index.js +30 -7
- package/dist-sdk/src/entities/shared/filters/option-lookups.d.ts +57 -0
- package/dist-sdk/src/entities/shared/filters/option-lookups.js +108 -0
- package/dist-sdk/src/entities/shared/filters/print.d.ts +2 -0
- package/dist-sdk/src/entities/shared/filters/print.js +19 -6
- package/dist-sdk/src/entities/shared/filters/tf-codec.d.ts +16 -7
- package/dist-sdk/src/entities/shared/filters/tf-codec.js +25 -5
- package/dist-sdk/src/entities/shared/filters/types.d.ts +4 -0
- package/dist-sdk/src/entities/shared/raw-option-id.d.ts +30 -0
- package/dist-sdk/src/entities/shared/raw-option-id.js +41 -0
- package/dist-sdk/src/entities/shared/tool-field-ref.d.ts +1 -1
- package/dist-sdk/src/entities/shared/tool-field-ref.js +3 -2
- package/dist-sdk/src/entities/skill/input-coverage.js +5 -2
- package/dist-sdk/src/entities/sla/build.d.ts +96 -0
- package/dist-sdk/src/entities/sla/build.js +124 -0
- package/dist-sdk/src/entities/sla/from-tf.d.ts +40 -0
- package/dist-sdk/src/entities/sla/from-tf.js +164 -0
- package/dist-sdk/src/entities/sla/index.d.ts +1 -0
- package/dist-sdk/src/entities/sla/index.js +1 -0
- package/dist-sdk/src/entities/sla/module.d.ts +4 -0
- package/dist-sdk/src/entities/sla/module.js +73 -0
- package/dist-sdk/src/entities/sla/printer.d.ts +2 -0
- package/dist-sdk/src/entities/sla/printer.js +84 -0
- package/dist-sdk/src/entities/sla/to-tf.d.ts +12 -0
- package/dist-sdk/src/entities/sla/to-tf.js +81 -0
- package/dist-sdk/src/entities/table/build.d.ts +7 -2
- package/dist-sdk/src/entities/table/build.js +22 -1
- package/dist-sdk/src/entities/table/deserializer/normalize.d.ts +4 -1
- package/dist-sdk/src/entities/table/from-tf.js +89 -14
- package/dist-sdk/src/entities/table/index.d.ts +1 -1
- package/dist-sdk/src/entities/table/to-tf.js +41 -2
- package/dist-sdk/src/entities/task/from-tf.js +3 -2
- package/dist-sdk/src/entities/view/custom-view-validate.d.ts +6 -4
- package/dist-sdk/src/entities/view/custom-view-validate.js +36 -18
- package/dist-sdk/src/entities/view/from-tf.js +16 -4
- package/dist-sdk/src/entities/view/to-tf.js +66 -47
- package/dist-sdk/src/entities/visual-flow/module.js +52 -1
- package/dist-sdk/src/entities/widget/from-tf.js +19 -8
- package/dist-sdk/src/generated/ragnarok/ragnarok-spec.d.ts +49 -4
- package/dist-sdk/src/generated/ragnarok/ragnarok-spec.js +2 -2
- package/dist-sdk/src/graph/index.d.ts +9 -0
- package/dist-sdk/src/graph/index.js +8 -0
- package/dist-sdk/src/graph/modules.js +13 -1
- package/dist-sdk/src/graph/resource-types.d.ts +47 -0
- package/dist-sdk/src/graph/resource-types.js +62 -0
- package/dist-sdk/src/graph/types.d.ts +113 -6
- package/package.json +7 -4
|
@@ -1,18 +1,26 @@
|
|
|
1
1
|
import { isUnsafePlatformId } from "../../core/platform-id.js";
|
|
2
2
|
import { EntityTfError } from "../../engine/entity.js";
|
|
3
|
-
import {
|
|
3
|
+
import { expr, scopedResourceLabel, tsLabelToTfLabel } from "../../engine/tf/index.js";
|
|
4
4
|
import { APP_RESOURCE_TYPE } from "../app/module.js";
|
|
5
|
+
import { ELEMENT_RESOURCE_TYPE } from "../element/module.js";
|
|
5
6
|
import { fieldRefToTfValue } from "../field/to-tf.js";
|
|
6
7
|
import { APPROVAL_PROCESS_RESOURCE_TYPE } from "./module.js";
|
|
8
|
+
import { approvalStepsToTf } from "./steps-tf.js";
|
|
7
9
|
export function approvalChainToTf(entity, ctx) {
|
|
8
10
|
if (entity.kind !== "approvalChain")
|
|
9
11
|
throw new EntityTfError(`approvalChainToTf expects approvalChain; got ${entity.kind}`);
|
|
10
12
|
const payload = entity.payload;
|
|
11
13
|
if (payload === null)
|
|
12
14
|
throw new EntityTfError(`approval chain ${entity.refName} has no payload`);
|
|
13
|
-
const
|
|
15
|
+
const scope = ctx.parentScope ?? "app";
|
|
16
|
+
if (scope === "element" && (payload.stage !== undefined || payload.stageId !== undefined)) {
|
|
17
|
+
throw new EntityTfError(`approval chain ${entity.refName}: an element-owned approval process takes no stage`);
|
|
18
|
+
}
|
|
19
|
+
const label = scopedResourceLabel(ctx.appTfLabel, tsLabelToTfLabel(entity.refName), scope);
|
|
14
20
|
const attrs = {
|
|
15
|
-
|
|
21
|
+
...(scope === "element"
|
|
22
|
+
? { element_id: expr.resourceAttr(ELEMENT_RESOURCE_TYPE, ctx.appTfLabel, ["id"]) }
|
|
23
|
+
: { app_id: expr.resourceAttr(APP_RESOURCE_TYPE, ctx.appTfLabel, ["id"]) }),
|
|
16
24
|
name: payload.name ?? "",
|
|
17
25
|
number_of_dynamic_approvers: payload.numberOfDynamicApprovers ?? 0,
|
|
18
26
|
managed_by_automation: payload.managedByAutomation ?? false,
|
|
@@ -35,12 +43,37 @@ export function approvalChainToTf(entity, ctx) {
|
|
|
35
43
|
return field.value;
|
|
36
44
|
if (field.parent !== undefined && field.parent !== "" && field.parent !== ctx.appRefName)
|
|
37
45
|
throw new EntityTfError(`approval chain ${entity.refName}: locked field belongs to ${field.parent}`);
|
|
38
|
-
const value = fieldRefToTfValue(field.fieldType ?? "", field.refName ?? "", ctx.appTfLabel);
|
|
46
|
+
const value = fieldRefToTfValue(field.fieldType ?? "", field.refName ?? "", ctx.appTfLabel, scope, ctx.fieldAddresses, field.resourceKey);
|
|
39
47
|
if (value === undefined)
|
|
40
48
|
throw new EntityTfError(`approval chain ${entity.refName}: locked field ${field.refName ?? ""} has no Terraform mapping`);
|
|
41
49
|
return value;
|
|
42
50
|
});
|
|
43
51
|
}
|
|
52
|
+
if (payload.dynamicChain === true)
|
|
53
|
+
attrs["dynamic_chain"] = true;
|
|
54
|
+
else if (payload.dynamicChain === false)
|
|
55
|
+
attrs["dynamic_chain"] = false;
|
|
56
|
+
if (payload.steps !== undefined) {
|
|
57
|
+
if (ctx.orgRefs === undefined)
|
|
58
|
+
throw new EntityTfError(`approval chain ${entity.refName}: approver steps need org lookups`);
|
|
59
|
+
attrs["approvers"] = approvalStepsToTf(payload.steps, `${APPROVAL_PROCESS_RESOURCE_TYPE}.${label}.approvers`, {
|
|
60
|
+
orgRefs: ctx.orgRefs, ownerTfLabel: ctx.appTfLabel, appRefName: ctx.appRefName, scope,
|
|
61
|
+
diagnostics: ctx.diagnostics ?? [], ...(ctx.fieldAddresses !== undefined ? { fieldAddresses: ctx.fieldAddresses } : {}),
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
if (payload.tableFilterFieldIds !== undefined) {
|
|
65
|
+
attrs["table_filter_field_ids"] = payload.tableFilterFieldIds.map((field) => {
|
|
66
|
+
if (isUnsafePlatformId(field))
|
|
67
|
+
return field.value;
|
|
68
|
+
if (field.parent !== undefined && field.parent !== "" && field.parent !== ctx.appRefName) {
|
|
69
|
+
throw new EntityTfError(`approval chain ${entity.refName}: table filter column belongs to ${field.parent}`);
|
|
70
|
+
}
|
|
71
|
+
const value = fieldRefToTfValue(field.fieldType ?? "", field.refName ?? "", ctx.appTfLabel, scope, ctx.fieldAddresses, field.resourceKey);
|
|
72
|
+
if (value === undefined)
|
|
73
|
+
throw new EntityTfError(`approval chain ${entity.refName}: table filter column ${field.refName ?? ""} has no Terraform mapping`);
|
|
74
|
+
return value;
|
|
75
|
+
});
|
|
76
|
+
}
|
|
44
77
|
const block = { kind: "resource", type: APPROVAL_PROCESS_RESOURCE_TYPE, label, attrs };
|
|
45
78
|
return { blocks: [block], address: `${APPROVAL_PROCESS_RESOURCE_TYPE}.${label}` };
|
|
46
79
|
}
|
|
@@ -321,7 +321,7 @@ interface ActionMethods<TTrigger, TActions extends Record<string, unknown>, TVar
|
|
|
321
321
|
initiateCall<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").InitiateCallOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
|
|
322
322
|
recordFieldLocking<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").RecordFieldLockingOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
|
|
323
323
|
unimplementedTask<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, import("./tasks.js").UnimplementedTaskOptions>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
|
|
324
|
-
forEach<TName extends string, TForEachItem>(name: TName, opts: ForEachConfig<TTrigger, TActions, TVars, TItem, TForEachItem, TName>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName,
|
|
324
|
+
forEach<TName extends string, TForEachItem>(name: TName, opts: ForEachConfig<TTrigger, TActions, TVars, TItem, TForEachItem, TName>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, ForEachOutput>;
|
|
325
325
|
switch<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, SwitchConfig<TTrigger, TActions, TVars, TItem>>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
|
|
326
326
|
forkJoin<TName extends string>(name: TName, opts: BuilderActionOptions<TTrigger, TActions, TVars, TItem, ForkJoinConfig<TTrigger, TActions, TVars, TItem>>, displayName?: string, hclParent?: "trigger" | string): WithAction<TMode, TItem, TTrigger, TActions, TVars, TName, EmptyObject>;
|
|
327
327
|
}
|
|
@@ -343,6 +343,15 @@ export type ForEachBuilder<TTrigger, TActions extends Record<string, unknown>, T
|
|
|
343
343
|
export type SwitchCaseBuilder<TTrigger, TActions extends Record<string, unknown>, TVars extends Record<string, unknown>, TItem = never> = NestedActionBuilder<TTrigger, TActions, TVars, TItem>;
|
|
344
344
|
/** A forkJoin branch body builder. */
|
|
345
345
|
export type ForkJoinBranchBuilder<TTrigger, TActions extends Record<string, unknown>, TVars extends Record<string, unknown>, TItem = never> = NestedActionBuilder<TTrigger, TActions, TVars, TItem>;
|
|
346
|
+
/**
|
|
347
|
+
* A forEach task's own output, readable only after the loop
|
|
348
|
+
* (`ctx.actions.<loop>.iteration`): its last iteration number. Inside the
|
|
349
|
+
* body, use `ctx.item.metadata.iteration` instead; the platform rejects the
|
|
350
|
+
* loop's own output there (#2943).
|
|
351
|
+
*/
|
|
352
|
+
export interface ForEachOutput {
|
|
353
|
+
readonly iteration: number;
|
|
354
|
+
}
|
|
346
355
|
export interface ForEachConfig<TTrigger, TActions extends Record<string, unknown>, TVars extends Record<string, unknown>, TEnclosingItem, TItem, TName extends string = string> {
|
|
347
356
|
readonly collection: Ref<readonly TItem[]> | ((ctx: NestedActionContext<TTrigger, TActions, TVars, TEnclosingItem>) => Ref<readonly TItem[]>);
|
|
348
357
|
/** The loop body. Its context adds `ctx.item` and this loop as `ctx.loops.<name>`. */
|
|
@@ -32,6 +32,7 @@ import { buildContext, createForEachItemProxy } from "../shared/context.js";
|
|
|
32
32
|
import { outputFieldTypesFromScriptSchema, scriptSchemaIsSingleStringArray } from "./output-field-types.js";
|
|
33
33
|
import { isRef } from "../shared/ref.js";
|
|
34
34
|
import { apiTaskCanonicalOutputName, apiTaskJsonRefsKeys, apiTaskRefsIndex, OUTPUT_KEY_CANONICAL, OUTPUT_KEY_WIRE_NAME } from "./output-key-wire-name.js";
|
|
35
|
+
import { memberPath, scriptActionAccess, unwrapUnsafeScriptOutput } from "./unsafe-script-output.js";
|
|
35
36
|
import { extractScriptBody, inferOutputSchema, isScriptFile, readScriptFile, toPlatformScriptBody, tryExtractFromCurrentSource } from "./script-code.js";
|
|
36
37
|
import { serializeNode } from "./serialize.js";
|
|
37
38
|
// Runtime factory imports stay below the public action-native surface. Their
|
|
@@ -284,6 +285,21 @@ function declaredScriptResultProperties(schema) {
|
|
|
284
285
|
}
|
|
285
286
|
return names;
|
|
286
287
|
}
|
|
288
|
+
/**
|
|
289
|
+
* What to read in a filter instead of `textResult`: each declared
|
|
290
|
+
* `result.<prop>`, plus `stringArrayResult` for a single text array. With no
|
|
291
|
+
* declared properties, the whole `result`, or a property once the script's
|
|
292
|
+
* outputs declare it.
|
|
293
|
+
*/
|
|
294
|
+
function scriptFilterReadHint(at, schema) {
|
|
295
|
+
const declared = declaredScriptResultProperties(schema);
|
|
296
|
+
const reads = declared === undefined ? [] : [...declared].map((p) => `${at}.result${memberPath(p)}`);
|
|
297
|
+
if (scriptSchemaIsSingleStringArray(schema))
|
|
298
|
+
reads.push(`${at}.stringArrayResult`);
|
|
299
|
+
if (reads.length > 0)
|
|
300
|
+
return `Read ${reads.join(" or ")} instead.`;
|
|
301
|
+
return `Read ${at}.result instead, or add the value to the script's outputs and read it under ${at}.result.`;
|
|
302
|
+
}
|
|
287
303
|
/**
|
|
288
304
|
* A script's declared outputs are read under `result`. A bare
|
|
289
305
|
* `ctx.actions.<script>.<name>` would compile to a `refs["<name>"]` key the
|
|
@@ -293,32 +309,47 @@ function declaredScriptResultProperties(schema) {
|
|
|
293
309
|
* `numberArrayResult`, and `result.<prop>`. `Text Result` / `Result` /
|
|
294
310
|
* `Text List Result` are refs-map keys, not names someone authors (#1656).
|
|
295
311
|
*/
|
|
296
|
-
function assertKnownScriptOutput(name, taskRefKey, schema,
|
|
312
|
+
function assertKnownScriptOutput(name, taskRefKey, schema, undeclared) {
|
|
313
|
+
const at = scriptActionAccess(taskRefKey);
|
|
314
|
+
const task = `executeScript${taskRefKey === undefined ? "" : ` task "${taskRefKey}"`}`;
|
|
315
|
+
// On a filter value, the platform refuses to publish the short
|
|
316
|
+
// `task.<id>.Text Result` reference build writes for `textResult` ("has a
|
|
317
|
+
// value reference that is no longer valid"), whether or not the script
|
|
318
|
+
// declares outputs. A switch condition's left side doesn't reach here (see
|
|
319
|
+
// rewriteTaskOutputRefs). Checked live on the EDK org (#1725, #2221).
|
|
320
|
+
if (name === "textResult" && undeclared === "unsafeOnly") {
|
|
321
|
+
throw new EntityTfError(`${task}: ${at}.textResult can't be read as a filter value; the platform rejects it when the automation is published. ` +
|
|
322
|
+
scriptFilterReadHint(at, schema));
|
|
323
|
+
}
|
|
297
324
|
if (name === "result" || name === "textResult" || EXECUTE_SCRIPT_CONTRACT_OUTPUT_NAMES.has(name))
|
|
298
325
|
return;
|
|
299
326
|
if (name.startsWith("result.")) {
|
|
300
|
-
|
|
301
|
-
// whose script does not declare the property stays a typed envelope on the
|
|
302
|
-
// task `.id` (#1151), which to-tf emits with a diagnostic.
|
|
303
|
-
if (!checkDeclaredResult)
|
|
327
|
+
if (undeclared === "allow")
|
|
304
328
|
return;
|
|
305
329
|
const declared = declaredScriptResultProperties(schema);
|
|
306
|
-
const
|
|
307
|
-
if (declared === undefined || declared.has(
|
|
330
|
+
const output = name.slice("result.".length);
|
|
331
|
+
if (declared === undefined || declared.has(output.split(".")[0] ?? ""))
|
|
308
332
|
return;
|
|
309
333
|
const listed = [...declared].join(", ");
|
|
310
|
-
|
|
311
|
-
|
|
334
|
+
const reads = [...declared].map((p) => `${at}.result${memberPath(p)}`);
|
|
335
|
+
if (scriptSchemaIsSingleStringArray(schema))
|
|
336
|
+
reads.push(`${at}.stringArrayResult`);
|
|
337
|
+
throw new EntityTfError(`${task} has no output "${name}"; declared result properties are ${listed === "" ? "(none)" : listed}.` +
|
|
338
|
+
(undeclared === "unsafeOnly"
|
|
339
|
+
? ` Read a declared output${reads.length > 0 ? ` (${reads.join(" or ")})` : ""}, add ${JSON.stringify(output)} to the script's outputs, ` +
|
|
340
|
+
`or keep a pulled reference the live schema doesn't declare with unsafeScriptOutput(${at}, ${JSON.stringify(output)}) ` +
|
|
341
|
+
`(the platform won't publish the automation while a filter reads it).`
|
|
342
|
+
: ""));
|
|
312
343
|
}
|
|
313
|
-
//
|
|
314
|
-
//
|
|
344
|
+
// A bare name is not a `result.<prop>` read (an undeclared `result.<name>` is
|
|
345
|
+
// handled above). Suggest only declared reads: an undeclared one reads
|
|
346
|
+
// nothing at runtime (#1725).
|
|
315
347
|
const declared = declaredScriptResultProperties(schema);
|
|
316
348
|
const missing = declared !== undefined && !declared.has(name.split(".")[0] ?? "");
|
|
317
|
-
const
|
|
318
|
-
const uses = missing ? [...declared].map((p) => `${at}.result.${p}`) : [`${at}.result.${name}`];
|
|
349
|
+
const uses = missing ? [...declared].map((p) => `${at}.result${memberPath(p)}`) : [`${at}.result${memberPath(name)}`];
|
|
319
350
|
if ((missing || !name.includes(".")) && scriptSchemaIsSingleStringArray(schema))
|
|
320
351
|
uses.push(`${at}.stringArrayResult`);
|
|
321
|
-
throw new EntityTfError(
|
|
352
|
+
throw new EntityTfError(`${task} has no output "${name}"; ` +
|
|
322
353
|
`script outputs are read under result` +
|
|
323
354
|
(missing ? ` and the declared result properties are ${declared.size === 0 ? "(none)" : [...declared].join(", ")}` : "") +
|
|
324
355
|
(uses.length > 0 ? `. Use ${uses.join(" or ")}.` : "."));
|
|
@@ -351,7 +382,7 @@ function assertKnownScriptOutput(name, taskRefKey, schema, checkDeclaredResult)
|
|
|
351
382
|
* - single-scalar-output tasks (see `OUTPUT_KEY_WIRE_NAME`): `output` →
|
|
352
383
|
* the platform's actual output name for that task kind.
|
|
353
384
|
*/
|
|
354
|
-
function rewriteForwardTaskRefName(taskKey, name, taskRefKey, schema,
|
|
385
|
+
function rewriteForwardTaskRefName(taskKey, name, taskRefKey, schema, undeclaredScriptResult = "reject", apiResponseType) {
|
|
355
386
|
if (taskKey === "findRelatedRecords" && FIND_RELATED_RECORDS_COUNT_REF_NAMES.has(name.split(".")[0])) {
|
|
356
387
|
throw findRelatedRecordsTotalCountError(taskRefKey);
|
|
357
388
|
}
|
|
@@ -370,7 +401,7 @@ function rewriteForwardTaskRefName(taskKey, name, taskRefKey, schema, checkDecla
|
|
|
370
401
|
return USER_SEARCH_REF_WIRE_NAMES[name] ?? name;
|
|
371
402
|
}
|
|
372
403
|
if (taskKey === "executeScript") {
|
|
373
|
-
assertKnownScriptOutput(name, taskRefKey, schema,
|
|
404
|
+
assertKnownScriptOutput(name, taskRefKey, schema, undeclaredScriptResult);
|
|
374
405
|
if (name === "textResult")
|
|
375
406
|
return "Text Result";
|
|
376
407
|
}
|
|
@@ -416,14 +447,14 @@ export function rewriteCanonicalOutputRefName(taskKey, name, taskRefKey, schema,
|
|
|
416
447
|
}
|
|
417
448
|
// Workflow outputs are jsonencode envelopes on the task id, not refs-map indexes.
|
|
418
449
|
if (taskKey === "executeScript")
|
|
419
|
-
assertKnownScriptOutput(name, taskRefKey, schema,
|
|
450
|
+
assertKnownScriptOutput(name, taskRefKey, schema, "allow");
|
|
420
451
|
if (taskKey === "api" && name.startsWith("file.")) {
|
|
421
452
|
// apiRequest's file SUB-refs (.file.content / .contentType / .name) have no
|
|
422
453
|
// canonical service_tasks output name of their own — they resolve by the
|
|
423
454
|
// provider's refs-map DISPLAY label ("Content" / "Content Type" / "Name", via
|
|
424
455
|
// API_TASK_REF_WIRE_NAMES). Keep the base display rewrite. Top-level api
|
|
425
456
|
// outputs ARE contract names and ride the envelope as identity.
|
|
426
|
-
return rewriteForwardTaskRefName(taskKey, name, taskRefKey, schema,
|
|
457
|
+
return rewriteForwardTaskRefName(taskKey, name, taskRefKey, schema, "reject", apiResponseType);
|
|
427
458
|
}
|
|
428
459
|
if (taskKey === "api")
|
|
429
460
|
return apiTaskCanonicalOutputName(apiResponseType, name) ?? apiTaskMissingOutput(taskRefKey, name, apiResponseType);
|
|
@@ -512,10 +543,12 @@ function rewriteTaskOutputRefs(node, taskKindByRefKey, scriptSchemas,
|
|
|
512
543
|
// those positions.
|
|
513
544
|
canonical = false,
|
|
514
545
|
// Field assignments rebuild an undeclared result.* as the value envelope.
|
|
515
|
-
|
|
546
|
+
undeclaredScriptResult = "reject", apiResponseTypes = new Map(),
|
|
547
|
+
// The reference in a filter's `leftValue` (a switch condition's left side).
|
|
548
|
+
filterLeft = false) {
|
|
516
549
|
if (Array.isArray(node)) {
|
|
517
550
|
for (const item of node)
|
|
518
|
-
rewriteTaskOutputRefs(item, taskKindByRefKey, scriptSchemas, canonical,
|
|
551
|
+
rewriteTaskOutputRefs(item, taskKindByRefKey, scriptSchemas, canonical, undeclaredScriptResult, apiResponseTypes);
|
|
519
552
|
return;
|
|
520
553
|
}
|
|
521
554
|
if (node === null || typeof node !== "object")
|
|
@@ -541,22 +574,32 @@ checkDeclaredScriptResult = true, apiResponseTypes = new Map()) {
|
|
|
541
574
|
const kind = taskKindByRefKey.get(ref.taskRefKey);
|
|
542
575
|
const schema = scriptSchemas.get(ref.taskRefKey);
|
|
543
576
|
const apiResponseType = apiResponseTypes.get(ref.taskRefKey);
|
|
577
|
+
const undeclared = canonical ? "allow" : undeclaredScriptResult;
|
|
578
|
+
const { name, unsafe } = unwrapUnsafeScriptOutput(ref.name, kind, ref.taskRefKey, declaredScriptResultProperties(schema), undeclared);
|
|
544
579
|
ref.name = canonical
|
|
545
|
-
? rewriteCanonicalOutputRefName(kind,
|
|
546
|
-
: rewriteForwardTaskRefName(kind,
|
|
580
|
+
? rewriteCanonicalOutputRefName(kind, name, ref.taskRefKey, schema, apiResponseType)
|
|
581
|
+
: rewriteForwardTaskRefName(kind, name, ref.taskRefKey, schema, unsafe ? "allow" : undeclared, apiResponseType);
|
|
547
582
|
}
|
|
548
583
|
if (rec.type === "TASK" && typeof rec.taskRefKey === "string" && typeof rec.name === "string") {
|
|
549
584
|
// Filter `{type:"TASK"}` shapes never appear in a workflow OUTPUT subtree;
|
|
550
585
|
// keep the display rewrite (#1271's filter path) regardless of `canonical`.
|
|
551
|
-
|
|
586
|
+
const kind = taskKindByRefKey.get(rec.taskRefKey);
|
|
587
|
+
const schema = scriptSchemas.get(rec.taskRefKey);
|
|
588
|
+
const { name, unsafe } = unwrapUnsafeScriptOutput(rec.name, kind, rec.taskRefKey, declaredScriptResultProperties(schema), "unsafeOnly");
|
|
589
|
+
// A left side is written as the `refs["Text Result"]` envelope, which
|
|
590
|
+
// publishes for a script with or without a schema; only the value side's
|
|
591
|
+
// short `task.<id>.Text Result` is rejected (checked live, #2221).
|
|
592
|
+
const leftTextResult = filterLeft && kind === "executeScript" && name === "textResult";
|
|
593
|
+
rec.name = rewriteForwardTaskRefName(kind, name, rec.taskRefKey, schema, unsafe || leftTextResult ? "allow" : "unsafeOnly", apiResponseTypes.get(rec.taskRefKey));
|
|
552
594
|
}
|
|
553
595
|
for (const [key, v] of Object.entries(rec)) {
|
|
554
596
|
// A calc-engine mustache subtree (`calculationReference` → templateReference)
|
|
555
597
|
// keeps the display/forward rewrite even under an output, so its decode
|
|
556
598
|
// (decodeCalculationTaskMustache) stays idempotent.
|
|
557
599
|
const childCanonical = key === "calculationReference" ? false : canonical;
|
|
558
|
-
const childCheck = key === "workflowFields" ?
|
|
559
|
-
|
|
600
|
+
const childCheck = key === "workflowFields" ? "allow" : undeclaredScriptResult;
|
|
601
|
+
const childLeft = key === "leftValue" || (filterLeft && key === "value" && rec.type === "REFERENCE");
|
|
602
|
+
rewriteTaskOutputRefs(v, taskKindByRefKey, scriptSchemas, childCanonical, childCheck, apiResponseTypes, childLeft);
|
|
560
603
|
}
|
|
561
604
|
}
|
|
562
605
|
/**
|
|
@@ -814,11 +857,11 @@ function makeActionBuilder(state, mode = "root", item, loops = {}) {
|
|
|
814
857
|
// Deep copy: the rewrites below mutate in place, and `state.outputs` is
|
|
815
858
|
// shared by every build of this definition (#1536).
|
|
816
859
|
const outputs = state.outputs?.map((o) => structuredClone(o));
|
|
817
|
-
rewriteTaskOutputRefs(tasks, taskKindByRefKey, scriptSchemas, false,
|
|
860
|
+
rewriteTaskOutputRefs(tasks, taskKindByRefKey, scriptSchemas, false, "reject", apiResponseTypes);
|
|
818
861
|
// Workflow OUTPUTS emit the platform's CANONICAL output name (edk#835);
|
|
819
862
|
// task inputs/filters above stay on the display path (#1271 owns them).
|
|
820
863
|
if (outputs)
|
|
821
|
-
rewriteTaskOutputRefs(outputs, taskKindByRefKey, scriptSchemas, /* canonical */ true,
|
|
864
|
+
rewriteTaskOutputRefs(outputs, taskKindByRefKey, scriptSchemas, /* canonical */ true, "reject", apiResponseTypes);
|
|
822
865
|
// Trigger reference names are NOT canonicalized: the authored name is
|
|
823
866
|
// the name, everywhere in EDK. (Mobius canonicalizes reference names in
|
|
824
867
|
// ITS storage — `ValueReference.ofTriggerReference` — but on the tf
|
|
@@ -34,6 +34,7 @@ import { camelCase } from "../../../../pull/util.js";
|
|
|
34
34
|
import { sdkPackageSpecifier } from "../../../internal/sdk-package.js";
|
|
35
35
|
import { safeIdentifier } from "../../../internal/safe-identifier.js";
|
|
36
36
|
import { isRefExpr } from "../../shared/filters/ast.js";
|
|
37
|
+
import { isTextOptionValue } from "../../shared/filters/index.js";
|
|
37
38
|
import { printFilter as printCanonicalFilter } from "../../shared/filters/print.js";
|
|
38
39
|
import { isUuid, sanitizeName, tfLabelToTsLabel } from "../../../engine/tf/labels.js";
|
|
39
40
|
import { UNRESOLVED_FIELD_MARKER } from "../../shared/ref.js";
|
|
@@ -1597,6 +1598,11 @@ function printArgValue(name, value, state, indent, refCtx) {
|
|
|
1597
1598
|
const fn = trackFactory("requiredSecret", state);
|
|
1598
1599
|
return `${fn}(${quote(value.variable)})`;
|
|
1599
1600
|
}
|
|
1601
|
+
// A Dropdown or Multi-Select assignment's option (#1733).
|
|
1602
|
+
if (isTextOptionValue(value)) {
|
|
1603
|
+
state.imports.filterOps.add("textOption");
|
|
1604
|
+
return `filter.textOption(${quote(value.value)})`;
|
|
1605
|
+
}
|
|
1600
1606
|
if (isRefExpr(value))
|
|
1601
1607
|
return printRef(value, state, refCtx);
|
|
1602
1608
|
if (isFilter(value))
|
|
@@ -1674,23 +1680,32 @@ function printRef(ref, state, refCtx) {
|
|
|
1674
1680
|
if (state.forkJoinBranchTaskRefKeys.has(ref.task) &&
|
|
1675
1681
|
!refCtx.currentForkJoinBranchTaskRefKeys?.has(ref.task) &&
|
|
1676
1682
|
!state.topLevelTaskRefKeys.has(ref.task)) {
|
|
1677
|
-
const
|
|
1678
|
-
|
|
1683
|
+
const receiver = `(${ctxName}.actions as any /* TODO: "${ref.task}" is inside a forkJoin branch, not reachable from here */)${safeMember(ref.task)}`;
|
|
1684
|
+
// Same marker as below for an undeclared script output: build rejects
|
|
1685
|
+
// a plain `result.<name>` in a filter, cast receiver or not (#1725).
|
|
1686
|
+
if (ref.path[0] === "result" && ref.undeclaredScriptOutput === true) {
|
|
1687
|
+
return `${trackFactory("unsafeScriptOutput", state)}(${receiver}, ${quote(ref.path.slice(1).join("."))})`;
|
|
1688
|
+
}
|
|
1689
|
+
return receiver + ref.path.map(safeMember).join("");
|
|
1679
1690
|
}
|
|
1680
1691
|
// `result.<prop>` segments are output-schema property names — typed,
|
|
1681
1692
|
// legitimate — so print them with plain dot/bracket access; only record
|
|
1682
1693
|
// paths keep the unresolved-key as-any heuristic.
|
|
1683
1694
|
if (ref.path[0] === "result") {
|
|
1695
|
+
// The live automation reads a script output its schema doesn't
|
|
1696
|
+
// declare; build accepts that only through this marker (#1725).
|
|
1684
1697
|
if (ref.undeclaredScriptOutput === true) {
|
|
1685
|
-
|
|
1686
|
-
return `(${ctxName}.actions${safeMember(ref.task)}${safeMember(result)} as any /* TODO: live automation references an execute-script output absent from its output schema */)` +
|
|
1687
|
-
rest.map(safeMember).join("");
|
|
1698
|
+
return `${trackFactory("unsafeScriptOutput", state)}(${ctxName}.actions${safeMember(ref.task)}, ${quote(ref.path.slice(1).join("."))})`;
|
|
1688
1699
|
}
|
|
1689
1700
|
return `${ctxName}.actions${safeMember(ref.task)}` + ref.path.map(safeMember).join("");
|
|
1690
1701
|
}
|
|
1691
1702
|
return printPathAccess(`${ctxName}.actions${safeMember(ref.task)}`, ref.path);
|
|
1692
1703
|
}
|
|
1693
1704
|
case "triggerRef": {
|
|
1705
|
+
// The output type has no such property and no index signature (#2643).
|
|
1706
|
+
if (ref.undeclaredHead === true) {
|
|
1707
|
+
return `(${ctxName}.trigger as any /* TODO: trigger ref the trigger output doesn't declare */)${ref.path.map(safeMember).join("")}`;
|
|
1708
|
+
}
|
|
1694
1709
|
// A bare `record.<unresolved-id>` path (no trailing sub-path) — the
|
|
1695
1710
|
// exact shape `unresolvedField` round-trips through the wire. Anything
|
|
1696
1711
|
// with a trailing sub-path (e.g. `.label`) falls back to the generic
|
|
@@ -1936,6 +1951,7 @@ function printFilter(filter, state, refCtx = DEFAULT_CTX) {
|
|
|
1936
1951
|
reference: (reference) => printFilterReference(reference, state, refCtx),
|
|
1937
1952
|
quote,
|
|
1938
1953
|
used: (helper) => state.imports.filterOps.add(helper),
|
|
1954
|
+
user: (email) => `${trackFactory("userRef", state)}(${quote(email)})`,
|
|
1939
1955
|
});
|
|
1940
1956
|
}
|
|
1941
1957
|
/**
|
|
@@ -42,6 +42,14 @@ interface DecodeContext {
|
|
|
42
42
|
}>;
|
|
43
43
|
/** Stage key -> name, from the app block's `stages` list; see `stageFilterName`. */
|
|
44
44
|
readonly stagesByKey: ReadonlyMap<string, string>;
|
|
45
|
+
/**
|
|
46
|
+
* The owner's renamed Title / Handle / Status (`title_field_name`,
|
|
47
|
+
* `id_field_name`, `status_field_name`). A trigger ref by that display name
|
|
48
|
+
* decodes to `record.title` / `record.id` / `record.status` (#2650, #2671 S1).
|
|
49
|
+
*/
|
|
50
|
+
readonly titleFieldName?: string;
|
|
51
|
+
readonly idFieldName?: string;
|
|
52
|
+
readonly statusFieldName?: string;
|
|
45
53
|
readonly foreignFieldRefsById?: ReadonlyMap<string, {
|
|
46
54
|
readonly ownerRefName: string;
|
|
47
55
|
readonly fieldKey: string;
|
|
@@ -59,13 +67,15 @@ interface DecodeContext {
|
|
|
59
67
|
readonly ownerNamespace?: string;
|
|
60
68
|
readonly fieldName?: string;
|
|
61
69
|
readonly fieldType?: string;
|
|
70
|
+
readonly options?: readonly string[];
|
|
71
|
+
readonly systemStage?: true;
|
|
62
72
|
}>;
|
|
63
73
|
readonly foreignTableRefsById?: ReadonlyMap<string, {
|
|
64
74
|
readonly tableRefName: string;
|
|
65
75
|
readonly name: string;
|
|
66
76
|
}>;
|
|
67
77
|
readonly foreignFileReaderRefsById?: FromTfContext["foreignFileReaderRefsById"];
|
|
68
|
-
readonly
|
|
78
|
+
readonly picklistOptionsByField?: ReadonlyMap<string, ReadonlyMap<string, string>>;
|
|
69
79
|
readonly fieldNamesByOwnerRefName?: ReadonlyMap<string, ReadonlyMap<string, string>>;
|
|
70
80
|
/** Task resource address → target aspect refName (from `object_id`). */
|
|
71
81
|
readonly taskTargetOwnerRefNameByAddress?: ReadonlyMap<string, string>;
|
|
@@ -84,6 +94,8 @@ interface DecodeContext {
|
|
|
84
94
|
};
|
|
85
95
|
/** Names of static group recipients org.ts doesn't carry yet (edk#2241), for one pull diagnostic each. */
|
|
86
96
|
readonly groupsMissingFromOrg?: Set<string>;
|
|
97
|
+
/** Filter option ids that are not one of the compared field's current options (#2568), one pull warning each. */
|
|
98
|
+
readonly optionIdWarnings?: Set<string>;
|
|
87
99
|
/** Says what a task id that matches none of this automation's tasks points to (#2054). */
|
|
88
100
|
readonly describeUnresolvedTask?: (taskId: string) => string;
|
|
89
101
|
/** This automation's platform id, from its import block. */
|
|
@@ -99,8 +111,13 @@ interface DecodeContext {
|
|
|
99
111
|
export declare const RECORD_SEARCH_CALCULATION_REF_NAME_TO_TS: Readonly<Record<string, readonly string[]>>;
|
|
100
112
|
export declare const AI_SEARCH_TABLE_TASK_REF_SEGMENT_TO_TS: Readonly<Record<string, string>>;
|
|
101
113
|
export declare const TABLE_RECORDS_SEARCH_TASK_REF_SEGMENT_TO_TS: Readonly<Record<string, string>>;
|
|
102
|
-
/**
|
|
103
|
-
|
|
114
|
+
/**
|
|
115
|
+
* Option ids `filterOptionLabel` prints as labels at every filter comparison
|
|
116
|
+
* that holds them. The export still holds the id. An id that any comparison
|
|
117
|
+
* keeps raw, on another field or a deleted option, is left out, so its
|
|
118
|
+
* unresolved-UUID warning is not muted (#2568).
|
|
119
|
+
*/
|
|
120
|
+
export declare function filterOptionIdsPrintedAsLabels(doc: TfDocument, optionsByField: ReadonlyMap<string, ReadonlyMap<string, string>> | undefined): ReadonlySet<string>;
|
|
104
121
|
export declare function inferredPublishOutputType(value: TfValue, ctx: DecodeContext): {
|
|
105
122
|
readonly fieldType: string;
|
|
106
123
|
readonly multiple: boolean;
|
|
@@ -194,12 +211,14 @@ export interface AutomationFromTfContext {
|
|
|
194
211
|
readonly ownerNamespace?: string;
|
|
195
212
|
readonly fieldName?: string;
|
|
196
213
|
readonly fieldType?: string;
|
|
214
|
+
readonly options?: readonly string[];
|
|
215
|
+
readonly systemStage?: true;
|
|
197
216
|
}>;
|
|
198
217
|
readonly foreignTableRefsById?: ReadonlyMap<string, {
|
|
199
218
|
readonly tableRefName: string;
|
|
200
219
|
readonly name: string;
|
|
201
220
|
}>;
|
|
202
|
-
readonly
|
|
221
|
+
readonly picklistOptionsByField?: ReadonlyMap<string, ReadonlyMap<string, string>>;
|
|
203
222
|
readonly fieldNamesByOwnerRefName?: ReadonlyMap<string, ReadonlyMap<string, string>>;
|
|
204
223
|
readonly foreignAppRefNames?: ReadonlyMap<string, string>;
|
|
205
224
|
readonly foreignElementRefNames?: ReadonlyMap<string, string>;
|
|
@@ -229,8 +248,10 @@ export declare function automationFromTf(doc: TfDocument, automationLabel: strin
|
|
|
229
248
|
readonly ownerNamespace?: string;
|
|
230
249
|
readonly fieldName?: string;
|
|
231
250
|
readonly fieldType?: string;
|
|
251
|
+
readonly options?: readonly string[];
|
|
252
|
+
readonly systemStage?: true;
|
|
232
253
|
}>, foreignTableRefsById?: ReadonlyMap<string, {
|
|
233
254
|
readonly tableRefName: string;
|
|
234
255
|
readonly name: string;
|
|
235
|
-
}>,
|
|
256
|
+
}>, picklistOptionsByField?: ReadonlyMap<string, ReadonlyMap<string, string>>, fieldNamesByOwnerRefName?: ReadonlyMap<string, ReadonlyMap<string, string>>, foreignAppRefNames?: ReadonlyMap<string, string>, foreignElementRefNames?: ReadonlyMap<string, string>, procedureKeysByDiscriminator?: ReadonlyMap<string, string>, foreignTaskRefNames?: ReadonlyMap<string, string>, groupKeysByName?: ReadonlyMap<string, string>, serviceAccountsById?: FromTfContext["serviceAccountsById"], foreignFileReaderRefsById?: FromTfContext["foreignFileReaderRefsById"], foreignAppRefNamespaces?: ReadonlyMap<string, string>): AutomationFromTfResult;
|
|
236
257
|
export {};
|