@elementumai/edk 0.13.3 → 0.14.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.
Files changed (140) hide show
  1. package/dist-sdk/src/catalog/factories.d.ts +4 -2
  2. package/dist-sdk/src/catalog/factories.js +3 -1
  3. package/dist-sdk/src/catalog/from-authoring.d.ts +8 -3
  4. package/dist-sdk/src/catalog/from-authoring.js +21 -8
  5. package/dist-sdk/src/engine/build/context.d.ts +17 -0
  6. package/dist-sdk/src/engine/coverage-gaps.d.ts +13 -0
  7. package/dist-sdk/src/engine/coverage-gaps.js +21 -0
  8. package/dist-sdk/src/engine/pull/context.d.ts +57 -1
  9. package/dist-sdk/src/engine/pull/context.js +9 -1
  10. package/dist-sdk/src/engine/pull/pulled-roots.d.ts +14 -1
  11. package/dist-sdk/src/engine/pull/pulled-roots.js +23 -3
  12. package/dist-sdk/src/engine/pull/ref-only.d.ts +6 -1
  13. package/dist-sdk/src/engine/pull/ref-only.js +4 -1
  14. package/dist-sdk/src/engine/pull/stream-root.d.ts +17 -1
  15. package/dist-sdk/src/engine/pull/stream-root.js +57 -4
  16. package/dist-sdk/src/engine/tf/index.d.ts +1 -0
  17. package/dist-sdk/src/engine/tf/index.js +1 -0
  18. package/dist-sdk/src/engine/tf/jsonencode.d.ts +19 -0
  19. package/dist-sdk/src/engine/tf/jsonencode.js +49 -0
  20. package/dist-sdk/src/engine/validation.d.ts +36 -1
  21. package/dist-sdk/src/engine/validation.js +56 -2
  22. package/dist-sdk/src/engine/workspace/loader.d.ts +6 -0
  23. package/dist-sdk/src/engine/workspace/loader.js +87 -2
  24. package/dist-sdk/src/entities/access-policy/from-tf.d.ts +7 -0
  25. package/dist-sdk/src/entities/access-policy/from-tf.js +58 -17
  26. package/dist-sdk/src/entities/access-policy/to-tf.d.ts +3 -1
  27. package/dist-sdk/src/entities/access-policy/to-tf.js +1 -1
  28. package/dist-sdk/src/entities/agent/build.d.ts +15 -0
  29. package/dist-sdk/src/entities/agent/build.js +139 -16
  30. package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.d.ts +3 -3
  31. package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.js +39 -25
  32. package/dist-sdk/src/entities/agent/module.js +95 -3
  33. package/dist-sdk/src/entities/agent/to-tf.js +6 -4
  34. package/dist-sdk/src/entities/agent-evaluation/from-tf.d.ts +7 -0
  35. package/dist-sdk/src/entities/agent-evaluation/from-tf.js +14 -5
  36. package/dist-sdk/src/entities/agent-evaluation/module.js +4 -2
  37. package/dist-sdk/src/entities/agent-tool/from-tf.d.ts +11 -2
  38. package/dist-sdk/src/entities/agent-tool/from-tf.js +38 -40
  39. package/dist-sdk/src/entities/agent-tool/to-tf.js +12 -5
  40. package/dist-sdk/src/entities/app/build.d.ts +1 -1
  41. package/dist-sdk/src/entities/app/index.d.ts +1 -1
  42. package/dist-sdk/src/entities/automation/approval-trigger-refs.d.ts +20 -0
  43. package/dist-sdk/src/entities/automation/approval-trigger-refs.js +83 -0
  44. package/dist-sdk/src/entities/automation/build.d.ts +75 -42
  45. package/dist-sdk/src/entities/automation/build.js +18 -8
  46. package/dist-sdk/src/entities/automation/deserializer/ast.d.ts +14 -2
  47. package/dist-sdk/src/entities/automation/deserializer/print-automation.d.ts +9 -0
  48. package/dist-sdk/src/entities/automation/deserializer/print-automation.js +64 -12
  49. package/dist-sdk/src/entities/automation/from-tf.d.ts +53 -0
  50. package/dist-sdk/src/entities/automation/from-tf.js +579 -106
  51. package/dist-sdk/src/entities/automation/index.d.ts +2 -2
  52. package/dist-sdk/src/entities/automation/index.js +1 -1
  53. package/dist-sdk/src/entities/automation/lookup-owner.d.ts +23 -0
  54. package/dist-sdk/src/entities/automation/lookup-owner.js +27 -0
  55. package/dist-sdk/src/entities/automation/module.js +265 -26
  56. package/dist-sdk/src/entities/automation/operators.d.ts +6 -2
  57. package/dist-sdk/src/entities/automation/operators.js +0 -2
  58. package/dist-sdk/src/entities/automation/task-output-labels.d.ts +8 -0
  59. package/dist-sdk/src/entities/automation/task-output-labels.js +11 -0
  60. package/dist-sdk/src/entities/automation/tasks.d.ts +37 -2
  61. package/dist-sdk/src/entities/automation/tasks.js +38 -1
  62. package/dist-sdk/src/entities/automation/to-tf.d.ts +8 -0
  63. package/dist-sdk/src/entities/automation/to-tf.js +576 -52
  64. package/dist-sdk/src/entities/automation/triggers.d.ts +47 -1
  65. package/dist-sdk/src/entities/automation/unsafe-script-output.d.ts +10 -5
  66. package/dist-sdk/src/entities/automation/unsafe-script-output.js +10 -5
  67. package/dist-sdk/src/entities/chart/to-tf.js +18 -5
  68. package/dist-sdk/src/entities/dashboard/from-tf.js +45 -11
  69. package/dist-sdk/src/entities/dashboard-widget-order/order.d.ts +5 -3
  70. package/dist-sdk/src/entities/dashboard-widget-order/order.js +6 -4
  71. package/dist-sdk/src/entities/datamine/from-tf.js +10 -3
  72. package/dist-sdk/src/entities/dynamic-layout/build.d.ts +38 -11
  73. package/dist-sdk/src/entities/dynamic-layout/from-tf.js +35 -7
  74. package/dist-sdk/src/entities/dynamic-layout/to-tf.js +101 -9
  75. package/dist-sdk/src/entities/element/build.d.ts +4 -1
  76. package/dist-sdk/src/entities/element/build.js +3 -4
  77. package/dist-sdk/src/entities/element/index.d.ts +1 -1
  78. package/dist-sdk/src/entities/field/from-tf.js +8 -1
  79. package/dist-sdk/src/entities/field/to-tf.d.ts +29 -2
  80. package/dist-sdk/src/entities/field/to-tf.js +106 -7
  81. package/dist-sdk/src/entities/phone-service/from-tf.d.ts +7 -0
  82. package/dist-sdk/src/entities/phone-service/from-tf.js +15 -7
  83. package/dist-sdk/src/entities/phone-service/module.js +4 -2
  84. package/dist-sdk/src/entities/portal/to-tf.d.ts +1 -1
  85. package/dist-sdk/src/entities/portal/to-tf.js +61 -2
  86. package/dist-sdk/src/entities/record-create-form/from-tf.js +3 -1
  87. package/dist-sdk/src/entities/relationship/from-tf.js +34 -4
  88. package/dist-sdk/src/entities/relationship/to-tf.js +24 -6
  89. package/dist-sdk/src/entities/role/from-tf.js +3 -1
  90. package/dist-sdk/src/entities/search-table/from-tf.d.ts +3 -1
  91. package/dist-sdk/src/entities/search-table/from-tf.js +6 -3
  92. package/dist-sdk/src/entities/search-table/module.js +18 -2
  93. package/dist-sdk/src/entities/search-table/to-tf.js +10 -16
  94. package/dist-sdk/src/entities/shared/aspect-target-from-tf.js +6 -1
  95. package/dist-sdk/src/entities/shared/filters/ast.d.ts +6 -0
  96. package/dist-sdk/src/entities/shared/filters/index.d.ts +21 -4
  97. package/dist-sdk/src/entities/shared/filters/index.js +27 -3
  98. package/dist-sdk/src/entities/shared/filters/print.js +23 -7
  99. package/dist-sdk/src/entities/shared/filters/tf-codec.d.ts +24 -0
  100. package/dist-sdk/src/entities/shared/filters/tf-codec.js +98 -3
  101. package/dist-sdk/src/entities/shared/filters/types.d.ts +8 -1
  102. package/dist-sdk/src/entities/shared/run-automation-requirement.d.ts +15 -0
  103. package/dist-sdk/src/entities/shared/run-automation-requirement.js +28 -0
  104. package/dist-sdk/src/entities/shared/search-table-address.d.ts +17 -0
  105. package/dist-sdk/src/entities/shared/search-table-address.js +24 -0
  106. package/dist-sdk/src/entities/shared/skip-release.d.ts +49 -0
  107. package/dist-sdk/src/entities/shared/skip-release.js +74 -0
  108. package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.d.ts +3 -3
  109. package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.js +11 -5
  110. package/dist-sdk/src/entities/skill/module.js +3 -25
  111. package/dist-sdk/src/entities/skill-tool/from-tf.d.ts +4 -2
  112. package/dist-sdk/src/entities/skill-tool/from-tf.js +28 -27
  113. package/dist-sdk/src/entities/skill-tool/to-tf.js +12 -5
  114. package/dist-sdk/src/entities/skill-tool/types.d.ts +1 -0
  115. package/dist-sdk/src/entities/skill-tool/types.js +2 -1
  116. package/dist-sdk/src/entities/table/catalog.d.ts +16 -0
  117. package/dist-sdk/src/entities/table/catalog.js +44 -2
  118. package/dist-sdk/src/entities/table/from-tf.js +30 -4
  119. package/dist-sdk/src/entities/table/keys.d.ts +27 -0
  120. package/dist-sdk/src/entities/table/keys.js +46 -0
  121. package/dist-sdk/src/entities/table/to-tf.js +2 -2
  122. package/dist-sdk/src/entities/view/agent-view-layout-from-tf.d.ts +12 -1
  123. package/dist-sdk/src/entities/view/agent-view-layout-from-tf.js +9 -4
  124. package/dist-sdk/src/entities/view/agent-view-layout-to-tf.js +215 -10
  125. package/dist-sdk/src/entities/view/agent-view-layout.d.ts +10 -4
  126. package/dist-sdk/src/entities/view/custom-view-runtime-rules.d.ts +43 -0
  127. package/dist-sdk/src/entities/view/custom-view-runtime-rules.js +285 -0
  128. package/dist-sdk/src/entities/view/custom-view-validate.d.ts +3 -1
  129. package/dist-sdk/src/entities/view/custom-view-validate.js +24 -5
  130. package/dist-sdk/src/entities/view/from-tf.js +14 -1
  131. package/dist-sdk/src/entities/widget/from-tf.js +14 -7
  132. package/dist-sdk/src/entities/widget/to-tf.js +9 -6
  133. package/dist-sdk/src/generated/ragnarok/ragnarok-spec.d.ts +4 -2
  134. package/dist-sdk/src/generated/ragnarok/ragnarok-spec.js +2 -2
  135. package/dist-sdk/src/graph/index.d.ts +14 -1
  136. package/dist-sdk/src/graph/index.js +2 -0
  137. package/dist-sdk/src/graph/resource-types.d.ts +2 -0
  138. package/dist-sdk/src/graph/resource-types.js +3 -0
  139. package/dist-sdk/src/graph/types.d.ts +105 -0
  140. package/package.json +1 -1
@@ -1044,8 +1044,12 @@ export interface ApprovalChainOptions {
1044
1044
  readonly record: RecordReference;
1045
1045
  /** User requesting the approval. Use a USER_ID value reference. */
1046
1046
  readonly requester: ValueOrRef<unknown>;
1047
- /** Optional dynamic approvers. Each entry must resolve to a USER_ID. */
1048
- readonly approvers?: readonly ValueOrRef<unknown>[];
1047
+ /**
1048
+ * Optional dynamic approvers, one per dynamic approver slot of the process,
1049
+ * in order. A plain entry is a user: a USER_ID value reference (or a
1050
+ * variable holding a user id). Wrap a group in `groupApprover(...)`.
1051
+ */
1052
+ readonly approvers?: readonly (ValueOrRef<unknown> | ApprovalGroupApprover)[];
1049
1053
  readonly reason?: ValueOrRef<unknown>;
1050
1054
  readonly summary?: ValueOrRef<unknown>;
1051
1055
  /**
@@ -1056,6 +1060,37 @@ export interface ApprovalChainOptions {
1056
1060
  */
1057
1061
  readonly tag?: ValueOrRef<unknown>;
1058
1062
  }
1063
+ /**
1064
+ * A group in a dynamic approver slot of `approvalChain`, with how many of its
1065
+ * members must approve or deny. Build it with `groupApprover(...)`.
1066
+ */
1067
+ export interface ApprovalGroupApprover {
1068
+ readonly kind: "groupApprover";
1069
+ /** The group: a GROUP_ID value reference (a group field's `.id`), a variable holding a group id, or an `org.groups` token. */
1070
+ readonly group: ValueOrRef<string> | GroupRef | Ref<unknown, string>;
1071
+ readonly approvalsRequired: number;
1072
+ readonly denialsRequired: number;
1073
+ }
1074
+ /**
1075
+ * What `groupApprover` accepts as its group: an `org.groups` token, a group
1076
+ * id, a reference whose value is a string (a group field's `.id`), or a
1077
+ * variable (its reference is untyped). A reference to anything else, such as
1078
+ * the group field itself (`record.team` instead of `record.team.id`), is a
1079
+ * type error.
1080
+ */
1081
+ export type GroupApproverValue<G> = G extends GroupRef ? G : G extends string ? G : G extends Ref<infer T, string> ? (unknown extends T ? G : [T] extends [string] ? G : GroupApproverArgumentError) : GroupApproverArgumentError;
1082
+ /** The type a wrong `groupApprover` argument is checked against, so the compiler error says what to pass. */
1083
+ export interface GroupApproverArgumentError {
1084
+ readonly "groupApprover takes a group: an org.groups token, a Group field's .id (record.<field>.id, not record.<field>), a group id string, or a variable": never;
1085
+ }
1086
+ /**
1087
+ * A group approves in an `approvalChain` dynamic approver slot:
1088
+ * `groupApprover(ctx.item.approvalGroup.id, { approvalsRequired: 1, denialsRequired: 1 })`.
1089
+ */
1090
+ export declare function groupApprover<G>(group: G & GroupApproverValue<G>, options: {
1091
+ readonly approvalsRequired: number;
1092
+ readonly denialsRequired: number;
1093
+ }): ApprovalGroupApprover;
1059
1094
  export declare function approvalChain(opts: ApprovalChainOptions): ActionDef<Empty>;
1060
1095
  export type ApprovalChainTemplateOptions = ApprovalChainOptions;
1061
1096
  export declare function approvalChainTemplate(opts: ApprovalChainTemplateOptions): ActionDef<Empty>;
@@ -927,6 +927,43 @@ export function bulkExcel(opts) {
927
927
  },
928
928
  };
929
929
  }
930
+ /**
931
+ * A group approves in an `approvalChain` dynamic approver slot:
932
+ * `groupApprover(ctx.item.approvalGroup.id, { approvalsRequired: 1, denialsRequired: 1 })`.
933
+ */
934
+ export function groupApprover(group, options) {
935
+ if (group === undefined || group === null)
936
+ throw new Error("groupApprover requires a group.");
937
+ for (const [name, value] of [["approvalsRequired", options.approvalsRequired], ["denialsRequired", options.denialsRequired]]) {
938
+ if (!Number.isInteger(value) || value < 0) {
939
+ throw new Error(`groupApprover: ${name} must be an integer >= 0 (got ${String(value)}).`);
940
+ }
941
+ }
942
+ return {
943
+ kind: "groupApprover",
944
+ group: group,
945
+ approvalsRequired: options.approvalsRequired,
946
+ denialsRequired: options.denialsRequired,
947
+ };
948
+ }
949
+ function isGroupApprover(value) {
950
+ return !isRef(value) && typeof value === "object" && value !== null && value.kind === "groupApprover";
951
+ }
952
+ /**
953
+ * The approvers config: `approverReferences` while every slot is a user (the
954
+ * HCL `approver_references`), otherwise `approvers`, one `{ user }` or
955
+ * `{ group, approvalsRequired, denialsRequired }` per slot, the only form that
956
+ * keeps a group (edk#3163). Export makes the same choice.
957
+ */
958
+ function approversConfig(approvers) {
959
+ if (!approvers.some(isGroupApprover))
960
+ return { approverReferences: approvers.map((a) => serializeValueOrRef(a)) };
961
+ return {
962
+ approvers: approvers.map((a) => isGroupApprover(a)
963
+ ? { group: serializeValueOrRef(a.group), approvalsRequired: a.approvalsRequired, denialsRequired: a.denialsRequired }
964
+ : { user: serializeValueOrRef(a) }),
965
+ };
966
+ }
930
967
  export function approvalChain(opts) {
931
968
  return {
932
969
  key: "approvalChain",
@@ -934,7 +971,7 @@ export function approvalChain(opts) {
934
971
  approvalProcessId: opts.approvalProcess,
935
972
  recordReference: serializeValueOrRef(opts.record),
936
973
  requesterReference: serializeValueOrRef(opts.requester),
937
- ...(opts.approvers !== undefined ? { approverReferences: opts.approvers.map((a) => serializeValueOrRef(a)) } : {}),
974
+ ...(opts.approvers !== undefined ? approversConfig(opts.approvers) : {}),
938
975
  ...(opts.reason !== undefined ? { reason: serializeValueOrRef(opts.reason) } : {}),
939
976
  ...(opts.summary !== undefined ? { summary: serializeValueOrRef(opts.summary) } : {}),
940
977
  ...(opts.tag !== undefined ? { tags: serializeValueOrRef(opts.tag) } : {}),
@@ -75,6 +75,10 @@ export interface AutomationToTfContext {
75
75
  readonly workspaceAspects?: ReadonlyMap<string, WorkspaceAspect>;
76
76
  /** See `ToTfContext.outOfScopeApps`. */
77
77
  readonly outOfScopeApps?: ReadonlyMap<string, ForeignRootIdentity>;
78
+ /** See `ToTfContext.outOfScopeElements`. */
79
+ readonly outOfScopeElements?: ReadonlyMap<string, ForeignRootIdentity>;
80
+ /** See `ToTfContext.catalogElementIdentities`. */
81
+ readonly catalogElementIdentities?: ReadonlyMap<string, ForeignRootIdentity>;
78
82
  /**
79
83
  * The build's shared `locals.tf` attrs map — mutated in place so a foreign
80
84
  * field crossing through {@link crossAppFieldToTf} can contribute its own
@@ -102,6 +106,10 @@ export interface AutomationToTfResult {
102
106
  * plus field mappings, and the script receives `{}` at runtime. Record
103
107
  * triggers' `ctx.trigger.record` and the `.record` of recordSearch,
104
108
  * createRecord and updateField carry the whole record (#1284, #1489).
109
+ * AI agent and email record attachments read the record's files from the
110
+ * whole record too: an on-demand record parameter or an explicit record ID
111
+ * fails there (#3069). A task's `.record`, Find Related Records' included,
112
+ * builds the whole record in an attachment.
105
113
  */
106
114
  export declare function recordIdFieldMappingFailures(entity: DeployableEntity, payload: object, address: string): ValidationFailure[];
107
115
  export declare function automationToTf(entity: DeployableEntity, ctx: AutomationToTfContext): AutomationToTfResult;