@keboola/api-client 40.0.0 → 42.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (322) hide show
  1. package/API-SURFACE.md +47 -3
  2. package/CHANGELOG.md +167 -0
  3. package/README.md +1 -1
  4. package/dist/{ManagementClientAuthError-DE7lNGZQ.cjs → ManagementClientAuthError-BFZOtLgj.cjs} +2 -2
  5. package/dist/{ManagementClientAuthError-DE7lNGZQ.cjs.map → ManagementClientAuthError-BFZOtLgj.cjs.map} +1 -1
  6. package/dist/{ManagementClientAuthError-H30lti_Q.js → ManagementClientAuthError-DUbXlry2.js} +2 -2
  7. package/dist/{ManagementClientAuthError-H30lti_Q.js.map → ManagementClientAuthError-DUbXlry2.js.map} +1 -1
  8. package/dist/ai/index.cjs +2 -2
  9. package/dist/ai/index.js +2 -2
  10. package/dist/{appLogs-BBkkUOW1.js → appLogs-DfkItQCO.js} +2 -2
  11. package/dist/{appLogs-BBkkUOW1.js.map → appLogs-DfkItQCO.js.map} +1 -1
  12. package/dist/{appLogs-B9zFJIuy.cjs → appLogs-oZvt59mk.cjs} +2 -2
  13. package/dist/{appLogs-B9zFJIuy.cjs.map → appLogs-oZvt59mk.cjs.map} +1 -1
  14. package/dist/apps/index.cjs +3 -3
  15. package/dist/apps/index.js +3 -3
  16. package/dist/assets/index.cjs +1 -1
  17. package/dist/assets/index.js +1 -1
  18. package/dist/auth/index.cjs +1 -1
  19. package/dist/auth/index.d.cts +1 -1
  20. package/dist/auth/index.d.ts +1 -1
  21. package/dist/auth/index.js +1 -1
  22. package/dist/auth/types.d.cts +2 -2
  23. package/dist/auth/types.d.ts +2 -2
  24. package/dist/{auth-DworfoPy.js → auth-DUHTJTwS.js} +2 -2
  25. package/dist/{auth-DworfoPy.js.map → auth-DUHTJTwS.js.map} +1 -1
  26. package/dist/{auth-Dm0F2rOh.cjs → auth-zfI04oj7.cjs} +2 -2
  27. package/dist/{auth-Dm0F2rOh.cjs.map → auth-zfI04oj7.cjs.map} +1 -1
  28. package/dist/{authClient-BmuUo0J4.cjs → authClient-BxqRGR5c.cjs} +39 -5
  29. package/dist/authClient-BxqRGR5c.cjs.map +1 -0
  30. package/dist/{authClient-vEt_7_uk.d.cts → authClient-CBVAT3v9.d.cts} +49 -2
  31. package/dist/{authClient-CHXWJ9x3.d.ts → authClient-CRumc934.d.ts} +49 -2
  32. package/dist/{authClient-CgcDGd30.js → authClient-CX4buUMc.js} +39 -5
  33. package/dist/authClient-CX4buUMc.js.map +1 -0
  34. package/dist/billing/index.cjs +2 -2
  35. package/dist/billing/index.js +2 -2
  36. package/dist/businessWorkspaceApi/index.cjs +1 -1
  37. package/dist/businessWorkspaceApi/index.js +1 -1
  38. package/dist/{businessWorkspaceApi-BLUdefRF.js → businessWorkspaceApi-DFky1k61.js} +3 -3
  39. package/dist/{businessWorkspaceApi-BLUdefRF.js.map → businessWorkspaceApi-DFky1k61.js.map} +1 -1
  40. package/dist/{businessWorkspaceApi-6tCDdpnY.cjs → businessWorkspaceApi-Uzqu0PJM.cjs} +3 -3
  41. package/dist/{businessWorkspaceApi-6tCDdpnY.cjs.map → businessWorkspaceApi-Uzqu0PJM.cjs.map} +1 -1
  42. package/dist/chat/index.cjs +3 -3
  43. package/dist/chat/index.js +3 -3
  44. package/dist/{componentId-57vjsa2i.cjs → componentId-D4jp6a13.cjs} +19 -1
  45. package/dist/componentId-D4jp6a13.cjs.map +1 -0
  46. package/dist/{componentId-C6WZa_R1.js → componentId-DmHwHG5V.js} +19 -1
  47. package/dist/componentId-DmHwHG5V.js.map +1 -0
  48. package/dist/{configurations-IYyOvhI3.cjs → configurations-D_Rbs0Wl.cjs} +2 -2
  49. package/dist/{configurations-IYyOvhI3.cjs.map → configurations-D_Rbs0Wl.cjs.map} +1 -1
  50. package/dist/{configurations-BPKGGy-M.js → configurations-DcpUlC8I.js} +2 -2
  51. package/dist/{configurations-BPKGGy-M.js.map → configurations-DcpUlC8I.js.map} +1 -1
  52. package/dist/constants/index.cjs +1 -1
  53. package/dist/constants/index.d.cts +1 -1
  54. package/dist/constants/index.d.ts +1 -1
  55. package/dist/constants/index.js +1 -1
  56. package/dist/{createFetchClient-Cwp8max9.cjs → createFetchClient-BgihytBn.cjs} +2 -1
  57. package/dist/createFetchClient-BgihytBn.cjs.map +1 -0
  58. package/dist/{createFetchClient-DXHQK63w.js → createFetchClient-cgWkwgAQ.js} +2 -1
  59. package/dist/createFetchClient-cgWkwgAQ.js.map +1 -0
  60. package/dist/{createGenericFetchClient-Dl9cqTvR.cjs → createGenericFetchClient-C7Y0YVfc.cjs} +2 -2
  61. package/dist/{createGenericFetchClient-Dl9cqTvR.cjs.map → createGenericFetchClient-C7Y0YVfc.cjs.map} +1 -1
  62. package/dist/{createGenericFetchClient-Dg1rgzmG.js → createGenericFetchClient-CX9Hn3Aq.js} +2 -2
  63. package/dist/{createGenericFetchClient-Dg1rgzmG.js.map → createGenericFetchClient-CX9Hn3Aq.js.map} +1 -1
  64. package/dist/{createOpenapiFetchClient-DZUOVupy.js → createOpenapiFetchClient-BxcLLU_N.js} +2 -2
  65. package/dist/{createOpenapiFetchClient-DZUOVupy.js.map → createOpenapiFetchClient-BxcLLU_N.js.map} +1 -1
  66. package/dist/{createOpenapiFetchClient-BYqW-9tm.cjs → createOpenapiFetchClient-DY5s-aH6.cjs} +2 -2
  67. package/dist/{createOpenapiFetchClient-BYqW-9tm.cjs.map → createOpenapiFetchClient-DY5s-aH6.cjs.map} +1 -1
  68. package/dist/dataScience/index.cjs +2 -2
  69. package/dist/dataScience/index.js +2 -2
  70. package/dist/{dataScience-B5QxZnvW.cjs → dataScience-BoS8Xfvx.cjs} +5 -5
  71. package/dist/{dataScience-B5QxZnvW.cjs.map → dataScience-BoS8Xfvx.cjs.map} +1 -1
  72. package/dist/{dataScience-OXcwdk1p.js → dataScience-BxRoGfnG.js} +5 -5
  73. package/dist/{dataScience-OXcwdk1p.js.map → dataScience-BxRoGfnG.js.map} +1 -1
  74. package/dist/developerPortal/index.cjs +1 -1
  75. package/dist/developerPortal/index.js +1 -1
  76. package/dist/{developerPortalClient-B1QZ1rYi.js → developerPortalClient-C7s0kpjK.js} +3 -3
  77. package/dist/{developerPortalClient-B1QZ1rYi.js.map → developerPortalClient-C7s0kpjK.js.map} +1 -1
  78. package/dist/{developerPortalClient-CLPpBksD.cjs → developerPortalClient-DFHEsrlt.cjs} +3 -3
  79. package/dist/{developerPortalClient-CLPpBksD.cjs.map → developerPortalClient-DFHEsrlt.cjs.map} +1 -1
  80. package/dist/domain/permissions/index.d.cts +2 -2
  81. package/dist/domain/permissions/index.d.ts +2 -2
  82. package/dist/domain/storageTable/index.cjs +7 -1
  83. package/dist/domain/storageTable/index.d.cts +2 -2
  84. package/dist/domain/storageTable/index.d.ts +2 -2
  85. package/dist/domain/storageTable/index.js +2 -2
  86. package/dist/editor/index.cjs +2 -2
  87. package/dist/editor/index.js +2 -2
  88. package/dist/encryption/index.cjs +1 -1
  89. package/dist/encryption/index.d.cts +1 -1
  90. package/dist/encryption/index.d.ts +1 -1
  91. package/dist/encryption/index.js +1 -1
  92. package/dist/encryption/types.d.cts +1 -1
  93. package/dist/encryption/types.d.ts +1 -1
  94. package/dist/import/index.cjs +1 -1
  95. package/dist/import/index.js +1 -1
  96. package/dist/{import-CNk89mqy.cjs → import-BSYvG3Uy.cjs} +3 -3
  97. package/dist/{import-CNk89mqy.cjs.map → import-BSYvG3Uy.cjs.map} +1 -1
  98. package/dist/{import-DiMQCzLa.js → import-CXBcFVbk.js} +3 -3
  99. package/dist/{import-DiMQCzLa.js.map → import-CXBcFVbk.js.map} +1 -1
  100. package/dist/{index-DCRKjihs.d.ts → index-B03vhWSX.d.ts} +117 -90
  101. package/dist/{index-DXYASsPP.d.cts → index-B2-7WJ-E.d.cts} +599 -78
  102. package/dist/{index-BDZvaRud.d.ts → index-B72LTF-k.d.ts} +6 -3
  103. package/dist/{index-DOAZmWvh.d.cts → index-BMiZx-4_.d.cts} +6 -3
  104. package/dist/{index--ZpnE3YT.d.cts → index-BUsLHNOA.d.cts} +2 -2
  105. package/dist/{index-D7-o-oGa.d.ts → index-CBWfpd-0.d.ts} +2 -2
  106. package/dist/index-CGCXR_6Q.d.ts +273 -0
  107. package/dist/{index-Cvbjp3jx.d.cts → index-CKENwClW.d.cts} +4 -4
  108. package/dist/{index-BkqackZf.d.ts → index-CpE_NWuq.d.ts} +599 -78
  109. package/dist/{index-DnQTuc6t.d.ts → index-Cw-d6vV3.d.ts} +4 -4
  110. package/dist/{index-ByRpNVcs.d.cts → index-D3HFMfJJ.d.cts} +117 -90
  111. package/dist/index-DINB7vsV.d.cts +273 -0
  112. package/dist/{index-C8gRRWHL.d.cts → index-DeQDdut6.d.cts} +19 -1
  113. package/dist/{index-C8gRRWHL.d.ts → index-DeQDdut6.d.ts} +19 -1
  114. package/dist/{index-Qb7X6-ph.d.ts → index-DwM1EpnZ.d.ts} +12 -2
  115. package/dist/{index-CXcWpZQ2.d.ts → index-P1vR966i.d.cts} +74 -2
  116. package/dist/{index-CXcWpZQ2.d.cts → index-P1vR966i.d.ts} +74 -2
  117. package/dist/{index-DNThyEej.d.cts → index-VnJCp8IL.d.cts} +12 -2
  118. package/dist/index.cjs +65 -39
  119. package/dist/index.cjs.map +1 -1
  120. package/dist/index.d.cts +3 -3
  121. package/dist/index.d.ts +3 -3
  122. package/dist/index.js +65 -40
  123. package/dist/index.js.map +1 -1
  124. package/dist/{isLoginPageRedirect-XPwAOKK3.js → isLoginPageRedirect-CsjF95_P.js} +2 -2
  125. package/dist/{isLoginPageRedirect-XPwAOKK3.js.map → isLoginPageRedirect-CsjF95_P.js.map} +1 -1
  126. package/dist/{isLoginPageRedirect-jQHiLrG7.cjs → isLoginPageRedirect-c451CoWW.cjs} +2 -2
  127. package/dist/{isLoginPageRedirect-jQHiLrG7.cjs.map → isLoginPageRedirect-c451CoWW.cjs.map} +1 -1
  128. package/dist/kaiAgent/index.cjs +1 -1
  129. package/dist/kaiAgent/index.d.cts +2 -2
  130. package/dist/kaiAgent/index.d.ts +2 -2
  131. package/dist/kaiAgent/index.js +1 -1
  132. package/dist/{kaiAgent-QNoeVKPs.cjs → kaiAgent-ph4DRKlT.cjs} +21 -5
  133. package/dist/kaiAgent-ph4DRKlT.cjs.map +1 -0
  134. package/dist/{kaiAgent-Dp20HLTh.js → kaiAgent-xBpUwLeQ.js} +21 -5
  135. package/dist/kaiAgent-xBpUwLeQ.js.map +1 -0
  136. package/dist/{kaiMemory-D0Y_16U4.js → kaiMemory-BAniZZAN.js} +2 -2
  137. package/dist/{kaiMemory-D0Y_16U4.js.map → kaiMemory-BAniZZAN.js.map} +1 -1
  138. package/dist/{kaiMemory-CClSPInt.cjs → kaiMemory-U0DG-CpY.cjs} +2 -2
  139. package/dist/{kaiMemory-CClSPInt.cjs.map → kaiMemory-U0DG-CpY.cjs.map} +1 -1
  140. package/dist/management/index.cjs +1 -1
  141. package/dist/management/index.d.cts +1 -1
  142. package/dist/management/index.d.ts +1 -1
  143. package/dist/management/index.js +1 -1
  144. package/dist/management/types.d.cts +2 -2
  145. package/dist/management/types.d.ts +2 -2
  146. package/dist/{management-CCY0IYnq.cjs → management-5597SiC7.cjs} +79 -11
  147. package/dist/management-5597SiC7.cjs.map +1 -0
  148. package/dist/{management-DvmPiG64.js → management-D46KlXts.js} +79 -11
  149. package/dist/management-D46KlXts.js.map +1 -0
  150. package/dist/metastore/index.cjs +1 -1
  151. package/dist/metastore/index.d.cts +1 -1
  152. package/dist/metastore/index.d.ts +1 -1
  153. package/dist/metastore/index.js +1 -1
  154. package/dist/metastore/types.d.cts +2 -2
  155. package/dist/metastore/types.d.ts +2 -2
  156. package/dist/{metastore-XtWciCZT.cjs → metastore-DwMFlP2d.cjs} +52 -7
  157. package/dist/metastore-DwMFlP2d.cjs.map +1 -0
  158. package/dist/{metastore-BycJxe7A.js → metastore-_OskcLGz.js} +52 -7
  159. package/dist/metastore-_OskcLGz.js.map +1 -0
  160. package/dist/microsoftGraph/index.cjs +2 -2
  161. package/dist/microsoftGraph/index.js +2 -2
  162. package/dist/{middleware-CBwrtgQd.js → middleware-Drbo_UIZ.js} +2 -2
  163. package/dist/{middleware-CBwrtgQd.js.map → middleware-Drbo_UIZ.js.map} +1 -1
  164. package/dist/{middleware-IjYx3d5u.cjs → middleware-xhg2r2fE.cjs} +2 -2
  165. package/dist/{middleware-IjYx3d5u.cjs.map → middleware-xhg2r2fE.cjs.map} +1 -1
  166. package/dist/notifications/index.cjs +3 -3
  167. package/dist/notifications/index.js +3 -3
  168. package/dist/oauth/index.cjs +1 -1
  169. package/dist/oauth/index.js +1 -1
  170. package/dist/{oauth--2p8jkJf.cjs → oauth-L0Uic3YA.cjs} +5 -5
  171. package/dist/{oauth--2p8jkJf.cjs.map → oauth-L0Uic3YA.cjs.map} +1 -1
  172. package/dist/{oauth-l5zE39cD.js → oauth-TWwAv-va.js} +5 -5
  173. package/dist/{oauth-l5zE39cD.js.map → oauth-TWwAv-va.js.map} +1 -1
  174. package/dist/omnisearch/index.cjs +2 -2
  175. package/dist/omnisearch/index.js +2 -2
  176. package/dist/{project-cHKuGvqJ.d.cts → project-B8wtlstY.d.cts} +2 -2
  177. package/dist/{project-B15gStbM.d.ts → project-BCc3mpAy.d.ts} +2 -2
  178. package/dist/queryService/index.cjs +1 -1
  179. package/dist/queryService/index.d.cts +1 -1
  180. package/dist/queryService/index.d.ts +1 -1
  181. package/dist/queryService/index.js +1 -1
  182. package/dist/{queryService-CCOYbRbw.js → queryService-CdtogGr7.js} +5 -5
  183. package/dist/{queryService-CCOYbRbw.js.map → queryService-CdtogGr7.js.map} +1 -1
  184. package/dist/{queryService-CQzclHdL.cjs → queryService-Dx6AdxOl.cjs} +5 -5
  185. package/dist/{queryService-CQzclHdL.cjs.map → queryService-Dx6AdxOl.cjs.map} +1 -1
  186. package/dist/queue/index.cjs +1 -1
  187. package/dist/queue/index.d.cts +1 -1
  188. package/dist/queue/index.d.ts +1 -1
  189. package/dist/queue/index.js +1 -1
  190. package/dist/{queue-Cowbg6bR.js → queue-f2xsjy0o.js} +4 -4
  191. package/dist/{queue-Cowbg6bR.js.map → queue-f2xsjy0o.js.map} +1 -1
  192. package/dist/{queue-UG_BWKIC.cjs → queue-wIdnMtaZ.cjs} +4 -4
  193. package/dist/{queue-UG_BWKIC.cjs.map → queue-wIdnMtaZ.cjs.map} +1 -1
  194. package/dist/scheduler/index.cjs +3 -3
  195. package/dist/scheduler/index.js +3 -3
  196. package/dist/sdk/configurations/index.cjs +1 -1
  197. package/dist/sdk/configurations/index.d.cts +4 -4
  198. package/dist/sdk/configurations/index.d.ts +4 -4
  199. package/dist/sdk/configurations/index.js +1 -1
  200. package/dist/sdk/developerPortal/index.cjs +3 -3
  201. package/dist/sdk/developerPortal/index.js +3 -3
  202. package/dist/sdk/kaiMemory/index.cjs +1 -1
  203. package/dist/sdk/kaiMemory/index.d.cts +1 -1
  204. package/dist/sdk/kaiMemory/index.d.ts +1 -1
  205. package/dist/sdk/kaiMemory/index.js +1 -1
  206. package/dist/sdk/kaiMemory/types.d.cts +1 -1
  207. package/dist/sdk/kaiMemory/types.d.ts +1 -1
  208. package/dist/sdk/queryService/index.d.cts +1 -1
  209. package/dist/sdk/queryService/index.d.ts +1 -1
  210. package/dist/sdk/semanticLayer/index.cjs +2 -1
  211. package/dist/sdk/semanticLayer/index.d.cts +10 -3
  212. package/dist/sdk/semanticLayer/index.d.ts +10 -3
  213. package/dist/sdk/semanticLayer/index.js +2 -2
  214. package/dist/sdk/semanticLayer/types.d.cts +2 -2
  215. package/dist/sdk/semanticLayer/types.d.ts +2 -2
  216. package/dist/sdk/storage/index.cjs +12 -24
  217. package/dist/sdk/storage/index.cjs.map +1 -1
  218. package/dist/sdk/storage/index.d.cts +1 -1
  219. package/dist/sdk/storage/index.d.ts +1 -1
  220. package/dist/sdk/storage/index.js +12 -24
  221. package/dist/sdk/storage/index.js.map +1 -1
  222. package/dist/sdk/tag/index.d.cts +2 -2
  223. package/dist/sdk/tag/index.d.ts +2 -2
  224. package/dist/sdk/tag/types.d.cts +1 -1
  225. package/dist/sdk/tag/types.d.ts +1 -1
  226. package/dist/sdk/vault/index.d.cts +1 -1
  227. package/dist/sdk/vault/index.d.ts +1 -1
  228. package/dist/{semanticLayer-CKDVkU56.cjs → semanticLayer-D3NDh_QH.cjs} +115 -20
  229. package/dist/semanticLayer-D3NDh_QH.cjs.map +1 -0
  230. package/dist/{semanticLayer-pYy082Ju.js → semanticLayer-Ddg0LSnt.js} +110 -21
  231. package/dist/semanticLayer-Ddg0LSnt.js.map +1 -0
  232. package/dist/status/index.cjs +1 -1
  233. package/dist/status/index.js +1 -1
  234. package/dist/storage/index.cjs +4 -4
  235. package/dist/storage/index.d.cts +2 -2
  236. package/dist/storage/index.d.ts +2 -2
  237. package/dist/storage/index.js +4 -4
  238. package/dist/storage/types.d.cts +3 -3
  239. package/dist/storage/types.d.ts +3 -3
  240. package/dist/{storage-CZQHZcXG.js → storage-BkdjgtCU.js} +272 -134
  241. package/dist/storage-BkdjgtCU.js.map +1 -0
  242. package/dist/{storage-JinL1y1s.cjs → storage-CXQTTVXl.cjs} +272 -134
  243. package/dist/storage-CXQTTVXl.cjs.map +1 -0
  244. package/dist/{storageTable-C9crh4Ef.cjs → storageTable-BNOR2FCh.cjs} +137 -5
  245. package/dist/storageTable-BNOR2FCh.cjs.map +1 -0
  246. package/dist/{storageTable-DslXtqNL.js → storageTable-BldTNyEk.js} +102 -6
  247. package/dist/storageTable-BldTNyEk.js.map +1 -0
  248. package/dist/stream/index.cjs +3 -3
  249. package/dist/stream/index.js +3 -3
  250. package/dist/syncActions/index.cjs +4 -1
  251. package/dist/syncActions/index.d.cts +3 -2
  252. package/dist/syncActions/index.d.ts +3 -2
  253. package/dist/syncActions/index.js +2 -2
  254. package/dist/syncActions/types.d.cts +2 -2
  255. package/dist/syncActions/types.d.ts +2 -2
  256. package/dist/syncActions-BQ8kMgL6.js +1191 -0
  257. package/dist/syncActions-BQ8kMgL6.js.map +1 -0
  258. package/dist/syncActions-DyxNmbUR.cjs +1216 -0
  259. package/dist/syncActions-DyxNmbUR.cjs.map +1 -0
  260. package/dist/telemetry/index.cjs +3 -3
  261. package/dist/telemetry/index.js +3 -3
  262. package/dist/{types-DWiLcrxt.d.cts → types-04GTqleJ.d.cts} +3 -3
  263. package/dist/{types-DRCMBt89.d.ts → types-2Do0DZ60.d.ts} +3 -3
  264. package/dist/{types-Dtuvhm3K.d.cts → types-BWmLo73i.d.cts} +749 -186
  265. package/dist/types-BaSlU0uo.d.ts +1313 -0
  266. package/dist/{types-DEzW1CfI.d.cts → types-BgHtMe8s.d.cts} +3 -3
  267. package/dist/{types-BiMahEK8.d.cts → types-BgVt8SUY.d.cts} +126 -62
  268. package/dist/{types-BS4jwuMi.d.ts → types-BhEx9iRx.d.ts} +3068 -621
  269. package/dist/{types-CMzQSHAQ.d.cts → types-BzPuxmaR.d.cts} +3 -3
  270. package/dist/{types-CKmTZSPG.d.ts → types-C0rVtqz2.d.ts} +126 -62
  271. package/dist/{types-Bl03Cg2n.d.cts → types-CAAgCRmE.d.cts} +31 -5
  272. package/dist/{types-BIECJYun.d.ts → types-CN6huo55.d.ts} +406 -5
  273. package/dist/{types-Cg14ncdV.d.ts → types-CV7jmgtX.d.ts} +3 -3
  274. package/dist/types-CcYxlqtB.d.cts +1313 -0
  275. package/dist/{types-FwRmjsNN.d.ts → types-CigD_EF5.d.ts} +18 -6
  276. package/dist/{types-B_iLJlp4.d.ts → types-CwZgZqrA.d.ts} +31 -5
  277. package/dist/{types-BTK7Bv3n.d.cts → types-DgPt4LY_.d.cts} +406 -5
  278. package/dist/{types-bc-4z_gc.d.cts → types-DyArI_Jq.d.cts} +18 -6
  279. package/dist/{types-DekYAlA-.d.ts → types-QSchmyvO.d.ts} +3 -3
  280. package/dist/{types-DKc1gmd9.d.ts → types-R3AFJD6r.d.ts} +749 -186
  281. package/dist/{types-DDOa07rU.d.cts → types-sV9OaqTI.d.cts} +3068 -621
  282. package/dist/{validateConnectionStatus-BEYkQpu9.cjs → validateConnectionStatus-Ca1uEizv.cjs} +3 -3
  283. package/dist/{validateConnectionStatus-BEYkQpu9.cjs.map → validateConnectionStatus-Ca1uEizv.cjs.map} +1 -1
  284. package/dist/{validateConnectionStatus-BEGu8wXT.js → validateConnectionStatus-gFsBi5FV.js} +3 -3
  285. package/dist/{validateConnectionStatus-BEGu8wXT.js.map → validateConnectionStatus-gFsBi5FV.js.map} +1 -1
  286. package/dist/vault/index.cjs +4 -4
  287. package/dist/vault/index.js +4 -4
  288. package/package.json +7 -7
  289. package/surface/auth.md +7 -0
  290. package/surface/kaiAgent.md +4 -2
  291. package/surface/management.md +28 -13
  292. package/surface/metastore.md +4 -1
  293. package/surface/queue.md +1 -1
  294. package/surface/sdk.md +13 -8
  295. package/surface/storage.md +27 -24
  296. package/surface/syncActions.md +55 -1
  297. package/dist/authClient-BmuUo0J4.cjs.map +0 -1
  298. package/dist/authClient-CgcDGd30.js.map +0 -1
  299. package/dist/componentId-57vjsa2i.cjs.map +0 -1
  300. package/dist/componentId-C6WZa_R1.js.map +0 -1
  301. package/dist/createFetchClient-Cwp8max9.cjs.map +0 -1
  302. package/dist/createFetchClient-DXHQK63w.js.map +0 -1
  303. package/dist/index-CPu4Nezo.d.cts +0 -90
  304. package/dist/index-Dazy-meb.d.ts +0 -90
  305. package/dist/kaiAgent-Dp20HLTh.js.map +0 -1
  306. package/dist/kaiAgent-QNoeVKPs.cjs.map +0 -1
  307. package/dist/management-CCY0IYnq.cjs.map +0 -1
  308. package/dist/management-DvmPiG64.js.map +0 -1
  309. package/dist/metastore-BycJxe7A.js.map +0 -1
  310. package/dist/metastore-XtWciCZT.cjs.map +0 -1
  311. package/dist/semanticLayer-CKDVkU56.cjs.map +0 -1
  312. package/dist/semanticLayer-pYy082Ju.js.map +0 -1
  313. package/dist/storage-CZQHZcXG.js.map +0 -1
  314. package/dist/storage-JinL1y1s.cjs.map +0 -1
  315. package/dist/storageTable-C9crh4Ef.cjs.map +0 -1
  316. package/dist/storageTable-DslXtqNL.js.map +0 -1
  317. package/dist/syncActions-BmmoqZO_.js +0 -516
  318. package/dist/syncActions-BmmoqZO_.js.map +0 -1
  319. package/dist/syncActions-CtcLGQiy.cjs +0 -523
  320. package/dist/syncActions-CtcLGQiy.cjs.map +0 -1
  321. package/dist/types-BYM9Ptz5.d.ts +0 -671
  322. package/dist/types-CFeZCQ9p.d.cts +0 -671
@@ -0,0 +1,1216 @@
1
+ const require_rolldown_runtime = require("./rolldown-runtime-VH7oDXx4.cjs");
2
+ const require_createFetchClient = require("./createFetchClient-BgihytBn.cjs");
3
+ const require_SyncActionError = require("./SyncActionError-BG0zwchi.cjs");
4
+ const require_ValidationError = require("./ValidationError-D65QU0uq.cjs");
5
+ const require_createGenericFetchClient = require("./createGenericFetchClient-C7Y0YVfc.cjs");
6
+ const require_createOpenapiFetchClient = require("./createOpenapiFetchClient-DY5s-aH6.cjs");
7
+ const require_auth = require("./auth-zfI04oj7.cjs");
8
+ const require_componentId = require("./componentId-D4jp6a13.cjs");
9
+ let zod = require("zod");
10
+ zod = require_rolldown_runtime.__toESM(zod, 1);
11
+ //#region src/clients/syncActions/utils/response.ts
12
+ const asErrorBody = (data) => typeof data === "object" && data !== null ? data : null;
13
+ const asString = (value) => typeof value === "string" && value ? value : void 0;
14
+ const asNumber = (value) => typeof value === "number" ? value : void 0;
15
+ /**
16
+ * Fails a sync action on a non-2xx, or on a 2xx whose body has `status: 'error'`.
17
+ *
18
+ * - Throws: `coreFetch` only rethrows a returned `ApiError`.
19
+ * - `SyncActionError` is not an `ApiError`, so retry / network-error handling skips it.
20
+ */
21
+ const syncActionValidateStatus = (apiResponse) => {
22
+ const body = asErrorBody(apiResponse.data);
23
+ if (body?.status === "error") throw new require_SyncActionError.SyncActionError(asString(body.message) ?? asString(body.error) ?? apiResponse.response.statusText, {
24
+ exceptionId: asString(body.exceptionId),
25
+ code: asNumber(body.code),
26
+ data: apiResponse.data
27
+ });
28
+ return require_createFetchClient.defaultValidateStatus(apiResponse);
29
+ };
30
+ //#endregion
31
+ //#region src/clients/syncActions/constants.ts
32
+ const SyncAction = {
33
+ PREPARE_ROWS: "prepareRows",
34
+ TEST_CONNECTION: "testConnection",
35
+ DB_EXTRACTOR_GET_TABLES: "getTables",
36
+ DB_WRITER_GET_TABLES_INFO: "getTablesInfo",
37
+ DBT_COMPILE: "dbtCompile",
38
+ DBT_DOCS: "dbtDocs",
39
+ DBT_GIT_REPOSITORY: "gitRepository",
40
+ DBT_RUN_RESULTS: "dbtRunResults",
41
+ CODE_PATTERN_GENERATE: "generate",
42
+ APIFY_LIST_ACTORS: "listActors",
43
+ APIFY_LIST_TASKS: "listTasks",
44
+ AWS_S3_GET_EXTERNAL_ID: "getExternalId",
45
+ CONFIGURATION_MIGRATION_STATUS: "status",
46
+ DATA_APP_ENTRYPOINTS: "data-app-entrypoints",
47
+ DATA_APP_GIT_REPOSITORY: "git-repository",
48
+ EMAIL_ATTACHMENTS_GET: "get",
49
+ FACEBOOK_ADS_ACCOUNTS: "adaccounts",
50
+ FACEBOOK_PAGES_ACCOUNTS: "accounts",
51
+ FLOW_MIGRATION_PREVIEW: "preview",
52
+ FLOW_MIGRATION_VALIDATE: "validate",
53
+ GENERIC_EXTRACTOR_INFER_MAPPING: "infer_mapping",
54
+ GENERIC_EXTRACTOR_LOAD_FROM_CURL: "load_from_curl",
55
+ GENERIC_EXTRACTOR_PERFORM_FUNCTION: "perform_function",
56
+ GENERIC_EXTRACTOR_TEST_REQUEST: "test_request",
57
+ GOOGLE_ADS_LIST_ACCOUNTS: "listAccounts",
58
+ GOOGLE_ANALYTICS_GET_PROFILES_PROPERTIES: "getProfilesProperties",
59
+ GOOGLE_ANALYTICS_GET_PROPERTIES_METADATA: "getPropertiesMetadata",
60
+ BIGQUERY_GET_CLUSTERING: "getClustering",
61
+ BIGQUERY_GET_COLUMNS: "getColumns",
62
+ BIGQUERY_GET_PARTITIONING: "getPartitioning",
63
+ GOOGLE_DRIVE_CREATE_FILE: "createFile",
64
+ GOOGLE_SHEETS_ADD_SHEET: "addSheet",
65
+ GOOGLE_SHEETS_CREATE_SPREADSHEET: "createSpreadsheet",
66
+ INSTAGRAM_ACCOUNTS: "igaccounts",
67
+ LOOKER_TEST_CREDENTIALS: "testLookerCredentials",
68
+ ONEDRIVE_CREATE_WORKBOOK: "createWorkbook",
69
+ ONEDRIVE_CREATE_WORKSHEET: "createWorksheet",
70
+ ONEDRIVE_GET_WORKSHEETS: "getWorksheets",
71
+ ONEDRIVE_SEARCH: "search",
72
+ SNOWFLAKE_DWH_MANAGER_ENROLL_MFA: "enrollMFA",
73
+ SNOWFLAKE_DWH_MANAGER_RESET_PASSWORD: "resetPassword",
74
+ SSH_KEYS_GENERATE: "generate",
75
+ STORAGE_EXTRACTOR_SOURCE_INFO: "sourceInfo",
76
+ STORAGE_WRITER_INFO: "info"
77
+ };
78
+ //#endregion
79
+ //#region src/clients/syncActions/schemas.ts
80
+ /** The Keboola-side context every sync action carries; namespaces extend it with their own fields. */
81
+ const syncActionContextSchema = zod.object({
82
+ /** A numeric id or `"default"`; required so requests are self-describing. */
83
+ branchId: zod.string().min(1, "Required"),
84
+ /** Leave undefined to run the published version (not Docker `latest`); set only to pin a build. */
85
+ tag: zod.string().optional(),
86
+ mode: zod.enum(["run", "debug"]).optional()
87
+ });
88
+ /** The `/actions` body; each namespace validates its own `configData` shape. */
89
+ const syncActionBodySchema = syncActionContextSchema.extend({
90
+ componentId: zod.string().min(1, "Required"),
91
+ action: zod.string().min(1, "Required"),
92
+ configData: zod.record(zod.string(), zod.unknown())
93
+ });
94
+ //#endregion
95
+ //#region src/clients/syncActions/apify/schemas.ts
96
+ const apifyObjectsInputSchema = syncActionContextSchema.extend({ "#token": zod.string().min(1, "Required") });
97
+ const apifyObjectsSchema = zod.array(zod.object({
98
+ id: zod.string(),
99
+ name: zod.string()
100
+ }));
101
+ //#endregion
102
+ //#region src/clients/syncActions/apify/utils.ts
103
+ /**
104
+ * A slow Apify account makes the component answer `{ timeout: true }` on a 200 instead of the list —
105
+ * a failure only this action knows how to spot, so it is checked before deferring to the shared
106
+ * validation.
107
+ */
108
+ const apifyValidateStatus = (apiResponse) => {
109
+ const data = apiResponse.data;
110
+ if (typeof data === "object" && data !== null && "timeout" in data && data.timeout) throw new require_SyncActionError.SyncActionError("Timed out while loading data from Apify.", { data });
111
+ return syncActionValidateStatus(apiResponse);
112
+ };
113
+ //#endregion
114
+ //#region src/clients/syncActions/apify/apify.ts
115
+ const createApify = (sendSyncAction) => {
116
+ const _getObjects = async (action, input, signal) => {
117
+ const { "#token": token, ...context } = require_ValidationError.parseOrThrow(apifyObjectsInputSchema, input);
118
+ const data = await sendSyncAction({
119
+ ...context,
120
+ action,
121
+ componentId: require_componentId.ComponentId.APIFY,
122
+ configData: { parameters: { "#token": token } }
123
+ }, {
124
+ signal,
125
+ validateStatus: apifyValidateStatus
126
+ });
127
+ return require_ValidationError.parseOrThrow(apifyObjectsSchema, data);
128
+ };
129
+ const getActors = (input, signal) => {
130
+ return _getObjects(SyncAction.APIFY_LIST_ACTORS, input, signal);
131
+ };
132
+ const getTasks = (input, signal) => {
133
+ return _getObjects(SyncAction.APIFY_LIST_TASKS, input, signal);
134
+ };
135
+ return {
136
+ getActors,
137
+ getTasks
138
+ };
139
+ };
140
+ //#endregion
141
+ //#region src/clients/syncActions/codePattern/schemas.ts
142
+ const codePatternGenerateInputSchema = syncActionContextSchema.extend({
143
+ /** The code pattern component; any pattern answers the same `generate` contract. */
144
+ componentId: zod.string().min(1, "Required"),
145
+ /** The transformation's input and output mapping. */
146
+ storage: zod.record(zod.string(), zod.unknown()),
147
+ /** The pattern's form values, plus the target transformation component as `_componentId`. */
148
+ parameters: zod.looseObject({ _componentId: zod.string().min(1, "Required") })
149
+ });
150
+ /** `storage` is optional; without it the transformation keeps its mapping. */
151
+ const codePatternGenerateResultSchema = zod.object({ result: zod.object({
152
+ parameters: zod.record(zod.string(), zod.unknown()),
153
+ storage: zod.record(zod.string(), zod.unknown()).optional()
154
+ }) }).transform(({ result }) => result);
155
+ //#endregion
156
+ //#region src/clients/syncActions/codePattern/codePattern.ts
157
+ const createCodePattern = (sendSyncAction) => {
158
+ /** The transformation configuration the pattern generates from its form values and mapping. */
159
+ const generate = async (input, signal) => {
160
+ const { componentId, storage, parameters, ...context } = require_ValidationError.parseOrThrow(codePatternGenerateInputSchema, input);
161
+ const data = await sendSyncAction({
162
+ ...context,
163
+ componentId,
164
+ action: SyncAction.CODE_PATTERN_GENERATE,
165
+ configData: {
166
+ storage,
167
+ parameters
168
+ }
169
+ }, { signal });
170
+ return require_ValidationError.parseOrThrow(codePatternGenerateResultSchema, data);
171
+ };
172
+ return { generate };
173
+ };
174
+ //#endregion
175
+ //#region src/clients/syncActions/common/schemas.ts
176
+ /** Actions any component may implement, so the id selects nothing and `configData` is its own. */
177
+ const commonActionInputSchema = syncActionContextSchema.extend({
178
+ componentId: zod.string().min(1, "Required"),
179
+ configData: zod.record(zod.string(), zod.unknown())
180
+ });
181
+ /** A failed test answers `status: 'error'`, which throws `SyncActionError`. */
182
+ const testConnectionResultSchema = zod.object({ message: zod.string().optional() });
183
+ /** The rows the configuration's create-row form describes; they exist only once created. */
184
+ const preparedRowsSchema = zod.array(zod.object({
185
+ name: zod.string(),
186
+ description: zod.string().optional(),
187
+ configuration: zod.record(zod.string(), zod.unknown())
188
+ }));
189
+ //#endregion
190
+ //#region src/clients/syncActions/common/common.ts
191
+ const createCommon = (sendSyncAction) => {
192
+ const sendCommonAction = (action, input, signal) => {
193
+ const { componentId, configData, ...context } = require_ValidationError.parseOrThrow(commonActionInputSchema, input);
194
+ return sendSyncAction({
195
+ ...context,
196
+ componentId,
197
+ action,
198
+ configData
199
+ }, { signal });
200
+ };
201
+ const testConnection = async (input, signal) => {
202
+ const data = await sendCommonAction(SyncAction.TEST_CONNECTION, input, signal);
203
+ return require_ValidationError.parseOrThrow(testConnectionResultSchema, data);
204
+ };
205
+ const prepareRows = async (input, signal) => {
206
+ const data = await sendCommonAction(SyncAction.PREPARE_ROWS, input, signal);
207
+ return require_ValidationError.parseOrThrow(preparedRowsSchema, data);
208
+ };
209
+ return {
210
+ prepareRows,
211
+ testConnection
212
+ };
213
+ };
214
+ //#endregion
215
+ //#region src/clients/syncActions/configurationMigration/schemas.ts
216
+ const getConfigurationMigrationStatusInputSchema = syncActionContextSchema.extend({
217
+ origin: zod.string().min(1, "Required"),
218
+ /** When omitted, the tool uses the destination it has registered for `origin`. */
219
+ destination: zod.string().optional()
220
+ });
221
+ const configurationMigrationStatusSchema = zod.object({
222
+ componentId: zod.string(),
223
+ configId: zod.string(),
224
+ configName: zod.string(),
225
+ /** The config's `runtime.migrationStatus`: `success`, `error: <message>`, or `n/a` before a run. */
226
+ status: zod.string()
227
+ });
228
+ const getConfigurationMigrationStatusResultSchema = zod.object({ configurations: zod.array(configurationMigrationStatusSchema) });
229
+ //#endregion
230
+ //#region src/clients/syncActions/configurationMigration/configurationMigration.ts
231
+ const createConfigurationMigration = (sendSyncAction) => {
232
+ /** Throws `SyncActionError` when the component has no migration registered for `origin`. */
233
+ const getStatus = async (input, signal) => {
234
+ const { origin, destination, ...context } = require_ValidationError.parseOrThrow(getConfigurationMigrationStatusInputSchema, input);
235
+ const data = await sendSyncAction({
236
+ ...context,
237
+ action: SyncAction.CONFIGURATION_MIGRATION_STATUS,
238
+ componentId: require_componentId.ComponentId.APP_CONFIGURATION_MIGRATION_TOOL,
239
+ configData: { parameters: {
240
+ origin,
241
+ destination
242
+ } }
243
+ }, { signal });
244
+ return require_ValidationError.parseOrThrow(getConfigurationMigrationStatusResultSchema, data).configurations;
245
+ };
246
+ return { getStatus };
247
+ };
248
+ //#endregion
249
+ //#region src/clients/syncActions/dbt/schemas.ts
250
+ /** `componentId` is a plain string: every dbt transformation serves the same actions, so it selects nothing. */
251
+ const dbtActionInputSchema = syncActionContextSchema.extend({
252
+ componentId: zod.string().min(1, "Required"),
253
+ configId: zod.string().min(1, "Required"),
254
+ artifacts: zod.record(zod.string(), zod.unknown()).optional()
255
+ });
256
+ /**
257
+ * Model file name (`orders.sql`) → compiled SQL, in the component's key order.
258
+ *
259
+ * - A never-run configuration fails with a `SyncActionError`, not an empty payload.
260
+ * - A missing key defaults to empty; a present key of the wrong shape still fails.
261
+ */
262
+ const dbtCompiledSchema = zod.object({ compiled: zod.record(zod.string(), zod.string()).default({}) }).transform(({ compiled }) => compiled);
263
+ /** `"Thread-1"` → `1`; an unparseable value falls back to `0` rather than failing the timeline. */
264
+ const dbtThreadSchema = zod.string().transform((thread) => Number.parseInt(thread.replace(/^Thread-/, ""), 10)).pipe(zod.number().int().nonnegative()).catch(0);
265
+ /** Omits `status` and `dependsOn`. */
266
+ const dbtModelTimingSchema = zod.object({
267
+ id: zod.string(),
268
+ name: zod.string(),
269
+ thread: dbtThreadSchema,
270
+ /** ISO timestamps, left unparsed. */
271
+ timeStarted: zod.string(),
272
+ timeCompleted: zod.string()
273
+ });
274
+ /** A missing key defaults to empty, as in `dbtCompiledSchema`. */
275
+ const dbtRunResultsSchema = zod.object({ modelTiming: zod.array(dbtModelTimingSchema).default([]) }).transform(({ modelTiming }) => modelTiming);
276
+ const dbtDocsSchema = zod.object({ html: zod.string() }).transform(({ html }) => html);
277
+ //#endregion
278
+ //#region src/clients/syncActions/dbt/utils.ts
279
+ /**
280
+ * The dbt artifact actions read the *stored* configuration — `configId` is what they resolve it by,
281
+ * so the payload carries no settings of its own. `artifacts` is the configuration's own artifacts
282
+ * section, passed through untouched: it selects which run's artifacts the component picks up, and
283
+ * omitting it leaves the component on its default (the latest run).
284
+ */
285
+ const buildDbtActionConfigData = ({ configId, artifacts }) => ({
286
+ parameters: { configId },
287
+ ...artifacts && { artifacts }
288
+ });
289
+ //#endregion
290
+ //#region src/clients/syncActions/dbt/dbt.ts
291
+ /** The dbt transformations' artifact actions — each reads what the *last run* left behind. */
292
+ const createDbt = (sendSyncAction) => {
293
+ const sendDbtAction = (action, input, signal) => {
294
+ const { componentId, configId, artifacts, ...context } = require_ValidationError.parseOrThrow(dbtActionInputSchema, input);
295
+ return sendSyncAction({
296
+ ...context,
297
+ componentId,
298
+ action,
299
+ configData: buildDbtActionConfigData({
300
+ configId,
301
+ artifacts
302
+ })
303
+ }, { signal });
304
+ };
305
+ /** The compiled SQL of every model in the configuration. */
306
+ const compile = async (input, signal) => {
307
+ const data = await sendDbtAction(SyncAction.DBT_COMPILE, input, signal);
308
+ return require_ValidationError.parseOrThrow(dbtCompiledSchema, data);
309
+ };
310
+ /** When each model of the last run started and finished, and on which worker. */
311
+ const runResults = async (input, signal) => {
312
+ const data = await sendDbtAction(SyncAction.DBT_RUN_RESULTS, input, signal);
313
+ return require_ValidationError.parseOrThrow(dbtRunResultsSchema, data);
314
+ };
315
+ /** The docs site the last run generated. */
316
+ const getDocs = async (input, signal) => {
317
+ const data = await sendDbtAction(SyncAction.DBT_DOCS, input, signal);
318
+ return require_ValidationError.parseOrThrow(dbtDocsSchema, data);
319
+ };
320
+ return {
321
+ compile,
322
+ getDocs,
323
+ runResults
324
+ };
325
+ };
326
+ //#endregion
327
+ //#region src/clients/syncActions/emailAttachments/schemas.ts
328
+ const getEmailAttachmentsEmailInputSchema = syncActionContextSchema.extend({
329
+ /** The configuration id — keys the stored address and is embedded in a newly generated one. */
330
+ config: zod.string().min(1, "Required") });
331
+ const emailAttachmentsEmailSchema = zod.object({ email: zod.string() });
332
+ //#endregion
333
+ //#region src/clients/syncActions/emailAttachments/emailAttachments.ts
334
+ const createEmailAttachments = (sendSyncAction) => {
335
+ /** The configuration's inbound address; the component generates and stores it on first call. */
336
+ const getEmail = async (input, signal) => {
337
+ const { config, ...context } = require_ValidationError.parseOrThrow(getEmailAttachmentsEmailInputSchema, input);
338
+ const data = await sendSyncAction({
339
+ ...context,
340
+ action: SyncAction.EMAIL_ATTACHMENTS_GET,
341
+ componentId: require_componentId.ComponentId.EX_EMAIL_ATTACHMENTS,
342
+ configData: { parameters: { config } }
343
+ }, { signal });
344
+ return require_ValidationError.parseOrThrow(emailAttachmentsEmailSchema, data).email;
345
+ };
346
+ return { getEmail };
347
+ };
348
+ //#endregion
349
+ //#region src/clients/syncActions/facebook/constants.ts
350
+ const FACEBOOK_FAMILY = [
351
+ require_componentId.ComponentId.EX_FACEBOOK,
352
+ require_componentId.ComponentId.EX_FACEBOOK_PAGES,
353
+ require_componentId.ComponentId.EX_FACEBOOK_ADS,
354
+ require_componentId.ComponentId.EX_FACEBOOK_ADS_V2,
355
+ require_componentId.ComponentId.EX_INSTAGRAM,
356
+ require_componentId.ComponentId.EX_INSTAGRAM_V2
357
+ ];
358
+ /** Pages list Pages, Ads lists ad accounts, Instagram lists the business accounts behind Pages. */
359
+ const FACEBOOK_ACCOUNTS_ACTION = {
360
+ [require_componentId.ComponentId.EX_FACEBOOK]: SyncAction.FACEBOOK_PAGES_ACCOUNTS,
361
+ [require_componentId.ComponentId.EX_FACEBOOK_PAGES]: SyncAction.FACEBOOK_PAGES_ACCOUNTS,
362
+ [require_componentId.ComponentId.EX_FACEBOOK_ADS]: SyncAction.FACEBOOK_ADS_ACCOUNTS,
363
+ [require_componentId.ComponentId.EX_FACEBOOK_ADS_V2]: SyncAction.FACEBOOK_ADS_ACCOUNTS,
364
+ [require_componentId.ComponentId.EX_INSTAGRAM]: SyncAction.INSTAGRAM_ACCOUNTS,
365
+ [require_componentId.ComponentId.EX_INSTAGRAM_V2]: SyncAction.INSTAGRAM_ACCOUNTS
366
+ };
367
+ const facebookIds = new Set(FACEBOOK_FAMILY);
368
+ const isFacebookComponentId = (componentId) => facebookIds.has(componentId);
369
+ //#endregion
370
+ //#region src/clients/syncActions/facebook/schemas.ts
371
+ const facebookGetAccountsInputSchema = syncActionContextSchema.extend({
372
+ componentId: zod.enum(FACEBOOK_FAMILY),
373
+ /** The stored configuration; the component reads its `authorization` and `parameters['api-version']`. */
374
+ configuration: zod.record(zod.string(), zod.unknown())
375
+ });
376
+ /** Kept whole: a configuration stores the accounts as the Graph API returned them. */
377
+ const facebookAccountsSchema = zod.array(zod.looseObject({
378
+ id: zod.string(),
379
+ name: zod.string().optional()
380
+ }));
381
+ //#endregion
382
+ //#region src/clients/syncActions/facebook/utils.ts
383
+ /**
384
+ * The message of the Graph API error body the component passed on as `error`.
385
+ *
386
+ * - JSON-encoded: its `error.message`.
387
+ * - Plain text: the text itself.
388
+ */
389
+ const getGraphApiErrorMessage = (error) => {
390
+ if (typeof error !== "string") return void 0;
391
+ let parsed;
392
+ try {
393
+ parsed = JSON.parse(error);
394
+ } catch {
395
+ return error || void 0;
396
+ }
397
+ if (typeof parsed !== "object" || parsed === null || !("error" in parsed)) return void 0;
398
+ const { error: graphError } = parsed;
399
+ return typeof graphError === "object" && graphError !== null && "message" in graphError && typeof graphError.message === "string" ? graphError.message : void 0;
400
+ };
401
+ /**
402
+ * The first-generation components answer a failed Graph API call with `{ code, error }` on a 200.
403
+ *
404
+ * - `error` is the Graph API's own error body, JSON-encoded; `code` is its HTTP status.
405
+ * - A `status: 'error'` body is left to the shared validation.
406
+ */
407
+ const facebookValidateStatus = (apiResponse) => {
408
+ const data = apiResponse.data;
409
+ if (typeof data === "object" && data !== null && !Array.isArray(data) && "error" in data && !("status" in data)) throw new require_SyncActionError.SyncActionError(getGraphApiErrorMessage(data.error) ?? "Failed to load the accounts.", {
410
+ code: "code" in data && typeof data.code === "number" ? data.code : void 0,
411
+ data
412
+ });
413
+ return syncActionValidateStatus(apiResponse);
414
+ };
415
+ //#endregion
416
+ //#region src/clients/syncActions/facebook/facebook.ts
417
+ const createFacebook = (sendSyncAction) => {
418
+ /** The accounts the configuration's authorization can extract from; which kind depends on `componentId`. */
419
+ const getAccounts = async (input, signal) => {
420
+ const { componentId, configuration, ...context } = require_ValidationError.parseOrThrow(facebookGetAccountsInputSchema, input);
421
+ const data = await sendSyncAction({
422
+ ...context,
423
+ componentId,
424
+ action: FACEBOOK_ACCOUNTS_ACTION[componentId],
425
+ configData: configuration
426
+ }, {
427
+ signal,
428
+ validateStatus: facebookValidateStatus
429
+ });
430
+ return require_ValidationError.parseOrThrow(facebookAccountsSchema, data);
431
+ };
432
+ return { getAccounts };
433
+ };
434
+ //#endregion
435
+ //#region src/clients/syncActions/flowMigration/schemas.ts
436
+ const flowMigrationInputSchema = syncActionContextSchema.extend({ orchestrationIds: zod.array(zod.string().min(1, "Required")) });
437
+ const flowMigrationValidationResultSchema = zod.object({
438
+ orchestrationId: zod.string(),
439
+ orchestrationName: zod.string(),
440
+ valid: zod.boolean(),
441
+ issues: zod.array(zod.string())
442
+ });
443
+ /** The orchestration's configuration as the flow it would become; extra keys pass through. */
444
+ const flowMigrationMigratedConfigurationSchema = zod.looseObject({
445
+ phases: zod.array(zod.unknown()).optional(),
446
+ tasks: zod.array(zod.unknown()).optional(),
447
+ parameters: zod.unknown().optional()
448
+ });
449
+ /**
450
+ * One orchestration's dry-run outcome.
451
+ *
452
+ * - `skipped`: it failed validation; `issues` says why.
453
+ * - `failed`: building the flow threw; `error` carries the message.
454
+ */
455
+ const flowMigrationPreviewResultSchema = zod.object({
456
+ orchestrationId: zod.string(),
457
+ orchestrationName: zod.string(),
458
+ status: zod.enum([
459
+ "dry-run",
460
+ "skipped",
461
+ "failed"
462
+ ]),
463
+ issues: zod.array(zod.string()),
464
+ changes: zod.array(zod.string()),
465
+ error: zod.string().optional(),
466
+ migratedConfiguration: flowMigrationMigratedConfigurationSchema.optional()
467
+ });
468
+ const flowMigrationValidationResultsSchema = zod.array(flowMigrationValidationResultSchema);
469
+ const flowMigrationPreviewResultsSchema = zod.array(flowMigrationPreviewResultSchema);
470
+ //#endregion
471
+ //#region src/clients/syncActions/flowMigration/flowMigration.ts
472
+ /** Orchestration → flow migration checks; one result per requested orchestration. */
473
+ const createFlowMigration = (sendSyncAction) => {
474
+ const validate = async (input, signal) => {
475
+ const { orchestrationIds, ...context } = require_ValidationError.parseOrThrow(flowMigrationInputSchema, input);
476
+ const data = await sendSyncAction({
477
+ ...context,
478
+ action: SyncAction.FLOW_MIGRATION_VALIDATE,
479
+ componentId: require_componentId.ComponentId.FLOW_MIGRATION_TOOL,
480
+ configData: { parameters: { orchestrationIds } }
481
+ }, { signal });
482
+ return require_ValidationError.parseOrThrow(flowMigrationValidationResultsSchema, data);
483
+ };
484
+ /** A dry run: nothing is written, and invalid orchestrations come back `skipped`. */
485
+ const preview = async (input, signal) => {
486
+ const { orchestrationIds, ...context } = require_ValidationError.parseOrThrow(flowMigrationInputSchema, input);
487
+ const data = await sendSyncAction({
488
+ ...context,
489
+ action: SyncAction.FLOW_MIGRATION_PREVIEW,
490
+ componentId: require_componentId.ComponentId.FLOW_MIGRATION_TOOL,
491
+ configData: { parameters: {
492
+ mode: "config",
493
+ orchestrationIds
494
+ } }
495
+ }, { signal });
496
+ return require_ValidationError.parseOrThrow(flowMigrationPreviewResultsSchema, data);
497
+ };
498
+ return {
499
+ validate,
500
+ preview
501
+ };
502
+ };
503
+ //#endregion
504
+ //#region src/clients/syncActions/genericExtractor/schemas.ts
505
+ /** The endpoint's position in the jobs tree, its indexes joined with `_` (`"0_1"`). */
506
+ const selectedJobSchema = zod.string().min(1, "Required");
507
+ /**
508
+ * Every action's `parameters` are the configuration's whole `parameters`.
509
+ *
510
+ * - `api`, `config` with its jobs, and the secrets, as stored.
511
+ * - Plus the `__`-prefixed keys that action reads.
512
+ */
513
+ const genericExtractorTestRequestInputSchema = syncActionContextSchema.extend({
514
+ parameters: zod.looseObject({ __SELECTED_JOB: selectedJobSchema }),
515
+ variables_id: zod.string().optional(),
516
+ variables_values_id: zod.string().optional()
517
+ });
518
+ /** `response.status_code` is `null` when the request never left — a configuration error. */
519
+ const genericExtractorTestRequestResultSchema = zod.object({
520
+ response: zod.looseObject({ status_code: zod.number().nullable() }),
521
+ request: zod.record(zod.string(), zod.unknown()),
522
+ records: zod.array(zod.unknown()),
523
+ debug_log: zod.string()
524
+ });
525
+ const genericExtractorLoadFromCurlInputSchema = syncActionContextSchema.extend({ parameters: zod.looseObject({ __CURL_COMMAND: zod.string().min(1, "Required") }) });
526
+ /** The job the command describes, ready to add to `config.jobs`. */
527
+ const genericExtractorJobSchema = zod.looseObject({ endpoint: zod.string() });
528
+ const genericExtractorPerformFunctionInputSchema = syncActionContextSchema.extend({ parameters: zod.looseObject({ __FUNCTION_CFG: zod.unknown() }) });
529
+ const genericExtractorPerformFunctionResultSchema = zod.object({ result: zod.unknown() }).transform(({ result }) => result);
530
+ /** The component defaults `__PRIMARY_KEY` to `[]` and `__NESTING_LEVEL` to `2`. */
531
+ const genericExtractorInferMappingInputSchema = syncActionContextSchema.extend({ parameters: zod.looseObject({
532
+ __SELECTED_JOB: selectedJobSchema,
533
+ __PRIMARY_KEY: zod.array(zod.string()).optional(),
534
+ __NESTING_LEVEL: zod.number().int().positive().optional()
535
+ }) });
536
+ const genericExtractorMappingSchema = zod.record(zod.string(), zod.unknown());
537
+ //#endregion
538
+ //#region src/clients/syncActions/genericExtractor/genericExtractor.ts
539
+ const createGenericExtractor = (sendSyncAction) => {
540
+ const send = (action, context, configData, signal) => sendSyncAction({
541
+ ...context,
542
+ action,
543
+ componentId: require_componentId.ComponentId.EX_GENERIC_V2,
544
+ configData
545
+ }, { signal });
546
+ /** Calls the selected endpoint once and reports the request, the response and the records. */
547
+ const testRequest = async (input, signal) => {
548
+ const { parameters, variables_id, variables_values_id, ...context } = require_ValidationError.parseOrThrow(genericExtractorTestRequestInputSchema, input);
549
+ const data = await send(SyncAction.GENERIC_EXTRACTOR_TEST_REQUEST, context, {
550
+ parameters,
551
+ variables_id,
552
+ variables_values_id
553
+ }, signal);
554
+ return require_ValidationError.parseOrThrow(genericExtractorTestRequestResultSchema, data);
555
+ };
556
+ const loadFromCurl = async (input, signal) => {
557
+ const { parameters, ...context } = require_ValidationError.parseOrThrow(genericExtractorLoadFromCurlInputSchema, input);
558
+ const data = await send(SyncAction.GENERIC_EXTRACTOR_LOAD_FROM_CURL, context, { parameters }, signal);
559
+ return require_ValidationError.parseOrThrow(genericExtractorJobSchema, data);
560
+ };
561
+ const performFunction = async (input, signal) => {
562
+ const { parameters, ...context } = require_ValidationError.parseOrThrow(genericExtractorPerformFunctionInputSchema, input);
563
+ const data = await send(SyncAction.GENERIC_EXTRACTOR_PERFORM_FUNCTION, context, { parameters }, signal);
564
+ return require_ValidationError.parseOrThrow(genericExtractorPerformFunctionResultSchema, data);
565
+ };
566
+ /** Derives the endpoint's output mapping from the records one test call returns. */
567
+ const inferMapping = async (input, signal) => {
568
+ const { parameters, ...context } = require_ValidationError.parseOrThrow(genericExtractorInferMappingInputSchema, input);
569
+ const data = await send(SyncAction.GENERIC_EXTRACTOR_INFER_MAPPING, context, { parameters }, signal);
570
+ return require_ValidationError.parseOrThrow(genericExtractorMappingSchema, data);
571
+ };
572
+ return {
573
+ inferMapping,
574
+ loadFromCurl,
575
+ performFunction,
576
+ testRequest
577
+ };
578
+ };
579
+ //#endregion
580
+ //#region src/clients/syncActions/git/constants.ts
581
+ /**
582
+ * Components whose git repository lives under `parameters.dataApp.git.repository` and that answer to
583
+ * the `git-repository` action. They are the only ones serving `data-app-entrypoints`, and the only
584
+ * ones accepting an SSH key.
585
+ */
586
+ const DATA_APP_FAMILY = [require_componentId.ComponentId.DATA_APPS, require_componentId.ComponentId.SANDBOXES];
587
+ /**
588
+ * Components whose git repository lives under `parameters.git.repo` and that answer to the
589
+ * `gitRepository` action. They authenticate over HTTPS with a username and password only.
590
+ *
591
+ * Deliberately a list rather than "everything else": `listBranches` / `list_branches` /
592
+ * `checkBranches` also exist on unrelated third-party components (`kds-team.app-custom-python`,
593
+ * `keboola.app-transformation-migration`, `kds-team.app-sox-migration-checker`) under a different
594
+ * contract. Those stay on the generic `sendSyncAction` escape hatch.
595
+ */
596
+ const DBT_FAMILY = [
597
+ require_componentId.ComponentId.DBT_TEST_CORE_KEY_PAIR,
598
+ require_componentId.ComponentId.DBT_TEST_REMOTE_SNOWFLAKE,
599
+ require_componentId.ComponentId.DBT_TRANSFORMATION,
600
+ require_componentId.ComponentId.DBT_TRANSFORMATION_LOCAL_BIGQUERY,
601
+ require_componentId.ComponentId.DBT_TRANSFORMATION_REMOTE_BIGQUERY,
602
+ require_componentId.ComponentId.DBT_TRANSFORMATION_REMOTE_MSSQL,
603
+ require_componentId.ComponentId.DBT_TRANSFORMATION_REMOTE_POSTGRESQL,
604
+ require_componentId.ComponentId.DBT_TRANSFORMATION_REMOTE_REDSHIFT,
605
+ require_componentId.ComponentId.DBT_TRANSFORMATION_REMOTE_SNOWFLAKE
606
+ ];
607
+ const GIT_FAMILY = [...DATA_APP_FAMILY, ...DBT_FAMILY];
608
+ const dataAppIds = new Set(DATA_APP_FAMILY);
609
+ const isDataAppFamily = (componentId) => dataAppIds.has(componentId);
610
+ //#endregion
611
+ //#region src/clients/syncActions/git/schemas.ts
612
+ const gitAuthSchema = zod.discriminatedUnion("type", [
613
+ zod.object({ type: zod.literal("public") }),
614
+ zod.object({
615
+ type: zod.literal("password"),
616
+ username: zod.string().min(1, "Required"),
617
+ "#password": zod.string().min(1, "Required")
618
+ }),
619
+ zod.object({
620
+ type: zod.literal("sshKey"),
621
+ /** Ignored by the component: over SSH the user is always `git`. */
622
+ username: zod.string().min(1, "Required").optional(),
623
+ "#sshKey": zod.string().min(1, "Required")
624
+ })
625
+ ]);
626
+ const gitInputSchema = syncActionContextSchema.extend({
627
+ repositoryUrl: zod.string().min(1, "Required"),
628
+ auth: gitAuthSchema.default({ type: "public" })
629
+ });
630
+ /**
631
+ * **Takes no `branch` — do not add one.** The component clones with `-b <branch>`, so a stale one
632
+ * would fail the branch listing. Zod strips it.
633
+ */
634
+ const getBranchesInputSchema = gitInputSchema.extend({ componentId: zod.enum(GIT_FAMILY) }).check((ctx) => {
635
+ const { componentId, auth } = ctx.value;
636
+ if (auth.type !== "sshKey" || isDataAppFamily(componentId)) return;
637
+ ctx.issues.push({
638
+ code: "custom",
639
+ input: auth,
640
+ path: ["auth"],
641
+ message: `Component "${componentId}" authenticates with a password, not an SSH key.`
642
+ });
643
+ });
644
+ /** Only the data-app family serves `data-app-entrypoints`. */
645
+ const getEntrypointsInputSchema = gitInputSchema.extend({
646
+ componentId: zod.enum(DATA_APP_FAMILY),
647
+ /** The *git* branch (not `branchId`); omit for the repository default. `""` normalises to omitted. */
648
+ branch: zod.string().optional().transform((branch) => branch || void 0)
649
+ });
650
+ /** Only `branch` is load-bearing; the rest falls back to `''` so one bad field can't fail the list. */
651
+ const gitBranchSchema = zod.object({
652
+ branch: zod.string(),
653
+ sha: zod.string().catch(""),
654
+ date: zod.string().catch(""),
655
+ comment: zod.string().catch(""),
656
+ author: zod.object({
657
+ name: zod.string().catch(""),
658
+ email: zod.string().catch("")
659
+ }).catch({
660
+ name: "",
661
+ email: ""
662
+ })
663
+ });
664
+ /** An array, or an index-keyed object with gaps (a server-filtered PHP array). */
665
+ const gitBranchListSchema = zod.union([zod.array(gitBranchSchema), zod.record(zod.string(), gitBranchSchema)]).transform((branches) => Array.isArray(branches) ? branches : Object.values(branches));
666
+ /**
667
+ * - `repository.branches` is confirmed; the top-level position is accepted but unverified.
668
+ * - A response with neither list is rejected, not read as no branches.
669
+ */
670
+ const gitBranchesSchema = zod.object({
671
+ repository: zod.object({ branches: gitBranchListSchema.optional() }).optional(),
672
+ branches: gitBranchListSchema.optional()
673
+ }).check((ctx) => {
674
+ if (ctx.value.branches ?? ctx.value.repository?.branches) return;
675
+ ctx.issues.push({
676
+ code: "custom",
677
+ input: ctx.value,
678
+ message: "The response carried no branch list."
679
+ });
680
+ }).transform(({ repository, branches }) => branches ?? repository?.branches ?? []);
681
+ const gitEntrypointsSchema = zod.object({ entrypoints: zod.array(zod.string()) });
682
+ //#endregion
683
+ //#region src/clients/syncActions/git/utils.ts
684
+ /** Every variant is already the shape the components read, minus the discriminator. */
685
+ const toCredentials = (auth) => {
686
+ const { type: _type, ...credentials } = auth;
687
+ return credentials;
688
+ };
689
+ const toRevision = (rev) => rev.revision === "branch" ? { branch: rev.branch } : {};
690
+ /** Data apps nest their repository a level deeper, and call the URL `repository`. */
691
+ const buildDataAppConfigData = ({ repositoryUrl, auth, ...rev }) => ({ parameters: { dataApp: { git: {
692
+ repository: repositoryUrl,
693
+ ...toCredentials(auth),
694
+ ...toRevision(rev)
695
+ } } } });
696
+ /** dbt transformations keep the same settings at the top of `parameters`, under `repo`. */
697
+ const buildDbtConfigData = ({ repositoryUrl, auth, ...rev }) => ({ parameters: { git: {
698
+ repo: repositoryUrl,
699
+ ...toCredentials(auth),
700
+ ...toRevision(rev)
701
+ } } });
702
+ //#endregion
703
+ //#region src/clients/syncActions/git/git.ts
704
+ /**
705
+ * Git repository actions, across both component families that serve them — the data apps
706
+ * (`git-repository`) and the dbt transformations (`gitRepository`). Which action name and which
707
+ * `configData` shape a call uses is resolved from `componentId`; see `./constants`.
708
+ */
709
+ const createGit = (sendSyncAction) => {
710
+ const getBranches = async (input, signal) => {
711
+ const { componentId, repositoryUrl, auth, ...context } = require_ValidationError.parseOrThrow(getBranchesInputSchema, input);
712
+ const isDataApp = isDataAppFamily(componentId);
713
+ const action = isDataApp ? SyncAction.DATA_APP_GIT_REPOSITORY : SyncAction.DBT_GIT_REPOSITORY;
714
+ const buildConfigData = isDataApp ? buildDataAppConfigData : buildDbtConfigData;
715
+ const data = await sendSyncAction({
716
+ ...context,
717
+ componentId,
718
+ action,
719
+ configData: buildConfigData({
720
+ repositoryUrl,
721
+ auth,
722
+ revision: "default"
723
+ })
724
+ }, { signal });
725
+ return require_ValidationError.parseOrThrow(gitBranchesSchema, data);
726
+ };
727
+ const getEntrypoints = async (input, signal) => {
728
+ const { componentId, repositoryUrl, auth, branch, ...context } = require_ValidationError.parseOrThrow(getEntrypointsInputSchema, input);
729
+ const data = await sendSyncAction({
730
+ ...context,
731
+ componentId,
732
+ action: SyncAction.DATA_APP_ENTRYPOINTS,
733
+ configData: buildDataAppConfigData({
734
+ repositoryUrl,
735
+ auth,
736
+ ...branch ? {
737
+ revision: "branch",
738
+ branch
739
+ } : { revision: "default" }
740
+ })
741
+ }, { signal });
742
+ return require_ValidationError.parseOrThrow(gitEntrypointsSchema, data);
743
+ };
744
+ return {
745
+ getBranches,
746
+ getEntrypoints
747
+ };
748
+ };
749
+ //#endregion
750
+ //#region src/clients/syncActions/utils/oauth.ts
751
+ /** The OAuth broker's credentials for one configuration, under the keys the components read. */
752
+ const oauthCredentialsSchema = zod.object({
753
+ appKey: zod.string().min(1, "Required"),
754
+ "#data": zod.string().min(1, "Required"),
755
+ "#appSecret": zod.string().min(1, "Required")
756
+ });
757
+ /** The `configData.authorization` block every OAuth-backed component expects. */
758
+ const buildOauthAuthorization = (credentials) => ({ oauth_api: { credentials } });
759
+ //#endregion
760
+ //#region src/clients/syncActions/googleAnalytics/schemas.ts
761
+ /** A GA4 Data API property, under the keys the component both returns and requires back. */
762
+ const googleAnalyticsPropertySchema = zod.object({
763
+ accountKey: zod.string(),
764
+ accountName: zod.string(),
765
+ propertyKey: zod.string(),
766
+ propertyName: zod.string()
767
+ });
768
+ /** A Universal Analytics view; the names are joined in only when Google lists the account and web property. */
769
+ const googleAnalyticsProfileSchema = zod.object({
770
+ id: zod.string().optional(),
771
+ name: zod.string().optional(),
772
+ webPropertyId: zod.string().optional(),
773
+ webPropertyName: zod.string().optional(),
774
+ accountId: zod.string().optional(),
775
+ accountName: zod.string().optional(),
776
+ eCommerceTracking: zod.boolean().optional()
777
+ });
778
+ const googleAnalyticsGetProfilesPropertiesInputSchema = syncActionContextSchema.extend({ credentials: oauthCredentialsSchema });
779
+ /** `messages` carries a failed listing of either kind; the other list still comes back. */
780
+ const googleAnalyticsGetProfilesPropertiesResultSchema = zod.object({
781
+ messages: zod.array(zod.string()),
782
+ properties: zod.array(googleAnalyticsPropertySchema),
783
+ profiles: zod.array(googleAnalyticsProfileSchema)
784
+ });
785
+ const googleAnalyticsGetPropertiesMetadataInputSchema = syncActionContextSchema.extend({
786
+ credentials: oauthCredentialsSchema,
787
+ properties: zod.array(googleAnalyticsPropertySchema)
788
+ });
789
+ const googleAnalyticsMetadataItemSchema = zod.object({
790
+ apiName: zod.string(),
791
+ uiName: zod.string().optional(),
792
+ description: zod.string().optional()
793
+ });
794
+ /** Merged across `properties`, one entry per `apiName`. */
795
+ const googleAnalyticsGetPropertiesMetadataResultSchema = zod.object({
796
+ metrics: zod.array(googleAnalyticsMetadataItemSchema),
797
+ dimensions: zod.array(googleAnalyticsMetadataItemSchema)
798
+ });
799
+ //#endregion
800
+ //#region src/clients/syncActions/googleAnalytics/googleAnalytics.ts
801
+ const createGoogleAnalytics = (sendSyncAction) => {
802
+ const getPropertiesMetadata = async (input, signal) => {
803
+ const { credentials, properties, ...context } = require_ValidationError.parseOrThrow(googleAnalyticsGetPropertiesMetadataInputSchema, input);
804
+ const data = await sendSyncAction({
805
+ ...context,
806
+ action: SyncAction.GOOGLE_ANALYTICS_GET_PROPERTIES_METADATA,
807
+ componentId: require_componentId.ComponentId.EX_GOOGLE_ANALYTICS_V4,
808
+ configData: {
809
+ authorization: buildOauthAuthorization(credentials),
810
+ parameters: { properties }
811
+ }
812
+ }, { signal });
813
+ return require_ValidationError.parseOrThrow(googleAnalyticsGetPropertiesMetadataResultSchema, data);
814
+ };
815
+ const getProfilesProperties = async (input, signal) => {
816
+ const { credentials, ...context } = require_ValidationError.parseOrThrow(googleAnalyticsGetProfilesPropertiesInputSchema, input);
817
+ const data = await sendSyncAction({
818
+ ...context,
819
+ action: SyncAction.GOOGLE_ANALYTICS_GET_PROFILES_PROPERTIES,
820
+ componentId: require_componentId.ComponentId.EX_GOOGLE_ANALYTICS_V4,
821
+ configData: { authorization: buildOauthAuthorization(credentials) }
822
+ }, { signal });
823
+ return require_ValidationError.parseOrThrow(googleAnalyticsGetProfilesPropertiesResultSchema, data);
824
+ };
825
+ return {
826
+ getPropertiesMetadata,
827
+ getProfilesProperties
828
+ };
829
+ };
830
+ //#endregion
831
+ //#region src/clients/syncActions/googleDrive/schemas.ts
832
+ /** The writer's `parameters.tables` entry; its config definition rejects any other key. */
833
+ const googleDriveTableSchema = zod.object({
834
+ id: zod.number().int().nonnegative(),
835
+ tableId: zod.string().optional(),
836
+ fileId: zod.string().optional(),
837
+ title: zod.string().min(1, "Required"),
838
+ folder: zod.object({
839
+ id: zod.string().optional(),
840
+ title: zod.string().optional()
841
+ }).optional(),
842
+ action: zod.enum(["create", "update"]).optional(),
843
+ enabled: zod.boolean().optional(),
844
+ convert: zod.boolean().optional()
845
+ });
846
+ const googleDriveCreateFileInputSchema = syncActionContextSchema.extend({
847
+ /** The stored configuration without `storage`; the writer reads its `authorization` and `parameters`. */
848
+ configuration: zod.looseObject({ parameters: zod.record(zod.string(), zod.unknown()).default({}) }),
849
+ table: googleDriveTableSchema
850
+ });
851
+ /** `folder` is the table's folder, or `{ id: 'root', title: '' }` when it has none. */
852
+ const googleDriveCreateFileResultSchema = zod.object({ file: zod.object({
853
+ id: zod.string(),
854
+ folder: zod.object({
855
+ id: zod.string(),
856
+ title: zod.string().optional()
857
+ })
858
+ }) }).transform(({ file }) => file);
859
+ //#endregion
860
+ //#region src/clients/syncActions/googleDrive/googleDrive.ts
861
+ const createGoogleDrive = (sendSyncAction) => {
862
+ /** Creates the Drive file a table will be written to, without writing any data. */
863
+ const createFile = async (input, signal) => {
864
+ const { configuration, table, ...context } = require_ValidationError.parseOrThrow(googleDriveCreateFileInputSchema, input);
865
+ const data = await sendSyncAction({
866
+ ...context,
867
+ action: SyncAction.GOOGLE_DRIVE_CREATE_FILE,
868
+ componentId: require_componentId.ComponentId.WR_GOOGLE_DRIVE,
869
+ configData: {
870
+ ...configuration,
871
+ parameters: {
872
+ ...configuration.parameters,
873
+ tables: [table]
874
+ }
875
+ }
876
+ }, { signal });
877
+ return require_ValidationError.parseOrThrow(googleDriveCreateFileResultSchema, data);
878
+ };
879
+ return { createFile };
880
+ };
881
+ //#endregion
882
+ //#region src/clients/syncActions/googleSheets/schemas.ts
883
+ /** The writer's `parameters.tables` entry; its config definition rejects any other key. */
884
+ const googleSheetsTableSchema = zod.object({
885
+ id: zod.number().int().nonnegative(),
886
+ tableId: zod.string().optional(),
887
+ fileId: zod.string().optional(),
888
+ title: zod.string().optional(),
889
+ folder: zod.object({
890
+ id: zod.string().optional(),
891
+ title: zod.string().optional()
892
+ }).optional(),
893
+ action: zod.enum([
894
+ "create",
895
+ "update",
896
+ "append"
897
+ ]).optional(),
898
+ enabled: zod.boolean().optional(),
899
+ sheetId: zod.union([zod.string(), zod.number()]).optional(),
900
+ sheetTitle: zod.string().optional(),
901
+ sheetMode: zod.enum(["replace", "add"]).optional()
902
+ });
903
+ const googleSheetsTableActionInputSchema = syncActionContextSchema.extend({
904
+ /** The stored configuration without `storage`; the writer reads its `authorization` and `parameters`. */
905
+ configuration: zod.looseObject({ parameters: zod.record(zod.string(), zod.unknown()).default({}) }),
906
+ table: googleSheetsTableSchema
907
+ });
908
+ const googleSheetPropertiesSchema = zod.object({ sheetId: zod.number() });
909
+ const googleSheetsCreateSpreadsheetResultSchema = zod.object({ spreadsheet: zod.object({
910
+ spreadsheetId: zod.string(),
911
+ sheets: zod.array(zod.object({ properties: googleSheetPropertiesSchema })).min(1)
912
+ }) }).transform(({ spreadsheet }) => spreadsheet);
913
+ /** The sheet named `sheetTitle` when the spreadsheet already has one, else the sheet it added. */
914
+ const googleSheetsAddSheetResultSchema = zod.object({ sheet: googleSheetPropertiesSchema }).transform(({ sheet }) => sheet);
915
+ //#endregion
916
+ //#region src/clients/syncActions/googleSheets/googleSheets.ts
917
+ const createGoogleSheets = (sendSyncAction) => {
918
+ const sendTableAction = (action, input, signal) => {
919
+ const { configuration, table, ...context } = require_ValidationError.parseOrThrow(googleSheetsTableActionInputSchema, input);
920
+ return sendSyncAction({
921
+ ...context,
922
+ action,
923
+ componentId: require_componentId.ComponentId.WR_GOOGLE_SHEETS,
924
+ configData: {
925
+ ...configuration,
926
+ parameters: {
927
+ ...configuration.parameters,
928
+ tables: [table]
929
+ }
930
+ }
931
+ }, { signal });
932
+ };
933
+ /** Creates the spreadsheet a table will be written to, without writing any data. */
934
+ const createSpreadsheet = async (input, signal) => {
935
+ const data = await sendTableAction(SyncAction.GOOGLE_SHEETS_CREATE_SPREADSHEET, input, signal);
936
+ return require_ValidationError.parseOrThrow(googleSheetsCreateSpreadsheetResultSchema, data);
937
+ };
938
+ /** Adds the table's `sheetTitle` sheet to its existing spreadsheet (`fileId`). */
939
+ const addSheet = async (input, signal) => {
940
+ const data = await sendTableAction(SyncAction.GOOGLE_SHEETS_ADD_SHEET, input, signal);
941
+ return require_ValidationError.parseOrThrow(googleSheetsAddSheetResultSchema, data);
942
+ };
943
+ return {
944
+ addSheet,
945
+ createSpreadsheet
946
+ };
947
+ };
948
+ //#endregion
949
+ //#region src/clients/syncActions/looker/schemas.ts
950
+ const testLookerCredentialsInputSchema = syncActionContextSchema.extend({
951
+ credentialsId: zod.string().min(1, "Required"),
952
+ "#token": zod.string().min(1, "Required"),
953
+ host: zod.string().min(1, "Required")
954
+ });
955
+ /** The component answers with a status envelope only — there is no payload to model. */
956
+ const lookerCredentialsResultSchema = zod.object({
957
+ status: zod.string().optional(),
958
+ message: zod.string().optional()
959
+ });
960
+ //#endregion
961
+ //#region src/clients/syncActions/looker/looker.ts
962
+ const createLooker = (sendSyncAction) => {
963
+ /** Registers the project's Looker credentials; throws `SyncActionError` when Looker rejects them. */
964
+ const testCredentials = async (input, signal) => {
965
+ const { credentialsId, "#token": token, host, ...context } = require_ValidationError.parseOrThrow(testLookerCredentialsInputSchema, input);
966
+ const data = await sendSyncAction({
967
+ ...context,
968
+ action: SyncAction.LOOKER_TEST_CREDENTIALS,
969
+ componentId: require_componentId.ComponentId.WR_LOOKER_V2,
970
+ configData: { parameters: { looker: {
971
+ credentialsId,
972
+ "#token": token,
973
+ host
974
+ } } }
975
+ }, { signal });
976
+ return require_ValidationError.parseOrThrow(lookerCredentialsResultSchema, data);
977
+ };
978
+ return { testCredentials };
979
+ };
980
+ //#endregion
981
+ //#region src/clients/syncActions/oneDrive/schemas.ts
982
+ const oneDriveInputSchema = syncActionContextSchema.extend({ credentials: oauthCredentialsSchema });
983
+ const oneDriveSearchFilesInputSchema = oneDriveInputSchema.extend({ search: zod.string().min(1, "Required") });
984
+ const oneDriveGetWorksheetsInputSchema = oneDriveInputSchema.extend({
985
+ componentId: zod.enum([require_componentId.ComponentId.EX_ONEDRIVE, require_componentId.ComponentId.WR_ONEDRIVE]),
986
+ driveId: zod.string().min(1, "Required"),
987
+ fileId: zod.string().min(1, "Required")
988
+ });
989
+ const oneDriveCreateWorkbookInputSchema = oneDriveInputSchema.extend({ path: zod.string().min(1, "Required") });
990
+ const oneDriveCreateWorksheetInputSchema = oneDriveInputSchema.extend({
991
+ driveId: zod.string().min(1, "Required"),
992
+ fileId: zod.string().min(1, "Required"),
993
+ name: zod.string().min(1, "Required")
994
+ });
995
+ const oneDriveFileSchema = zod.object({
996
+ driveId: zod.string(),
997
+ fileId: zod.string(),
998
+ name: zod.string(),
999
+ /** `null` when the component resolved no folder for the file. */
1000
+ path: zod.string().nullable()
1001
+ });
1002
+ const oneDriveWorksheetSchema = zod.object({
1003
+ driveId: zod.string(),
1004
+ fileId: zod.string(),
1005
+ worksheetId: zod.string(),
1006
+ name: zod.string(),
1007
+ /** `name`, suffixed with ` (hidden)` for a hidden worksheet. */
1008
+ title: zod.string(),
1009
+ position: zod.number(),
1010
+ visible: zod.boolean()
1011
+ });
1012
+ const oneDriveSearchFilesResultSchema = zod.object({ files: zod.array(oneDriveFileSchema) });
1013
+ const oneDriveGetWorksheetsResultSchema = zod.object({ worksheets: zod.array(oneDriveWorksheetSchema) });
1014
+ const oneDriveCreateWorkbookResultSchema = zod.object({ file: zod.object({
1015
+ driveId: zod.string(),
1016
+ fileId: zod.string()
1017
+ }) });
1018
+ const oneDriveCreateWorksheetResultSchema = zod.object({ worksheet: zod.object({
1019
+ driveId: zod.string(),
1020
+ fileId: zod.string(),
1021
+ worksheetId: zod.string()
1022
+ }) });
1023
+ //#endregion
1024
+ //#region src/clients/syncActions/oneDrive/oneDrive.ts
1025
+ const createOneDrive = (sendSyncAction) => {
1026
+ const searchFiles = async (input, signal) => {
1027
+ const { credentials, search, ...context } = require_ValidationError.parseOrThrow(oneDriveSearchFilesInputSchema, input);
1028
+ const data = await sendSyncAction({
1029
+ ...context,
1030
+ action: SyncAction.ONEDRIVE_SEARCH,
1031
+ componentId: require_componentId.ComponentId.EX_ONEDRIVE,
1032
+ configData: {
1033
+ parameters: { workbook: { search } },
1034
+ authorization: buildOauthAuthorization(credentials)
1035
+ }
1036
+ }, { signal });
1037
+ return require_ValidationError.parseOrThrow(oneDriveSearchFilesResultSchema, data).files;
1038
+ };
1039
+ const getWorksheets = async (input, signal) => {
1040
+ const { credentials, driveId, fileId, ...context } = require_ValidationError.parseOrThrow(oneDriveGetWorksheetsInputSchema, input);
1041
+ const data = await sendSyncAction({
1042
+ ...context,
1043
+ action: SyncAction.ONEDRIVE_GET_WORKSHEETS,
1044
+ configData: {
1045
+ parameters: { workbook: {
1046
+ driveId,
1047
+ fileId
1048
+ } },
1049
+ authorization: buildOauthAuthorization(credentials)
1050
+ }
1051
+ }, { signal });
1052
+ return require_ValidationError.parseOrThrow(oneDriveGetWorksheetsResultSchema, data).worksheets;
1053
+ };
1054
+ /** Throws `SyncActionError` when a workbook already exists at `path`. */
1055
+ const createWorkbook = async (input, signal) => {
1056
+ const { credentials, path, ...context } = require_ValidationError.parseOrThrow(oneDriveCreateWorkbookInputSchema, input);
1057
+ const data = await sendSyncAction({
1058
+ ...context,
1059
+ action: SyncAction.ONEDRIVE_CREATE_WORKBOOK,
1060
+ componentId: require_componentId.ComponentId.WR_ONEDRIVE,
1061
+ configData: {
1062
+ parameters: { workbook: { path } },
1063
+ authorization: buildOauthAuthorization(credentials)
1064
+ }
1065
+ }, { signal });
1066
+ return require_ValidationError.parseOrThrow(oneDriveCreateWorkbookResultSchema, data).file;
1067
+ };
1068
+ /** Throws `SyncActionError` when the workbook already has a worksheet called `name`. */
1069
+ const createWorksheet = async (input, signal) => {
1070
+ const { credentials, driveId, fileId, name, ...context } = require_ValidationError.parseOrThrow(oneDriveCreateWorksheetInputSchema, input);
1071
+ const data = await sendSyncAction({
1072
+ ...context,
1073
+ action: SyncAction.ONEDRIVE_CREATE_WORKSHEET,
1074
+ componentId: require_componentId.ComponentId.WR_ONEDRIVE,
1075
+ configData: {
1076
+ parameters: {
1077
+ workbook: {
1078
+ driveId,
1079
+ fileId
1080
+ },
1081
+ worksheet: { name }
1082
+ },
1083
+ authorization: buildOauthAuthorization(credentials)
1084
+ }
1085
+ }, { signal });
1086
+ return require_ValidationError.parseOrThrow(oneDriveCreateWorksheetResultSchema, data).worksheet;
1087
+ };
1088
+ return {
1089
+ searchFiles,
1090
+ getWorksheets,
1091
+ createWorkbook,
1092
+ createWorksheet
1093
+ };
1094
+ };
1095
+ //#endregion
1096
+ //#region src/clients/syncActions/snowflakeDwhManager/schemas.ts
1097
+ const snowflakeDwhManagerUserActionInputSchema = syncActionContextSchema.extend({
1098
+ /** The configuration's master connection merged with the one user row the action applies to. */
1099
+ parameters: zod.record(zod.string(), zod.unknown()) });
1100
+ const snowflakeDwhManagerUserActionResultSchema = zod.object({ message: zod.string() }).transform(({ message }) => message);
1101
+ //#endregion
1102
+ //#region src/clients/syncActions/snowflakeDwhManager/snowflakeDwhManager.ts
1103
+ const createSnowflakeDwhManager = (sendSyncAction) => {
1104
+ const sendUserAction = async (action, input, signal) => {
1105
+ const { parameters, ...context } = require_ValidationError.parseOrThrow(snowflakeDwhManagerUserActionInputSchema, input);
1106
+ const data = await sendSyncAction({
1107
+ ...context,
1108
+ action,
1109
+ componentId: require_componentId.ComponentId.APP_SNOWFLAKE_DWH_MANAGER,
1110
+ configData: { parameters }
1111
+ }, { signal });
1112
+ return require_ValidationError.parseOrThrow(snowflakeDwhManagerUserActionResultSchema, data);
1113
+ };
1114
+ /** Resolves with the component's message, which carries the one-time reset URL. */
1115
+ const resetPassword = (input, signal) => sendUserAction(SyncAction.SNOWFLAKE_DWH_MANAGER_RESET_PASSWORD, input, signal);
1116
+ const enrollMfa = (input, signal) => sendUserAction(SyncAction.SNOWFLAKE_DWH_MANAGER_ENROLL_MFA, input, signal);
1117
+ return {
1118
+ enrollMfa,
1119
+ resetPassword
1120
+ };
1121
+ };
1122
+ //#endregion
1123
+ //#region src/clients/syncActions/sshKeys/schemas.ts
1124
+ const sshKeyPairSchema = zod.object({
1125
+ status: zod.literal("success"),
1126
+ public: zod.string(),
1127
+ private: zod.string()
1128
+ });
1129
+ //#endregion
1130
+ //#region src/clients/syncActions/sshKeys/sshKeys.ts
1131
+ const createSshKeys = (sendSyncAction) => {
1132
+ /** Generates a new 4096-bit RSA key pair; the component keeps no copy. */
1133
+ const generate = async (input, signal) => {
1134
+ const data = await sendSyncAction({
1135
+ ...require_ValidationError.parseOrThrow(syncActionContextSchema, input),
1136
+ action: SyncAction.SSH_KEYS_GENERATE,
1137
+ componentId: require_componentId.ComponentId.SSH_KEYGEN_V2,
1138
+ configData: {}
1139
+ }, { signal });
1140
+ return require_ValidationError.parseOrThrow(sshKeyPairSchema, data);
1141
+ };
1142
+ return { generate };
1143
+ };
1144
+ //#endregion
1145
+ //#region src/clients/syncActions/syncActionsClient.ts
1146
+ const createSendSyncAction = (client) => {
1147
+ return async (body, options = {}) => {
1148
+ const { data } = await client.post("/actions", { body: require_ValidationError.parseOrThrow(syncActionBodySchema, body) }, options);
1149
+ return data;
1150
+ };
1151
+ };
1152
+ const createSyncActionsClient = ({ baseUrl, middlewares, auth }) => {
1153
+ const client = require_createOpenapiFetchClient.createOpenapiFetchClient({
1154
+ baseUrl,
1155
+ middlewares,
1156
+ headers: require_auth.createAuthHeaders(auth),
1157
+ validateStatus: syncActionValidateStatus
1158
+ });
1159
+ const genericClient = require_createGenericFetchClient.createGenericFetchClient({
1160
+ baseUrl,
1161
+ middlewares
1162
+ });
1163
+ const sendSyncAction = createSendSyncAction(client);
1164
+ const healthCheck = async (signal) => {
1165
+ const { data } = await genericClient.get("/health-check", {}, { signal });
1166
+ return data;
1167
+ };
1168
+ return {
1169
+ healthCheck,
1170
+ sendSyncAction,
1171
+ apify: createApify(sendSyncAction),
1172
+ codePattern: createCodePattern(sendSyncAction),
1173
+ common: createCommon(sendSyncAction),
1174
+ configurationMigration: createConfigurationMigration(sendSyncAction),
1175
+ dbt: createDbt(sendSyncAction),
1176
+ emailAttachments: createEmailAttachments(sendSyncAction),
1177
+ facebook: createFacebook(sendSyncAction),
1178
+ flowMigration: createFlowMigration(sendSyncAction),
1179
+ genericExtractor: createGenericExtractor(sendSyncAction),
1180
+ git: createGit(sendSyncAction),
1181
+ googleAnalytics: createGoogleAnalytics(sendSyncAction),
1182
+ googleDrive: createGoogleDrive(sendSyncAction),
1183
+ googleSheets: createGoogleSheets(sendSyncAction),
1184
+ looker: createLooker(sendSyncAction),
1185
+ oneDrive: createOneDrive(sendSyncAction),
1186
+ snowflakeDwhManager: createSnowflakeDwhManager(sendSyncAction),
1187
+ sshKeys: createSshKeys(sendSyncAction)
1188
+ };
1189
+ };
1190
+ //#endregion
1191
+ Object.defineProperty(exports, "FACEBOOK_FAMILY", {
1192
+ enumerable: true,
1193
+ get: function() {
1194
+ return FACEBOOK_FAMILY;
1195
+ }
1196
+ });
1197
+ Object.defineProperty(exports, "SyncAction", {
1198
+ enumerable: true,
1199
+ get: function() {
1200
+ return SyncAction;
1201
+ }
1202
+ });
1203
+ Object.defineProperty(exports, "createSyncActionsClient", {
1204
+ enumerable: true,
1205
+ get: function() {
1206
+ return createSyncActionsClient;
1207
+ }
1208
+ });
1209
+ Object.defineProperty(exports, "isFacebookComponentId", {
1210
+ enumerable: true,
1211
+ get: function() {
1212
+ return isFacebookComponentId;
1213
+ }
1214
+ });
1215
+
1216
+ //# sourceMappingURL=syncActions-DyxNmbUR.cjs.map