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