@elementumai/edk 0.8.2-alpha.5 → 0.9.2

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 (372) hide show
  1. package/README.md +18 -14
  2. package/dist-sdk/elementum-entity-client/clients/agents/models/agent-tool.d.ts +3 -3
  3. package/dist-sdk/elementum-entity-client/clients/aspects/models/index.d.ts +1 -1
  4. package/dist-sdk/elementum-entity-client/clients/aspects/models/picklist-config.d.ts +3 -11
  5. package/dist-sdk/elementum-entity-client/clients/automation/models/automation.d.ts +2 -10
  6. package/dist-sdk/elementum-entity-client/clients/skills/models/skill-tool.d.ts +1 -1
  7. package/dist-sdk/fs/entity.d.ts +2 -2
  8. package/dist-sdk/fs/entity.js +1 -1
  9. package/dist-sdk/pull/missing-report.d.ts +81 -0
  10. package/dist-sdk/pull/missing-report.js +52 -0
  11. package/dist-sdk/src/catalog/factories.d.ts +53 -19
  12. package/dist-sdk/src/catalog/factories.js +51 -12
  13. package/dist-sdk/src/catalog/from-authoring.js +13 -3
  14. package/dist-sdk/src/catalog/index.d.ts +2 -2
  15. package/dist-sdk/src/catalog/index.js +1 -1
  16. package/dist-sdk/src/catalog/org.js +1 -0
  17. package/dist-sdk/src/catalog/render.js +6 -0
  18. package/dist-sdk/src/catalog/token.js +7 -0
  19. package/dist-sdk/src/catalog/types.d.ts +34 -23
  20. package/dist-sdk/src/catalog/types.js +7 -4
  21. package/dist-sdk/src/core/app-to-ui.d.ts +6 -6
  22. package/dist-sdk/src/core/app-to-ui.js +7 -9
  23. package/dist-sdk/src/core/index.d.ts +1 -0
  24. package/dist-sdk/src/core/index.js +1 -0
  25. package/dist-sdk/src/core/platform-id.d.ts +11 -0
  26. package/dist-sdk/src/core/platform-id.js +8 -0
  27. package/dist-sdk/src/{entities/flow/activities/render-catalog.d.ts → core/render-tree.d.ts} +2 -2
  28. package/dist-sdk/src/{entities/flow/activities/render-catalog.js → core/render-tree.js} +6 -8
  29. package/dist-sdk/src/core/types/app.d.ts +13 -23
  30. package/dist-sdk/src/core/types/app.js +0 -1
  31. package/dist-sdk/src/engine/build/context.d.ts +3 -3
  32. package/dist-sdk/src/engine/pull/attrs.d.ts +4 -0
  33. package/dist-sdk/src/engine/pull/attrs.js +17 -0
  34. package/dist-sdk/src/engine/pull/context.d.ts +39 -0
  35. package/dist-sdk/src/engine/pull/org.d.ts +1 -0
  36. package/dist-sdk/src/engine/pull/org.js +2 -0
  37. package/dist-sdk/src/engine/tf/expr.d.ts +1 -1
  38. package/dist-sdk/src/engine/tf/expr.js +10 -3
  39. package/dist-sdk/src/engine/workspace/authoring-layout.js +4 -2
  40. package/dist-sdk/src/entities/access-policy/build.d.ts +4 -13
  41. package/dist-sdk/src/entities/access-policy/build.js +1 -1
  42. package/dist-sdk/src/entities/access-policy/from-tf.d.ts +12 -38
  43. package/dist-sdk/src/entities/access-policy/from-tf.js +16 -74
  44. package/dist-sdk/src/entities/access-policy/principal.d.ts +29 -0
  45. package/dist-sdk/src/entities/access-policy/principal.js +13 -0
  46. package/dist-sdk/src/entities/access-policy/to-tf.d.ts +20 -5
  47. package/dist-sdk/src/entities/access-policy/to-tf.js +26 -54
  48. package/dist-sdk/src/entities/agent/build.d.ts +39 -8
  49. package/dist-sdk/src/entities/agent/build.js +36 -15
  50. package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.d.ts +5 -0
  51. package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.js +121 -36
  52. package/dist-sdk/src/entities/agent/from-tf.js +5 -8
  53. package/dist-sdk/src/entities/agent/index.d.ts +5 -2
  54. package/dist-sdk/src/entities/agent/index.js +4 -2
  55. package/dist-sdk/src/entities/agent/module.js +5 -2
  56. package/dist-sdk/src/entities/agent/run-as.d.ts +16 -0
  57. package/dist-sdk/src/entities/agent/run-as.js +1 -0
  58. package/dist-sdk/src/entities/agent/to-tf.d.ts +2 -1
  59. package/dist-sdk/src/entities/agent/to-tf.js +2 -1
  60. package/dist-sdk/src/entities/agent/tools.d.ts +60 -48
  61. package/dist-sdk/src/entities/agent/tools.js +44 -38
  62. package/dist-sdk/src/entities/agent-a2a-skill/from-tf.js +1 -1
  63. package/dist-sdk/src/entities/agent-a2a-skill/to-tf.js +4 -4
  64. package/dist-sdk/src/entities/agent-tool/from-tf.d.ts +17 -8
  65. package/dist-sdk/src/entities/agent-tool/from-tf.js +127 -37
  66. package/dist-sdk/src/entities/agent-tool/module.js +6 -0
  67. package/dist-sdk/src/entities/agent-tool/to-tf.d.ts +5 -5
  68. package/dist-sdk/src/entities/agent-tool/to-tf.js +93 -20
  69. package/dist-sdk/src/entities/agent-tool/types.d.ts +4 -5
  70. package/dist-sdk/src/entities/agent-tool/types.js +36 -8
  71. package/dist-sdk/src/entities/app/build.d.ts +137 -25
  72. package/dist-sdk/src/entities/app/build.js +104 -53
  73. package/dist-sdk/src/entities/app/deserializer/normalize.d.ts +173 -1
  74. package/dist-sdk/src/entities/app/deserializer/pulled-expression.d.ts +59 -0
  75. package/dist-sdk/src/entities/app/deserializer/pulled-expression.js +68 -0
  76. package/dist-sdk/src/entities/app/display-blocks.d.ts +2 -1
  77. package/dist-sdk/src/entities/app/display-blocks.js +1 -1
  78. package/dist-sdk/src/entities/app/from-tf.d.ts +11 -1
  79. package/dist-sdk/src/entities/app/from-tf.js +30 -2
  80. package/dist-sdk/src/entities/app/index.d.ts +13 -4
  81. package/dist-sdk/src/entities/app/index.js +8 -1
  82. package/dist-sdk/src/entities/app/module.js +27 -2
  83. package/dist-sdk/src/entities/app/to-tf.js +75 -1
  84. package/dist-sdk/src/entities/approval-chain/build.d.ts +31 -16
  85. package/dist-sdk/src/entities/approval-chain/build.js +49 -49
  86. package/dist-sdk/src/entities/approval-chain/from-tf.d.ts +17 -0
  87. package/dist-sdk/src/entities/approval-chain/from-tf.js +57 -0
  88. package/dist-sdk/src/entities/approval-chain/index.d.ts +2 -3
  89. package/dist-sdk/src/entities/approval-chain/index.js +2 -3
  90. package/dist-sdk/src/entities/approval-chain/module.d.ts +3 -0
  91. package/dist-sdk/src/entities/approval-chain/module.js +51 -0
  92. package/dist-sdk/src/entities/approval-chain/printer.d.ts +2 -0
  93. package/dist-sdk/src/entities/approval-chain/printer.js +21 -0
  94. package/dist-sdk/src/entities/approval-chain/to-tf.d.ts +9 -0
  95. package/dist-sdk/src/entities/approval-chain/to-tf.js +43 -0
  96. package/dist-sdk/src/entities/automation/build.d.ts +10 -6
  97. package/dist-sdk/src/entities/automation/build.js +5 -4
  98. package/dist-sdk/src/entities/automation/deserializer/ast.d.ts +10 -8
  99. package/dist-sdk/src/entities/automation/deserializer/print-automation.js +51 -114
  100. package/dist-sdk/src/entities/automation/filter.d.ts +1 -115
  101. package/dist-sdk/src/entities/automation/filter.js +1 -197
  102. package/dist-sdk/src/entities/automation/from-tf.d.ts +4 -0
  103. package/dist-sdk/src/entities/automation/from-tf.js +202 -119
  104. package/dist-sdk/src/entities/automation/index.d.ts +4 -2
  105. package/dist-sdk/src/entities/automation/index.js +3 -1
  106. package/dist-sdk/src/entities/automation/module.js +10 -4
  107. package/dist-sdk/src/entities/automation/script-code.js +94 -6
  108. package/dist-sdk/src/entities/automation/tasks.d.ts +20 -19
  109. package/dist-sdk/src/entities/automation/tasks.js +2 -2
  110. package/dist-sdk/src/entities/automation/to-tf.d.ts +34 -2
  111. package/dist-sdk/src/entities/automation/to-tf.js +273 -98
  112. package/dist-sdk/src/entities/automation/triggers.d.ts +18 -17
  113. package/dist-sdk/src/entities/automation/triggers.js +1 -1
  114. package/dist-sdk/src/entities/dashboard/build.d.ts +17 -0
  115. package/dist-sdk/src/entities/dashboard/from-tf.d.ts +12 -0
  116. package/dist-sdk/src/entities/dashboard/from-tf.js +95 -0
  117. package/dist-sdk/src/entities/dashboard/module.d.ts +3 -0
  118. package/dist-sdk/src/entities/dashboard/module.js +16 -0
  119. package/dist-sdk/src/entities/dashboard/to-tf.d.ts +30 -0
  120. package/dist-sdk/src/entities/dashboard/to-tf.js +94 -0
  121. package/dist-sdk/src/entities/dashboard-widget/module.d.ts +3 -0
  122. package/dist-sdk/src/entities/dashboard-widget/module.js +10 -0
  123. package/dist-sdk/src/entities/data-lookup/module.d.ts +3 -0
  124. package/dist-sdk/src/entities/data-lookup/module.js +22 -0
  125. package/dist-sdk/src/entities/datamine/build.d.ts +22 -0
  126. package/dist-sdk/src/entities/datamine/build.js +1 -0
  127. package/dist-sdk/src/entities/datamine/from-tf.d.ts +17 -0
  128. package/dist-sdk/src/entities/datamine/from-tf.js +98 -0
  129. package/dist-sdk/src/entities/datamine/module.d.ts +3 -0
  130. package/dist-sdk/src/entities/datamine/module.js +23 -0
  131. package/dist-sdk/src/entities/datamine/to-tf.d.ts +11 -0
  132. package/dist-sdk/src/entities/datamine/to-tf.js +53 -0
  133. package/dist-sdk/src/entities/dynamic-layout/build.d.ts +303 -0
  134. package/dist-sdk/src/entities/dynamic-layout/build.js +4 -0
  135. package/dist-sdk/src/entities/dynamic-layout/dialect.d.ts +2 -0
  136. package/dist-sdk/src/entities/dynamic-layout/dialect.js +9 -0
  137. package/dist-sdk/src/entities/dynamic-layout/from-tf.d.ts +10 -0
  138. package/dist-sdk/src/entities/dynamic-layout/from-tf.js +233 -0
  139. package/dist-sdk/src/entities/dynamic-layout/module.d.ts +3 -0
  140. package/dist-sdk/src/entities/dynamic-layout/module.js +13 -0
  141. package/dist-sdk/src/entities/dynamic-layout/to-tf.d.ts +26 -0
  142. package/dist-sdk/src/entities/dynamic-layout/to-tf.js +267 -0
  143. package/dist-sdk/src/entities/element/build.d.ts +31 -14
  144. package/dist-sdk/src/entities/element/build.js +12 -4
  145. package/dist-sdk/src/entities/element/from-tf.d.ts +9 -1
  146. package/dist-sdk/src/entities/element/from-tf.js +31 -2
  147. package/dist-sdk/src/entities/element/index.d.ts +8 -3
  148. package/dist-sdk/src/entities/element/index.js +4 -1
  149. package/dist-sdk/src/entities/element/module.js +19 -2
  150. package/dist-sdk/src/entities/element/to-tf.js +57 -1
  151. package/dist-sdk/src/entities/field/build.d.ts +4 -3
  152. package/dist-sdk/src/entities/field/calculation-types.d.ts +6 -0
  153. package/dist-sdk/src/entities/field/calculation-types.js +42 -0
  154. package/dist-sdk/src/entities/field/from-tf.js +90 -11
  155. package/dist-sdk/src/entities/field/module.d.ts +1 -0
  156. package/dist-sdk/src/entities/field/module.js +5 -2
  157. package/dist-sdk/src/entities/field/record-shape.d.ts +1 -1
  158. package/dist-sdk/src/entities/field/to-tf.d.ts +1 -1
  159. package/dist-sdk/src/entities/field/to-tf.js +22 -6
  160. package/dist-sdk/src/entities/field/types.js +3 -0
  161. package/dist-sdk/src/entities/file-reader/build.d.ts +66 -19
  162. package/dist-sdk/src/entities/file-reader/build.js +49 -4
  163. package/dist-sdk/src/entities/file-reader/deserializer/print-file-reader.d.ts +1 -0
  164. package/dist-sdk/src/entities/file-reader/deserializer/print-file-reader.js +11 -9
  165. package/dist-sdk/src/entities/file-reader/from-tf.d.ts +1 -1
  166. package/dist-sdk/src/entities/file-reader/from-tf.js +31 -2
  167. package/dist-sdk/src/entities/file-reader/index.d.ts +3 -3
  168. package/dist-sdk/src/entities/file-reader/index.js +3 -3
  169. package/dist-sdk/src/entities/file-reader/module.js +6 -5
  170. package/dist-sdk/src/entities/file-reader/to-tf.d.ts +1 -1
  171. package/dist-sdk/src/entities/file-reader/to-tf.js +5 -2
  172. package/dist-sdk/src/entities/file-reader/types.d.ts +3 -4
  173. package/dist-sdk/src/entities/file-reader/types.js +4 -5
  174. package/dist-sdk/src/entities/org/category.js +4 -5
  175. package/dist-sdk/src/entities/org/group.js +4 -5
  176. package/dist-sdk/src/entities/org/index.d.ts +1 -0
  177. package/dist-sdk/src/entities/org/index.js +1 -0
  178. package/dist-sdk/src/entities/org/phone-provider.d.ts +4 -0
  179. package/dist-sdk/src/entities/org/phone-provider.js +33 -0
  180. package/dist-sdk/src/entities/org/role.d.ts +3 -3
  181. package/dist-sdk/src/entities/org/role.js +9 -6
  182. package/dist-sdk/src/entities/organization/build.d.ts +29 -0
  183. package/dist-sdk/src/entities/organization/build.js +24 -0
  184. package/dist-sdk/src/entities/organization/index.d.ts +2 -0
  185. package/dist-sdk/src/entities/organization/index.js +2 -0
  186. package/dist-sdk/src/entities/organization/module.d.ts +2 -0
  187. package/dist-sdk/src/entities/organization/module.js +18 -0
  188. package/dist-sdk/src/entities/organization/to-tf.d.ts +6 -0
  189. package/dist-sdk/src/entities/organization/to-tf.js +37 -0
  190. package/dist-sdk/src/entities/phone-service/build.d.ts +17 -0
  191. package/dist-sdk/src/entities/phone-service/build.js +31 -0
  192. package/dist-sdk/src/entities/phone-service/deserializer/print-phone-service.d.ts +4 -0
  193. package/dist-sdk/src/entities/phone-service/deserializer/print-phone-service.js +54 -0
  194. package/dist-sdk/src/entities/phone-service/from-tf.d.ts +25 -0
  195. package/dist-sdk/src/entities/phone-service/from-tf.js +75 -0
  196. package/dist-sdk/src/entities/phone-service/index.d.ts +2 -0
  197. package/dist-sdk/src/entities/phone-service/index.js +2 -0
  198. package/dist-sdk/src/entities/phone-service/module.d.ts +3 -0
  199. package/dist-sdk/src/entities/phone-service/module.js +55 -0
  200. package/dist-sdk/src/entities/phone-service/to-tf.d.ts +12 -0
  201. package/dist-sdk/src/entities/phone-service/to-tf.js +54 -0
  202. package/dist-sdk/src/entities/phone-service/types.d.ts +35 -0
  203. package/dist-sdk/src/entities/phone-service/types.js +22 -0
  204. package/dist-sdk/src/entities/record-create-form/from-tf.d.ts +11 -0
  205. package/dist-sdk/src/entities/record-create-form/from-tf.js +74 -0
  206. package/dist-sdk/src/entities/record-create-form/module.d.ts +11 -0
  207. package/dist-sdk/src/entities/record-create-form/module.js +24 -0
  208. package/dist-sdk/src/entities/record-create-form/to-tf.d.ts +33 -0
  209. package/dist-sdk/src/entities/record-create-form/to-tf.js +80 -0
  210. package/dist-sdk/src/entities/relationship/build.d.ts +16 -0
  211. package/dist-sdk/src/entities/relationship/build.js +1 -0
  212. package/dist-sdk/src/entities/relationship/from-tf.d.ts +12 -0
  213. package/dist-sdk/src/entities/relationship/from-tf.js +109 -0
  214. package/dist-sdk/src/entities/relationship/module.d.ts +3 -0
  215. package/dist-sdk/src/entities/relationship/module.js +16 -0
  216. package/dist-sdk/src/entities/relationship/to-tf.d.ts +31 -0
  217. package/dist-sdk/src/entities/relationship/to-tf.js +153 -0
  218. package/dist-sdk/src/entities/role/build.d.ts +65 -0
  219. package/dist-sdk/src/entities/role/build.js +33 -0
  220. package/dist-sdk/src/entities/role/from-tf.d.ts +13 -0
  221. package/dist-sdk/src/entities/role/from-tf.js +138 -0
  222. package/dist-sdk/src/entities/role/to-tf.d.ts +13 -0
  223. package/dist-sdk/src/entities/role/to-tf.js +69 -0
  224. package/dist-sdk/src/entities/search-table/build.d.ts +67 -28
  225. package/dist-sdk/src/entities/search-table/build.js +110 -56
  226. package/dist-sdk/src/entities/search-table/from-tf.d.ts +37 -0
  227. package/dist-sdk/src/entities/search-table/from-tf.js +113 -0
  228. package/dist-sdk/src/entities/search-table/index.d.ts +2 -2
  229. package/dist-sdk/src/entities/search-table/index.js +2 -2
  230. package/dist-sdk/src/entities/search-table/module.js +88 -10
  231. package/dist-sdk/src/entities/search-table/printer.d.ts +2 -0
  232. package/dist-sdk/src/entities/search-table/printer.js +52 -0
  233. package/dist-sdk/src/entities/search-table/to-tf.d.ts +14 -0
  234. package/dist-sdk/src/entities/search-table/to-tf.js +104 -0
  235. package/dist-sdk/src/entities/search-table/types.d.ts +8 -0
  236. package/dist-sdk/src/entities/search-table/types.js +21 -0
  237. package/dist-sdk/src/entities/service-account/build.d.ts +32 -0
  238. package/dist-sdk/src/entities/service-account/build.js +9 -0
  239. package/dist-sdk/src/entities/service-account/from-tf.d.ts +10 -0
  240. package/dist-sdk/src/entities/service-account/from-tf.js +109 -0
  241. package/dist-sdk/src/entities/service-account/module.d.ts +4 -0
  242. package/dist-sdk/src/entities/service-account/module.js +21 -0
  243. package/dist-sdk/src/entities/service-account/ref.d.ts +11 -0
  244. package/dist-sdk/src/entities/service-account/ref.js +5 -0
  245. package/dist-sdk/src/entities/service-account/to-tf.d.ts +11 -0
  246. package/dist-sdk/src/entities/service-account/to-tf.js +72 -0
  247. package/dist-sdk/src/entities/shared/connector-from-tf.d.ts +14 -0
  248. package/dist-sdk/src/entities/shared/connector-from-tf.js +14 -0
  249. package/dist-sdk/src/entities/shared/filters/ast.d.ts +21 -79
  250. package/dist-sdk/src/entities/shared/filters/ast.js +5 -2
  251. package/dist-sdk/src/entities/shared/filters/index.d.ts +94 -206
  252. package/dist-sdk/src/entities/shared/filters/index.js +189 -341
  253. package/dist-sdk/src/entities/shared/filters/print.d.ts +11 -0
  254. package/dist-sdk/src/entities/shared/filters/print.js +122 -0
  255. package/dist-sdk/src/entities/shared/filters/tf-codec.d.ts +170 -0
  256. package/dist-sdk/src/entities/shared/filters/tf-codec.js +527 -0
  257. package/dist-sdk/src/entities/shared/filters/types.d.ts +66 -69
  258. package/dist-sdk/src/entities/shared/filters/types.js +2 -3
  259. package/dist-sdk/src/entities/skill/build.d.ts +2 -2
  260. package/dist-sdk/src/entities/skill/build.js +4 -3
  261. package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.d.ts +10 -0
  262. package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.js +74 -32
  263. package/dist-sdk/src/entities/skill/index.d.ts +2 -1
  264. package/dist-sdk/src/entities/skill/index.js +2 -1
  265. package/dist-sdk/src/entities/skill/module.js +6 -0
  266. package/dist-sdk/src/entities/skill/to-tf.d.ts +5 -1
  267. package/dist-sdk/src/entities/skill/to-tf.js +18 -0
  268. package/dist-sdk/src/entities/skill/tools.d.ts +46 -31
  269. package/dist-sdk/src/entities/skill/tools.js +33 -20
  270. package/dist-sdk/src/entities/skill-tool/from-tf.d.ts +4 -1
  271. package/dist-sdk/src/entities/skill-tool/from-tf.js +76 -8
  272. package/dist-sdk/src/entities/skill-tool/module.js +9 -0
  273. package/dist-sdk/src/entities/skill-tool/to-tf.d.ts +6 -1
  274. package/dist-sdk/src/entities/skill-tool/to-tf.js +94 -42
  275. package/dist-sdk/src/entities/skill-tool/types.js +18 -1
  276. package/dist-sdk/src/entities/table/build.d.ts +64 -23
  277. package/dist-sdk/src/entities/table/build.js +33 -18
  278. package/dist-sdk/src/entities/table/catalog-render.js +6 -0
  279. package/dist-sdk/src/entities/table/deserializer/normalize.d.ts +99 -0
  280. package/dist-sdk/src/entities/table/deserializer/normalize.js +192 -0
  281. package/dist-sdk/src/entities/table/fields/types.d.ts +86 -0
  282. package/dist-sdk/src/entities/table/fields/types.js +12 -0
  283. package/dist-sdk/src/entities/table/fields.d.ts +107 -47
  284. package/dist-sdk/src/entities/table/fields.js +76 -55
  285. package/dist-sdk/src/entities/table/from-tf.d.ts +4 -0
  286. package/dist-sdk/src/entities/table/from-tf.js +261 -0
  287. package/dist-sdk/src/entities/table/index.d.ts +7 -5
  288. package/dist-sdk/src/entities/table/index.js +7 -7
  289. package/dist-sdk/src/entities/table/joins.d.ts +22 -9
  290. package/dist-sdk/src/entities/table/joins.js +8 -16
  291. package/dist-sdk/src/entities/table/module.d.ts +2 -1
  292. package/dist-sdk/src/entities/table/module.js +13 -6
  293. package/dist-sdk/src/entities/table/to-tf.d.ts +10 -0
  294. package/dist-sdk/src/entities/table/to-tf.js +230 -0
  295. package/dist-sdk/src/entities/task/build.d.ts +43 -0
  296. package/dist-sdk/src/entities/task/build.js +17 -0
  297. package/dist-sdk/src/entities/task/from-tf.d.ts +28 -0
  298. package/dist-sdk/src/entities/task/from-tf.js +38 -0
  299. package/dist-sdk/src/entities/task/index.d.ts +1 -0
  300. package/dist-sdk/src/entities/task/index.js +1 -0
  301. package/dist-sdk/src/entities/task/module.d.ts +3 -0
  302. package/dist-sdk/src/entities/task/module.js +12 -0
  303. package/dist-sdk/src/entities/task/to-tf.d.ts +9 -0
  304. package/dist-sdk/src/entities/task/to-tf.js +49 -0
  305. package/dist-sdk/src/entities/view/from-tf.d.ts +7 -2
  306. package/dist-sdk/src/entities/view/from-tf.js +209 -25
  307. package/dist-sdk/src/entities/view/module.js +5 -1
  308. package/dist-sdk/src/entities/view/to-tf.d.ts +49 -7
  309. package/dist-sdk/src/entities/view/to-tf.js +155 -18
  310. package/dist-sdk/src/entities/view/types.d.ts +8 -0
  311. package/dist-sdk/src/entities/view/types.js +43 -0
  312. package/dist-sdk/src/entities/visual-flow/build.d.ts +87 -0
  313. package/dist-sdk/src/entities/visual-flow/build.js +72 -0
  314. package/dist-sdk/src/entities/visual-flow/from-tf.d.ts +49 -0
  315. package/dist-sdk/src/entities/visual-flow/from-tf.js +124 -0
  316. package/dist-sdk/src/entities/visual-flow/index.d.ts +1 -0
  317. package/dist-sdk/src/entities/visual-flow/index.js +1 -0
  318. package/dist-sdk/src/entities/visual-flow/module.d.ts +3 -0
  319. package/dist-sdk/src/entities/visual-flow/module.js +41 -0
  320. package/dist-sdk/src/entities/visual-flow/printer.d.ts +8 -0
  321. package/dist-sdk/src/entities/visual-flow/printer.js +92 -0
  322. package/dist-sdk/src/entities/visual-flow/to-tf.d.ts +14 -0
  323. package/dist-sdk/src/entities/visual-flow/to-tf.js +101 -0
  324. package/dist-sdk/src/entities/widget/build.d.ts +55 -0
  325. package/dist-sdk/src/entities/widget/build.js +1 -0
  326. package/dist-sdk/src/entities/widget/from-tf.d.ts +11 -0
  327. package/dist-sdk/src/entities/widget/from-tf.js +209 -0
  328. package/dist-sdk/src/entities/widget/module.d.ts +3 -0
  329. package/dist-sdk/src/entities/widget/module.js +16 -0
  330. package/dist-sdk/src/entities/widget/to-tf.d.ts +44 -0
  331. package/dist-sdk/src/entities/widget/to-tf.js +204 -0
  332. package/dist-sdk/src/graph/deferred-catalog-render.d.ts +1 -1
  333. package/dist-sdk/src/graph/deferred-catalog-render.js +1 -1
  334. package/dist-sdk/src/graph/index.d.ts +7 -0
  335. package/dist-sdk/src/graph/index.js +4 -18
  336. package/dist-sdk/src/graph/modules.js +30 -1
  337. package/dist-sdk/src/graph/types.d.ts +55 -7
  338. package/dist-sdk/src/internal/sdk-package.d.ts +1 -1
  339. package/dist-sdk/src/internal/sdk-package.js +4 -2
  340. package/package.json +30 -15
  341. package/dist-sdk/src/entities/access-policy/filter.d.ts +0 -61
  342. package/dist-sdk/src/entities/access-policy/filter.js +0 -83
  343. package/dist-sdk/src/entities/approval-chain/steps.d.ts +0 -24
  344. package/dist-sdk/src/entities/approval-chain/steps.js +0 -20
  345. package/dist-sdk/src/entities/flow/activities/agent.d.ts +0 -15
  346. package/dist-sdk/src/entities/flow/activities/agent.js +0 -29
  347. package/dist-sdk/src/entities/flow/activities/approval.d.ts +0 -9
  348. package/dist-sdk/src/entities/flow/activities/approval.js +0 -18
  349. package/dist-sdk/src/entities/flow/activities/automation.d.ts +0 -12
  350. package/dist-sdk/src/entities/flow/activities/automation.js +0 -22
  351. package/dist-sdk/src/entities/flow/activities/ctx.d.ts +0 -34
  352. package/dist-sdk/src/entities/flow/activities/ctx.js +0 -38
  353. package/dist-sdk/src/entities/flow/activities/form.d.ts +0 -22
  354. package/dist-sdk/src/entities/flow/activities/form.js +0 -36
  355. package/dist-sdk/src/entities/flow/activities/index.d.ts +0 -14
  356. package/dist-sdk/src/entities/flow/activities/index.js +0 -13
  357. package/dist-sdk/src/entities/flow/activities/input-refs.d.ts +0 -39
  358. package/dist-sdk/src/entities/flow/activities/input-refs.js +0 -19
  359. package/dist-sdk/src/entities/flow/activities/prompt-template.d.ts +0 -13
  360. package/dist-sdk/src/entities/flow/activities/prompt-template.js +0 -34
  361. package/dist-sdk/src/entities/flow/activities/types.d.ts +0 -33
  362. package/dist-sdk/src/entities/flow/build.d.ts +0 -38
  363. package/dist-sdk/src/entities/flow/build.js +0 -115
  364. package/dist-sdk/src/entities/flow/index.d.ts +0 -8
  365. package/dist-sdk/src/entities/flow/index.js +0 -7
  366. package/dist-sdk/src/entities/flow/serialize.d.ts +0 -51
  367. package/dist-sdk/src/entities/flow/serialize.js +0 -94
  368. package/dist-sdk/src/entities/flow/util.d.ts +0 -27
  369. package/dist-sdk/src/entities/flow/util.js +0 -38
  370. package/dist-sdk/src/entities/table/filter.d.ts +0 -41
  371. package/dist-sdk/src/entities/table/filter.js +0 -89
  372. /package/dist-sdk/src/entities/{flow/activities/types.js → dashboard/build.js} +0 -0
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Opaque marker for a calculated-field expression pulled from the
3
+ * server. Wraps the server's stored expression string in a
4
+ * `CalculationExpression` brand so it round-trips byte-stable through
5
+ * `.deploy()` without any TS-side parsing.
6
+ *
7
+ * Why this exists (and why it isn't on the public `calc` namespace):
8
+ *
9
+ * Calculated expressions are stored on the server as a single string
10
+ * (the raw text the ANTLR parser accepts). The platform's parser also
11
+ * NORMALIZES expressions on conversion — `"Quantity" / "Threshold"`
12
+ * becomes something like `division(..., nullIf(cast(..., DECIMAL), 0))`
13
+ * server-side, so the stored text after a deploy may not match what
14
+ * the author wrote in the EDK DSL. Parsing it back into typed AST
15
+ * form would require both a TS port of the grammar AND an
16
+ * un-normalization pass — neither of which the EDK ships today.
17
+ *
18
+ * The marker sidesteps the problem: on pull, the deserializer wraps
19
+ * the server's stored string in `__pulledExpression(...)`. On
20
+ * re-deploy, the serializer reads `toCalcString()` and emits the
21
+ * exact same string. The server gets back what it stored.
22
+ *
23
+ * **Edit contract.** When an agent edits a pulled file:
24
+ * - **Unchanged expression** — leave the `__pulledExpression(...)`
25
+ * call alone. Re-deploy emits the same string, no semantic change.
26
+ * - **Changed expression** — REPLACE THE ENTIRE CALL with a typed
27
+ * `calc.*` expression (e.g. `calc.if(calc.gt(f.x, 10), 'hi', 'lo')`).
28
+ * The typed DSL gives the agent compile-time validation of field
29
+ * refs, function names, and argument types. Tweaking the inner
30
+ * string directly bypasses TypeScript and reintroduces the
31
+ * hallucination surface the typed DSL exists to eliminate.
32
+ *
33
+ * **Why this module isn't in `src/aspects/index.ts`.** Public-API
34
+ * autocomplete is the path an authoring agent discovers the EDK
35
+ * through. Surfacing `__pulledExpression` there would invite agents to
36
+ * use it as a generic "raw string expression" escape hatch, which
37
+ * defeats the typed DSL. Pulled files import this symbol via the
38
+ * deep path `../../aspects/deserializer/pulled-expression.js` — the
39
+ * unusual import signals "pull-printer-emitted; not for hand-authoring."
40
+ */
41
+ import type { CalculationExpression } from "../../../core/types/app.js";
42
+ import type { Expr, ExprType } from "../../field/calc/types.js";
43
+ /**
44
+ * Wrap the server-stored expression string as an opaque
45
+ * `CalculationExpression`. The only call site is the pull printer
46
+ * (`print-aspect.ts`); agents authoring new fields use the typed
47
+ * `calc.*` builder instead.
48
+ *
49
+ * Naming uses the `__` prefix that other pull-printer-emitted runtime
50
+ * guards on this codebase use (`__pulledType`, `__pulledValueIds`) —
51
+ * signals "this came from the pull printer; the runtime treats it
52
+ * specially."
53
+ */
54
+ export declare function __pulledExpression(serverText: string): CalculationExpression;
55
+ /**
56
+ * Pull-only fidelity bridge for server-normalized calculation grammar.
57
+ * Hand-authored calculations should use the typed `calc.*` DSL instead.
58
+ */
59
+ export declare function preservePulledCalculation<T extends ExprType>(serverText: string, resultType: T): Expr<T>;
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Opaque marker for a calculated-field expression pulled from the
3
+ * server. Wraps the server's stored expression string in a
4
+ * `CalculationExpression` brand so it round-trips byte-stable through
5
+ * `.deploy()` without any TS-side parsing.
6
+ *
7
+ * Why this exists (and why it isn't on the public `calc` namespace):
8
+ *
9
+ * Calculated expressions are stored on the server as a single string
10
+ * (the raw text the ANTLR parser accepts). The platform's parser also
11
+ * NORMALIZES expressions on conversion — `"Quantity" / "Threshold"`
12
+ * becomes something like `division(..., nullIf(cast(..., DECIMAL), 0))`
13
+ * server-side, so the stored text after a deploy may not match what
14
+ * the author wrote in the EDK DSL. Parsing it back into typed AST
15
+ * form would require both a TS port of the grammar AND an
16
+ * un-normalization pass — neither of which the EDK ships today.
17
+ *
18
+ * The marker sidesteps the problem: on pull, the deserializer wraps
19
+ * the server's stored string in `__pulledExpression(...)`. On
20
+ * re-deploy, the serializer reads `toCalcString()` and emits the
21
+ * exact same string. The server gets back what it stored.
22
+ *
23
+ * **Edit contract.** When an agent edits a pulled file:
24
+ * - **Unchanged expression** — leave the `__pulledExpression(...)`
25
+ * call alone. Re-deploy emits the same string, no semantic change.
26
+ * - **Changed expression** — REPLACE THE ENTIRE CALL with a typed
27
+ * `calc.*` expression (e.g. `calc.if(calc.gt(f.x, 10), 'hi', 'lo')`).
28
+ * The typed DSL gives the agent compile-time validation of field
29
+ * refs, function names, and argument types. Tweaking the inner
30
+ * string directly bypasses TypeScript and reintroduces the
31
+ * hallucination surface the typed DSL exists to eliminate.
32
+ *
33
+ * **Why this module isn't in `src/aspects/index.ts`.** Public-API
34
+ * autocomplete is the path an authoring agent discovers the EDK
35
+ * through. Surfacing `__pulledExpression` there would invite agents to
36
+ * use it as a generic "raw string expression" escape hatch, which
37
+ * defeats the typed DSL. Pulled files import this symbol via the
38
+ * deep path `../../aspects/deserializer/pulled-expression.js` — the
39
+ * unusual import signals "pull-printer-emitted; not for hand-authoring."
40
+ */
41
+ /**
42
+ * Wrap the server-stored expression string as an opaque
43
+ * `CalculationExpression`. The only call site is the pull printer
44
+ * (`print-aspect.ts`); agents authoring new fields use the typed
45
+ * `calc.*` builder instead.
46
+ *
47
+ * Naming uses the `__` prefix that other pull-printer-emitted runtime
48
+ * guards on this codebase use (`__pulledType`, `__pulledValueIds`) —
49
+ * signals "this came from the pull printer; the runtime treats it
50
+ * specially."
51
+ */
52
+ export function __pulledExpression(serverText) {
53
+ return {
54
+ __calc: true,
55
+ toCalcString: () => serverText,
56
+ };
57
+ }
58
+ /**
59
+ * Pull-only fidelity bridge for server-normalized calculation grammar.
60
+ * Hand-authored calculations should use the typed `calc.*` DSL instead.
61
+ */
62
+ export function preservePulledCalculation(serverText, resultType) {
63
+ return {
64
+ __calc: true,
65
+ __exprType: resultType,
66
+ toCalcString: () => serverText,
67
+ };
68
+ }
@@ -5,6 +5,7 @@
5
5
  * `AspectDisplayBlockInput` shape.
6
6
  */
7
7
  import type { FieldRef } from "../../catalog/index.js";
8
+ import type { UnsafePlatformId } from "../../core/platform-id.js";
8
9
  export type DisplayBlock = {
9
10
  readonly kind: "field";
10
11
  readonly field: FieldRef;
@@ -17,7 +18,7 @@ export type DisplayBlock = {
17
18
  readonly maxColumns?: number;
18
19
  } | {
19
20
  readonly kind: "widget";
20
- readonly widgetId: string;
21
+ readonly widgetId: UnsafePlatformId;
21
22
  } | {
22
23
  readonly kind: "comments";
23
24
  readonly channels?: readonly string[];
@@ -15,7 +15,7 @@ function serializeBlock(block, displayType) {
15
15
  },
16
16
  };
17
17
  case "widget":
18
- return { properties: { type: "WIDGET", displayType, widgetId: block.widgetId } };
18
+ return { properties: { type: "WIDGET", displayType, widgetId: block.widgetId.value } };
19
19
  case "comments":
20
20
  return {
21
21
  properties: {
@@ -18,6 +18,16 @@ export interface AppFromTfResult {
18
18
  export interface AppFromTfViewBlocks {
19
19
  readonly layoutBlocks: readonly TfBlock[];
20
20
  readonly listViewBlocks: readonly TfBlock[];
21
+ readonly calendarViewBlocks: readonly TfBlock[];
22
+ readonly kanbanViewBlocks: readonly TfBlock[];
23
+ readonly dashboardViewBlocks: readonly TfBlock[];
24
+ readonly agentViewBlocks: readonly TfBlock[];
21
25
  readonly managedViewOrderBlocks: readonly TfBlock[];
26
+ readonly recordCreateFormBlocks: readonly TfBlock[];
27
+ readonly dynamicLayoutBlocks: readonly TfBlock[];
28
+ readonly relationshipBlocks: readonly TfBlock[];
29
+ readonly dashboardBlocks: readonly TfBlock[];
30
+ readonly dashboardWidgetBlocks: readonly TfBlock[];
31
+ readonly widgetBlocks: readonly TfBlock[];
22
32
  }
23
- export declare function appFromTf(appBlock: TfBlock, fieldBlocks: readonly TfBlock[], ctx: FromTfContext, viewBlocks?: AppFromTfViewBlocks, accessPolicyBlocks?: readonly TfBlock[]): AppFromTfResult;
33
+ export declare function appFromTf(appBlock: TfBlock, fieldBlocks: readonly TfBlock[], ctx: FromTfContext, viewBlocks?: AppFromTfViewBlocks, accessPolicyBlocks?: readonly TfBlock[], roleBlocks?: readonly TfBlock[], serviceAccountBlocks?: readonly TfBlock[]): AppFromTfResult;
@@ -11,9 +11,16 @@ import { EntityTfError } from "../../engine/entity.js";
11
11
  import { dataRefLabel, optionalString, plainObject } from "../../engine/pull/context.js";
12
12
  import { snakeSlug, tfLabelToTsLabel } from "../../engine/tf/index.js";
13
13
  import { accessPolicyFromTf } from "../access-policy/from-tf.js";
14
+ import { dynamicLayoutsFromTf } from "../dynamic-layout/from-tf.js";
15
+ import { dashboardsFromTf } from "../dashboard/from-tf.js";
14
16
  import { fieldFromTf } from "../field/from-tf.js";
15
17
  import { optionsFromTf } from "../field/options.js";
18
+ import { recordCreateFormFromTf } from "../record-create-form/from-tf.js";
19
+ import { relationshipsFromTf } from "../relationship/from-tf.js";
20
+ import { rolesFromTf } from "../role/from-tf.js";
21
+ import { serviceAccountsFromTf } from "../service-account/from-tf.js";
16
22
  import { viewsFromTf } from "../view/from-tf.js";
23
+ import { widgetsFromTf } from "../widget/from-tf.js";
17
24
  import { APP_RESOURCE_TYPE } from "./module.js";
18
25
  /** Attributes `appFromTf` understands — anything else is dialect growth, reported loudly. */
19
26
  const KNOWN_APP_ATTRS = new Set([
@@ -35,7 +42,7 @@ const KNOWN_APP_ATTRS = new Set([
35
42
  "status_field_description",
36
43
  "comments_enabled",
37
44
  ]);
38
- export function appFromTf(appBlock, fieldBlocks, ctx, viewBlocks = { layoutBlocks: [], listViewBlocks: [], managedViewOrderBlocks: [] }, accessPolicyBlocks = []) {
45
+ export function appFromTf(appBlock, fieldBlocks, ctx, viewBlocks = { layoutBlocks: [], listViewBlocks: [], calendarViewBlocks: [], kanbanViewBlocks: [], dashboardViewBlocks: [], agentViewBlocks: [], managedViewOrderBlocks: [], recordCreateFormBlocks: [], dynamicLayoutBlocks: [], relationshipBlocks: [], dashboardBlocks: [], dashboardWidgetBlocks: [], widgetBlocks: [] }, accessPolicyBlocks = [], roleBlocks = [], serviceAccountBlocks = []) {
39
46
  const label = appBlock.label;
40
47
  if (label === undefined || label === "") {
41
48
  throw new EntityTfError("elementum_app block is missing its label");
@@ -148,7 +155,15 @@ export function appFromTf(appBlock, fieldBlocks, ctx, viewBlocks = { layoutBlock
148
155
  ctx.diagnostics.push(`app "${label}": no import block in the stream — adoption has no identity to bind`);
149
156
  }
150
157
  // --- View pass: layouts / list views / view order (entities/view), owner passed in.
151
- const { layouts, listViews, viewOrder } = viewsFromTf(viewBlocks.layoutBlocks, viewBlocks.listViewBlocks, viewBlocks.managedViewOrderBlocks, { type: APP_RESOURCE_TYPE, label, ownerTfLabel: refName, scope: "app", stageKeys: new Set(stages.map((stage) => stage.key)) }, ctx);
158
+ const dashboards = dashboardsFromTf(viewBlocks.dashboardBlocks, viewBlocks.dashboardWidgetBlocks, { type: APP_RESOURCE_TYPE, label, ownerTfLabel: refName, ownerRefName: refName, scope: "app", ownerType: "APP_ASPECT" }, ctx);
159
+ const { layouts, listViews, calendarViews, kanbanViews, dashboardViews, agentViews, viewOrder } = viewsFromTf(viewBlocks.layoutBlocks, viewBlocks.listViewBlocks, viewBlocks.calendarViewBlocks, viewBlocks.kanbanViewBlocks, viewBlocks.dashboardViewBlocks, viewBlocks.agentViewBlocks, viewBlocks.managedViewOrderBlocks, { type: APP_RESOURCE_TYPE, label, ownerTfLabel: refName, scope: "app", stageKeys: new Set(stages.map((stage) => stage.key)) }, ctx);
160
+ if (viewBlocks.recordCreateFormBlocks.length > 1) {
161
+ ctx.diagnostics.push(`app "${label}": found ${viewBlocks.recordCreateFormBlocks.length} record create forms; only the first is used`);
162
+ }
163
+ const recordCreateForm = recordCreateFormFromTf(viewBlocks.recordCreateFormBlocks[0], { type: APP_RESOURCE_TYPE, label, ownerTfLabel: refName, scope: "app" }, ctx);
164
+ const dynamicLayouts = dynamicLayoutsFromTf(viewBlocks.dynamicLayoutBlocks, { type: APP_RESOURCE_TYPE, label, ownerRefName: refName, ownerTfLabel: refName }, ctx);
165
+ const relationships = relationshipsFromTf(viewBlocks.relationshipBlocks, { kind: "app", label, ownerRefName: refName, ownerTfLabel: refName, scope: "app" }, ctx);
166
+ const widgets = widgetsFromTf(viewBlocks.widgetBlocks, { type: APP_RESOURCE_TYPE, label, ownerRefName: refName, ownerTfLabel: label, scope: "app" }, ctx);
152
167
  // --- Access policies (entities/access-policy), owner passed in.
153
168
  const accessPolicyOwner = {
154
169
  type: APP_RESOURCE_TYPE,
@@ -163,6 +178,8 @@ export function appFromTf(appBlock, fieldBlocks, ctx, viewBlocks = { layoutBlock
163
178
  if (entry !== undefined)
164
179
  accessPolicies.push(entry);
165
180
  }
181
+ const roles = rolesFromTf(roleBlocks, accessPolicyOwner, ctx);
182
+ const serviceAccounts = serviceAccountsFromTf([...serviceAccountBlocks, ...roleBlocks], { label, ownerTfLabel: label }, ctx);
166
183
  const app = {
167
184
  id: appId ?? "",
168
185
  name,
@@ -180,8 +197,19 @@ export function appFromTf(appBlock, fieldBlocks, ctx, viewBlocks = { layoutBlock
180
197
  ...(commentsEnabled !== undefined && { commentsEnabled }),
181
198
  ...(layouts.length > 0 && { layouts }),
182
199
  ...(listViews.length > 0 && { listViews }),
200
+ ...(calendarViews.length > 0 && { calendarViews }),
201
+ ...(kanbanViews.length > 0 && { kanbanViews }),
202
+ ...(dashboardViews.length > 0 && { dashboardViews }),
203
+ ...(dashboards.length > 0 && { dashboards }),
204
+ ...(widgets.length > 0 && { widgets }),
205
+ ...(agentViews.length > 0 && { agentViews }),
206
+ ...(recordCreateForm !== undefined && { recordCreateForm }),
207
+ ...(dynamicLayouts.length > 0 && { dynamicLayouts }),
208
+ ...(relationships.length > 0 && { relationships }),
183
209
  ...(viewOrder !== undefined && { viewOrder }),
184
210
  ...(accessPolicies.length > 0 && { accessPolicies }),
211
+ ...(roles.length > 0 && { roles }),
212
+ ...(serviceAccounts.length > 0 && { serviceAccounts }),
185
213
  };
186
214
  return { app, ...(cloudLinkHandle !== undefined && { cloudLinkHandle }) };
187
215
  }
@@ -5,10 +5,19 @@
5
5
  * `src/elements/build.ts`'s header for why apps and elements split into
6
6
  * dedicated builders despite sharing this module's field/print internals.
7
7
  */
8
- export { defineApp, type AppCategory, type AppCloudOptions, type AppField, type AppPicklistConfig, type AppPicklistDynamicConfig, type AppV2Options, type PicklistOption, } from "./build.js";
8
+ export { defineApp, type AppCategory, type AppCloudOptions, type AppField, type AppPicklistConfig, type AppPicklistDynamicConfig, type AppRecordCreateForm, type AppRecordCreateFormSection, type AppConfigured, type AppFieldRefs, type AppRef, type AppSelfRef, type AppReferenceConfiguration, type AppV2Options, type PicklistOption, } from "./build.js";
9
+ export { type AppWidget, type CreateRecordWidget, type LinkRecordsWidget, type RelatedRecordsWidget, type RunAutomationWidget, type RunAutomationWidgetParameter, type WidgetButtonStyle, type WidgetButtonType, } from "../widget/build.js";
9
10
  export { type DisplayBlock } from "./display-blocks.js";
11
+ export { type AppRelationship, type AppRelationshipColumn } from "../relationship/build.js";
12
+ export { type DashboardRecordsWidget, type DashboardWidget, type DashboardWidgetSize } from "../dashboard/build.js";
13
+ export { type AppDynamicLayout, type DynamicLayoutComponent, type DynamicLayoutCondition, type DynamicLayoutCssLength, type DynamicLayoutDependency, type DynamicLayoutFieldComponent, type DynamicLayoutFieldValidation, type DynamicLayoutSaveGroup, type DynamicLayoutStyle, type DynamicLayoutTypedValue, type DynamicLayoutValidationRule, defineDynamicLayout, } from "../dynamic-layout/build.js";
10
14
  export { attachmentField, booleanField, dateField, dateTimeField, decimalField, groupField, htmlField, jsonField, multiPicklistField, numberField, picklistField, relationField, textField, userField, type BaseFieldOptions, type NumericFieldOptions, type PicklistFieldOptions, type RelationFieldOptions, type TextFieldOptions, } from "../field/build.js";
11
15
  export { calc, field, type Expr, type ExprType } from "../field/calc.js";
12
- export { type AccessPolicyGroupRef, type AccessPolicyOptions, type AccessPolicyUserRef } from "../access-policy/build.js";
13
- export * as accessPolicyFilter from "../access-policy/filter.js";
14
- export { type AccessPolicyFilter, type AccessPolicyFilterValue, type CurrentUserFilterValue } from "../access-policy/filter.js";
16
+ export { definePhoneService, callerAccessMode, type CallerAccessMode, type E164PhoneNumber, type PhoneServiceConfigured, type PhoneServiceNumber, type PhoneServiceOptions, type PhoneServiceRegistration, } from "../phone-service/index.js";
17
+ export { preservePulledCalculation } from "./deserializer/pulled-expression.js";
18
+ export { groupId, userId, type AccessPolicyGroupRef, type AccessPolicyOptions, type AccessPolicyPrincipalRef, type AccessPolicyUserRef, type GroupId, type UserId } from "../access-policy/build.js";
19
+ export { roleAutoShare, rolePermissionGroup, rolePermissionLevel, userRef, type AppRole, type RoleAutoShare, type RoleGroupRef, type RolePermission, type RolePermissionGroup, type RolePermissionLevel, type RoleUserRef } from "../role/build.js";
20
+ export { serviceAccountRoleRef, serviceAccountStatus, type AppServiceAccount, type ServiceAccountAccessPolicy, type ServiceAccountRoleRef, type ServiceAccountStatus } from "../service-account/build.js";
21
+ export { serviceAccountRef, type ServiceAccountRef } from "../service-account/ref.js";
22
+ export * as filter from "../shared/filters/index.js";
23
+ export { type Filter } from "../shared/filters/index.js";
@@ -6,6 +6,13 @@
6
6
  * dedicated builders despite sharing this module's field/print internals.
7
7
  */
8
8
  export { defineApp, } from "./build.js";
9
+ export { defineDynamicLayout, } from "../dynamic-layout/build.js";
9
10
  export { attachmentField, booleanField, dateField, dateTimeField, decimalField, groupField, htmlField, jsonField, multiPicklistField, numberField, picklistField, relationField, textField, userField, } from "../field/build.js";
10
11
  export { calc, field } from "../field/calc.js";
11
- export * as accessPolicyFilter from "../access-policy/filter.js";
12
+ export { definePhoneService, callerAccessMode, } from "../phone-service/index.js";
13
+ export { preservePulledCalculation } from "./deserializer/pulled-expression.js";
14
+ export { groupId, userId } from "../access-policy/build.js";
15
+ export { roleAutoShare, rolePermissionGroup, rolePermissionLevel, userRef } from "../role/build.js";
16
+ export { serviceAccountRoleRef, serviceAccountStatus } from "../service-account/build.js";
17
+ export { serviceAccountRef } from "../service-account/ref.js";
18
+ export * as filter from "../shared/filters/index.js";
@@ -1,7 +1,7 @@
1
1
  /** The app entity's graph module + resource-type constant (see src/graph/). */
2
2
  import { NO_CATALOG, } from "../../graph/types.js";
3
3
  import { appendFieldLocals } from "../field/locals.js";
4
- import { LAYOUT_RESOURCE_TYPE, LIST_VIEW_RESOURCE_TYPE } from "../view/types.js";
4
+ import { AGENT_VIEW_RESOURCE_TYPE, CALENDAR_VIEW_RESOURCE_TYPE, DASHBOARD_VIEW_RESOURCE_TYPE, KANBAN_VIEW_RESOURCE_TYPE, LAYOUT_RESOURCE_TYPE, LIST_VIEW_RESOURCE_TYPE } from "../view/types.js";
5
5
  import { appFromTf } from "./from-tf.js";
6
6
  import { appendAppLocals } from "./locals.js";
7
7
  import { appToTf } from "./to-tf.js";
@@ -16,13 +16,38 @@ function extractAppStreamRoot(stream, ctx) {
16
16
  const viewBlocks = stream.byKind.get("view") ?? [];
17
17
  const layoutBlocks = viewBlocks.filter((b) => b.type === LAYOUT_RESOURCE_TYPE);
18
18
  const listViewBlocks = viewBlocks.filter((b) => b.type === LIST_VIEW_RESOURCE_TYPE);
19
+ const calendarViewBlocks = viewBlocks.filter((b) => b.type === CALENDAR_VIEW_RESOURCE_TYPE);
20
+ const kanbanViewBlocks = viewBlocks.filter((b) => b.type === KANBAN_VIEW_RESOURCE_TYPE);
21
+ const dashboardViewBlocks = viewBlocks.filter((b) => b.type === DASHBOARD_VIEW_RESOURCE_TYPE);
22
+ const agentViewBlocks = viewBlocks.filter((b) => b.type === AGENT_VIEW_RESOURCE_TYPE);
19
23
  const managedViewOrderBlocks = stream.byKind.get("managed-view-order") ?? [];
24
+ const recordCreateFormBlocks = stream.byKind.get("record-create-form") ?? [];
25
+ const dynamicLayoutBlocks = stream.byKind.get("dynamic-layout") ?? [];
26
+ const relationshipBlocks = stream.byKind.get("relationship") ?? [];
27
+ const dashboardBlocks = stream.byKind.get("dashboard") ?? [];
28
+ const dashboardWidgetBlocks = stream.byKind.get("dashboard-widget") ?? [];
29
+ const widgetBlocks = stream.byKind.get("widget") ?? [];
20
30
  const accessPolicyBlocks = stream.byKind.get("access-policy") ?? [];
31
+ const roleBlocks = stream.byKind.get("role") ?? [];
32
+ const serviceAccountBlocks = [
33
+ ...(stream.byKind.get("service-account") ?? []),
34
+ ...(stream.familyByKind.get("service-account") ?? []),
35
+ ];
21
36
  const { app, cloudLinkHandle } = appFromTf(appBlocks[0], fieldBlocks, ctx, {
22
37
  layoutBlocks,
23
38
  listViewBlocks,
39
+ calendarViewBlocks,
40
+ kanbanViewBlocks,
41
+ dashboardViewBlocks,
42
+ agentViewBlocks,
24
43
  managedViewOrderBlocks,
25
- }, accessPolicyBlocks);
44
+ recordCreateFormBlocks,
45
+ dynamicLayoutBlocks,
46
+ relationshipBlocks,
47
+ dashboardBlocks,
48
+ dashboardWidgetBlocks,
49
+ widgetBlocks,
50
+ }, accessPolicyBlocks, roleBlocks, serviceAccountBlocks);
26
51
  return {
27
52
  instance: app,
28
53
  ...(cloudLinkHandle !== undefined && { cloudLinkHandle }),
@@ -17,11 +17,18 @@
17
17
  import { EntityTfError } from "../../engine/entity.js";
18
18
  import { expr, snakeSlug } from "../../engine/tf/index.js";
19
19
  import { accessPolicyToTf } from "../access-policy/to-tf.js";
20
+ import { dashboardsToTf } from "../dashboard/to-tf.js";
20
21
  import { picklistLabel } from "../field/options.js";
22
+ import { dynamicLayoutsToTf } from "../dynamic-layout/to-tf.js";
21
23
  import { fieldToTf } from "../field/to-tf.js";
22
24
  import { SUB_TYPE_BY_TYPE_KEY } from "../field/types.js";
23
25
  import { CATEGORY_ORG_BAG } from "../org/category.js";
24
26
  import { CLOUD_LINK_ORG_BAG } from "../org/cloud-link.js";
27
+ import { recordCreateFormToTf } from "../record-create-form/to-tf.js";
28
+ import { relationshipsToTf } from "../relationship/to-tf.js";
29
+ import { rolesToTf } from "../role/to-tf.js";
30
+ import { serviceAccountsToTf } from "../service-account/to-tf.js";
31
+ import { widgetsToTf } from "../widget/to-tf.js";
25
32
  import { viewToTf } from "../view/to-tf.js";
26
33
  import { APP_RESOURCE_TYPE } from "./module.js";
27
34
  /** System-field tags that fold into the app resource instead of emitting a field resource. */
@@ -198,13 +205,64 @@ export function appToTf(entity, ctx) {
198
205
  appAttrs["status_options"] = statusOptions ?? [];
199
206
  appAttrs["stages"] = stages ?? [];
200
207
  // --- View pass: layouts / list views / view order (entities/view), owner passed in.
201
- const { blocks: viewBlocks } = viewToTf(payload.layouts, payload.listViews, payload.viewOrder, {
208
+ blocks.push(...dashboardsToTf(payload.dashboards, {
209
+ ownerTfLabel: ctx.appTfLabel,
210
+ scope: "app",
211
+ ownerType: "APP_ASPECT",
212
+ ownerId: objectId,
213
+ ownerRefName: ctx.appRefName,
214
+ ownerResourceType: APP_RESOURCE_TYPE,
215
+ orgRefs: ctx.orgRefs,
216
+ workspaceAspects: ctx.workspaceAspects,
217
+ diagnostics: ctx.diagnostics,
218
+ }));
219
+ blocks.push(...widgetsToTf(payload.widgets, {
220
+ ownerRefName: ctx.appRefName,
221
+ ownerTfLabel: ctx.appTfLabel,
222
+ ownerType: APP_RESOURCE_TYPE,
223
+ scope: "app",
224
+ objectId,
225
+ orgRefs: ctx.orgRefs,
226
+ workspaceAspects: ctx.workspaceAspects,
227
+ diagnostics: ctx.diagnostics,
228
+ }));
229
+ const { blocks: viewBlocks } = viewToTf(payload.layouts, payload.listViews, payload.calendarViews, payload.kanbanViews, payload.dashboardViews, payload.agentViews, payload.viewOrder, {
230
+ ownerRefName: ctx.appRefName,
202
231
  ownerTfLabel: ctx.appTfLabel,
203
232
  aspectName: payload.name ?? "",
204
233
  objectId,
234
+ dashboardKeys: new Set(Object.keys(payload.dashboards ?? {})),
235
+ orgRefs: ctx.orgRefs,
205
236
  diagnostics: ctx.diagnostics,
206
237
  });
207
238
  blocks.push(...viewBlocks);
239
+ const recordCreateForm = recordCreateFormToTf(payload.recordCreateForm, {
240
+ ownerRefName: ctx.appRefName,
241
+ ownerTfLabel: ctx.appTfLabel,
242
+ scope: "app",
243
+ objectId,
244
+ diagnostics: ctx.diagnostics,
245
+ });
246
+ if (recordCreateForm !== undefined)
247
+ blocks.push(recordCreateForm);
248
+ blocks.push(...dynamicLayoutsToTf(payload.dynamicLayouts, {
249
+ ownerRefName: ctx.appRefName,
250
+ ownerTfLabel: ctx.appTfLabel,
251
+ objectId,
252
+ diagnostics: ctx.diagnostics,
253
+ orgRefs: ctx.orgRefs,
254
+ workspaceAspects: ctx.workspaceAspects,
255
+ }));
256
+ blocks.push(...relationshipsToTf(payload.relationships, {
257
+ ownerRefName: ctx.appRefName,
258
+ ownerTfLabel: ctx.appTfLabel,
259
+ ownerType: "elementum_app",
260
+ scope: "app",
261
+ objectId,
262
+ orgRefs: ctx.orgRefs,
263
+ workspaceAspects: ctx.workspaceAspects,
264
+ diagnostics: ctx.diagnostics,
265
+ }));
208
266
  // --- Access policy pass (entities/access-policy), owner passed in.
209
267
  // Authored entries only. Creating an app also has the platform mint a
210
268
  // creator policy (userIds = [you]) that is NOT in this payload — pull
@@ -219,6 +277,22 @@ export function appToTf(entity, ctx) {
219
277
  });
220
278
  blocks.push(block);
221
279
  }
280
+ blocks.push(...rolesToTf(payload.roles, {
281
+ ownerRefName: ctx.appRefName,
282
+ ownerTfLabel: ctx.appTfLabel,
283
+ scope: "app",
284
+ objectId,
285
+ serviceAccounts: payload.serviceAccounts,
286
+ orgRefs: ctx.orgRefs,
287
+ diagnostics: ctx.diagnostics,
288
+ }));
289
+ blocks.push(...serviceAccountsToTf(payload.serviceAccounts, {
290
+ ownerTfLabel: ctx.appTfLabel,
291
+ appId: objectId,
292
+ roles: payload.roles,
293
+ orgRefs: ctx.orgRefs,
294
+ diagnostics: ctx.diagnostics,
295
+ }));
222
296
  blocks.unshift({ kind: "resource", type: APP_RESOURCE_TYPE, label: ctx.appTfLabel, attrs: appAttrs });
223
297
  return { blocks, fieldAddresses, fieldNames, fieldMetadata };
224
298
  }
@@ -1,24 +1,39 @@
1
- import { type AspectRef, type ApprovalChainRef, type FieldRef } from "../../catalog/index.js";
1
+ import { type ApprovalProcessRef, type CatalogRef, type FieldRef } from "../../catalog/index.js";
2
2
  import type { DeployableEntity, EntityDeployOptions } from "../../engine/entity.js";
3
- import type { ApprovalStep } from "./steps.js";
4
- export interface DefineApprovalChainV2Options extends EntityDeployOptions {
5
- readonly handle?: string;
3
+ type AppOwner = CatalogRef<"app">;
4
+ type OwnedField<App extends AppOwner> = App extends {
5
+ readonly fields: infer Fields;
6
+ } ? Fields extends Readonly<Record<string, FieldRef>> ? Fields[keyof Fields] : FieldRef<App["refName"]> : FieldRef<App["refName"]>;
7
+ export interface UnsafeApprovalStageId {
8
+ readonly __unsafe: "approvalStageId";
9
+ readonly value: string;
10
+ }
11
+ /** Explicit escape hatch used only when pull cannot recover a portable stage key. */
12
+ export declare function unsafeApprovalStageId(value: string): UnsafeApprovalStageId;
13
+ interface DefineApprovalProcessBase<App extends AppOwner> extends EntityDeployOptions {
14
+ /** The app that owns this approval process. */
15
+ readonly app: App;
6
16
  readonly name: string;
7
- readonly parent?: string;
8
- /** The owning app's stage this chain gates (raw id — stages aren't v2-tokenized). */
9
- readonly stageId: string;
10
- /** A related app whose records the chain also touches (token → id at deploy). */
11
- readonly relatedApp?: AspectRef;
17
+ readonly numberOfDynamicApprovers: number;
18
+ readonly managedByAutomation?: boolean;
12
19
  readonly defaultReason?: string;
13
20
  readonly summary?: string;
14
21
  readonly approveButton?: string;
15
22
  readonly denyButton?: string;
16
23
  readonly exceptionButton?: string;
17
- /** Fields locked while the chain is in flight (tokens → ids at deploy). */
18
- readonly lockedFields?: readonly FieldRef[];
19
- readonly steps: readonly ApprovalStep[];
24
+ readonly lockedFields?: readonly OwnedField<App>[];
25
+ }
26
+ export type DefineApprovalProcessOptions<App extends AppOwner = AppOwner> = DefineApprovalProcessBase<App> & ({
27
+ readonly stage?: string;
28
+ readonly unsafeStageId?: never;
29
+ } | {
30
+ readonly stage?: never;
31
+ readonly unsafeStageId: UnsafeApprovalStageId;
32
+ });
33
+ export interface ApprovalProcessConfigured<App extends AppOwner = AppOwner> {
34
+ ref<const RefName extends string>(refName: RefName): ApprovalProcessRef<App["refName"], RefName>;
35
+ def(refName: string): DeployableEntity;
20
36
  }
21
- /** Build a v2 approval-chain entity (app-owned; PUT-updatable). */
22
- export declare function defineApprovalChain(opts: DefineApprovalChainV2Options): DeployableEntity & {
23
- readonly ref: ApprovalChainRef;
24
- };
37
+ /** Define an app-owned approval process using the provider's dynamic-approver contract. */
38
+ export declare function defineApprovalProcess<App extends AppOwner>(opts: DefineApprovalProcessOptions<App>): ApprovalProcessConfigured<App>;
39
+ export {};
@@ -1,56 +1,56 @@
1
- /**
2
- * v2 approval-chain authoring — `defineApprovalChain`. Parallel to v1
3
- * `src/approvalChains/`, but standalone: produces a `DeployableEntity` of kind
4
- * `approvalChain` (app-owned) whose `lockedFields` and `relatedApp` are catalog
5
- * tokens resolved at deploy. Approval chains support PUT, so a changed one
6
- * updates in place.
7
- *
8
- * `stageId` is carried raw — stages are app config, not a managed v2 entity (no
9
- * token to resolve); same for step user/group ids (org-directory entities).
10
- */
11
1
  import { EdkValidationError } from "../../../elementum-entity-client/errors.js";
12
- import { slimTokens } from "../../catalog/index.js";
13
- function serializeStep(step) {
14
- if (step.kind === "user") {
15
- return { ...(step.id != null ? { id: step.id } : {}), user: { userId: step.ref.id } };
16
- }
17
- return {
18
- ...(step.id != null ? { id: step.id } : {}),
19
- group: {
20
- groupId: step.ref.id,
21
- numberOfApprovalsRequired: step.approvalsRequired,
22
- numberOfDenialsRequired: step.denialsRequired,
23
- },
24
- };
2
+ import { slimTokens, } from "../../catalog/index.js";
3
+ /** Explicit escape hatch used only when pull cannot recover a portable stage key. */
4
+ export function unsafeApprovalStageId(value) {
5
+ if (value.trim() === "")
6
+ throw new EdkValidationError("unsafeApprovalStageId requires a non-empty platform id.");
7
+ return { __unsafe: "approvalStageId", value };
25
8
  }
26
- /** Build a v2 approval-chain entity (app-owned; PUT-updatable). */
27
- export function defineApprovalChain(opts) {
28
- const ref = { __kind: "approvalChain", refName: opts.handle ?? "", name: opts.name, parent: opts.parent ?? "" };
29
- if (opts.steps.length === 0) {
30
- throw new EdkValidationError(`defineApprovalChain "${opts.name}": at least one step is required.`);
9
+ /** Define an app-owned approval process using the provider's dynamic-approver contract. */
10
+ export function defineApprovalProcess(opts) {
11
+ if ("steps" in opts) {
12
+ throw new EdkValidationError("defineApprovalProcess static steps are not supported; use the dynamic approver contract.");
13
+ }
14
+ if (opts.name.trim() === "")
15
+ throw new EdkValidationError("defineApprovalProcess requires a non-empty name.");
16
+ if (!Number.isInteger(opts.numberOfDynamicApprovers) || opts.numberOfDynamicApprovers < 0) {
17
+ throw new EdkValidationError("defineApprovalProcess numberOfDynamicApprovers must be an integer >= 0.");
31
18
  }
32
- const payload = {
33
- ...(opts.relatedApp !== undefined
34
- ? { relatedAspectOwnerId: opts.relatedApp, relatedAspectOwnerType: "AspectApp" } // token → id
35
- : {}),
19
+ for (const field of opts.lockedFields ?? []) {
20
+ if (field.parent !== opts.app.refName) {
21
+ throw new EdkValidationError(`defineApprovalProcess locked field ${JSON.stringify(field.refName)} belongs to ${JSON.stringify(field.parent)}, not app ${JSON.stringify(opts.app.refName)}.`);
22
+ }
23
+ }
24
+ const payload = slimTokens({
36
25
  name: opts.name,
37
- stageId: opts.stageId,
38
- ...(opts.defaultReason != null ? { defaultReason: opts.defaultReason } : {}),
39
- ...(opts.summary != null ? { summary: opts.summary } : {}),
40
- ...(opts.approveButton != null ? { approveButton: opts.approveButton } : {}),
41
- ...(opts.denyButton != null ? { denyButton: opts.denyButton } : {}),
42
- ...(opts.exceptionButton != null ? { exceptionButton: opts.exceptionButton } : {}),
43
- ...(opts.lockedFields != null && opts.lockedFields.length > 0
44
- ? { lockedAspectFieldIds: opts.lockedFields } // FieldRef tokens → ids at deploy
45
- : {}),
46
- approvalTemplates: opts.steps.map(serializeStep),
47
- };
26
+ ...(opts.stage !== undefined ? { stage: opts.stage } : {}),
27
+ ...(opts.unsafeStageId !== undefined ? { stageId: opts.unsafeStageId.value } : {}),
28
+ numberOfDynamicApprovers: opts.numberOfDynamicApprovers,
29
+ managedByAutomation: opts.managedByAutomation ?? false,
30
+ denyButton: opts.denyButton ?? "Deny",
31
+ ...(opts.defaultReason !== undefined ? { defaultReason: opts.defaultReason } : {}),
32
+ ...(opts.summary !== undefined ? { summary: opts.summary } : {}),
33
+ approveButton: opts.approveButton ?? "Approve",
34
+ ...(opts.exceptionButton !== undefined ? { exceptionButton: opts.exceptionButton } : {}),
35
+ ...(opts.lockedFields !== undefined ? { lockedFieldIds: opts.lockedFields } : {}),
36
+ });
48
37
  return {
49
- ref,
50
- kind: "approvalChain",
51
- parent: opts.parent ?? "",
52
- refName: opts.handle ?? "",
53
- payload: slimTokens(payload),
54
- ...(opts.enabled !== undefined ? { enabled: opts.enabled } : {}),
38
+ ref(refName) {
39
+ return {
40
+ __kind: "approvalChain",
41
+ refName,
42
+ name: opts.name,
43
+ parent: opts.app.refName,
44
+ };
45
+ },
46
+ def(refName) {
47
+ return {
48
+ kind: "approvalChain",
49
+ parent: opts.app.refName,
50
+ refName,
51
+ payload,
52
+ ...(opts.enabled !== undefined ? { enabled: opts.enabled } : {}),
53
+ };
54
+ },
55
55
  };
56
56
  }
@@ -0,0 +1,17 @@
1
+ import { type FromTfContext } from "../../engine/pull/context.js";
2
+ import { type TfBlock } from "../../engine/tf/index.js";
3
+ export interface NormalizedApprovalChain {
4
+ readonly refName: string;
5
+ readonly name: string;
6
+ readonly stage?: string;
7
+ readonly stageId?: string;
8
+ readonly numberOfDynamicApprovers: number;
9
+ readonly managedByAutomation: boolean;
10
+ readonly denyButton: string;
11
+ readonly approveButton: string;
12
+ readonly exceptionButton?: string;
13
+ readonly defaultReason?: string;
14
+ readonly summary?: string;
15
+ readonly lockedFields: readonly string[];
16
+ }
17
+ export declare function approvalChainFromTf(block: TfBlock, appTfLabel: string, _ctx: FromTfContext): NormalizedApprovalChain;