@elementumai/edk 0.9.2 → 0.9.6

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 (296) hide show
  1. package/README.md +34 -26
  2. package/dist-sdk/elementum-entity-client/clients/automation/models/automation.d.ts +1 -1
  3. package/dist-sdk/elementum-entity-client/clients/skills/models/skill.d.ts +1 -1
  4. package/dist-sdk/elementum-entity-client/clients/skills/models/skill.js +1 -1
  5. package/dist-sdk/pull/util.d.ts +1 -1
  6. package/dist-sdk/pull/util.js +3 -3
  7. package/dist-sdk/src/catalog/factories.d.ts +49 -10
  8. package/dist-sdk/src/catalog/factories.js +94 -13
  9. package/dist-sdk/src/catalog/from-authoring.d.ts +5 -5
  10. package/dist-sdk/src/catalog/from-authoring.js +7 -7
  11. package/dist-sdk/src/catalog/index.d.ts +2 -2
  12. package/dist-sdk/src/catalog/index.js +1 -1
  13. package/dist-sdk/src/catalog/org.js +62 -4
  14. package/dist-sdk/src/catalog/render-helpers.d.ts +1 -1
  15. package/dist-sdk/src/catalog/render-helpers.js +1 -1
  16. package/dist-sdk/src/catalog/render.d.ts +1 -0
  17. package/dist-sdk/src/catalog/render.js +2 -2
  18. package/dist-sdk/src/catalog/token.js +11 -4
  19. package/dist-sdk/src/catalog/types.d.ts +33 -4
  20. package/dist-sdk/src/catalog/types.js +5 -0
  21. package/dist-sdk/src/core/index.d.ts +10 -10
  22. package/dist-sdk/src/core/index.js +9 -9
  23. package/dist-sdk/src/core/render-tree.d.ts +1 -1
  24. package/dist-sdk/src/core/render-tree.js +1 -2
  25. package/dist-sdk/src/core/types/ai-provider.d.ts +1 -1
  26. package/dist-sdk/src/core/types/ai-provider.js +1 -1
  27. package/dist-sdk/src/core/types/app.d.ts +66 -30
  28. package/dist-sdk/src/core/types/app.js +2 -2
  29. package/dist-sdk/src/core/types/aspect-category.d.ts +4 -4
  30. package/dist-sdk/src/core/types/aspect-category.js +4 -4
  31. package/dist-sdk/src/core/types/cloud-link.d.ts +3 -3
  32. package/dist-sdk/src/core/types/cloud-link.js +3 -3
  33. package/dist-sdk/src/core/types/display-block.d.ts +2 -2
  34. package/dist-sdk/src/core/types/display-block.js +2 -2
  35. package/dist-sdk/src/core/types/group.d.ts +1 -1
  36. package/dist-sdk/src/core/types/group.js +1 -1
  37. package/dist-sdk/src/core/types/user.d.ts +1 -1
  38. package/dist-sdk/src/core/types/user.js +1 -1
  39. package/dist-sdk/src/core/wire/ref-serializer.js +3 -3
  40. package/dist-sdk/src/engine/build/context.d.ts +20 -13
  41. package/dist-sdk/src/engine/entity.d.ts +1 -1
  42. package/dist-sdk/src/engine/pull/context.d.ts +34 -0
  43. package/dist-sdk/src/engine/pull/context.js +14 -0
  44. package/dist-sdk/src/engine/pull/org.d.ts +9 -0
  45. package/dist-sdk/src/engine/pull/org.js +33 -0
  46. package/dist-sdk/src/engine/pull/ref-only.d.ts +37 -0
  47. package/dist-sdk/src/engine/pull/ref-only.js +204 -0
  48. package/dist-sdk/src/engine/tf/expr.d.ts +6 -2
  49. package/dist-sdk/src/engine/tf/expr.js +18 -13
  50. package/dist-sdk/src/engine/tf/index.d.ts +1 -1
  51. package/dist-sdk/src/engine/tf/index.js +1 -1
  52. package/dist-sdk/src/engine/tf/model.d.ts +8 -1
  53. package/dist-sdk/src/engine/tf/model.js +4 -0
  54. package/dist-sdk/src/engine/tf/parse.js +13 -2
  55. package/dist-sdk/src/engine/tf/render.js +4 -0
  56. package/dist-sdk/src/entities/access-policy/build.d.ts +4 -5
  57. package/dist-sdk/src/entities/access-policy/build.js +1 -1
  58. package/dist-sdk/src/entities/access-policy/from-tf.d.ts +4 -4
  59. package/dist-sdk/src/entities/access-policy/from-tf.js +12 -13
  60. package/dist-sdk/src/entities/access-policy/principal.d.ts +14 -4
  61. package/dist-sdk/src/entities/access-policy/to-tf.d.ts +14 -2
  62. package/dist-sdk/src/entities/access-policy/to-tf.js +36 -6
  63. package/dist-sdk/src/entities/agent/build.d.ts +3 -3
  64. package/dist-sdk/src/entities/agent/build.js +5 -5
  65. package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.d.ts +6 -1
  66. package/dist-sdk/src/entities/agent/deserializer/print-agent-v2.js +68 -18
  67. package/dist-sdk/src/entities/agent/from-tf.d.ts +3 -1
  68. package/dist-sdk/src/entities/agent/from-tf.js +12 -4
  69. package/dist-sdk/src/entities/agent/index.d.ts +2 -2
  70. package/dist-sdk/src/entities/agent/index.js +1 -1
  71. package/dist-sdk/src/entities/agent/module.js +2 -0
  72. package/dist-sdk/src/entities/agent/to-tf.d.ts +5 -2
  73. package/dist-sdk/src/entities/agent/to-tf.js +56 -8
  74. package/dist-sdk/src/entities/agent/tools.d.ts +38 -23
  75. package/dist-sdk/src/entities/agent/tools.js +21 -7
  76. package/dist-sdk/src/entities/agent-evaluation/build.d.ts +19 -0
  77. package/dist-sdk/src/entities/agent-evaluation/build.js +41 -0
  78. package/dist-sdk/src/entities/agent-evaluation/deserializer/print-agent-evaluation.d.ts +4 -0
  79. package/dist-sdk/src/entities/agent-evaluation/deserializer/print-agent-evaluation.js +30 -0
  80. package/dist-sdk/src/entities/agent-evaluation/from-tf.d.ts +12 -0
  81. package/dist-sdk/src/entities/agent-evaluation/from-tf.js +46 -0
  82. package/dist-sdk/src/entities/agent-evaluation/index.d.ts +1 -0
  83. package/dist-sdk/src/entities/agent-evaluation/index.js +1 -0
  84. package/dist-sdk/src/entities/agent-evaluation/module.d.ts +3 -0
  85. package/dist-sdk/src/entities/agent-evaluation/module.js +58 -0
  86. package/dist-sdk/src/entities/agent-evaluation/to-tf.d.ts +12 -0
  87. package/dist-sdk/src/entities/agent-evaluation/to-tf.js +35 -0
  88. package/dist-sdk/src/entities/agent-tool/from-tf.d.ts +8 -7
  89. package/dist-sdk/src/entities/agent-tool/from-tf.js +48 -6
  90. package/dist-sdk/src/entities/agent-tool/to-tf.d.ts +10 -2
  91. package/dist-sdk/src/entities/agent-tool/to-tf.js +76 -28
  92. package/dist-sdk/src/entities/agent-tool/types.d.ts +0 -1
  93. package/dist-sdk/src/entities/agent-tool/types.js +10 -37
  94. package/dist-sdk/src/entities/app/build.d.ts +97 -42
  95. package/dist-sdk/src/entities/app/build.js +25 -14
  96. package/dist-sdk/src/entities/app/deserializer/normalize.d.ts +32 -24
  97. package/dist-sdk/src/entities/app/deserializer/pulled-expression.d.ts +1 -1
  98. package/dist-sdk/src/entities/app/deserializer/pulled-expression.js +2 -0
  99. package/dist-sdk/src/entities/app/index.d.ts +11 -8
  100. package/dist-sdk/src/entities/app/index.js +10 -7
  101. package/dist-sdk/src/entities/app/module.js +2 -2
  102. package/dist-sdk/src/entities/app/to-tf.d.ts +1 -1
  103. package/dist-sdk/src/entities/app/to-tf.js +22 -6
  104. package/dist-sdk/src/entities/approval-chain/build.d.ts +1 -1
  105. package/dist-sdk/src/entities/approval-chain/build.js +5 -5
  106. package/dist-sdk/src/entities/approval-chain/index.d.ts +1 -1
  107. package/dist-sdk/src/entities/approval-chain/index.js +1 -1
  108. package/dist-sdk/src/entities/approval-chain/printer.js +2 -2
  109. package/dist-sdk/src/entities/automation/build.d.ts +172 -94
  110. package/dist-sdk/src/entities/automation/build.js +159 -68
  111. package/dist-sdk/src/entities/automation/calculation-expression.d.ts +191 -0
  112. package/dist-sdk/src/entities/automation/calculation-expression.js +57 -0
  113. package/dist-sdk/src/entities/automation/deserializer/ast.d.ts +11 -4
  114. package/dist-sdk/src/entities/automation/deserializer/print-automation.d.ts +18 -14
  115. package/dist-sdk/src/entities/automation/deserializer/print-automation.js +164 -198
  116. package/dist-sdk/src/entities/automation/from-tf.d.ts +26 -2
  117. package/dist-sdk/src/entities/automation/from-tf.js +510 -80
  118. package/dist-sdk/src/entities/automation/index.d.ts +9 -12
  119. package/dist-sdk/src/entities/automation/index.js +11 -13
  120. package/dist-sdk/src/entities/automation/module.js +74 -6
  121. package/dist-sdk/src/entities/automation/operators.d.ts +32 -48
  122. package/dist-sdk/src/entities/automation/operators.js +10 -37
  123. package/dist-sdk/src/entities/automation/output-key-wire-name.d.ts +1 -1
  124. package/dist-sdk/src/entities/automation/output-key-wire-name.js +1 -1
  125. package/dist-sdk/src/entities/automation/script-code.js +13 -22
  126. package/dist-sdk/src/entities/automation/serialize.js +1 -1
  127. package/dist-sdk/src/entities/automation/tasks.d.ts +153 -89
  128. package/dist-sdk/src/entities/automation/tasks.js +64 -11
  129. package/dist-sdk/src/entities/automation/to-tf.d.ts +10 -1
  130. package/dist-sdk/src/entities/automation/to-tf.js +342 -71
  131. package/dist-sdk/src/entities/automation/triggers.d.ts +17 -10
  132. package/dist-sdk/src/entities/automation/triggers.js +7 -1
  133. package/dist-sdk/src/entities/automation/types.d.ts +3 -2
  134. package/dist-sdk/src/entities/automation/types.js +3 -2
  135. package/dist-sdk/src/entities/chart/build.d.ts +95 -0
  136. package/dist-sdk/src/entities/chart/build.js +42 -0
  137. package/dist-sdk/src/entities/chart/from-tf.d.ts +55 -0
  138. package/dist-sdk/src/entities/chart/from-tf.js +269 -0
  139. package/dist-sdk/src/entities/chart/index.d.ts +4 -0
  140. package/dist-sdk/src/entities/chart/index.js +3 -0
  141. package/dist-sdk/src/entities/chart/module.d.ts +3 -0
  142. package/dist-sdk/src/entities/chart/module.js +61 -0
  143. package/dist-sdk/src/entities/chart/printer.d.ts +5 -0
  144. package/dist-sdk/src/entities/chart/printer.js +104 -0
  145. package/dist-sdk/src/entities/chart/to-tf.d.ts +15 -0
  146. package/dist-sdk/src/entities/chart/to-tf.js +150 -0
  147. package/dist-sdk/src/entities/chart/types.d.ts +53 -0
  148. package/dist-sdk/src/entities/chart/types.js +22 -0
  149. package/dist-sdk/src/entities/dashboard/build.d.ts +34 -7
  150. package/dist-sdk/src/entities/dashboard/build.js +16 -1
  151. package/dist-sdk/src/entities/dashboard/from-tf.js +22 -4
  152. package/dist-sdk/src/entities/dashboard/to-tf.d.ts +16 -3
  153. package/dist-sdk/src/entities/dashboard/to-tf.js +37 -10
  154. package/dist-sdk/src/entities/datamine/module.js +1 -1
  155. package/dist-sdk/src/entities/dynamic-layout/build.d.ts +4 -3
  156. package/dist-sdk/src/entities/dynamic-layout/build.js +1 -1
  157. package/dist-sdk/src/entities/dynamic-layout/dialect.d.ts +2 -0
  158. package/dist-sdk/src/entities/dynamic-layout/dialect.js +43 -5
  159. package/dist-sdk/src/entities/dynamic-layout/from-tf.js +12 -6
  160. package/dist-sdk/src/entities/dynamic-layout/to-tf.js +10 -10
  161. package/dist-sdk/src/entities/element/build.d.ts +25 -32
  162. package/dist-sdk/src/entities/element/build.js +15 -32
  163. package/dist-sdk/src/entities/element/index.d.ts +7 -5
  164. package/dist-sdk/src/entities/element/index.js +7 -4
  165. package/dist-sdk/src/entities/element/module.js +7 -3
  166. package/dist-sdk/src/entities/element/to-tf.d.ts +2 -1
  167. package/dist-sdk/src/entities/element/to-tf.js +7 -3
  168. package/dist-sdk/src/entities/field/build.d.ts +51 -24
  169. package/dist-sdk/src/entities/field/build.js +31 -6
  170. package/dist-sdk/src/entities/field/calc/aggregate.d.ts +52 -21
  171. package/dist-sdk/src/entities/field/calc/aggregate.js +59 -29
  172. package/dist-sdk/src/entities/field/calc/date.d.ts +78 -29
  173. package/dist-sdk/src/entities/field/calc/date.js +120 -29
  174. package/dist-sdk/src/entities/field/calc/index.d.ts +80 -85
  175. package/dist-sdk/src/entities/field/calc/index.js +82 -139
  176. package/dist-sdk/src/entities/field/calc/numeric.d.ts +8 -12
  177. package/dist-sdk/src/entities/field/calc/numeric.js +10 -27
  178. package/dist-sdk/src/entities/field/calc/runtime.d.ts +19 -2
  179. package/dist-sdk/src/entities/field/calc/runtime.js +79 -8
  180. package/dist-sdk/src/entities/field/calc/text.d.ts +32 -23
  181. package/dist-sdk/src/entities/field/calc/text.js +43 -31
  182. package/dist-sdk/src/entities/field/calc/types.d.ts +36 -81
  183. package/dist-sdk/src/entities/field/calc/types.js +1 -22
  184. package/dist-sdk/src/entities/field/calc.d.ts +71 -48
  185. package/dist-sdk/src/entities/field/calc.js +5 -15
  186. package/dist-sdk/src/entities/field/calculation-types.js +10 -3
  187. package/dist-sdk/src/entities/field/from-tf.js +156 -10
  188. package/dist-sdk/src/entities/field/locals.d.ts +11 -3
  189. package/dist-sdk/src/entities/field/locals.js +15 -2
  190. package/dist-sdk/src/entities/field/module.js +23 -6
  191. package/dist-sdk/src/entities/field/record-shape.d.ts +24 -10
  192. package/dist-sdk/src/entities/field/to-tf.d.ts +40 -1
  193. package/dist-sdk/src/entities/field/to-tf.js +293 -35
  194. package/dist-sdk/src/entities/field/types.d.ts +1 -1
  195. package/dist-sdk/src/entities/field/types.js +7 -1
  196. package/dist-sdk/src/entities/file-reader/build.d.ts +5 -0
  197. package/dist-sdk/src/entities/file-reader/deserializer/print-file-reader.js +1 -1
  198. package/dist-sdk/src/entities/org/cloud-link.js +4 -5
  199. package/dist-sdk/src/entities/org/email-alias.d.ts +2 -0
  200. package/dist-sdk/src/entities/org/email-alias.js +12 -0
  201. package/dist-sdk/src/entities/org/index.d.ts +1 -0
  202. package/dist-sdk/src/entities/org/index.js +1 -0
  203. package/dist-sdk/src/entities/org/phone-provider.js +4 -7
  204. package/dist-sdk/src/entities/organization/build.d.ts +214 -2
  205. package/dist-sdk/src/entities/organization/build.js +145 -4
  206. package/dist-sdk/src/entities/organization/index.d.ts +1 -1
  207. package/dist-sdk/src/entities/organization/index.js +1 -1
  208. package/dist-sdk/src/entities/organization/module.js +4 -1
  209. package/dist-sdk/src/entities/organization/to-tf.d.ts +1 -0
  210. package/dist-sdk/src/entities/organization/to-tf.js +118 -1
  211. package/dist-sdk/src/entities/phone-service/build.d.ts +1 -1
  212. package/dist-sdk/src/entities/phone-service/build.js +2 -2
  213. package/dist-sdk/src/entities/phone-service/deserializer/print-phone-service.js +5 -3
  214. package/dist-sdk/src/entities/phone-service/index.d.ts +1 -1
  215. package/dist-sdk/src/entities/phone-service/index.js +1 -1
  216. package/dist-sdk/src/entities/phone-service/types.js +1 -1
  217. package/dist-sdk/src/entities/record-create-form/to-tf.js +9 -1
  218. package/dist-sdk/src/entities/relationship/to-tf.d.ts +1 -0
  219. package/dist-sdk/src/entities/relationship/to-tf.js +5 -13
  220. package/dist-sdk/src/entities/search-table/build.d.ts +4 -4
  221. package/dist-sdk/src/entities/search-table/build.js +13 -13
  222. package/dist-sdk/src/entities/search-table/index.d.ts +2 -2
  223. package/dist-sdk/src/entities/search-table/index.js +2 -2
  224. package/dist-sdk/src/entities/search-table/printer.js +5 -5
  225. package/dist-sdk/src/entities/service-account/to-tf.d.ts +21 -0
  226. package/dist-sdk/src/entities/service-account/to-tf.js +32 -1
  227. package/dist-sdk/src/entities/shared/context.d.ts +25 -24
  228. package/dist-sdk/src/entities/shared/context.js +36 -35
  229. package/dist-sdk/src/entities/shared/filters/ast.d.ts +10 -3
  230. package/dist-sdk/src/entities/shared/filters/ast.js +1 -0
  231. package/dist-sdk/src/entities/shared/filters/index.d.ts +2 -1
  232. package/dist-sdk/src/entities/shared/filters/index.js +11 -4
  233. package/dist-sdk/src/entities/shared/foreign-ref.d.ts +14 -0
  234. package/dist-sdk/src/entities/shared/foreign-ref.js +12 -0
  235. package/dist-sdk/src/entities/shared/ref.d.ts +26 -11
  236. package/dist-sdk/src/entities/shared/ref.js +8 -3
  237. package/dist-sdk/src/entities/shared/types/common.d.ts +2 -2
  238. package/dist-sdk/src/entities/shared/types/field-types.d.ts +1 -1
  239. package/dist-sdk/src/entities/shared/types/field-types.js +1 -1
  240. package/dist-sdk/src/entities/skill/build.d.ts +2 -2
  241. package/dist-sdk/src/entities/skill/build.js +3 -3
  242. package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.d.ts +1 -1
  243. package/dist-sdk/src/entities/skill/deserializer/print-skill-v2.js +26 -7
  244. package/dist-sdk/src/entities/skill/index.d.ts +1 -1
  245. package/dist-sdk/src/entities/skill/index.js +1 -1
  246. package/dist-sdk/src/entities/skill/module.js +2 -2
  247. package/dist-sdk/src/entities/skill/to-tf.d.ts +1 -1
  248. package/dist-sdk/src/entities/skill/to-tf.js +2 -2
  249. package/dist-sdk/src/entities/skill/tools.d.ts +4 -3
  250. package/dist-sdk/src/entities/skill/tools.js +4 -3
  251. package/dist-sdk/src/entities/skill-tool/from-tf.d.ts +13 -0
  252. package/dist-sdk/src/entities/skill-tool/from-tf.js +42 -0
  253. package/dist-sdk/src/entities/skill-tool/to-tf.js +6 -6
  254. package/dist-sdk/src/entities/table/build.d.ts +1 -1
  255. package/dist-sdk/src/entities/table/build.js +9 -9
  256. package/dist-sdk/src/entities/table/catalog-render.js +9 -1
  257. package/dist-sdk/src/entities/table/deserializer/normalize.js +4 -4
  258. package/dist-sdk/src/entities/table/fields/types.d.ts +1 -1
  259. package/dist-sdk/src/entities/table/fields/types.js +1 -1
  260. package/dist-sdk/src/entities/table/index.d.ts +2 -2
  261. package/dist-sdk/src/entities/table/index.js +3 -3
  262. package/dist-sdk/src/entities/table/module.js +1 -1
  263. package/dist-sdk/src/entities/table/to-tf.js +22 -30
  264. package/dist-sdk/src/entities/task/build.d.ts +1 -1
  265. package/dist-sdk/src/entities/task/build.js +5 -5
  266. package/dist-sdk/src/entities/task/index.d.ts +1 -1
  267. package/dist-sdk/src/entities/task/index.js +1 -1
  268. package/dist-sdk/src/entities/view/build.d.ts +46 -0
  269. package/dist-sdk/src/entities/view/build.js +19 -0
  270. package/dist-sdk/src/entities/view/from-tf.js +68 -18
  271. package/dist-sdk/src/entities/view/module.d.ts +6 -13
  272. package/dist-sdk/src/entities/view/module.js +7 -14
  273. package/dist-sdk/src/entities/view/sharing.d.ts +10 -0
  274. package/dist-sdk/src/entities/view/sharing.js +6 -0
  275. package/dist-sdk/src/entities/view/to-tf.d.ts +21 -19
  276. package/dist-sdk/src/entities/view/to-tf.js +61 -26
  277. package/dist-sdk/src/entities/view/types.js +3 -0
  278. package/dist-sdk/src/entities/visual-flow/build.d.ts +1 -1
  279. package/dist-sdk/src/entities/visual-flow/build.js +8 -8
  280. package/dist-sdk/src/entities/visual-flow/index.d.ts +1 -1
  281. package/dist-sdk/src/entities/visual-flow/index.js +1 -1
  282. package/dist-sdk/src/entities/visual-flow/module.js +1 -1
  283. package/dist-sdk/src/entities/visual-flow/printer.js +3 -3
  284. package/dist-sdk/src/entities/visual-flow/to-tf.d.ts +1 -0
  285. package/dist-sdk/src/entities/visual-flow/to-tf.js +3 -7
  286. package/dist-sdk/src/entities/widget/to-tf.d.ts +1 -0
  287. package/dist-sdk/src/entities/widget/to-tf.js +9 -7
  288. package/dist-sdk/src/graph/index.d.ts +5 -1
  289. package/dist-sdk/src/graph/index.js +4 -1
  290. package/dist-sdk/src/graph/modules.js +6 -1
  291. package/dist-sdk/src/graph/types.d.ts +52 -1
  292. package/dist-sdk/src/internal/safe-identifier.d.ts +4 -0
  293. package/dist-sdk/src/internal/safe-identifier.js +13 -0
  294. package/dist-sdk/src/internal/sdk-package.d.ts +1 -1
  295. package/dist-sdk/src/internal/sdk-package.js +1 -0
  296. package/package.json +12 -3
@@ -9,7 +9,7 @@
9
9
  export const FIELD_SUB_TYPES = [
10
10
  { typeKey: "calculated", resourceType: "elementum_calculated_field", authoringType: "CALCULATED", implemented: true },
11
11
  { typeKey: "text", resourceType: "elementum_text_field", authoringType: "TEXT", implemented: true },
12
- { typeKey: "html", resourceType: "elementum_longtext_field", authoringType: "HTML", implemented: true },
12
+ { typeKey: "html", resourceType: "elementum_longtext_field", authoringType: "RICH_TEXT", implemented: true },
13
13
  { typeKey: "number", resourceType: "elementum_number_field", authoringType: "NUMBER", implemented: true },
14
14
  { typeKey: "decimal", resourceType: "elementum_decimal_field", authoringType: "DECIMAL", implemented: true },
15
15
  { typeKey: "bool", resourceType: "elementum_boolean_field", authoringType: "BOOLEAN", implemented: true },
@@ -65,7 +65,13 @@ export const KNOWN_FIELD_ATTRS = new Set([
65
65
  "related_object_id",
66
66
  "related_label_field_id",
67
67
  "auto_relate",
68
+ "dynamic_config",
68
69
  "decimal_places",
70
+ "currency",
71
+ "percentage",
72
+ "delimiter",
69
73
  "calculation",
70
74
  "calculation_type",
75
+ "include_type",
76
+ "picklist_field_id",
71
77
  ]);
@@ -104,7 +104,12 @@ export interface ExcelFileReaderOptions extends FileReaderOptionsBase {
104
104
  * resource) rather than fabricate a value that would plan a replace.
105
105
  */
106
106
  readonly documentContent?: string;
107
+ /** File name shown for the uploaded sample document. */
107
108
  readonly documentName?: string;
109
+ /**
110
+ * MIME type of the uploaded sample document. For an `.xlsx` workbook, use
111
+ * `application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`.
112
+ */
108
113
  readonly fileType?: string;
109
114
  }
110
115
  export interface JsonFileReaderOptions extends FileReaderOptionsBase {
@@ -41,7 +41,7 @@ function printBody(payload) {
41
41
  // sets them: only needed to CREATE a genuinely new Excel reader, e.g.
42
42
  // documentContent: filebase64("path/to/sample.xlsx"),
43
43
  // documentName: "sample.xlsx",
44
- // fileType: "xlsx",
44
+ // fileType: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
45
45
  ...(payload.documentContent !== undefined ? [` documentContent: ${quote(payload.documentContent)},`] : []),
46
46
  ...(payload.documentName !== undefined ? [` documentName: ${quote(payload.documentName)},`] : []),
47
47
  ...(payload.fileType !== undefined ? [` fileType: ${quote(payload.fileType)},`] : []),
@@ -1,11 +1,10 @@
1
1
  /** Cloud links: org-owned reference identities, name-keyed data lookups. */
2
2
  import { namedOnlyFactoryEntry } from "../../catalog/render-helpers.js";
3
- import { NO_LIFECYCLE, } from "../../graph/types.js";
4
3
  /** org.ts / OrgRefLookup bag — keep in lockstep with `data.orgBag`. */
5
4
  export const CLOUD_LINK_ORG_BAG = "cloudLinks";
6
5
  export const cloudLinkModule = {
7
6
  kind: "cloud-link",
8
- stream: { role: "orgExport" },
7
+ stream: { role: "streamMember" },
9
8
  data: {
10
9
  participates: true,
11
10
  lookupAttr: "name",
@@ -15,10 +14,10 @@ export const cloudLinkModule = {
15
14
  // and the build-vs-export must scope it.
16
15
  referencedByBuild: true,
17
16
  },
18
- authoring: { unit: "none" },
17
+ authoring: { unit: "inline", bag: "cloudLinks" },
19
18
  parents: [{ parent: "org", child: "cloud-link" }],
20
- resource: { shape: "single", resourceType: "elementum_cloudlink", adoptable: false },
21
- lifecycle: NO_LIFECYCLE,
19
+ resource: { shape: "single", resourceType: "elementum_cloudlink", adoptable: true },
20
+ lifecycle: { participates: true },
22
21
  canvas: { participates: true, label: "Cloud Links", glyph: "☁", component: "orgIdentity" },
23
22
  catalog: {
24
23
  participates: true,
@@ -0,0 +1,2 @@
1
+ import { type EntityKindModule } from "../../graph/types.js";
2
+ export declare const emailAliasModule: EntityKindModule;
@@ -0,0 +1,12 @@
1
+ import { NO_CANVAS, NO_CATALOG, NO_DATA } from "../../graph/types.js";
2
+ export const emailAliasModule = {
3
+ kind: "email-alias",
4
+ stream: { role: "streamMember" },
5
+ authoring: { unit: "inline", bag: "emailAliases" },
6
+ parents: [{ parent: "org", child: "email-alias" }],
7
+ resource: { shape: "single", resourceType: "elementum_email_alias", adoptable: true },
8
+ data: NO_DATA,
9
+ lifecycle: { participates: true },
10
+ canvas: NO_CANVAS,
11
+ catalog: NO_CATALOG,
12
+ };
@@ -6,6 +6,7 @@ export { aiProviderModules } from "./ai-provider.js";
6
6
  export { categoryModule } from "./category.js";
7
7
  export { cloudLinkModule } from "./cloud-link.js";
8
8
  export { connectorModule } from "./connector.js";
9
+ export { emailAliasModule } from "./email-alias.js";
9
10
  export { groupModule } from "./group.js";
10
11
  export { phoneProviderModule } from "./phone-provider.js";
11
12
  export { roleModule } from "./role.js";
@@ -6,6 +6,7 @@ export { aiProviderModules } from "./ai-provider.js";
6
6
  export { categoryModule } from "./category.js";
7
7
  export { cloudLinkModule } from "./cloud-link.js";
8
8
  export { connectorModule } from "./connector.js";
9
+ export { emailAliasModule } from "./email-alias.js";
9
10
  export { groupModule } from "./group.js";
10
11
  export { phoneProviderModule } from "./phone-provider.js";
11
12
  export { roleModule } from "./role.js";
@@ -1,10 +1,9 @@
1
1
  /** Phone providers: org-owned reference identities, name-keyed data lookups. */
2
2
  import { namedOnlyFactoryEntry } from "../../catalog/render-helpers.js";
3
- import { NO_LIFECYCLE } from "../../graph/types.js";
4
3
  export const PHONE_PROVIDER_ORG_BAG = "phoneProviders";
5
4
  export const phoneProviderModule = {
6
5
  kind: "phone-provider",
7
- stream: { role: "orgExport" },
6
+ stream: { role: "streamMember" },
8
7
  data: {
9
8
  participates: true,
10
9
  resourceType: "elementum_phone_provider",
@@ -13,12 +12,10 @@ export const phoneProviderModule = {
13
12
  orgBag: PHONE_PROVIDER_ORG_BAG,
14
13
  referencedByBuild: true,
15
14
  },
16
- authoring: { unit: "none" },
15
+ authoring: { unit: "inline", bag: "phoneProviders" },
17
16
  parents: [{ parent: "org", child: "phone-provider" }],
18
- // Creation is a separate future tranche; this module currently owns the
19
- // provider's genuine data-source/catalog surface only.
20
- resource: { shape: "none" },
21
- lifecycle: NO_LIFECYCLE,
17
+ resource: { shape: "single", resourceType: "elementum_phone_provider", adoptable: true },
18
+ lifecycle: { participates: true },
22
19
  canvas: { participates: true, label: "Phone Providers", glyph: "☎", component: "orgIdentity" },
23
20
  catalog: {
24
21
  participates: true,
@@ -13,17 +13,229 @@ export interface OrganizationGroup {
13
13
  readonly watchable?: boolean;
14
14
  readonly dynamic?: boolean;
15
15
  readonly tags?: readonly string[];
16
- /** Typed users. Provider IDs stay internal to build and pull. */
16
+ /**
17
+ * Typed users whose membership this configuration owns. Omit the property
18
+ * to preserve membership managed outside EDK; use an empty list to remove
19
+ * all members explicitly. Provider IDs stay internal to build and pull.
20
+ */
17
21
  readonly members?: readonly RoleUserRef[];
18
22
  }
23
+ export interface OrganizationSecret {
24
+ readonly __kind: "organizationSecret";
25
+ /** Terraform variable name. Supply it as TF_VAR_<variable>. */
26
+ readonly variable: string;
27
+ }
28
+ export interface RedactedOrganizationSecret {
29
+ readonly __kind: "redactedOrganizationSecret";
30
+ readonly variable: string;
31
+ }
32
+ export interface UnavailableOrganizationValue {
33
+ readonly __kind: "unavailableOrganizationValue";
34
+ readonly field: string;
35
+ }
36
+ export type OrganizationSecretValue = OrganizationSecret | RedactedOrganizationSecret;
37
+ export declare function secret(variable: string): OrganizationSecret;
38
+ /** Pull-only placeholder for a write-only credential. Replace with secret(...). */
39
+ export declare function redactedSecret(variable: string): RedactedOrganizationSecret;
40
+ /** Pull-only marker for an input the platform does not expose. Replace it with the real value. */
41
+ export declare function unavailableValue(field: string): UnavailableOrganizationValue;
42
+ declare const cloudLinkScheduleUnitBrand: unique symbol;
43
+ export type CloudLinkScheduleUnit = string & {
44
+ readonly [cloudLinkScheduleUnitBrand]: "CloudLinkScheduleUnit";
45
+ };
46
+ export declare const cloudLinkScheduleUnit: {
47
+ readonly hours: CloudLinkScheduleUnit;
48
+ readonly minutes: CloudLinkScheduleUnit;
49
+ };
50
+ declare const cloudLinkWarehouseSizeBrand: unique symbol;
51
+ export type CloudLinkWarehouseSize = string & {
52
+ readonly [cloudLinkWarehouseSizeBrand]: "CloudLinkWarehouseSize";
53
+ };
54
+ export declare const cloudLinkWarehouseSize: {
55
+ readonly xSmall: CloudLinkWarehouseSize;
56
+ readonly small: CloudLinkWarehouseSize;
57
+ readonly medium: CloudLinkWarehouseSize;
58
+ readonly large: CloudLinkWarehouseSize;
59
+ readonly xLarge: CloudLinkWarehouseSize;
60
+ readonly xxLarge: CloudLinkWarehouseSize;
61
+ readonly xxxLarge: CloudLinkWarehouseSize;
62
+ readonly x4Large: CloudLinkWarehouseSize;
63
+ readonly x5Large: CloudLinkWarehouseSize;
64
+ readonly x6Large: CloudLinkWarehouseSize;
65
+ };
66
+ declare const cloudLinkUsageTypeBrand: unique symbol;
67
+ export type CloudLinkUsageType = string & {
68
+ readonly [cloudLinkUsageTypeBrand]: "CloudLinkUsageType";
69
+ };
70
+ export declare const cloudLinkUsageType: {
71
+ readonly standard: CloudLinkUsageType;
72
+ readonly provider: CloudLinkUsageType;
73
+ readonly external: CloudLinkUsageType;
74
+ };
75
+ declare const cloudLinkTypeBrand: unique symbol;
76
+ export type CloudLinkType = string & {
77
+ readonly [cloudLinkTypeBrand]: "CloudLinkType";
78
+ };
79
+ export declare const cloudLinkTypeMetadata: {
80
+ readonly api: {
81
+ readonly config: "api";
82
+ readonly credentials: true;
83
+ };
84
+ readonly bigquery: {
85
+ readonly config: "bigQuery";
86
+ readonly credentials: true;
87
+ };
88
+ readonly databricks: {
89
+ readonly config: "databricks";
90
+ readonly credentials: true;
91
+ };
92
+ readonly elementum: {
93
+ readonly config: undefined;
94
+ readonly credentials: false;
95
+ };
96
+ readonly elementum_snowflake: {
97
+ readonly config: "elementumSnowflake";
98
+ readonly credentials: false;
99
+ };
100
+ readonly snowflake: {
101
+ readonly config: "snowflake";
102
+ readonly credentials: true;
103
+ };
104
+ };
105
+ export declare function cloudLinkScheduleUnitKey(value: CloudLinkScheduleUnit): keyof typeof cloudLinkScheduleUnit | undefined;
106
+ export declare function cloudLinkWarehouseSizeKey(value: CloudLinkWarehouseSize): keyof typeof cloudLinkWarehouseSize | undefined;
107
+ export declare function cloudLinkUsageTypeKey(value: CloudLinkUsageType): keyof typeof cloudLinkUsageType | undefined;
108
+ export declare function isCloudLinkWarehouseSize(value: string): value is CloudLinkWarehouseSize;
109
+ export interface CloudLinkSchedule {
110
+ readonly interval: number;
111
+ readonly unit: CloudLinkScheduleUnit;
112
+ }
113
+ type ExactlyOneCredential<Map extends object> = {
114
+ [K in keyof Map]: {
115
+ readonly [P in K]: Map[K];
116
+ } & {
117
+ readonly [P in Exclude<keyof Map, K>]?: never;
118
+ };
119
+ }[keyof Map];
120
+ export type CloudLinkCredentials = ExactlyOneCredential<{
121
+ readonly bearerToken: {
122
+ readonly token: OrganizationSecretValue;
123
+ };
124
+ readonly password: {
125
+ readonly username: string;
126
+ readonly password: OrganizationSecretValue;
127
+ };
128
+ readonly privateKey: {
129
+ readonly username: string;
130
+ };
131
+ readonly externalOauth: {
132
+ readonly clientId: string;
133
+ readonly clientSecret: OrganizationSecretValue;
134
+ readonly url: string;
135
+ readonly username?: string;
136
+ readonly password?: OrganizationSecretValue;
137
+ };
138
+ readonly serviceAccount: {
139
+ readonly json: OrganizationSecretValue;
140
+ };
141
+ readonly redacted: RedactedOrganizationSecret;
142
+ }>;
143
+ export declare const bearerTokenCredentials: (token: OrganizationSecretValue) => CloudLinkCredentials;
144
+ export declare const passwordCredentials: (opts: {
145
+ readonly username: string;
146
+ readonly password: OrganizationSecretValue;
147
+ }) => CloudLinkCredentials;
148
+ export declare const privateKeyCredentials: (username: string) => CloudLinkCredentials;
149
+ export declare const externalOauthCredentials: (opts: {
150
+ readonly clientId: string;
151
+ readonly clientSecret: OrganizationSecretValue;
152
+ readonly url: string;
153
+ readonly username?: string;
154
+ readonly password?: OrganizationSecretValue;
155
+ }) => CloudLinkCredentials;
156
+ export declare const serviceAccountCredentials: (json: OrganizationSecretValue) => CloudLinkCredentials;
157
+ export interface OrganizationCloudLink {
158
+ readonly name: string;
159
+ readonly type: CloudLinkType;
160
+ readonly cache?: boolean;
161
+ readonly encryptCache?: boolean;
162
+ readonly usageType?: CloudLinkUsageType;
163
+ readonly credentials?: CloudLinkCredentials;
164
+ readonly api?: {
165
+ readonly baseUrl: string;
166
+ };
167
+ readonly bigQuery?: {
168
+ readonly projectId: string;
169
+ readonly datasetId: string;
170
+ readonly location: string;
171
+ readonly readOnly: boolean;
172
+ readonly schedule?: CloudLinkSchedule;
173
+ };
174
+ readonly databricks?: {
175
+ readonly hostname: string;
176
+ readonly port: number;
177
+ readonly database: string;
178
+ readonly schema: string;
179
+ readonly readOnly: boolean;
180
+ readonly schedule?: CloudLinkSchedule;
181
+ };
182
+ readonly elementumSnowflake?: {
183
+ readonly region: string | UnavailableOrganizationValue;
184
+ readonly warehouseSize: CloudLinkWarehouseSize;
185
+ readonly schedule?: CloudLinkSchedule;
186
+ };
187
+ readonly snowflake?: {
188
+ readonly url: string;
189
+ readonly account: string;
190
+ readonly warehouse: string;
191
+ readonly role: string;
192
+ readonly readOnly: boolean;
193
+ readonly createDatabase?: string;
194
+ readonly createSchema?: string;
195
+ readonly gzip?: boolean;
196
+ readonly schedule?: CloudLinkSchedule;
197
+ };
198
+ }
199
+ export interface OrganizationEmailAlias {
200
+ readonly alias: string;
201
+ }
202
+ export interface OrganizationPhoneProvider {
203
+ readonly name: string;
204
+ readonly twilio: {
205
+ readonly accountId: OrganizationSecretValue;
206
+ readonly authToken: OrganizationSecretValue;
207
+ };
208
+ }
209
+ type CloudLinkCommon = Pick<OrganizationCloudLink, "name" | "cache" | "encryptCache" | "usageType" | "credentials">;
210
+ export declare function apiCloudLink(opts: CloudLinkCommon & {
211
+ readonly baseUrl: string;
212
+ }): OrganizationCloudLink;
213
+ export declare function bigQueryCloudLink(opts: CloudLinkCommon & NonNullable<OrganizationCloudLink["bigQuery"]>): OrganizationCloudLink;
214
+ export declare function databricksCloudLink(opts: CloudLinkCommon & NonNullable<OrganizationCloudLink["databricks"]>): OrganizationCloudLink;
215
+ export declare function elementumCloudLink(opts: Omit<CloudLinkCommon, "credentials">): OrganizationCloudLink;
216
+ export declare function elementumSnowflakeCloudLink(opts: Omit<CloudLinkCommon, "credentials"> & NonNullable<OrganizationCloudLink["elementumSnowflake"]>): OrganizationCloudLink;
217
+ export declare function snowflakeCloudLink(opts: CloudLinkCommon & NonNullable<OrganizationCloudLink["snowflake"]>): OrganizationCloudLink;
218
+ export declare function emailAlias(alias: string): OrganizationEmailAlias;
219
+ export declare function twilioPhoneProvider(opts: {
220
+ readonly name: string;
221
+ readonly accountId: OrganizationSecretValue;
222
+ readonly authToken: OrganizationSecretValue;
223
+ }): OrganizationPhoneProvider;
19
224
  export interface DefineOrganizationOptions {
20
225
  readonly categories?: Readonly<Record<string, OrganizationCategory>>;
21
226
  readonly groups?: Readonly<Record<string, OrganizationGroup>>;
227
+ readonly cloudLinks?: Readonly<Record<string, OrganizationCloudLink>>;
228
+ readonly emailAliases?: Readonly<Record<string, OrganizationEmailAlias>>;
229
+ readonly phoneProviders?: Readonly<Record<string, OrganizationPhoneProvider>>;
22
230
  }
23
231
  export interface ConfiguredOrganization {
24
232
  readonly kind: "organizationConfig";
25
233
  readonly categories: Readonly<Record<string, OrganizationCategory>>;
26
234
  readonly groups: Readonly<Record<string, OrganizationGroup>>;
235
+ readonly cloudLinks: Readonly<Record<string, OrganizationCloudLink>>;
236
+ readonly emailAliases: Readonly<Record<string, OrganizationEmailAlias>>;
237
+ readonly phoneProviders: Readonly<Record<string, OrganizationPhoneProvider>>;
27
238
  }
28
239
  /** Organization-owned resources live in one ergonomic, optional `organization.ts` file. */
29
- export declare function defineOrganization(opts: DefineOrganizationOptions): ConfiguredOrganization;
240
+ export declare function organization(opts: DefineOrganizationOptions): ConfiguredOrganization;
241
+ export {};
@@ -1,24 +1,165 @@
1
1
  import { EdkValidationError } from "../../../elementum-entity-client/errors.js";
2
+ export function secret(variable) {
3
+ if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(variable)) {
4
+ throw new EdkValidationError("organization secret variable must be a Terraform identifier; supply it as TF_VAR_<variable>.");
5
+ }
6
+ return { __kind: "organizationSecret", variable };
7
+ }
8
+ /** Pull-only placeholder for a write-only credential. Replace with secret(...). */
9
+ export function redactedSecret(variable) {
10
+ return { __kind: "redactedOrganizationSecret", variable };
11
+ }
12
+ /** Pull-only marker for an input the platform does not expose. Replace it with the real value. */
13
+ export function unavailableValue(field) {
14
+ return { __kind: "unavailableOrganizationValue", field };
15
+ }
16
+ export const cloudLinkScheduleUnit = {
17
+ hours: "HOUR",
18
+ minutes: "MINUTE",
19
+ };
20
+ export const cloudLinkWarehouseSize = {
21
+ xSmall: "XSMALL",
22
+ small: "SMALL",
23
+ medium: "MEDIUM",
24
+ large: "LARGE",
25
+ xLarge: "XLARGE",
26
+ xxLarge: "XXLARGE",
27
+ xxxLarge: "XXXLARGE",
28
+ x4Large: "X4LARGE",
29
+ x5Large: "X5LARGE",
30
+ x6Large: "X6LARGE",
31
+ };
32
+ export const cloudLinkUsageType = {
33
+ standard: "STANDARD",
34
+ provider: "PROVIDER",
35
+ external: "EXTERNAL",
36
+ };
37
+ const cloudLinkType = {
38
+ api: "api",
39
+ bigQuery: "bigquery",
40
+ databricks: "databricks",
41
+ elementum: "elementum",
42
+ elementumSnowflake: "elementum_snowflake",
43
+ snowflake: "snowflake",
44
+ };
45
+ export const cloudLinkTypeMetadata = {
46
+ api: { config: "api", credentials: true },
47
+ bigquery: { config: "bigQuery", credentials: true },
48
+ databricks: { config: "databricks", credentials: true },
49
+ elementum: { config: undefined, credentials: false },
50
+ elementum_snowflake: { config: "elementumSnowflake", credentials: false },
51
+ snowflake: { config: "snowflake", credentials: true },
52
+ };
53
+ export function cloudLinkScheduleUnitKey(value) {
54
+ return Object.entries(cloudLinkScheduleUnit)
55
+ .find(([, candidate]) => candidate === value)?.[0];
56
+ }
57
+ export function cloudLinkWarehouseSizeKey(value) {
58
+ return Object.entries(cloudLinkWarehouseSize)
59
+ .find(([, candidate]) => candidate === value)?.[0];
60
+ }
61
+ export function cloudLinkUsageTypeKey(value) {
62
+ return Object.entries(cloudLinkUsageType)
63
+ .find(([, candidate]) => candidate === value)?.[0];
64
+ }
65
+ export function isCloudLinkWarehouseSize(value) {
66
+ return Object.values(cloudLinkWarehouseSize).some((candidate) => candidate === value);
67
+ }
68
+ export const bearerTokenCredentials = (token) => ({ bearerToken: { token } });
69
+ export const passwordCredentials = (opts) => ({ password: opts });
70
+ export const privateKeyCredentials = (username) => ({ privateKey: { username } });
71
+ export const externalOauthCredentials = (opts) => ({ externalOauth: opts });
72
+ export const serviceAccountCredentials = (json) => ({ serviceAccount: { json } });
73
+ export function apiCloudLink(opts) {
74
+ const { baseUrl, ...common } = opts;
75
+ return { ...common, type: cloudLinkType.api, api: { baseUrl } };
76
+ }
77
+ export function bigQueryCloudLink(opts) {
78
+ const { projectId, datasetId, location, readOnly, schedule, ...common } = opts;
79
+ return { ...common, type: cloudLinkType.bigQuery, bigQuery: { projectId, datasetId, location, readOnly, ...(schedule !== undefined && { schedule }) } };
80
+ }
81
+ export function databricksCloudLink(opts) {
82
+ const { hostname, port, database, schema, readOnly, schedule, ...common } = opts;
83
+ return { ...common, type: cloudLinkType.databricks, databricks: { hostname, port, database, schema, readOnly, ...(schedule !== undefined && { schedule }) } };
84
+ }
85
+ export function elementumCloudLink(opts) {
86
+ return { ...opts, type: cloudLinkType.elementum };
87
+ }
88
+ export function elementumSnowflakeCloudLink(opts) {
89
+ const { region, warehouseSize, schedule, ...common } = opts;
90
+ return { ...common, type: cloudLinkType.elementumSnowflake, elementumSnowflake: { region, warehouseSize, ...(schedule !== undefined && { schedule }) } };
91
+ }
92
+ export function snowflakeCloudLink(opts) {
93
+ const { url, account, warehouse, role, readOnly, createDatabase, createSchema, gzip, schedule, ...common } = opts;
94
+ return { ...common, type: cloudLinkType.snowflake, snowflake: { url, account, warehouse, role, readOnly, ...(createDatabase !== undefined && { createDatabase }), ...(createSchema !== undefined && { createSchema }), ...(gzip !== undefined && { gzip }), ...(schedule !== undefined && { schedule }) } };
95
+ }
96
+ export function emailAlias(alias) {
97
+ if (alias.trim() === "")
98
+ throw new EdkValidationError("email alias must not be empty");
99
+ return { alias };
100
+ }
101
+ export function twilioPhoneProvider(opts) {
102
+ return { name: opts.name, twilio: { accountId: opts.accountId, authToken: opts.authToken } };
103
+ }
2
104
  function requireNames(bag, values) {
3
105
  for (const [key, value] of Object.entries(values ?? {})) {
4
106
  if (key.trim() === "")
5
- throw new EdkValidationError(`defineOrganization ${bag} keys must be non-empty.`);
107
+ throw new EdkValidationError(`organization ${bag} keys must be non-empty.`);
6
108
  if (value.name.trim() === "")
7
- throw new EdkValidationError(`defineOrganization ${bag}.${key}.name must be non-empty.`);
109
+ throw new EdkValidationError(`organization ${bag}.${key}.name must be non-empty.`);
110
+ }
111
+ }
112
+ function validateCloudLink(key, value) {
113
+ const metadata = cloudLinkTypeMetadata[value.type];
114
+ if (metadata === undefined) {
115
+ throw new EdkValidationError(`organization cloudLinks.${key} has unsupported type ${JSON.stringify(value.type)}.`);
116
+ }
117
+ const configs = {
118
+ api: value.api,
119
+ bigQuery: value.bigQuery,
120
+ databricks: value.databricks,
121
+ elementumSnowflake: value.elementumSnowflake,
122
+ snowflake: value.snowflake,
123
+ };
124
+ for (const [configKey, config] of Object.entries(configs)) {
125
+ if (configKey === metadata.config && config === undefined) {
126
+ throw new EdkValidationError(`organization cloudLinks.${key} requires its ${configKey} configuration.`);
127
+ }
128
+ if (configKey !== metadata.config && config !== undefined) {
129
+ throw new EdkValidationError(`organization cloudLinks.${key} type ${value.type} cannot include ${configKey} configuration.`);
130
+ }
131
+ const schedule = config !== undefined && "schedule" in config ? config.schedule : undefined;
132
+ if (schedule !== undefined && (!Number.isInteger(schedule.interval) || schedule.interval < 1)) {
133
+ throw new EdkValidationError(`organization cloudLinks.${key} schedule interval must be a positive integer.`);
134
+ }
135
+ }
136
+ if (!metadata.credentials && value.credentials !== undefined) {
137
+ throw new EdkValidationError(`organization cloudLinks.${key} type ${value.type} cannot include credentials.`);
8
138
  }
9
139
  }
10
140
  /** Organization-owned resources live in one ergonomic, optional `organization.ts` file. */
11
- export function defineOrganization(opts) {
141
+ export function organization(opts) {
12
142
  requireNames("categories", opts.categories);
13
143
  requireNames("groups", opts.groups);
144
+ requireNames("cloudLinks", opts.cloudLinks);
145
+ requireNames("phoneProviders", opts.phoneProviders);
146
+ for (const [key, value] of Object.entries(opts.emailAliases ?? {})) {
147
+ if (key.trim() === "" || value.alias.trim() === "")
148
+ throw new EdkValidationError(`organization emailAliases.${key} must have a non-empty alias.`);
149
+ }
150
+ for (const [key, value] of Object.entries(opts.cloudLinks ?? {}))
151
+ validateCloudLink(key, value);
14
152
  for (const [key, group] of Object.entries(opts.groups ?? {})) {
15
153
  if (group.dynamic === true && (group.members?.length ?? 0) > 0) {
16
- throw new EdkValidationError(`defineOrganization groups.${key} cannot set members on a dynamic group.`);
154
+ throw new EdkValidationError(`organization groups.${key} cannot set members on a dynamic group.`);
17
155
  }
18
156
  }
19
157
  return {
20
158
  kind: "organizationConfig",
21
159
  categories: opts.categories ?? {},
22
160
  groups: opts.groups ?? {},
161
+ cloudLinks: opts.cloudLinks ?? {},
162
+ emailAliases: opts.emailAliases ?? {},
163
+ phoneProviders: opts.phoneProviders ?? {},
23
164
  };
24
165
  }
@@ -1,2 +1,2 @@
1
- export { defineOrganization, type ConfiguredOrganization, type DefineOrganizationOptions, type OrganizationCategory, type OrganizationGroup, } from "./build.js";
1
+ export { organization, apiCloudLink, bearerTokenCredentials, bigQueryCloudLink, cloudLinkScheduleUnit, cloudLinkUsageType, cloudLinkWarehouseSize, databricksCloudLink, emailAlias, elementumCloudLink, elementumSnowflakeCloudLink, externalOauthCredentials, passwordCredentials, privateKeyCredentials, serviceAccountCredentials, snowflakeCloudLink, twilioPhoneProvider, type ConfiguredOrganization, type DefineOrganizationOptions, type OrganizationCategory, type OrganizationGroup, redactedSecret, secret, unavailableValue, type CloudLinkCredentials, type CloudLinkSchedule, type CloudLinkScheduleUnit, type CloudLinkUsageType, type CloudLinkWarehouseSize, type OrganizationCloudLink, type OrganizationEmailAlias, type OrganizationPhoneProvider, type OrganizationSecret, type OrganizationSecretValue, type RedactedOrganizationSecret, type UnavailableOrganizationValue, } from "./build.js";
2
2
  export { userRef, type RoleUserRef as OrganizationUserRef } from "../role/build.js";
@@ -1,2 +1,2 @@
1
- export { defineOrganization, } from "./build.js";
1
+ export { organization, apiCloudLink, bearerTokenCredentials, bigQueryCloudLink, cloudLinkScheduleUnit, cloudLinkUsageType, cloudLinkWarehouseSize, databricksCloudLink, emailAlias, elementumCloudLink, elementumSnowflakeCloudLink, externalOauthCredentials, passwordCredentials, privateKeyCredentials, serviceAccountCredentials, snowflakeCloudLink, twilioPhoneProvider, redactedSecret, secret, unavailableValue, } from "./build.js";
2
2
  export { userRef } from "../role/build.js";
@@ -10,7 +10,10 @@ export const organizationModule = {
10
10
  lifecycle: {
11
11
  participates: true,
12
12
  toTf: (entity, ctx) => ({
13
- blocks: organizationToTf(entity.payload, { orgRefs: ctx.orgRefs }),
13
+ blocks: organizationToTf(entity.payload, {
14
+ orgRefs: ctx.orgRefs,
15
+ diagnostics: ctx.diagnostics,
16
+ }),
14
17
  }),
15
18
  },
16
19
  canvas: NO_CANVAS,
@@ -3,4 +3,5 @@ import { type TfBlock } from "../../engine/tf/index.js";
3
3
  import type { ConfiguredOrganization } from "./build.js";
4
4
  export declare function organizationToTf(organization: ConfiguredOrganization, ctx: {
5
5
  readonly orgRefs: OrgRefLookup;
6
+ readonly diagnostics?: string[];
6
7
  }): TfBlock[];