@keboola/api-client 25.0.0 → 29.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 (812) hide show
  1. package/AGENTS.md +623 -0
  2. package/API-SURFACE.md +133 -57
  3. package/README.md +81 -42
  4. package/dist/ManagementClientAuthError-B97OtOQ7.js +15 -0
  5. package/dist/ManagementClientAuthError-B97OtOQ7.js.map +1 -0
  6. package/dist/ManagementClientAuthError-ZJ2-RoKT.cjs +20 -0
  7. package/dist/ManagementClientAuthError-ZJ2-RoKT.cjs.map +1 -0
  8. package/dist/QueryJobTimeoutError-C7JbNGOM.js +38 -0
  9. package/dist/QueryJobTimeoutError-C7JbNGOM.js.map +1 -0
  10. package/dist/QueryJobTimeoutError-CVNPdCWX.cjs +61 -0
  11. package/dist/QueryJobTimeoutError-CVNPdCWX.cjs.map +1 -0
  12. package/dist/SyncActionError-BG0zwchi.cjs +35 -0
  13. package/dist/SyncActionError-BG0zwchi.cjs.map +1 -0
  14. package/dist/SyncActionError-CoZFsdUk.js +24 -0
  15. package/dist/SyncActionError-CoZFsdUk.js.map +1 -0
  16. package/dist/UserError-By_Zckmc.js +10 -0
  17. package/dist/UserError-By_Zckmc.js.map +1 -0
  18. package/dist/UserError-CSGO1qII.cjs +15 -0
  19. package/dist/UserError-CSGO1qII.cjs.map +1 -0
  20. package/dist/ValidationError-CzPWydEb.js +44 -0
  21. package/dist/ValidationError-CzPWydEb.js.map +1 -0
  22. package/dist/ValidationError-h5qvwahi.cjs +61 -0
  23. package/dist/ValidationError-h5qvwahi.cjs.map +1 -0
  24. package/dist/adminRoles-B40yBcmq.js +14 -0
  25. package/dist/adminRoles-B40yBcmq.js.map +1 -0
  26. package/dist/adminRoles-C696kD_U.d.cts +14 -0
  27. package/dist/adminRoles-C696kD_U.d.ts +14 -0
  28. package/dist/adminRoles-CO7J5qAy.cjs +19 -0
  29. package/dist/adminRoles-CO7J5qAy.cjs.map +1 -0
  30. package/dist/ai/index.cjs +62 -12
  31. package/dist/ai/index.cjs.map +1 -1
  32. package/dist/ai/index.d.cts +52 -50
  33. package/dist/ai/index.d.ts +52 -50
  34. package/dist/ai/index.js +62 -4
  35. package/dist/ai/index.js.map +1 -1
  36. package/dist/ai/types.cjs +0 -4
  37. package/dist/ai/types.d.cts +2 -2
  38. package/dist/ai/types.d.ts +2 -2
  39. package/dist/ai/types.js +1 -3
  40. package/dist/appLogs-CNG3yby-.cjs +153 -0
  41. package/dist/appLogs-CNG3yby-.cjs.map +1 -0
  42. package/dist/appLogs-Dl5BcCSD.d.cts +10 -0
  43. package/dist/appLogs-VdgP08aX.d.ts +10 -0
  44. package/dist/appLogs-enL9XR9r.js +132 -0
  45. package/dist/appLogs-enL9XR9r.js.map +1 -0
  46. package/dist/apps/index.cjs +231 -0
  47. package/dist/apps/index.cjs.map +1 -0
  48. package/dist/apps/index.d.cts +248 -0
  49. package/dist/apps/index.d.ts +248 -0
  50. package/dist/apps/index.js +230 -0
  51. package/dist/apps/index.js.map +1 -0
  52. package/dist/apps/types.cjs +0 -0
  53. package/dist/apps/types.d.cts +3 -0
  54. package/dist/apps/types.d.ts +3 -0
  55. package/dist/apps/types.js +1 -0
  56. package/dist/assets/index.cjs +33 -38
  57. package/dist/assets/index.cjs.map +1 -1
  58. package/dist/assets/index.d.cts +22 -22
  59. package/dist/assets/index.d.ts +22 -22
  60. package/dist/assets/index.js +32 -36
  61. package/dist/assets/index.js.map +1 -1
  62. package/dist/assets/schema.cjs +23 -13
  63. package/dist/assets/schema.cjs.map +1 -1
  64. package/dist/assets/schema.d.cts +29 -28
  65. package/dist/assets/schema.d.ts +29 -28
  66. package/dist/assets/schema.js +21 -2
  67. package/dist/assets/schema.js.map +1 -1
  68. package/dist/auth/index.cjs +14 -53
  69. package/dist/auth/index.d.cts +2 -305
  70. package/dist/auth/index.d.ts +2 -305
  71. package/dist/auth/index.js +2 -4
  72. package/dist/auth/types.cjs +0 -4
  73. package/dist/auth/types.d.cts +2 -7
  74. package/dist/auth/types.d.ts +2 -7
  75. package/dist/auth/types.js +1 -3
  76. package/dist/auth-5HCvCsZO.cjs +18 -0
  77. package/dist/auth-5HCvCsZO.cjs.map +1 -0
  78. package/dist/auth-D2jfNlpX.js +13 -0
  79. package/dist/{chunk-EDX5D6UY.js.map → auth-D2jfNlpX.js.map} +1 -1
  80. package/dist/authClient-Bgj2Ay7h.d.cts +320 -0
  81. package/dist/authClient-DOk6VKdV.js +332 -0
  82. package/dist/authClient-DOk6VKdV.js.map +1 -0
  83. package/dist/authClient-Dsd7W99W.d.ts +320 -0
  84. package/dist/authClient-Z8Eg8rlN.cjs +405 -0
  85. package/dist/authClient-Z8Eg8rlN.cjs.map +1 -0
  86. package/dist/backends-DKBz5OxE.d.cts +9 -0
  87. package/dist/backends-DKBz5OxE.d.ts +9 -0
  88. package/dist/chat/index.cjs +134 -13
  89. package/dist/chat/index.cjs.map +1 -1
  90. package/dist/chat/index.d.cts +49 -48
  91. package/dist/chat/index.d.ts +49 -48
  92. package/dist/chat/index.js +134 -5
  93. package/dist/chat/index.js.map +1 -1
  94. package/dist/chat/suggestions.cjs +152 -74
  95. package/dist/chat/suggestions.cjs.map +1 -1
  96. package/dist/chat/suggestions.d.cts +2 -437
  97. package/dist/chat/suggestions.d.ts +2 -437
  98. package/dist/chat/suggestions.js +136 -2
  99. package/dist/chat/suggestions.js.map +1 -1
  100. package/dist/chat/types.cjs +6 -8
  101. package/dist/chat/types.cjs.map +1 -1
  102. package/dist/chat/types.d.cts +2 -3
  103. package/dist/chat/types.d.ts +2 -3
  104. package/dist/chat/types.js +5 -6
  105. package/dist/chat/types.js.map +1 -1
  106. package/dist/componentId-DkyQ8PM0.cjs +73 -0
  107. package/dist/componentId-DkyQ8PM0.cjs.map +1 -0
  108. package/dist/componentId-vJz-kWs6.js +68 -0
  109. package/dist/componentId-vJz-kWs6.js.map +1 -0
  110. package/dist/concurrent-CH9fbNr3.js +34 -0
  111. package/dist/concurrent-CH9fbNr3.js.map +1 -0
  112. package/dist/concurrent-tbiIa0UL.cjs +39 -0
  113. package/dist/concurrent-tbiIa0UL.cjs.map +1 -0
  114. package/dist/configurations-Byt59bIa.js +726 -0
  115. package/dist/{chunk-IAYPOSMM.cjs.map → configurations-Byt59bIa.js.map} +1 -1
  116. package/dist/configurations-CujCwDcB.cjs +743 -0
  117. package/dist/configurations-CujCwDcB.cjs.map +1 -0
  118. package/dist/configurations-DCOJONZZ.cjs +313 -0
  119. package/dist/configurations-DCOJONZZ.cjs.map +1 -0
  120. package/dist/configurations-iCbhe0tb.js +158 -0
  121. package/dist/configurations-iCbhe0tb.js.map +1 -0
  122. package/dist/constants/index.cjs +10 -34
  123. package/dist/constants/index.d.cts +4 -92
  124. package/dist/constants/index.d.ts +4 -92
  125. package/dist/constants/index.js +4 -5
  126. package/dist/constants-CqyyBkXW.cjs +197 -0
  127. package/dist/constants-CqyyBkXW.cjs.map +1 -0
  128. package/dist/constants-_HhqKvBg.js +174 -0
  129. package/dist/constants-_HhqKvBg.js.map +1 -0
  130. package/dist/createFetchClient-BK0TZK-U.js +184 -0
  131. package/dist/createFetchClient-BK0TZK-U.js.map +1 -0
  132. package/dist/createFetchClient-BsG719K1.cjs +263 -0
  133. package/dist/createFetchClient-BsG719K1.cjs.map +1 -0
  134. package/dist/createGenericFetchClient-CVZYekDk.js +7 -0
  135. package/dist/createGenericFetchClient-CVZYekDk.js.map +1 -0
  136. package/dist/createGenericFetchClient-DLbjX0eM.cjs +12 -0
  137. package/dist/createGenericFetchClient-DLbjX0eM.cjs.map +1 -0
  138. package/dist/createOpenapiFetchClient-B5U1fCHS.js +7 -0
  139. package/dist/createOpenapiFetchClient-B5U1fCHS.js.map +1 -0
  140. package/dist/createOpenapiFetchClient-Cr90VXY4.cjs +12 -0
  141. package/dist/createOpenapiFetchClient-Cr90VXY4.cjs.map +1 -0
  142. package/dist/createStore-BNiCRQXa.js +148 -0
  143. package/dist/createStore-BNiCRQXa.js.map +1 -0
  144. package/dist/createStore-MQbboXcB.cjs +177 -0
  145. package/dist/createStore-MQbboXcB.cjs.map +1 -0
  146. package/dist/credential-0c6yFwtp.cjs +44 -0
  147. package/dist/credential-0c6yFwtp.cjs.map +1 -0
  148. package/dist/credential-kEGLnVez.js +33 -0
  149. package/dist/credential-kEGLnVez.js.map +1 -0
  150. package/dist/dataScience/index.cjs +5 -19
  151. package/dist/dataScience/index.d.cts +3 -207
  152. package/dist/dataScience/index.d.ts +3 -207
  153. package/dist/dataScience/index.js +3 -6
  154. package/dist/dataScience/types.cjs +0 -4
  155. package/dist/dataScience/types.d.cts +3 -2
  156. package/dist/dataScience/types.d.ts +3 -2
  157. package/dist/dataScience/types.js +1 -3
  158. package/dist/dataScience-C-JrA0Uk.cjs +114 -0
  159. package/dist/dataScience-C-JrA0Uk.cjs.map +1 -0
  160. package/dist/dataScience-CE0pSWbl.js +109 -0
  161. package/dist/dataScience-CE0pSWbl.js.map +1 -0
  162. package/dist/dedupe-CiskLkGR.cjs +30 -0
  163. package/dist/dedupe-CiskLkGR.cjs.map +1 -0
  164. package/dist/dedupe-DYIHgZoG.js +25 -0
  165. package/dist/dedupe-DYIHgZoG.js.map +1 -0
  166. package/dist/developerPortal/index.cjs +6 -0
  167. package/dist/developerPortal/index.d.cts +3 -0
  168. package/dist/developerPortal/index.d.ts +3 -0
  169. package/dist/developerPortal/index.js +2 -0
  170. package/dist/developerPortal/types.cjs +0 -0
  171. package/dist/developerPortal/types.d.cts +2 -0
  172. package/dist/developerPortal/types.d.ts +2 -0
  173. package/dist/developerPortal/types.js +1 -0
  174. package/dist/developerPortalClient-BPPEAdJW.js +485 -0
  175. package/dist/developerPortalClient-BPPEAdJW.js.map +1 -0
  176. package/dist/developerPortalClient-C8oq48xW.cjs +508 -0
  177. package/dist/developerPortalClient-C8oq48xW.cjs.map +1 -0
  178. package/dist/domain/permissions/index.cjs +31 -122
  179. package/dist/domain/permissions/index.d.cts +19 -51
  180. package/dist/domain/permissions/index.d.ts +19 -51
  181. package/dist/domain/permissions/index.js +3 -5
  182. package/dist/domain/storageTable/index.cjs +4 -16
  183. package/dist/domain/storageTable/index.d.cts +2 -131
  184. package/dist/domain/storageTable/index.d.ts +2 -131
  185. package/dist/domain/storageTable/index.js +2 -3
  186. package/dist/editor/index.cjs +96 -12
  187. package/dist/editor/index.cjs.map +1 -1
  188. package/dist/editor/index.d.cts +163 -161
  189. package/dist/editor/index.d.ts +163 -161
  190. package/dist/editor/index.js +96 -4
  191. package/dist/editor/index.js.map +1 -1
  192. package/dist/editor/types.cjs +0 -4
  193. package/dist/editor/types.d.cts +2 -2
  194. package/dist/editor/types.d.ts +2 -2
  195. package/dist/editor/types.js +1 -3
  196. package/dist/encryption/index.cjs +58 -11
  197. package/dist/encryption/index.cjs.map +1 -1
  198. package/dist/encryption/index.d.cts +2 -18
  199. package/dist/encryption/index.d.ts +2 -18
  200. package/dist/encryption/index.js +58 -3
  201. package/dist/encryption/index.js.map +1 -1
  202. package/dist/encryption/types.cjs +0 -4
  203. package/dist/encryption/types.d.cts +2 -68
  204. package/dist/encryption/types.d.ts +2 -68
  205. package/dist/encryption/types.js +1 -3
  206. package/dist/generateUUID-C6qKBPIv.cjs +11 -0
  207. package/dist/generateUUID-C6qKBPIv.cjs.map +1 -0
  208. package/dist/generateUUID-Dr8l-aoc.js +6 -0
  209. package/dist/generateUUID-Dr8l-aoc.js.map +1 -0
  210. package/dist/import/index.cjs +3 -14
  211. package/dist/import/index.d.cts +41 -38
  212. package/dist/import/index.d.ts +41 -38
  213. package/dist/import/index.js +2 -5
  214. package/dist/import-Cf0W-7YD.js +116 -0
  215. package/dist/import-Cf0W-7YD.js.map +1 -0
  216. package/dist/import-KLH1uRtx.cjs +121 -0
  217. package/dist/import-KLH1uRtx.cjs.map +1 -0
  218. package/dist/index-8pN6Emos.d.ts +218 -0
  219. package/dist/index-BEKaJ7Cc.d.cts +1388 -0
  220. package/dist/index-BMqLPS6S.d.cts +135 -0
  221. package/dist/index-BMqLPS6S.d.ts +135 -0
  222. package/dist/index-BWBScAYc.d.cts +16 -0
  223. package/dist/index-BmjeNd9u.d.ts +1075 -0
  224. package/dist/index-BthgbVdd.d.ts +31 -0
  225. package/dist/index-CLPrlyIz.d.cts +218 -0
  226. package/dist/index-CXQRvZ-f.d.cts +31 -0
  227. package/dist/index-CeistZnj.d.ts +1388 -0
  228. package/dist/index-Cfrl7sd5.d.ts +65 -0
  229. package/dist/index-DIM8KZly.d.ts +16 -0
  230. package/dist/index-DNlX-H1V.d.ts +208 -0
  231. package/dist/index-DVsnxZap.d.cts +65 -0
  232. package/dist/index-DXi6wsr5.d.cts +77 -0
  233. package/dist/index-DYQt4zxC.d.ts +77 -0
  234. package/dist/index-DplMbm9E.d.cts +19882 -0
  235. package/dist/index-Dwp8tF6O.d.ts +19882 -0
  236. package/dist/index-IN0qzs52.d.cts +208 -0
  237. package/dist/index-KKJkrxjx.d.ts +26 -0
  238. package/dist/index-NC1dXRTD.d.cts +40 -0
  239. package/dist/index-NC1dXRTD.d.ts +40 -0
  240. package/dist/index-WQkVzx5e.d.cts +1075 -0
  241. package/dist/index-eEBVG5s3.d.cts +26 -0
  242. package/dist/index-vb9Rfqca.d.cts +115 -0
  243. package/dist/index-vb9Rfqca.d.ts +115 -0
  244. package/dist/index.cjs +1728 -1802
  245. package/dist/index.cjs.map +1 -1
  246. package/dist/index.d.cts +7 -15301
  247. package/dist/index.d.ts +7 -15301
  248. package/dist/index.js +1678 -1675
  249. package/dist/index.js.map +1 -1
  250. package/dist/isPlainObject-BB3iy87C.cjs +16 -0
  251. package/dist/isPlainObject-BB3iy87C.cjs.map +1 -0
  252. package/dist/isPlainObject-LYW-03uB.js +11 -0
  253. package/dist/isPlainObject-LYW-03uB.js.map +1 -0
  254. package/dist/jobStatus-DbMupQEK.js +423 -0
  255. package/dist/jobStatus-DbMupQEK.js.map +1 -0
  256. package/dist/jobStatus-kQ9JqF8t.cjs +494 -0
  257. package/dist/jobStatus-kQ9JqF8t.cjs.map +1 -0
  258. package/dist/management/index.cjs +4 -18
  259. package/dist/management/index.d.cts +2 -1083
  260. package/dist/management/index.d.ts +2 -1083
  261. package/dist/management/index.js +2 -5
  262. package/dist/management/types.cjs +0 -4
  263. package/dist/management/types.d.cts +2 -12
  264. package/dist/management/types.d.ts +2 -12
  265. package/dist/management/types.js +1 -3
  266. package/dist/management-DqwQcDCx.js +1065 -0
  267. package/dist/management-DqwQcDCx.js.map +1 -0
  268. package/dist/management-WOmlBt6H.cjs +1076 -0
  269. package/dist/management-WOmlBt6H.cjs.map +1 -0
  270. package/dist/metastore/index.cjs +3 -14
  271. package/dist/metastore/index.d.cts +2 -33
  272. package/dist/metastore/index.d.ts +2 -33
  273. package/dist/metastore/index.js +2 -5
  274. package/dist/metastore/types.cjs +0 -4
  275. package/dist/metastore/types.d.cts +2 -2
  276. package/dist/metastore/types.d.ts +2 -2
  277. package/dist/metastore/types.js +1 -3
  278. package/dist/metastore-CNEhL66f.js +134 -0
  279. package/dist/metastore-CNEhL66f.js.map +1 -0
  280. package/dist/metastore-CkQluyX1.cjs +139 -0
  281. package/dist/metastore-CkQluyX1.cjs.map +1 -0
  282. package/dist/notifications/index.cjs +67 -13
  283. package/dist/notifications/index.cjs.map +1 -1
  284. package/dist/notifications/index.d.cts +56 -56
  285. package/dist/notifications/index.d.ts +56 -56
  286. package/dist/notifications/index.js +67 -5
  287. package/dist/notifications/index.js.map +1 -1
  288. package/dist/notifications/types.cjs +0 -4
  289. package/dist/notifications/types.d.cts +2 -2
  290. package/dist/notifications/types.d.ts +2 -2
  291. package/dist/notifications/types.js +1 -3
  292. package/dist/oauth/index.cjs +3 -14
  293. package/dist/oauth/index.d.cts +49 -49
  294. package/dist/oauth/index.d.ts +49 -49
  295. package/dist/oauth/index.js +2 -5
  296. package/dist/oauth/types.cjs +0 -4
  297. package/dist/oauth/types.d.cts +2 -725
  298. package/dist/oauth/types.d.ts +2 -725
  299. package/dist/oauth/types.js +1 -3
  300. package/dist/oauth-DTvrqe6P.cjs +88 -0
  301. package/dist/oauth-DTvrqe6P.cjs.map +1 -0
  302. package/dist/oauth-DYDObUX9.js +83 -0
  303. package/dist/oauth-DYDObUX9.js.map +1 -0
  304. package/dist/omnisearch/index.cjs +49 -0
  305. package/dist/omnisearch/index.cjs.map +1 -0
  306. package/dist/omnisearch/index.d.cts +30 -0
  307. package/dist/omnisearch/index.d.ts +30 -0
  308. package/dist/omnisearch/index.js +48 -0
  309. package/dist/omnisearch/index.js.map +1 -0
  310. package/dist/omnisearch/types.cjs +0 -0
  311. package/dist/omnisearch/types.d.cts +2 -0
  312. package/dist/omnisearch/types.d.ts +2 -0
  313. package/dist/omnisearch/types.js +1 -0
  314. package/dist/project-BvFi19K_.cjs +56 -0
  315. package/dist/project-BvFi19K_.cjs.map +1 -0
  316. package/dist/project-CcGxXIW_.d.cts +18 -0
  317. package/dist/project-DWwZv66D.js +39 -0
  318. package/dist/project-DWwZv66D.js.map +1 -0
  319. package/dist/project-io1pY-hW.d.ts +18 -0
  320. package/dist/queryService/index.cjs +3 -14
  321. package/dist/queryService/index.d.cts +2 -39
  322. package/dist/queryService/index.d.ts +2 -39
  323. package/dist/queryService/index.js +2 -5
  324. package/dist/queryService/types.cjs +0 -4
  325. package/dist/queryService/types.d.cts +2 -2
  326. package/dist/queryService/types.d.ts +2 -2
  327. package/dist/queryService/types.js +1 -3
  328. package/dist/queryService-BHV_OZI2.js +114 -0
  329. package/dist/queryService-BHV_OZI2.js.map +1 -0
  330. package/dist/queryService-CvqDqigW.cjs +119 -0
  331. package/dist/queryService-CvqDqigW.cjs.map +1 -0
  332. package/dist/queue/index.cjs +3 -15
  333. package/dist/queue/index.d.cts +411 -334
  334. package/dist/queue/index.d.ts +411 -334
  335. package/dist/queue/index.js +2 -6
  336. package/dist/queue/types.cjs +0 -4
  337. package/dist/queue/types.d.cts +2 -2
  338. package/dist/queue/types.d.ts +2 -2
  339. package/dist/queue/types.js +1 -3
  340. package/dist/queue-CUHKupTA.cjs +137 -0
  341. package/dist/queue-CUHKupTA.cjs.map +1 -0
  342. package/dist/queue-uofE4Eu6.js +126 -0
  343. package/dist/queue-uofE4Eu6.js.map +1 -0
  344. package/dist/rolldown-runtime-VH7oDXx4.cjs +28 -0
  345. package/dist/scheduler/index.cjs +61 -13
  346. package/dist/scheduler/index.cjs.map +1 -1
  347. package/dist/scheduler/index.d.cts +73 -73
  348. package/dist/scheduler/index.d.ts +73 -73
  349. package/dist/scheduler/index.js +61 -5
  350. package/dist/scheduler/index.js.map +1 -1
  351. package/dist/scheduler/types.cjs +0 -4
  352. package/dist/scheduler/types.d.cts +2 -372
  353. package/dist/scheduler/types.d.ts +2 -372
  354. package/dist/scheduler/types.js +1 -3
  355. package/dist/sdk/configurations/index.cjs +3 -16
  356. package/dist/sdk/configurations/index.d.cts +3066 -3077
  357. package/dist/sdk/configurations/index.d.ts +3066 -3077
  358. package/dist/sdk/configurations/index.js +2 -7
  359. package/dist/sdk/developerPortal/index.cjs +203 -0
  360. package/dist/sdk/developerPortal/index.cjs.map +1 -0
  361. package/dist/sdk/developerPortal/index.d.cts +1371 -0
  362. package/dist/sdk/developerPortal/index.d.ts +1371 -0
  363. package/dist/sdk/developerPortal/index.js +202 -0
  364. package/dist/sdk/developerPortal/index.js.map +1 -0
  365. package/dist/sdk/queryService/index.cjs +93 -0
  366. package/dist/sdk/queryService/index.cjs.map +1 -0
  367. package/dist/sdk/queryService/index.d.cts +2 -0
  368. package/dist/sdk/queryService/index.d.ts +2 -0
  369. package/dist/sdk/queryService/index.js +92 -0
  370. package/dist/sdk/queryService/index.js.map +1 -0
  371. package/dist/sdk/semanticLayer/index.cjs +352 -50
  372. package/dist/sdk/semanticLayer/index.cjs.map +1 -1
  373. package/dist/sdk/semanticLayer/index.d.cts +105 -94
  374. package/dist/sdk/semanticLayer/index.d.ts +105 -94
  375. package/dist/sdk/semanticLayer/index.js +346 -4
  376. package/dist/sdk/semanticLayer/index.js.map +1 -1
  377. package/dist/sdk/semanticLayer/types.cjs +0 -4
  378. package/dist/sdk/semanticLayer/types.d.cts +2 -132
  379. package/dist/sdk/semanticLayer/types.d.ts +2 -132
  380. package/dist/sdk/semanticLayer/types.js +1 -3
  381. package/dist/sdk/storage/index.cjs +267 -47
  382. package/dist/sdk/storage/index.cjs.map +1 -1
  383. package/dist/sdk/storage/index.d.cts +2 -119
  384. package/dist/sdk/storage/index.d.ts +2 -119
  385. package/dist/sdk/storage/index.js +258 -3
  386. package/dist/sdk/storage/index.js.map +1 -1
  387. package/dist/sdk/tag/index.cjs +3 -14
  388. package/dist/sdk/tag/index.d.cts +16 -20
  389. package/dist/sdk/tag/index.d.ts +16 -20
  390. package/dist/sdk/tag/index.js +2 -5
  391. package/dist/sdk/tag/types.cjs +0 -4
  392. package/dist/sdk/tag/types.d.cts +2 -30
  393. package/dist/sdk/tag/types.d.ts +2 -30
  394. package/dist/sdk/tag/types.js +1 -3
  395. package/dist/sdk/vault/index.cjs +93 -31
  396. package/dist/sdk/vault/index.cjs.map +1 -1
  397. package/dist/sdk/vault/index.d.cts +2 -72
  398. package/dist/sdk/vault/index.d.ts +2 -72
  399. package/dist/sdk/vault/index.js +88 -3
  400. package/dist/sdk/vault/index.js.map +1 -1
  401. package/dist/status/index.cjs +16 -20
  402. package/dist/status/index.cjs.map +1 -1
  403. package/dist/status/index.d.cts +8 -9
  404. package/dist/status/index.d.ts +8 -9
  405. package/dist/status/index.js +15 -18
  406. package/dist/status/index.js.map +1 -1
  407. package/dist/status/types.cjs +0 -6
  408. package/dist/status/types.d.cts +17 -15
  409. package/dist/status/types.d.ts +17 -15
  410. package/dist/status/types.js +1 -3
  411. package/dist/storage/index.cjs +27 -54
  412. package/dist/storage/index.d.cts +3 -43
  413. package/dist/storage/index.d.ts +3 -43
  414. package/dist/storage/index.js +8 -9
  415. package/dist/storage/types.cjs +0 -4
  416. package/dist/storage/types.d.cts +5 -1654
  417. package/dist/storage/types.d.ts +5 -1654
  418. package/dist/storage/types.js +1 -3
  419. package/dist/storage-DbyNnkIJ.cjs +2458 -0
  420. package/dist/storage-DbyNnkIJ.cjs.map +1 -0
  421. package/dist/storage-luq7YBZF.js +2429 -0
  422. package/dist/storage-luq7YBZF.js.map +1 -0
  423. package/dist/storageTable-C9crh4Ef.cjs +310 -0
  424. package/dist/storageTable-C9crh4Ef.cjs.map +1 -0
  425. package/dist/storageTable-DslXtqNL.js +299 -0
  426. package/dist/storageTable-DslXtqNL.js.map +1 -0
  427. package/dist/stream/index.cjs +363 -12
  428. package/dist/stream/index.cjs.map +1 -1
  429. package/dist/stream/index.d.cts +345 -345
  430. package/dist/stream/index.d.ts +345 -345
  431. package/dist/stream/index.js +363 -4
  432. package/dist/stream/index.js.map +1 -1
  433. package/dist/stream/types.cjs +0 -4
  434. package/dist/stream/types.d.cts +2 -2
  435. package/dist/stream/types.d.ts +2 -2
  436. package/dist/stream/types.js +1 -3
  437. package/dist/suggestions-BH3x7xU7.d.cts +438 -0
  438. package/dist/suggestions-BH3x7xU7.d.ts +438 -0
  439. package/dist/syncActions/index.cjs +3 -18
  440. package/dist/syncActions/index.d.cts +2 -112
  441. package/dist/syncActions/index.d.ts +2 -112
  442. package/dist/syncActions/index.js +2 -9
  443. package/dist/syncActions/types.cjs +0 -4
  444. package/dist/syncActions/types.d.cts +2 -298
  445. package/dist/syncActions/types.d.ts +2 -298
  446. package/dist/syncActions/types.js +1 -3
  447. package/dist/syncActions-DKWeJ8GH.cjs +504 -0
  448. package/dist/syncActions-DKWeJ8GH.cjs.map +1 -0
  449. package/dist/syncActions-ssWWVN_4.js +497 -0
  450. package/dist/syncActions-ssWWVN_4.js.map +1 -0
  451. package/dist/tag-CsoOZWB_.cjs +175 -0
  452. package/dist/tag-CsoOZWB_.cjs.map +1 -0
  453. package/dist/tag-DCsoewjL.js +164 -0
  454. package/dist/{chunk-DHOVQ2TW.js.map → tag-DCsoewjL.js.map} +1 -1
  455. package/dist/telemetry/index.cjs +3 -14
  456. package/dist/telemetry/index.d.cts +10 -10
  457. package/dist/telemetry/index.d.ts +10 -10
  458. package/dist/telemetry/index.js +2 -5
  459. package/dist/telemetry/types.cjs +0 -4
  460. package/dist/telemetry/types.d.cts +2 -12
  461. package/dist/telemetry/types.d.ts +2 -12
  462. package/dist/telemetry/types.js +1 -3
  463. package/dist/telemetry-2IrE8HaZ.cjs +29 -0
  464. package/dist/telemetry-2IrE8HaZ.cjs.map +1 -0
  465. package/dist/telemetry-yQfQxBBI.js +24 -0
  466. package/dist/telemetry-yQfQxBBI.js.map +1 -0
  467. package/dist/types--T-vBqdd.d.cts +2835 -0
  468. package/dist/{types-CM1zHzgm.d.ts → types-2mHlPakp.d.cts} +893 -69
  469. package/dist/types-7H6Dnz0Y.d.ts +23 -0
  470. package/dist/types-B06L4-WE.d.cts +2124 -0
  471. package/dist/types-B1S2H7q1.d.ts +373 -0
  472. package/dist/types-B1glyy_Q.d.ts +726 -0
  473. package/dist/{utils-DK7uJcmR.d.cts → types-BCt0EMiO.d.ts} +16 -905
  474. package/dist/{types-BX1xr4CX.d.cts → types-BD6czYPH.d.ts} +43 -108
  475. package/dist/{types-BEnE7LHB.d.cts → types-BO-mTxKb.d.cts} +57 -81
  476. package/dist/{types-BieLFMW1.d.cts → types-BREBK0xX.d.ts} +9 -8
  477. package/dist/types-BRQAKEC1.d.cts +32 -0
  478. package/dist/types-BXK6Ebtm.d.ts +32 -0
  479. package/dist/types-BefwoXik.d.cts +373 -0
  480. package/dist/{types-DeoA45gz.d.cts → types-BhBvnvqe.d.ts} +632 -464
  481. package/dist/{types-Cgh3jqrV.d.cts → types-BmFyDKe6.d.ts} +893 -69
  482. package/dist/types-BpWqpMkL.d.ts +66 -0
  483. package/dist/types-C8XiTXxi.d.cts +23 -0
  484. package/dist/{types-BfuVN8Pk.d.cts → types-CAOvDtMC.d.cts} +11 -16
  485. package/dist/types-CC0wymfG.d.ts +2088 -0
  486. package/dist/{types-YzkNUuYo.d.ts → types-CI1mW2lA.d.ts} +11 -16
  487. package/dist/{types-00IaLn3S.d.ts → types-CRYtdj5w.d.ts} +876 -374
  488. package/dist/{types-CrLjE5xf.d.ts → types-CSmttcZ_.d.ts} +10 -12
  489. package/dist/{types-DgSyBwP3.d.cts → types-CbZ8aMKW.d.cts} +11 -14
  490. package/dist/{types-DwMezEHT.d.ts → types-CexuN7Mw.d.cts} +43 -108
  491. package/dist/types-CjAia48k.d.ts +386 -0
  492. package/dist/{types-D-MuJHwl.d.cts → types-CtdyAkzI.d.cts} +28 -16
  493. package/dist/{types-DpUcInCX.d.ts → types-CvADp-x-.d.ts} +11 -14
  494. package/dist/types-CwvOcTOm.d.cts +2088 -0
  495. package/dist/types-CyRK5z-E.d.cts +386 -0
  496. package/dist/{types-DbAO-Tgk.d.ts → types-D2n3h1gp.d.ts} +57 -81
  497. package/dist/types-DBOEA7l0.d.cts +148 -0
  498. package/dist/{types-DYnHIm7m.d.cts → types-DCBKso0t.d.cts} +10 -12
  499. package/dist/{types-Hj1CaKtV.d.ts → types-DEKF5pbg.d.cts} +632 -464
  500. package/dist/{types-B30y9Lhc.d.ts → types-DMvU4kZ2.d.cts} +208 -24
  501. package/dist/{types-B-vmDlWB.d.cts → types-DS8uFAeq.d.cts} +10 -15
  502. package/dist/types-DeApSCzx.d.cts +602 -0
  503. package/dist/types-DebL68-g.d.ts +148 -0
  504. package/dist/types-DgaYUtu_.d.cts +726 -0
  505. package/dist/{types-CiJ5ULtS.d.ts → types-DkbfBOBr.d.cts} +9 -8
  506. package/dist/types-DvsGS8By.d.cts +66 -0
  507. package/dist/{types-DHXZZKb3.d.ts → types-DwX1uxp_.d.ts} +10 -15
  508. package/dist/{types-sVyfECai.d.cts → types-ISUNM_BR.d.cts} +876 -374
  509. package/dist/{utils-B_SOM1XR.d.ts → types-QOIQ-dZU.d.cts} +16 -905
  510. package/dist/types-SGuvOEV8.d.ts +2124 -0
  511. package/dist/types-V8rC5if7.d.cts +621 -0
  512. package/dist/{types-CSZoV4lM.d.cts → types-Z-vUwgym.d.ts} +208 -24
  513. package/dist/types-bws2RtKq.d.ts +602 -0
  514. package/dist/types-h9TTimS_.d.ts +2835 -0
  515. package/dist/types-lFsTSkhe.d.cts +14 -0
  516. package/dist/types-lFsTSkhe.d.ts +14 -0
  517. package/dist/types-n4FFKqa4.d.ts +621 -0
  518. package/dist/{types-DeS-oVdn.d.ts → types-x4xPlrr0.d.ts} +28 -16
  519. package/dist/vault/index.cjs +49 -13
  520. package/dist/vault/index.cjs.map +1 -1
  521. package/dist/vault/index.d.cts +2 -26
  522. package/dist/vault/index.d.ts +2 -26
  523. package/dist/vault/index.js +49 -5
  524. package/dist/vault/index.js.map +1 -1
  525. package/dist/vault/types.cjs +0 -4
  526. package/dist/vault/types.d.cts +2 -385
  527. package/dist/vault/types.d.ts +2 -385
  528. package/dist/vault/types.js +1 -3
  529. package/package.json +113 -7
  530. package/surface/ai.md +1 -0
  531. package/surface/apps.md +32 -0
  532. package/surface/auth.md +6 -4
  533. package/surface/chat.md +3 -2
  534. package/surface/dataScience.md +3 -2
  535. package/surface/editor.md +1 -0
  536. package/surface/encryption.md +1 -0
  537. package/surface/import.md +1 -0
  538. package/surface/kaiAgent.md +2 -1
  539. package/surface/management.md +17 -16
  540. package/surface/metastore.md +2 -1
  541. package/surface/notifications.md +1 -0
  542. package/surface/oauth.md +1 -0
  543. package/surface/omnisearch.md +9 -0
  544. package/surface/queryService.md +5 -3
  545. package/surface/queue.md +8 -6
  546. package/surface/scheduler.md +1 -0
  547. package/surface/sdk.md +22 -22
  548. package/surface/storage.md +147 -106
  549. package/surface/stream.md +1 -0
  550. package/surface/syncActions.md +13 -6
  551. package/surface/vault.md +1 -0
  552. package/dist/ManagementClientAuthError-4J0S5tV-.d.ts +0 -9
  553. package/dist/ManagementClientAuthError-CyDpa4NS.d.cts +0 -9
  554. package/dist/adminRoles-Cil1lavB.d.cts +0 -18
  555. package/dist/adminRoles-Cil1lavB.d.ts +0 -18
  556. package/dist/ai/types.cjs.map +0 -1
  557. package/dist/ai/types.js.map +0 -1
  558. package/dist/auth/index.cjs.map +0 -1
  559. package/dist/auth/index.js.map +0 -1
  560. package/dist/auth/types.cjs.map +0 -1
  561. package/dist/auth/types.js.map +0 -1
  562. package/dist/chunk-22E6IGXR.js +0 -6
  563. package/dist/chunk-22E6IGXR.js.map +0 -1
  564. package/dist/chunk-2BOG5U7C.js +0 -75
  565. package/dist/chunk-2BOG5U7C.js.map +0 -1
  566. package/dist/chunk-2CFM7K4U.cjs +0 -55
  567. package/dist/chunk-2CFM7K4U.cjs.map +0 -1
  568. package/dist/chunk-34GM6NXB.js +0 -77
  569. package/dist/chunk-34GM6NXB.js.map +0 -1
  570. package/dist/chunk-3BFPNM2J.js +0 -61
  571. package/dist/chunk-3BFPNM2J.js.map +0 -1
  572. package/dist/chunk-3PVERYSF.js +0 -16
  573. package/dist/chunk-3PVERYSF.js.map +0 -1
  574. package/dist/chunk-3YWQQ3OG.cjs +0 -79
  575. package/dist/chunk-3YWQQ3OG.cjs.map +0 -1
  576. package/dist/chunk-4RC5E3SL.js +0 -140
  577. package/dist/chunk-4RC5E3SL.js.map +0 -1
  578. package/dist/chunk-4VVF2PIX.js +0 -110
  579. package/dist/chunk-4VVF2PIX.js.map +0 -1
  580. package/dist/chunk-552FC4ZV.js +0 -14
  581. package/dist/chunk-552FC4ZV.js.map +0 -1
  582. package/dist/chunk-5XWVWFTC.js +0 -33
  583. package/dist/chunk-5XWVWFTC.js.map +0 -1
  584. package/dist/chunk-6YZQIMML.cjs +0 -163
  585. package/dist/chunk-6YZQIMML.cjs.map +0 -1
  586. package/dist/chunk-77LILJYX.js +0 -110
  587. package/dist/chunk-77LILJYX.js.map +0 -1
  588. package/dist/chunk-7J2R6XHB.js +0 -3
  589. package/dist/chunk-7J2R6XHB.js.map +0 -1
  590. package/dist/chunk-7R22VKV7.cjs +0 -62
  591. package/dist/chunk-7R22VKV7.cjs.map +0 -1
  592. package/dist/chunk-7RO6PKZ4.cjs +0 -16
  593. package/dist/chunk-7RO6PKZ4.cjs.map +0 -1
  594. package/dist/chunk-7YXL4FKN.cjs +0 -340
  595. package/dist/chunk-7YXL4FKN.cjs.map +0 -1
  596. package/dist/chunk-7Z4MU7ZB.js +0 -1294
  597. package/dist/chunk-7Z4MU7ZB.js.map +0 -1
  598. package/dist/chunk-AFJGNBVM.cjs +0 -63
  599. package/dist/chunk-AFJGNBVM.cjs.map +0 -1
  600. package/dist/chunk-AVH6F5LB.js +0 -1492
  601. package/dist/chunk-AVH6F5LB.js.map +0 -1
  602. package/dist/chunk-AXEANGGK.js +0 -226
  603. package/dist/chunk-AXEANGGK.js.map +0 -1
  604. package/dist/chunk-BCZPCMGL.cjs +0 -49
  605. package/dist/chunk-BCZPCMGL.cjs.map +0 -1
  606. package/dist/chunk-BR6WZE3O.cjs +0 -42
  607. package/dist/chunk-BR6WZE3O.cjs.map +0 -1
  608. package/dist/chunk-BZA3FGO6.js +0 -40
  609. package/dist/chunk-BZA3FGO6.js.map +0 -1
  610. package/dist/chunk-CV2JGHBN.js +0 -183
  611. package/dist/chunk-CV2JGHBN.js.map +0 -1
  612. package/dist/chunk-CWCUQACX.cjs +0 -18
  613. package/dist/chunk-CWCUQACX.cjs.map +0 -1
  614. package/dist/chunk-CWUQ6ZAO.cjs +0 -185
  615. package/dist/chunk-CWUQ6ZAO.cjs.map +0 -1
  616. package/dist/chunk-D4WOOKMI.js +0 -350
  617. package/dist/chunk-D4WOOKMI.js.map +0 -1
  618. package/dist/chunk-DHOVQ2TW.js +0 -177
  619. package/dist/chunk-DRNOCC6W.cjs +0 -295
  620. package/dist/chunk-DRNOCC6W.cjs.map +0 -1
  621. package/dist/chunk-EDX5D6UY.js +0 -14
  622. package/dist/chunk-EWMXK3EI.cjs +0 -8
  623. package/dist/chunk-EWMXK3EI.cjs.map +0 -1
  624. package/dist/chunk-EYIPM2XB.cjs +0 -82
  625. package/dist/chunk-EYIPM2XB.cjs.map +0 -1
  626. package/dist/chunk-F6ZAYTBX.cjs +0 -364
  627. package/dist/chunk-F6ZAYTBX.cjs.map +0 -1
  628. package/dist/chunk-FJBP3MRI.cjs +0 -63
  629. package/dist/chunk-FJBP3MRI.cjs.map +0 -1
  630. package/dist/chunk-FMS5PNM2.cjs +0 -37
  631. package/dist/chunk-FMS5PNM2.cjs.map +0 -1
  632. package/dist/chunk-FPB6OGTV.js +0 -26
  633. package/dist/chunk-FPB6OGTV.js.map +0 -1
  634. package/dist/chunk-FRLSKIUI.cjs +0 -180
  635. package/dist/chunk-FRLSKIUI.cjs.map +0 -1
  636. package/dist/chunk-G3N5KDEY.js +0 -10
  637. package/dist/chunk-G3N5KDEY.js.map +0 -1
  638. package/dist/chunk-G66EP527.js +0 -59
  639. package/dist/chunk-G66EP527.js.map +0 -1
  640. package/dist/chunk-GF4XZK5N.cjs +0 -43
  641. package/dist/chunk-GF4XZK5N.cjs.map +0 -1
  642. package/dist/chunk-HITKHHWN.cjs +0 -174
  643. package/dist/chunk-HITKHHWN.cjs.map +0 -1
  644. package/dist/chunk-HMCZUHR7.js +0 -53
  645. package/dist/chunk-HMCZUHR7.js.map +0 -1
  646. package/dist/chunk-HTVJR5WS.cjs +0 -305
  647. package/dist/chunk-HTVJR5WS.cjs.map +0 -1
  648. package/dist/chunk-HY7J3OD3.cjs +0 -1298
  649. package/dist/chunk-HY7J3OD3.cjs.map +0 -1
  650. package/dist/chunk-IAYPOSMM.cjs +0 -472
  651. package/dist/chunk-IDWGBCSB.cjs +0 -61
  652. package/dist/chunk-IDWGBCSB.cjs.map +0 -1
  653. package/dist/chunk-J3NLKXQ5.cjs +0 -79
  654. package/dist/chunk-J3NLKXQ5.cjs.map +0 -1
  655. package/dist/chunk-KEFXOJD7.js +0 -61
  656. package/dist/chunk-KEFXOJD7.js.map +0 -1
  657. package/dist/chunk-KUYVBCUM.cjs +0 -231
  658. package/dist/chunk-KUYVBCUM.cjs.map +0 -1
  659. package/dist/chunk-L262THNK.cjs +0 -253
  660. package/dist/chunk-L262THNK.cjs.map +0 -1
  661. package/dist/chunk-LD3JERYP.js +0 -77
  662. package/dist/chunk-LD3JERYP.js.map +0 -1
  663. package/dist/chunk-LIXSIM3H.cjs +0 -113
  664. package/dist/chunk-LIXSIM3H.cjs.map +0 -1
  665. package/dist/chunk-LNZP2O4P.js +0 -169
  666. package/dist/chunk-LNZP2O4P.js.map +0 -1
  667. package/dist/chunk-MMOAH3EH.cjs +0 -288
  668. package/dist/chunk-MMOAH3EH.cjs.map +0 -1
  669. package/dist/chunk-MRHQJNWF.cjs +0 -8
  670. package/dist/chunk-MRHQJNWF.cjs.map +0 -1
  671. package/dist/chunk-MSI6FVGG.js +0 -6
  672. package/dist/chunk-MSI6FVGG.js.map +0 -1
  673. package/dist/chunk-N4COL54U.cjs +0 -22
  674. package/dist/chunk-N4COL54U.cjs.map +0 -1
  675. package/dist/chunk-NVQ6LGDO.cjs +0 -35
  676. package/dist/chunk-NVQ6LGDO.cjs.map +0 -1
  677. package/dist/chunk-NVRVPWNY.js +0 -148
  678. package/dist/chunk-NVRVPWNY.js.map +0 -1
  679. package/dist/chunk-OUSPQ55W.js +0 -263
  680. package/dist/chunk-OUSPQ55W.js.map +0 -1
  681. package/dist/chunk-PPQF7LTS.cjs +0 -63
  682. package/dist/chunk-PPQF7LTS.cjs.map +0 -1
  683. package/dist/chunk-PSR3N4NC.js +0 -136
  684. package/dist/chunk-PSR3N4NC.js.map +0 -1
  685. package/dist/chunk-QHD4LPAQ.cjs +0 -8
  686. package/dist/chunk-QHD4LPAQ.cjs.map +0 -1
  687. package/dist/chunk-RRC5RKF7.cjs +0 -12
  688. package/dist/chunk-RRC5RKF7.cjs.map +0 -1
  689. package/dist/chunk-RVBGE2Z4.js +0 -468
  690. package/dist/chunk-RVBGE2Z4.js.map +0 -1
  691. package/dist/chunk-S4JK7DKM.js +0 -61
  692. package/dist/chunk-S4JK7DKM.js.map +0 -1
  693. package/dist/chunk-SJZ66FD5.js +0 -35
  694. package/dist/chunk-SJZ66FD5.js.map +0 -1
  695. package/dist/chunk-T242YFMT.cjs +0 -150
  696. package/dist/chunk-T242YFMT.cjs.map +0 -1
  697. package/dist/chunk-T526LPBK.js +0 -6
  698. package/dist/chunk-T526LPBK.js.map +0 -1
  699. package/dist/chunk-U5SE6W5M.cjs +0 -158
  700. package/dist/chunk-U5SE6W5M.cjs.map +0 -1
  701. package/dist/chunk-UABYNGBZ.js +0 -39
  702. package/dist/chunk-UABYNGBZ.js.map +0 -1
  703. package/dist/chunk-UP5SEEYZ.js +0 -218
  704. package/dist/chunk-UP5SEEYZ.js.map +0 -1
  705. package/dist/chunk-UQ5CACMW.js +0 -283
  706. package/dist/chunk-UQ5CACMW.js.map +0 -1
  707. package/dist/chunk-UUY6LQT6.cjs +0 -267
  708. package/dist/chunk-UUY6LQT6.cjs.map +0 -1
  709. package/dist/chunk-UWQUHP3T.cjs +0 -112
  710. package/dist/chunk-UWQUHP3T.cjs.map +0 -1
  711. package/dist/chunk-XHDYLUM4.js +0 -268
  712. package/dist/chunk-XHDYLUM4.js.map +0 -1
  713. package/dist/chunk-XIIER7QQ.js +0 -60
  714. package/dist/chunk-XIIER7QQ.js.map +0 -1
  715. package/dist/chunk-XKIENBIE.js +0 -338
  716. package/dist/chunk-XKIENBIE.js.map +0 -1
  717. package/dist/chunk-XPDEQND7.cjs +0 -4
  718. package/dist/chunk-XPDEQND7.cjs.map +0 -1
  719. package/dist/chunk-YGEJDWGG.js +0 -19
  720. package/dist/chunk-YGEJDWGG.js.map +0 -1
  721. package/dist/chunk-YXGBD4WP.cjs +0 -16
  722. package/dist/chunk-YXGBD4WP.cjs.map +0 -1
  723. package/dist/chunk-Z3HZ4MP4.cjs +0 -1496
  724. package/dist/chunk-Z3HZ4MP4.cjs.map +0 -1
  725. package/dist/chunk-ZOREOLGE.js +0 -264
  726. package/dist/chunk-ZOREOLGE.js.map +0 -1
  727. package/dist/constants/index.cjs.map +0 -1
  728. package/dist/constants/index.js.map +0 -1
  729. package/dist/createGenericFetchClient-JcbIIqwF.d.cts +0 -18
  730. package/dist/createGenericFetchClient-ZGG5wbAC.d.ts +0 -18
  731. package/dist/createOpenapiFetchClient-6RX67Hws.d.ts +0 -24
  732. package/dist/createOpenapiFetchClient-BFmiJ9C5.d.cts +0 -24
  733. package/dist/dataScience/index.cjs.map +0 -1
  734. package/dist/dataScience/index.js.map +0 -1
  735. package/dist/dataScience/types.cjs.map +0 -1
  736. package/dist/dataScience/types.js.map +0 -1
  737. package/dist/domain/permissions/index.cjs.map +0 -1
  738. package/dist/domain/permissions/index.js.map +0 -1
  739. package/dist/domain/storageTable/index.cjs.map +0 -1
  740. package/dist/domain/storageTable/index.js.map +0 -1
  741. package/dist/editor/types.cjs.map +0 -1
  742. package/dist/editor/types.js.map +0 -1
  743. package/dist/encryption/types.cjs.map +0 -1
  744. package/dist/encryption/types.js.map +0 -1
  745. package/dist/import/index.cjs.map +0 -1
  746. package/dist/import/index.js.map +0 -1
  747. package/dist/keboolaUID-D1DGSbge.d.cts +0 -19
  748. package/dist/keboolaUID-D1DGSbge.d.ts +0 -19
  749. package/dist/management/index.cjs.map +0 -1
  750. package/dist/management/index.js.map +0 -1
  751. package/dist/management/types.cjs.map +0 -1
  752. package/dist/management/types.js.map +0 -1
  753. package/dist/metastore/index.cjs.map +0 -1
  754. package/dist/metastore/index.js.map +0 -1
  755. package/dist/metastore/types.cjs.map +0 -1
  756. package/dist/metastore/types.js.map +0 -1
  757. package/dist/notifications/types.cjs.map +0 -1
  758. package/dist/notifications/types.js.map +0 -1
  759. package/dist/oauth/index.cjs.map +0 -1
  760. package/dist/oauth/index.js.map +0 -1
  761. package/dist/oauth/types.cjs.map +0 -1
  762. package/dist/oauth/types.js.map +0 -1
  763. package/dist/project-CXqPYo4T.d.ts +0 -17
  764. package/dist/project-CZPvcxRW.d.cts +0 -17
  765. package/dist/queryService/index.cjs.map +0 -1
  766. package/dist/queryService/index.js.map +0 -1
  767. package/dist/queryService/types.cjs.map +0 -1
  768. package/dist/queryService/types.js.map +0 -1
  769. package/dist/queue/index.cjs.map +0 -1
  770. package/dist/queue/index.js.map +0 -1
  771. package/dist/queue/types.cjs.map +0 -1
  772. package/dist/queue/types.js.map +0 -1
  773. package/dist/registry-CcKlB-yY.d.ts +0 -1046
  774. package/dist/registry-Cg0Yng1z.d.cts +0 -1046
  775. package/dist/scheduler/types.cjs.map +0 -1
  776. package/dist/scheduler/types.js.map +0 -1
  777. package/dist/sdk/configurations/index.cjs.map +0 -1
  778. package/dist/sdk/configurations/index.js.map +0 -1
  779. package/dist/sdk/semanticLayer/types.cjs.map +0 -1
  780. package/dist/sdk/semanticLayer/types.js.map +0 -1
  781. package/dist/sdk/tag/index.cjs.map +0 -1
  782. package/dist/sdk/tag/index.js.map +0 -1
  783. package/dist/sdk/tag/types.cjs.map +0 -1
  784. package/dist/sdk/tag/types.js.map +0 -1
  785. package/dist/status/types.cjs.map +0 -1
  786. package/dist/status/types.js.map +0 -1
  787. package/dist/storage/index.cjs.map +0 -1
  788. package/dist/storage/index.js.map +0 -1
  789. package/dist/storage/types.cjs.map +0 -1
  790. package/dist/storage/types.js.map +0 -1
  791. package/dist/storageClient-Cd4jVt58.d.ts +0 -1519
  792. package/dist/storageClient-Dkcg7hKa.d.cts +0 -1519
  793. package/dist/storageSdk-15_Fbucc.d.cts +0 -746
  794. package/dist/storageSdk-L6NOdgSJ.d.ts +0 -746
  795. package/dist/stream/types.cjs.map +0 -1
  796. package/dist/stream/types.js.map +0 -1
  797. package/dist/syncActions/index.cjs.map +0 -1
  798. package/dist/syncActions/index.js.map +0 -1
  799. package/dist/syncActions/types.cjs.map +0 -1
  800. package/dist/syncActions/types.js.map +0 -1
  801. package/dist/telemetry/index.cjs.map +0 -1
  802. package/dist/telemetry/index.js.map +0 -1
  803. package/dist/telemetry/types.cjs.map +0 -1
  804. package/dist/telemetry/types.js.map +0 -1
  805. package/dist/types-BqC3U0k0.d.cts +0 -12
  806. package/dist/types-Dkipk6NN.d.ts +0 -12
  807. package/dist/types-UwuKN9Kx.d.cts +0 -60
  808. package/dist/types-UwuKN9Kx.d.ts +0 -60
  809. package/dist/types-gcShAmmi.d.cts +0 -90
  810. package/dist/types-gcShAmmi.d.ts +0 -90
  811. package/dist/vault/types.cjs.map +0 -1
  812. package/dist/vault/types.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createFetchClient-BsG719K1.cjs","names":[],"sources":["../src/errors/ApiError.ts","../src/internal.ts","../src/fetchClient/createFetchClient/utils.ts","../src/fetchClient/createFetchClient/createFetchClient.ts"],"sourcesContent":["import type { ApiResponse } from '../fetchClient/createFetchClient/types';\n\nexport class ApiError extends Error {\n response: Response;\n request: Request;\n data: unknown;\n\n constructor({ response, request, data }: ApiResponse) {\n super(response.statusText);\n this.response = response;\n this.request = request;\n this.data = data;\n }\n}\n","// Package-internal constants. Not part of the public\n// `@keboola/api-client/constants` sub-path (that is the `constants/` directory).\n\nexport const KeboolaHttpHeader = {\n STORAGE_API_TOKEN: 'X-StorageApi-Token',\n MANAGEMENT_API_TOKEN: 'X-Kbc-Manageapitoken',\n STORAGE_API_URL: 'x-storageapi-url',\n PROJECT_ID: 'X-KBC-ProjectId',\n /** Storage job a request enqueued, reported on the response rather than in its body. */\n STORAGE_API_JOB_ID: 'X-StorageApi-Job-Id',\n} as const;\n\nexport const HttpStatus = {\n NO_CONTENT: 204,\n BAD_REQUEST: 400,\n UNAUTHORIZED: 401,\n UNPROCESSABLE_ENTITY: 422,\n INTERNAL_SERVER_ERROR: 500,\n BAD_GATEWAY: 502,\n SERVICE_UNAVAILABLE: 503,\n GATEWAY_TIMEOUT: 504,\n} as const;\n\nexport const ENCRYPTED_VALUE_PREFIX = 'KBC::';\n","import type { IStringifyOptions } from 'qs';\nimport qs from 'qs';\n\nimport { HttpStatus } from '../../internal';\n\nimport type { BodyParam, CreateFetchRequestFn, PathParam, ValidateStatusFn } from './types';\n\n/**\n * Strips trailing slashes from a base URL so concatenating a leading-slash\n * path (e.g. `/v2/storage`) never produces a double slash.\n *\n * Without this, callers that pass `https://connection.keboola.com/` end up\n * issuing requests to `https://connection.keboola.com//v2/storage/...`, which\n * the Storage API rejects with a 404.\n */\nexport const normalizeBaseUrl = (baseUrl: string): string => baseUrl.replace(/\\/+$/, '');\n\nexport const HttpHeader = {\n CONTENT_TYPE: 'content-type',\n CONTENT_DISPOSITION: 'content-disposition',\n AUTHORIZATION: 'Authorization',\n IDEMPOTENCY_KEY: 'Idempotency-Key',\n IF_MATCH: 'If-Match',\n};\n\nexport const HttpContentType = {\n JSON: 'application/json',\n TEXT_PLAIN: 'text/plain',\n FORM_DATA: 'multipart/form-data',\n TEXT_HTML: 'text/html',\n};\n\nexport const defaultValidateStatus: ValidateStatusFn = ({ response }) =>\n response.status >= 200 && response.status <= 299;\n\nfunction removeUndefined(obj: Record<string, string>) {\n const objCopy = { ...obj };\n for (const [key, value] of Object.entries(objCopy)) {\n if (value == null) delete objCopy[key];\n }\n return objCopy;\n}\n\n// `application/json`, but also `application/json; charset=utf-8` and the `+json` suffix family.\n// Comparing the raw header for equality misses every response that carries a charset.\nconst JSON_MEDIA_TYPE = /^application\\/([\\w.-]+\\+)?json$/;\n\nconst getMediaType = (response: Response) =>\n response.headers.get(HttpHeader.CONTENT_TYPE)?.split(';')[0]?.trim().toLowerCase() ?? '';\n\nexport const parseData = async (response: Response) => {\n if (response.status === HttpStatus.NO_CONTENT) return null;\n\n const mediaType = getMediaType(response);\n\n // Declared JSON is parsed strictly: a body that doesn't parse is a broken response, not a text\n // payload, and `JSON.parse` throwing is the right answer. Read it as text first only so an empty\n // body can resolve to `null` like a 204 — matching the charset form brings `application/json;\n // charset=utf-8` onto this path, where `response.json()` would turn a 200-with-no-body into a\n // `SyntaxError` it never used to be.\n if (JSON_MEDIA_TYPE.test(mediaType)) {\n const text = await response.text();\n\n return text.trim() === '' ? null : JSON.parse(text);\n }\n\n // Any other declared type describes its own payload — the query-service CSV export, the\n // data-science `text/plain` endpoints — so hand back the exact bytes instead of sniffing them.\n return response.text();\n};\n\n// Header instance serialize undefined value as `undefined`, we do not want that\nconst cleanHeadersInit = (headersInit: HeadersInit | undefined) => {\n if (Array.isArray(headersInit)) return headersInit;\n if (headersInit instanceof Headers) return headersInit;\n if (headersInit == null) return headersInit;\n\n return removeUndefined(headersInit);\n};\n\nconst createHeaders = (\n headersInitA: HeadersInit | undefined,\n headersInitB: HeadersInit | undefined,\n) => {\n const headersA = new Headers(cleanHeadersInit(headersInitA));\n const headersB = new Headers(cleanHeadersInit(headersInitB));\n\n headersB.forEach((value, key) => {\n headersA.set(key, value);\n });\n\n return headersA;\n};\n\nexport const createPath = (path: string, pathParam: PathParam = {}) =>\n path.replace(/\\{([^}]+)}/g, (_, key) => {\n if (!(key in pathParam))\n throw new Error(`Path parameter \"${key}\" is missing in the path \"${path}\"`);\n\n return encodeURIComponent(pathParam[key]!);\n });\n\nexport const createSearch = (\n query: Record<string, unknown>,\n options: Pick<IStringifyOptions, 'arrayFormat'> = {},\n) => {\n return qs.stringify(query, {\n encodeValuesOnly: true,\n skipNulls: true,\n ...options,\n });\n};\n\nexport const createBody = (body: BodyParam, headers: Headers) => {\n if (body == null) return null;\n if (body instanceof FormData) return body; // fetch automatically sets content-type header\n if (typeof body === 'string') return body; // fetch automatically sets content-type header\n\n const stringifyBody = JSON.stringify(body);\n const stringBody = stringifyBody === '{}' ? null : stringifyBody;\n if (stringBody) headers.set(HttpHeader.CONTENT_TYPE, HttpContentType.JSON);\n\n return stringBody;\n};\n\nexport const parseContentDispositionHeader = (contentDisposition?: string | null) => {\n // extract the type ('inline' or 'attachment'), default the type to 'unknown'\n const type = (() => {\n const typeMatch = contentDisposition?.match(/^\\s*(inline|attachment)\\s*;/i);\n return (typeMatch?.[1]?.toLowerCase() ?? 'unknown') as 'inline' | 'attachment' | 'unknown';\n })();\n\n // extract the filename, default the type to null\n const filename = (() => {\n const filenameMatch = contentDisposition?.match(/filename=\"([^\"]+)\"/i);\n if (filenameMatch) return filenameMatch[1];\n\n // If no filename=\"...\", check for encoded filename*=UTF-8''\n const encodedFilenameMatch = contentDisposition?.match(/filename\\*=(?:UTF-8'')?([^;]+)/i);\n if (encodedFilenameMatch?.[1]) return decodeURIComponent(encodedFilenameMatch[1]);\n\n // Check for unquoted filenames (rare but possible)\n const unquotedFilenameMatch = contentDisposition?.match(/filename=([^;]+)/i);\n return unquotedFilenameMatch?.[1] ?? null;\n })();\n\n // Return the parsed result\n return { type, filename };\n};\n\nexport const createFetchRequest: CreateFetchRequestFn = ({\n url,\n method,\n params,\n options = {},\n defaultOptions,\n}) => {\n const {\n baseUrl,\n validateStatus: defValidateStatus = defaultValidateStatus,\n headers: defaultHeaders,\n fetchFn: defaultFetchFn,\n ...restDefaultOptions\n } = defaultOptions;\n const {\n validateStatus,\n queryArrayFormat,\n headers: endpointHeaders,\n fetchFn,\n ...restOptions\n } = options;\n\n const headers = createHeaders(defaultHeaders, endpointHeaders);\n const path = createPath(url, params.path);\n const search = createSearch(params.query ?? {}, { arrayFormat: queryArrayFormat });\n const body = createBody(params.body, headers);\n\n const urlInstance = new URL(normalizeBaseUrl(baseUrl) + path);\n urlInstance.search = search;\n\n const request = new Request(urlInstance, {\n ...restDefaultOptions,\n ...restOptions,\n headers,\n method: method.toUpperCase(),\n body,\n });\n\n return {\n request,\n validateStatus: validateStatus ?? defValidateStatus,\n fetchFn: fetchFn ?? defaultFetchFn,\n };\n};\n","import { ApiError } from '../../errors';\n\nimport type {\n BaseFetchParams,\n CoreFetchFn,\n CreateFetchClientOptions,\n FetchClientOptions,\n HttpMethod,\n} from './types';\nimport { createFetchRequest, parseData } from './utils';\n\nexport type FetchClientError = TypeError | ApiError | SyntaxError | DOMException;\n\nexport const isApiError = (error: unknown): error is ApiError => error instanceof ApiError;\n\nexport const isAbortError = (error: unknown): error is DOMException =>\n error instanceof DOMException && error.name === 'AbortError';\n\nexport const isFetchClientError = (error: unknown): error is FetchClientError =>\n error instanceof TypeError || error instanceof SyntaxError || isApiError(error);\n\n// `fetchFn` is resolved per request by `createFetchRequest` (endpoint option beats client option),\n// so a single request can swap the transport without rebuilding the client.\nconst coreFetch: CoreFetchFn = async ({ request, validateStatus, fetchFn = fetch }) => {\n const response = await fetchFn(request);\n const data = await parseData(response);\n\n const apiResponse = {\n request,\n response,\n data,\n };\n\n const boolOrError = validateStatus(apiResponse);\n if (isApiError(boolOrError)) throw boolOrError;\n if (!boolOrError) throw new ApiError(apiResponse);\n\n return apiResponse;\n};\n\nexport const createFetchClient = ({\n middlewares = [],\n ...defaultOptions\n}: CreateFetchClientOptions) => {\n const fetchWithMiddlewares = middlewares.reduceRight(\n (next, middleware) => middleware(next),\n coreFetch,\n );\n\n const createFetchMethod =\n (method: HttpMethod) =>\n async (url: string, params: BaseFetchParams, options: FetchClientOptions = {}) => {\n const request = createFetchRequest({\n url,\n method,\n params,\n defaultOptions,\n options,\n });\n\n const methodMiddlewares = options?.middlewares ?? [];\n\n return methodMiddlewares.reduceRight(\n (next, middleware) => middleware(next),\n fetchWithMiddlewares,\n )(request);\n };\n\n return {\n get: createFetchMethod('get'),\n post: createFetchMethod('post'),\n put: createFetchMethod('put'),\n patch: createFetchMethod('patch'),\n delete: createFetchMethod('delete'),\n };\n};\n"],"mappings":";;;;AAEA,IAAa,WAAb,cAA8B,MAAM;CAClC;CACA;CACA;CAEA,YAAY,EAAE,UAAU,SAAS,QAAqB;EACpD,MAAM,SAAS,UAAU;EACzB,KAAK,WAAW;EAChB,KAAK,UAAU;EACf,KAAK,OAAO;CACd;AACF;;;ACVA,MAAa,oBAAoB;CAC/B,mBAAmB;CACnB,sBAAsB;CACtB,iBAAiB;CACjB,YAAY;;CAEZ,oBAAoB;AACtB;AAEA,MAAa,aAAa;CACxB,YAAY;CACZ,aAAa;CACb,cAAc;CACd,sBAAsB;CACtB,uBAAuB;CACvB,aAAa;CACb,qBAAqB;CACrB,iBAAiB;AACnB;AAEA,MAAa,yBAAyB;;;;;;;;;;;ACRtC,MAAa,oBAAoB,YAA4B,QAAQ,QAAQ,QAAQ,EAAE;AAEvF,MAAa,aAAa;CACxB,cAAc;CACd,qBAAqB;CACrB,eAAe;CACf,iBA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KAAK;EAC5B,MAAM,kBAAkB,MAAM;EAC9B,KAAK,kBAAkB,KAAK;EAC5B,OAAO,kBAAkB,OAAO;EAChC,QAAQ,kBAAkB,QAAQ;CACpC;AACF"}
@@ -0,0 +1,7 @@
1
+ import { t as createFetchClient } from "./createFetchClient-BK0TZK-U.js";
2
+ //#region src/fetchClient/createGenericFetchClient.ts
3
+ const createGenericFetchClient = (defaultOptions) => createFetchClient(defaultOptions);
4
+ //#endregion
5
+ export { createGenericFetchClient as t };
6
+
7
+ //# sourceMappingURL=createGenericFetchClient-CVZYekDk.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createGenericFetchClient-CVZYekDk.js","names":[],"sources":["../src/fetchClient/createGenericFetchClient.ts"],"sourcesContent":["import type {\n ApiResponse,\n BodyParam,\n CreateFetchClientOptions,\n FetchClientOptions,\n PathParam,\n QueryParam,\n} from './createFetchClient';\nimport { createFetchClient } from './createFetchClient';\n\ntype FetchParams<Path = PathParam, Query = QueryParam, Body = BodyParam> = {\n path?: Path;\n query?: Query;\n body?: Body;\n};\n\ntype FetchMethod = <Data, Path = PathParam, Query = QueryParam, Body = BodyParam>(\n url: string,\n params: FetchParams<Path, Query, Body>,\n options?: FetchClientOptions,\n) => Promise<ApiResponse<Data>>;\n\ntype FetchClient = {\n get: FetchMethod;\n post: FetchMethod;\n put: FetchMethod;\n patch: FetchMethod;\n delete: FetchMethod;\n};\n\nexport const createGenericFetchClient = (defaultOptions: CreateFetchClientOptions) =>\n createFetchClient(defaultOptions) as FetchClient;\n"],"mappings":";;AA8BA,MAAa,4BAA4B,mBACvC,kBAAkB,cAAc"}
@@ -0,0 +1,12 @@
1
+ const require_createFetchClient = require("./createFetchClient-BsG719K1.cjs");
2
+ //#region src/fetchClient/createGenericFetchClient.ts
3
+ const createGenericFetchClient = (defaultOptions) => require_createFetchClient.createFetchClient(defaultOptions);
4
+ //#endregion
5
+ Object.defineProperty(exports, "createGenericFetchClient", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return createGenericFetchClient;
9
+ }
10
+ });
11
+
12
+ //# sourceMappingURL=createGenericFetchClient-DLbjX0eM.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createGenericFetchClient-DLbjX0eM.cjs","names":["createFetchClient"],"sources":["../src/fetchClient/createGenericFetchClient.ts"],"sourcesContent":["import type {\n ApiResponse,\n BodyParam,\n CreateFetchClientOptions,\n FetchClientOptions,\n PathParam,\n QueryParam,\n} from './createFetchClient';\nimport { createFetchClient } from './createFetchClient';\n\ntype FetchParams<Path = PathParam, Query = QueryParam, Body = BodyParam> = {\n path?: Path;\n query?: Query;\n body?: Body;\n};\n\ntype FetchMethod = <Data, Path = PathParam, Query = QueryParam, Body = BodyParam>(\n url: string,\n params: FetchParams<Path, Query, Body>,\n options?: FetchClientOptions,\n) => Promise<ApiResponse<Data>>;\n\ntype FetchClient = {\n get: FetchMethod;\n post: FetchMethod;\n put: FetchMethod;\n patch: FetchMethod;\n delete: FetchMethod;\n};\n\nexport const createGenericFetchClient = (defaultOptions: CreateFetchClientOptions) =>\n createFetchClient(defaultOptions) as FetchClient;\n"],"mappings":";;AA8BA,MAAa,4BAA4B,mBACvCA,0BAAAA,kBAAkB,cAAc"}
@@ -0,0 +1,7 @@
1
+ import { t as createFetchClient } from "./createFetchClient-BK0TZK-U.js";
2
+ //#region src/fetchClient/createOpenapiFetchClient.ts
3
+ const createOpenapiFetchClient = (defaultOptions) => createFetchClient(defaultOptions);
4
+ //#endregion
5
+ export { createOpenapiFetchClient as t };
6
+
7
+ //# sourceMappingURL=createOpenapiFetchClient-B5U1fCHS.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createOpenapiFetchClient-B5U1fCHS.js","names":[],"sources":["../src/fetchClient/createOpenapiFetchClient.ts"],"sourcesContent":["import {\n type ApiResponse,\n createFetchClient,\n type CreateFetchClientOptions,\n type FetchClientOptions,\n type HttpMethod,\n} from './createFetchClient';\nimport type { OpenapiParametersType, OpenapiReturnType } from './types';\n\ntype OpenapiPaths<Paths> = {\n [P in keyof Paths]: {\n [M in HttpMethod]?: unknown;\n };\n};\n\ntype PathsWithMethod<Paths extends OpenapiPaths<Paths>, PathnameMethod extends HttpMethod> = {\n [Pathname in keyof Paths]: Paths[Pathname] extends {\n [K in PathnameMethod]: any;\n }\n ? Pathname\n : never;\n}[keyof Paths];\n\ntype FetchMethod<Paths extends OpenapiPaths<Paths>, Method extends HttpMethod> = <\n Path extends PathsWithMethod<Paths, Method>,\n>(\n url: Path,\n params: OpenapiParametersType<Paths[Path][Method]>,\n options?: FetchClientOptions,\n) => Promise<ApiResponse<OpenapiReturnType<Paths[Path][Method]>>>;\n\ntype FetchClient<Paths extends OpenapiPaths<Paths>> = {\n get: FetchMethod<Paths, 'get'>;\n post: FetchMethod<Paths, 'post'>;\n put: FetchMethod<Paths, 'put'>;\n patch: FetchMethod<Paths, 'patch'>;\n delete: FetchMethod<Paths, 'delete'>;\n};\n\nexport const createOpenapiFetchClient = <Paths extends OpenapiPaths<Paths>>(\n defaultOptions: CreateFetchClientOptions,\n) => createFetchClient(defaultOptions) as FetchClient<Paths>;\n"],"mappings":";;AAuCA,MAAa,4BACX,mBACG,kBAAkB,cAAc"}
@@ -0,0 +1,12 @@
1
+ const require_createFetchClient = require("./createFetchClient-BsG719K1.cjs");
2
+ //#region src/fetchClient/createOpenapiFetchClient.ts
3
+ const createOpenapiFetchClient = (defaultOptions) => require_createFetchClient.createFetchClient(defaultOptions);
4
+ //#endregion
5
+ Object.defineProperty(exports, "createOpenapiFetchClient", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return createOpenapiFetchClient;
9
+ }
10
+ });
11
+
12
+ //# sourceMappingURL=createOpenapiFetchClient-Cr90VXY4.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createOpenapiFetchClient-Cr90VXY4.cjs","names":["createFetchClient"],"sources":["../src/fetchClient/createOpenapiFetchClient.ts"],"sourcesContent":["import {\n type ApiResponse,\n createFetchClient,\n type CreateFetchClientOptions,\n type FetchClientOptions,\n type HttpMethod,\n} from './createFetchClient';\nimport type { OpenapiParametersType, OpenapiReturnType } from './types';\n\ntype OpenapiPaths<Paths> = {\n [P in keyof Paths]: {\n [M in HttpMethod]?: unknown;\n };\n};\n\ntype PathsWithMethod<Paths extends OpenapiPaths<Paths>, PathnameMethod extends HttpMethod> = {\n [Pathname in keyof Paths]: Paths[Pathname] extends {\n [K in PathnameMethod]: any;\n }\n ? Pathname\n : never;\n}[keyof Paths];\n\ntype FetchMethod<Paths extends OpenapiPaths<Paths>, Method extends HttpMethod> = <\n Path extends PathsWithMethod<Paths, Method>,\n>(\n url: Path,\n params: OpenapiParametersType<Paths[Path][Method]>,\n options?: FetchClientOptions,\n) => Promise<ApiResponse<OpenapiReturnType<Paths[Path][Method]>>>;\n\ntype FetchClient<Paths extends OpenapiPaths<Paths>> = {\n get: FetchMethod<Paths, 'get'>;\n post: FetchMethod<Paths, 'post'>;\n put: FetchMethod<Paths, 'put'>;\n patch: FetchMethod<Paths, 'patch'>;\n delete: FetchMethod<Paths, 'delete'>;\n};\n\nexport const createOpenapiFetchClient = <Paths extends OpenapiPaths<Paths>>(\n defaultOptions: CreateFetchClientOptions,\n) => createFetchClient(defaultOptions) as FetchClient<Paths>;\n"],"mappings":";;AAuCA,MAAa,4BACX,mBACGA,0BAAAA,kBAAkB,cAAc"}
@@ -0,0 +1,148 @@
1
+ //#region src/utils/createStore.ts
2
+ /**
3
+ * An occurrence, announced to whoever is listening.
4
+ *
5
+ * - For what happened rather than what is: nothing is held, so a listener that arrives later hears
6
+ * the next event and never the last one. A store is this plus a value it keeps.
7
+ * - Listeners run in the order they subscribed, synchronously, so an emitter is safe where the
8
+ * emitting code must not be left waiting.
9
+ * - A listener that throws is logged and stepped over. Emitting happens on someone else's call
10
+ * stack — a poll reporting how it ended, a session announcing a new token — and a subscriber's
11
+ * failure must not become theirs.
12
+ */
13
+ const createEmitter = () => {
14
+ const listeners = /* @__PURE__ */ new Set();
15
+ return {
16
+ emit: (event) => listeners.forEach((listener) => {
17
+ try {
18
+ listener(event);
19
+ } catch (error) {
20
+ console.error("A subscriber threw while handling an event", error);
21
+ }
22
+ }),
23
+ subscribe: (listener) => {
24
+ listeners.add(listener);
25
+ return () => {
26
+ listeners.delete(listener);
27
+ };
28
+ },
29
+ clear: () => listeners.clear()
30
+ };
31
+ };
32
+ /** A value that is kept, and announced when it changes: an emitter with the value in front of it. */
33
+ const createStore = (initial) => {
34
+ const changes = createEmitter();
35
+ let value = initial;
36
+ return {
37
+ get: () => value,
38
+ set: (next) => {
39
+ if (Object.is(next, value)) return;
40
+ value = next;
41
+ changes.emit(value);
42
+ },
43
+ subscribe: changes.subscribe,
44
+ dispose: () => {
45
+ value = initial;
46
+ changes.clear();
47
+ }
48
+ };
49
+ };
50
+ const isPlainObjectOrArray = (value) => {
51
+ if (Array.isArray(value)) return true;
52
+ const proto = Object.getPrototypeOf(value);
53
+ return proto === Object.prototype || proto === null;
54
+ };
55
+ const shallowEqual = (a, b) => {
56
+ if (Object.is(a, b)) return true;
57
+ if (typeof a !== "object" || a === null || typeof b !== "object" || b === null) return false;
58
+ if (!isPlainObjectOrArray(a) || !isPlainObjectOrArray(b)) return false;
59
+ const aKeys = Object.keys(a);
60
+ const bKeys = Object.keys(b);
61
+ return aKeys.length === bKeys.length && aKeys.every((key) => Object.is(a[key], b[key]));
62
+ };
63
+ const createDerivedStore = ({ source, dependsOn, build, keyEquals = shallowEqual }) => {
64
+ let key = dependsOn(source.get());
65
+ const store = createStore(build(key));
66
+ const unsubscribe = source.subscribe((state) => {
67
+ const next = dependsOn(state);
68
+ if (keyEquals(key, next)) return;
69
+ key = next;
70
+ store.set(build(next));
71
+ });
72
+ return {
73
+ get: store.get,
74
+ subscribe: store.subscribe,
75
+ dispose: () => {
76
+ unsubscribe();
77
+ store.dispose();
78
+ }
79
+ };
80
+ };
81
+ const createDerivedAsyncStore = ({ source, dependsOn, build, keyEquals = shallowEqual }) => {
82
+ const store = createStore({ state: "idle" });
83
+ let currentKey = null;
84
+ let generation = 0;
85
+ let controller = null;
86
+ const run = (key) => {
87
+ controller?.abort();
88
+ controller = new AbortController();
89
+ const runGeneration = ++generation;
90
+ store.set({ state: "pending" });
91
+ build(key, controller.signal).then((value) => {
92
+ if (runGeneration === generation) store.set({
93
+ state: "ready",
94
+ value
95
+ });
96
+ }, (error) => {
97
+ if (runGeneration === generation) store.set({
98
+ state: "errored",
99
+ error
100
+ });
101
+ });
102
+ };
103
+ const sync = (state) => {
104
+ const next = dependsOn(state);
105
+ if (next === null) {
106
+ if (currentKey === null) return;
107
+ controller?.abort();
108
+ controller = null;
109
+ generation += 1;
110
+ currentKey = null;
111
+ store.set({ state: "idle" });
112
+ return;
113
+ }
114
+ if (currentKey !== null && keyEquals(currentKey, next)) return;
115
+ currentKey = next;
116
+ run(next);
117
+ };
118
+ sync(source.get());
119
+ const unsubscribe = source.subscribe(sync);
120
+ const readable = {
121
+ get: store.get,
122
+ subscribe: store.subscribe,
123
+ dispose: () => {
124
+ controller?.abort();
125
+ unsubscribe();
126
+ store.dispose();
127
+ }
128
+ };
129
+ const settled = () => new Promise((resolve) => {
130
+ let unsubscribeSettled = () => {};
131
+ const check = (state) => {
132
+ if (state.state === "ready" || state.state === "errored") {
133
+ unsubscribeSettled();
134
+ resolve(state);
135
+ }
136
+ };
137
+ unsubscribeSettled = store.subscribe(check);
138
+ check(store.get());
139
+ });
140
+ return {
141
+ store: readable,
142
+ settled
143
+ };
144
+ };
145
+ //#endregion
146
+ export { shallowEqual as a, createStore as i, createDerivedStore as n, createEmitter as r, createDerivedAsyncStore as t };
147
+
148
+ //# sourceMappingURL=createStore-BNiCRQXa.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createStore-BNiCRQXa.js","names":[],"sources":["../src/utils/createStore.ts"],"sourcesContent":["type Listener<T> = (value: T) => void;\n\nexport type Emitter<T> = {\n emit: (event: T) => void;\n subscribe: (listener: Listener<T>) => () => void;\n /** Drops every listener. A store's `dispose` is the reason this exists. */\n clear: () => void;\n};\n\n/**\n * An occurrence, announced to whoever is listening.\n *\n * - For what happened rather than what is: nothing is held, so a listener that arrives later hears\n * the next event and never the last one. A store is this plus a value it keeps.\n * - Listeners run in the order they subscribed, synchronously, so an emitter is safe where the\n * emitting code must not be left waiting.\n * - A listener that throws is logged and stepped over. Emitting happens on someone else's call\n * stack — a poll reporting how it ended, a session announcing a new token — and a subscriber's\n * failure must not become theirs.\n */\nexport const createEmitter = <T>(): Emitter<T> => {\n const listeners = new Set<Listener<T>>();\n\n return {\n emit: (event) =>\n listeners.forEach((listener) => {\n try {\n listener(event);\n } catch (error) {\n console.error('A subscriber threw while handling an event', error);\n }\n }),\n subscribe: (listener) => {\n listeners.add(listener);\n\n return () => {\n listeners.delete(listener);\n };\n },\n clear: () => listeners.clear(),\n };\n};\n\nexport type ReadableStore<T> = {\n get: () => T;\n subscribe: (listener: Listener<T>) => () => void;\n dispose: () => void;\n};\n\nexport type Store<T> = ReadableStore<T> & {\n set: (value: T) => void;\n};\n\n/** A value that is kept, and announced when it changes: an emitter with the value in front of it. */\nexport const createStore = <T>(initial: T): Store<T> => {\n const changes = createEmitter<T>();\n let value = initial;\n\n return {\n get: () => value,\n set: (next) => {\n if (Object.is(next, value)) return;\n\n value = next;\n changes.emit(value);\n },\n subscribe: changes.subscribe,\n dispose: () => {\n value = initial;\n changes.clear();\n },\n };\n};\n\nconst isPlainObjectOrArray = (value: object): boolean => {\n if (Array.isArray(value)) return true;\n const proto = Object.getPrototypeOf(value);\n return proto === Object.prototype || proto === null;\n};\n\nexport const shallowEqual = <T>(a: T, b: T): boolean => {\n if (Object.is(a, b)) return true;\n if (typeof a !== 'object' || a === null || typeof b !== 'object' || b === null) return false;\n if (!isPlainObjectOrArray(a) || !isPlainObjectOrArray(b)) return false;\n const aKeys = Object.keys(a) as (keyof T)[];\n const bKeys = Object.keys(b) as (keyof T)[];\n return aKeys.length === bKeys.length && aKeys.every((key) => Object.is(a[key], b[key]));\n};\n\ntype DerivedStoreOptions<S, K, T> = {\n source: ReadableStore<S>;\n dependsOn: (state: S) => K;\n build: (key: K) => T;\n keyEquals?: (a: K, b: K) => boolean;\n};\n\nexport const createDerivedStore = <S, K, T>({\n source,\n dependsOn,\n build,\n keyEquals = shallowEqual,\n}: DerivedStoreOptions<S, K, T>): ReadableStore<T> => {\n let key = dependsOn(source.get());\n const store = createStore(build(key));\n\n // The source subscription lives for the derived store's lifetime (both normally live as long as\n // the client). `dispose()` tears down both it and the derived store, so a short-lived derived\n // store can be cleaned up without leaking the source subscription or taking stale updates.\n const unsubscribe = source.subscribe((state) => {\n const next = dependsOn(state);\n if (keyEquals(key, next)) return;\n key = next;\n store.set(build(next));\n });\n\n return {\n get: store.get,\n subscribe: store.subscribe,\n dispose: () => {\n unsubscribe();\n store.dispose();\n },\n };\n};\n\nexport type AsyncState<T> =\n | { state: 'idle' }\n | { state: 'pending' }\n | { state: 'ready'; value: T }\n | { state: 'errored'; error: unknown };\n\n// The terminal states `settled()` resolves with.\ntype SettledState<T> = Extract<AsyncState<T>, { state: 'ready' } | { state: 'errored' }>;\n\ntype DerivedAsyncStoreOptions<S, K, T> = {\n source: ReadableStore<S>;\n dependsOn: (state: S) => K | null;\n build: (key: K, signal: AbortSignal) => Promise<T>;\n keyEquals?: (a: K, b: K) => boolean;\n};\n\n// The async sibling of `createDerivedStore`: it derives a value that arrives later, exposed as an\n// `AsyncState<T>` cell. Two switchMap-style guarantees keep concurrent rebuilds honest:\n// - generation guard: only the latest run may write state, so a stale build resolving after a\n// newer key can never clobber the fresh result;\n// - AbortController: a re-key (or a null key) aborts the previous run's `signal` so in-flight work\n// can actually stop.\n// `dependsOn` returning `null` means \"nothing to build\" → the store goes `idle` and any in-flight run\n// is aborted. Like `createDerivedStore`, the subscription is permanent for the store's lifetime.\n//\n// Returns `{ store, settled }`: `store` is the reactive `AsyncState<T>` cell; `settled()` resolves\n// on the next terminal state with that state (`ready` or `errored`) — the awaitable bridge for\n// callers that need to `await` the build rather than react to it. It never rejects: a failed build\n// is data (`{ state: 'errored', error }`), so callers handle it the same way whether they await or\n// subscribe. Settles immediately if the store is already terminal; while `idle`/`pending` it waits.\nexport const createDerivedAsyncStore = <S, K, T>({\n source,\n dependsOn,\n build,\n keyEquals = shallowEqual,\n}: DerivedAsyncStoreOptions<S, K, T>): {\n store: ReadableStore<AsyncState<T>>;\n settled: () => Promise<SettledState<T>>;\n} => {\n const store = createStore<AsyncState<T>>({ state: 'idle' });\n let currentKey: K | null = null;\n let generation = 0;\n let controller: AbortController | null = null;\n\n const run = (key: K) => {\n controller?.abort();\n controller = new AbortController();\n const runGeneration = ++generation;\n store.set({ state: 'pending' });\n // `.then(onFulfilled, onRejected)` — the reject handler consumes every rejection (including the\n // AbortError from a superseded run), so nothing goes unhandled; the generation guard drops the\n // stale write either way.\n build(key, controller.signal).then(\n (value) => {\n if (runGeneration === generation) store.set({ state: 'ready', value });\n },\n (error) => {\n if (runGeneration === generation) store.set({ state: 'errored', error });\n },\n );\n };\n\n const sync = (state: S) => {\n const next = dependsOn(state);\n if (next === null) {\n if (currentKey === null) return;\n controller?.abort();\n controller = null;\n generation += 1;\n currentKey = null;\n store.set({ state: 'idle' });\n return;\n }\n if (currentKey !== null && keyEquals(currentKey, next)) return;\n currentKey = next;\n run(next);\n };\n sync(source.get());\n\n const unsubscribe = source.subscribe(sync);\n\n const readable: ReadableStore<AsyncState<T>> = {\n get: store.get,\n subscribe: store.subscribe,\n dispose: () => {\n controller?.abort();\n unsubscribe();\n store.dispose();\n },\n };\n\n const settled = (): Promise<SettledState<T>> =>\n new Promise<SettledState<T>>((resolve) => {\n let unsubscribeSettled = () => {};\n const check = (state: AsyncState<T>) => {\n if (state.state === 'ready' || state.state === 'errored') {\n unsubscribeSettled();\n resolve(state);\n }\n };\n unsubscribeSettled = store.subscribe(check);\n check(store.get());\n });\n\n return { store: readable, settled };\n};\n"],"mappings":";;;;;;;;;;;;AAoBA,MAAa,sBAAqC;CAChD,MAAM,4BAA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AW,MAAM;EACjB,eAAe;GACb,YAAY,MAAM;GAClB,YAAY;GACZ,MAAM,QAAQ;EAChB;CACF;CAEA,MAAM,gBACJ,IAAI,SAA0B,YAAY;EACxC,IAAI,2BAA2B,CAAC;EAChC,MAAM,SAAS,UAAyB;GACtC,IAAI,MAAM,UAAU,WAAW,MAAM,UAAU,WAAW;IACxD,mBAAmB;IACnB,QAAQ,KAAK;GACf;EACF;EACA,qBAAqB,MAAM,UAAU,KAAK;EAC1C,MAAM,MAAM,IAAI,CAAC;CACnB,CAAC;CAEH,OAAO;EAAE,OAAO;EAAU;CAAQ;AACpC"}
@@ -0,0 +1,177 @@
1
+ //#region src/utils/createStore.ts
2
+ /**
3
+ * An occurrence, announced to whoever is listening.
4
+ *
5
+ * - For what happened rather than what is: nothing is held, so a listener that arrives later hears
6
+ * the next event and never the last one. A store is this plus a value it keeps.
7
+ * - Listeners run in the order they subscribed, synchronously, so an emitter is safe where the
8
+ * emitting code must not be left waiting.
9
+ * - A listener that throws is logged and stepped over. Emitting happens on someone else's call
10
+ * stack — a poll reporting how it ended, a session announcing a new token — and a subscriber's
11
+ * failure must not become theirs.
12
+ */
13
+ const createEmitter = () => {
14
+ const listeners = /* @__PURE__ */ new Set();
15
+ return {
16
+ emit: (event) => listeners.forEach((listener) => {
17
+ try {
18
+ listener(event);
19
+ } catch (error) {
20
+ console.error("A subscriber threw while handling an event", error);
21
+ }
22
+ }),
23
+ subscribe: (listener) => {
24
+ listeners.add(listener);
25
+ return () => {
26
+ listeners.delete(listener);
27
+ };
28
+ },
29
+ clear: () => listeners.clear()
30
+ };
31
+ };
32
+ /** A value that is kept, and announced when it changes: an emitter with the value in front of it. */
33
+ const createStore = (initial) => {
34
+ const changes = createEmitter();
35
+ let value = initial;
36
+ return {
37
+ get: () => value,
38
+ set: (next) => {
39
+ if (Object.is(next, value)) return;
40
+ value = next;
41
+ changes.emit(value);
42
+ },
43
+ subscribe: changes.subscribe,
44
+ dispose: () => {
45
+ value = initial;
46
+ changes.clear();
47
+ }
48
+ };
49
+ };
50
+ const isPlainObjectOrArray = (value) => {
51
+ if (Array.isArray(value)) return true;
52
+ const proto = Object.getPrototypeOf(value);
53
+ return proto === Object.prototype || proto === null;
54
+ };
55
+ const shallowEqual = (a, b) => {
56
+ if (Object.is(a, b)) return true;
57
+ if (typeof a !== "object" || a === null || typeof b !== "object" || b === null) return false;
58
+ if (!isPlainObjectOrArray(a) || !isPlainObjectOrArray(b)) return false;
59
+ const aKeys = Object.keys(a);
60
+ const bKeys = Object.keys(b);
61
+ return aKeys.length === bKeys.length && aKeys.every((key) => Object.is(a[key], b[key]));
62
+ };
63
+ const createDerivedStore = ({ source, dependsOn, build, keyEquals = shallowEqual }) => {
64
+ let key = dependsOn(source.get());
65
+ const store = createStore(build(key));
66
+ const unsubscribe = source.subscribe((state) => {
67
+ const next = dependsOn(state);
68
+ if (keyEquals(key, next)) return;
69
+ key = next;
70
+ store.set(build(next));
71
+ });
72
+ return {
73
+ get: store.get,
74
+ subscribe: store.subscribe,
75
+ dispose: () => {
76
+ unsubscribe();
77
+ store.dispose();
78
+ }
79
+ };
80
+ };
81
+ const createDerivedAsyncStore = ({ source, dependsOn, build, keyEquals = shallowEqual }) => {
82
+ const store = createStore({ state: "idle" });
83
+ let currentKey = null;
84
+ let generation = 0;
85
+ let controller = null;
86
+ const run = (key) => {
87
+ controller?.abort();
88
+ controller = new AbortController();
89
+ const runGeneration = ++generation;
90
+ store.set({ state: "pending" });
91
+ build(key, controller.signal).then((value) => {
92
+ if (runGeneration === generation) store.set({
93
+ state: "ready",
94
+ value
95
+ });
96
+ }, (error) => {
97
+ if (runGeneration === generation) store.set({
98
+ state: "errored",
99
+ error
100
+ });
101
+ });
102
+ };
103
+ const sync = (state) => {
104
+ const next = dependsOn(state);
105
+ if (next === null) {
106
+ if (currentKey === null) return;
107
+ controller?.abort();
108
+ controller = null;
109
+ generation += 1;
110
+ currentKey = null;
111
+ store.set({ state: "idle" });
112
+ return;
113
+ }
114
+ if (currentKey !== null && keyEquals(currentKey, next)) return;
115
+ currentKey = next;
116
+ run(next);
117
+ };
118
+ sync(source.get());
119
+ const unsubscribe = source.subscribe(sync);
120
+ const readable = {
121
+ get: store.get,
122
+ subscribe: store.subscribe,
123
+ dispose: () => {
124
+ controller?.abort();
125
+ unsubscribe();
126
+ store.dispose();
127
+ }
128
+ };
129
+ const settled = () => new Promise((resolve) => {
130
+ let unsubscribeSettled = () => {};
131
+ const check = (state) => {
132
+ if (state.state === "ready" || state.state === "errored") {
133
+ unsubscribeSettled();
134
+ resolve(state);
135
+ }
136
+ };
137
+ unsubscribeSettled = store.subscribe(check);
138
+ check(store.get());
139
+ });
140
+ return {
141
+ store: readable,
142
+ settled
143
+ };
144
+ };
145
+ //#endregion
146
+ Object.defineProperty(exports, "createDerivedAsyncStore", {
147
+ enumerable: true,
148
+ get: function() {
149
+ return createDerivedAsyncStore;
150
+ }
151
+ });
152
+ Object.defineProperty(exports, "createDerivedStore", {
153
+ enumerable: true,
154
+ get: function() {
155
+ return createDerivedStore;
156
+ }
157
+ });
158
+ Object.defineProperty(exports, "createEmitter", {
159
+ enumerable: true,
160
+ get: function() {
161
+ return createEmitter;
162
+ }
163
+ });
164
+ Object.defineProperty(exports, "createStore", {
165
+ enumerable: true,
166
+ get: function() {
167
+ return createStore;
168
+ }
169
+ });
170
+ Object.defineProperty(exports, "shallowEqual", {
171
+ enumerable: true,
172
+ get: function() {
173
+ return shallowEqual;
174
+ }
175
+ });
176
+
177
+ //# sourceMappingURL=createStore-MQbboXcB.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createStore-MQbboXcB.cjs","names":[],"sources":["../src/utils/createStore.ts"],"sourcesContent":["type Listener<T> = (value: T) => void;\n\nexport type Emitter<T> = {\n emit: (event: T) => void;\n subscribe: (listener: Listener<T>) => () => void;\n /** Drops every listener. A store's `dispose` is the reason this exists. */\n clear: () => void;\n};\n\n/**\n * An occurrence, announced to whoever is listening.\n *\n * - For what happened rather than what is: nothing is held, so a listener that arrives later hears\n * the next event and never the last one. A store is this plus a value it keeps.\n * - Listeners run in the order they subscribed, synchronously, so an emitter is safe where the\n * emitting code must not be left waiting.\n * - A listener that throws is logged and stepped over. Emitting happens on someone else's call\n * stack — a poll reporting how it ended, a session announcing a new token — and a subscriber's\n * failure must not become theirs.\n */\nexport const createEmitter = <T>(): Emitter<T> => {\n const listeners = new Set<Listener<T>>();\n\n return {\n emit: (event) =>\n listeners.forEach((listener) => {\n try {\n listener(event);\n } catch (error) {\n console.error('A subscriber threw while handling an event', error);\n }\n }),\n subscribe: (listener) => {\n listeners.add(listener);\n\n return () => {\n listeners.delete(listener);\n };\n },\n clear: () => listeners.clear(),\n };\n};\n\nexport type ReadableStore<T> = {\n get: () => T;\n subscribe: (listener: Listener<T>) => () => void;\n dispose: () => void;\n};\n\nexport type Store<T> = ReadableStore<T> & {\n set: (value: T) => void;\n};\n\n/** A value that is kept, and announced when it changes: an emitter with the value in front of it. */\nexport const createStore = <T>(initial: T): Store<T> => {\n const changes = createEmitter<T>();\n let value = initial;\n\n return {\n get: () => value,\n set: (next) => {\n if (Object.is(next, value)) return;\n\n value = next;\n changes.emit(value);\n },\n subscribe: changes.subscribe,\n dispose: () => {\n value = initial;\n changes.clear();\n },\n };\n};\n\nconst isPlainObjectOrArray = (value: object): boolean => {\n if (Array.isArray(value)) return true;\n const proto = Object.getPrototypeOf(value);\n return proto === Object.prototype || proto === null;\n};\n\nexport const shallowEqual = <T>(a: T, b: T): boolean => {\n if (Object.is(a, b)) return true;\n if (typeof a !== 'object' || a === null || typeof b !== 'object' || b === null) return false;\n if (!isPlainObjectOrArray(a) || !isPlainObjectOrArray(b)) return false;\n const aKeys = Object.keys(a) as (keyof T)[];\n const bKeys = Object.keys(b) as (keyof T)[];\n return aKeys.length === bKeys.length && aKeys.every((key) => Object.is(a[key], b[key]));\n};\n\ntype DerivedStoreOptions<S, K, T> = {\n source: ReadableStore<S>;\n dependsOn: (state: S) => K;\n build: (key: K) => T;\n keyEquals?: (a: K, b: K) => boolean;\n};\n\nexport const createDerivedStore = <S, K, T>({\n source,\n dependsOn,\n build,\n keyEquals = shallowEqual,\n}: DerivedStoreOptions<S, K, T>): ReadableStore<T> => {\n let key = dependsOn(source.get());\n const store = createStore(build(key));\n\n // The source subscription lives for the derived store's lifetime (both normally live as long as\n // the client). `dispose()` tears down both it and the derived store, so a short-lived derived\n // store can be cleaned up without leaking the source subscription or taking stale updates.\n const unsubscribe = source.subscribe((state) => {\n const next = dependsOn(state);\n if (keyEquals(key, next)) return;\n key = next;\n store.set(build(next));\n });\n\n return {\n get: store.get,\n subscribe: store.subscribe,\n dispose: () => {\n unsubscribe();\n store.dispose();\n },\n };\n};\n\nexport type AsyncState<T> =\n | { state: 'idle' }\n | { state: 'pending' }\n | { state: 'ready'; value: T }\n | { state: 'errored'; error: unknown };\n\n// The terminal states `settled()` resolves with.\ntype SettledState<T> = Extract<AsyncState<T>, { state: 'ready' } | { state: 'errored' }>;\n\ntype DerivedAsyncStoreOptions<S, K, T> = {\n source: ReadableStore<S>;\n dependsOn: (state: S) => K | null;\n build: (key: K, signal: AbortSignal) => Promise<T>;\n keyEquals?: (a: K, b: K) => boolean;\n};\n\n// The async sibling of `createDerivedStore`: it derives a value that arrives later, exposed as an\n// `AsyncState<T>` cell. Two switchMap-style guarantees keep concurrent rebuilds honest:\n// - generation guard: only the latest run may write state, so a stale build resolving after a\n// newer key can never clobber the fresh result;\n// - AbortController: a re-key (or a null key) aborts the previous run's `signal` so in-flight work\n// can actually stop.\n// `dependsOn` returning `null` means \"nothing to build\" → the store goes `idle` and any in-flight run\n// is aborted. Like `createDerivedStore`, the subscription is permanent for the store's lifetime.\n//\n// Returns `{ store, settled }`: `store` is the reactive `AsyncState<T>` cell; `settled()` resolves\n// on the next terminal state with that state (`ready` or `errored`) — the awaitable bridge for\n// callers that need to `await` the build rather than react to it. It never rejects: a failed build\n// is data (`{ state: 'errored', error }`), so callers handle it the same way whether they await or\n// subscribe. Settles immediately if the store is already terminal; while `idle`/`pending` it waits.\nexport const createDerivedAsyncStore = <S, K, T>({\n source,\n dependsOn,\n build,\n keyEquals = shallowEqual,\n}: DerivedAsyncStoreOptions<S, K, T>): {\n store: ReadableStore<AsyncState<T>>;\n settled: () => Promise<SettledState<T>>;\n} => {\n const store = createStore<AsyncState<T>>({ state: 'idle' });\n let currentKey: K | null = null;\n let generation = 0;\n let controller: AbortController | null = null;\n\n const run = (key: K) => {\n controller?.abort();\n controller = new AbortController();\n const runGeneration = ++generation;\n store.set({ state: 'pending' });\n // `.then(onFulfilled, onRejected)` — the reject handler consumes every rejection (including the\n // AbortError from a superseded run), so nothing goes unhandled; the generation guard drops the\n // stale write either way.\n build(key, controller.signal).then(\n (value) => {\n if (runGeneration === generation) store.set({ state: 'ready', value });\n },\n (error) => {\n if (runGeneration === generation) store.set({ state: 'errored', error });\n },\n );\n };\n\n const sync = (state: S) => {\n const next = dependsOn(state);\n if (next === null) {\n if (currentKey === null) return;\n controller?.abort();\n controller = null;\n generation += 1;\n currentKey = null;\n store.set({ state: 'idle' });\n return;\n }\n if (currentKey !== null && keyEquals(currentKey, next)) return;\n currentKey = next;\n run(next);\n };\n sync(source.get());\n\n const unsubscribe = source.subscribe(sync);\n\n const readable: ReadableStore<AsyncState<T>> = {\n get: store.get,\n subscribe: store.subscribe,\n dispose: () => {\n controller?.abort();\n unsubscribe();\n store.dispose();\n },\n };\n\n const settled = (): Promise<SettledState<T>> =>\n new Promise<SettledState<T>>((resolve) => {\n let unsubscribeSettled = () => {};\n const check = (state: AsyncState<T>) => {\n if (state.state === 'ready' || state.state === 'errored') {\n unsubscribeSettled();\n resolve(state);\n }\n };\n unsubscribeSettled = store.subscribe(check);\n check(store.get());\n });\n\n return { store: readable, settled };\n};\n"],"mappings":";;;;;;;;;;;;AAoBA,MAAa,sBAAqC;CAChD,MAAM,4BAAY,IAAI,IAAiB;CAEvC,OAAO;EACL,OAAO,UACL,UAAU,SAAS,aAAa;GAC9B,IAAI;I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ACF;CAEA,MAAM,gBACJ,IAAI,SAA0B,YAAY;EACxC,IAAI,2BAA2B,CAAC;EAChC,MAAM,SAAS,UAAyB;GACtC,IAAI,MAAM,UAAU,WAAW,MAAM,UAAU,WAAW;IACxD,mBAAmB;IACnB,QAAQ,KAAK;GACf;EACF;EACA,qBAAqB,MAAM,UAAU,KAAK;EAC1C,MAAM,MAAM,IAAI,CAAC;CACnB,CAAC;CAEH,OAAO;EAAE,OAAO;EAAU;CAAQ;AACpC"}
@@ -0,0 +1,44 @@
1
+ const require_dedupe = require("./dedupe-CiskLkGR.cjs");
2
+ const require_createFetchClient = require("./createFetchClient-BsG719K1.cjs");
3
+ //#region src/keboola/bearer/credential.ts
4
+ const DEFAULT_REFRESH_THRESHOLD = .9;
5
+ const isUnauthorized = (error) => error instanceof require_createFetchClient.ApiError && error.response.status === require_createFetchClient.HttpStatus.UNAUTHORIZED;
6
+ const createBearerCredential = ({ refresh, getToken, onSessionExpired, refreshThreshold = DEFAULT_REFRESH_THRESHOLD }) => {
7
+ const doRefresh = async () => {
8
+ try {
9
+ return await refresh();
10
+ } catch (error) {
11
+ if (isUnauthorized(error)) onSessionExpired?.();
12
+ throw error;
13
+ }
14
+ };
15
+ const refreshShared = require_dedupe.dedupe(doRefresh);
16
+ const refreshAt = (timing) => timing.issuedAt + timing.expiresIn * 1e3 * refreshThreshold;
17
+ const getAccessToken = async ({ forceRefresh = false } = {}) => {
18
+ const snapshot = getToken();
19
+ if (snapshot === null) return null;
20
+ const { accessToken, timing } = snapshot;
21
+ if (forceRefresh) return refreshShared();
22
+ if (Date.now() < refreshAt(timing)) return accessToken;
23
+ return refreshShared().catch(() => accessToken);
24
+ };
25
+ return {
26
+ getAccessToken,
27
+ notifyExpired: () => onSessionExpired?.()
28
+ };
29
+ };
30
+ //#endregion
31
+ Object.defineProperty(exports, "createBearerCredential", {
32
+ enumerable: true,
33
+ get: function() {
34
+ return createBearerCredential;
35
+ }
36
+ });
37
+ Object.defineProperty(exports, "isUnauthorized", {
38
+ enumerable: true,
39
+ get: function() {
40
+ return isUnauthorized;
41
+ }
42
+ });
43
+
44
+ //# sourceMappingURL=credential-0c6yFwtp.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credential-0c6yFwtp.cjs","names":["ApiError","HttpStatus","dedupe"],"sources":["../src/keboola/bearer/credential.ts"],"sourcesContent":["import { ApiError } from '../../errors';\nimport { HttpStatus } from '../../internal';\nimport { dedupe } from '../../utils';\n\ntype TokenTiming = { issuedAt: number; expiresIn: number };\ntype TokenSnapshot = { accessToken: string; timing: TokenTiming };\n\ntype Options = {\n // Rotate the credential (single-use refresh-token flow); resolves to the fresh access token.\n refresh: () => Promise<string>;\n // Live read of the current token + timing from the single source of truth (config). `null` when the\n // session is anonymous (no credential yet) — e.g. a pre-auth `login` request.\n getToken: () => TokenSnapshot | null;\n // Called when the session is found dead (refresh or replay rejected). The caller owns the\n // fire-once latch + per-session re-arm (see `config.notifyExpired`), so this may fire more than once.\n onSessionExpired?: () => void;\n refreshThreshold?: number;\n};\n\nconst DEFAULT_REFRESH_THRESHOLD = 0.9;\n\nexport const isUnauthorized = (error: unknown): boolean =>\n error instanceof ApiError && error.response.status === HttpStatus.UNAUTHORIZED;\n\nexport type BearerCredential = {\n // Resolves the current access token, or `null` when the session is anonymous (nothing to stamp).\n getAccessToken: (options?: { forceRefresh?: boolean }) => Promise<string | null>;\n notifyExpired: () => void;\n};\n\nexport const createBearerCredential = ({\n refresh,\n getToken,\n onSessionExpired,\n refreshThreshold = DEFAULT_REFRESH_THRESHOLD,\n}: Options): BearerCredential => {\n const doRefresh = async (): Promise<string> => {\n try {\n return await refresh();\n } catch (error) {\n if (isUnauthorized(error)) onSessionExpired?.();\n throw error;\n }\n };\n\n const refreshShared = dedupe(doRefresh);\n\n const refreshAt = (timing: TokenTiming): number =>\n timing.issuedAt + timing.expiresIn * 1000 * refreshThreshold;\n\n const getAccessToken = async ({ forceRefresh = false } = {}): Promise<string | null> => {\n const snapshot = getToken();\n if (snapshot === null) return null; // anonymous: nothing to stamp (pre-auth request)\n const { accessToken, timing } = snapshot;\n if (forceRefresh) return refreshShared(); // 401 path: must succeed, propagate failure\n if (Date.now() < refreshAt(timing)) return accessToken; // still fresh: current token\n // Proactive: best-effort — if the ahead-of-time refresh fails, proceed with the current token\n // and let a real 401 drive the mandatory refresh.\n return refreshShared().catch(() => accessToken);\n };\n\n return { getAccessToken, notifyExpired: () => onSessionExpired?.() };\n};\n"],"mappings":";;;AAmBA,MAAM,4BAA4B;AAElC,MAAa,kBAAkB,UAC7B,iBAAiBA,0BAAAA,YAAY,MAAM,SAAS,WAAWC,0BAAAA,WAAW;AAQpE,MAAa,0BAA0B,EACrC,SACA,UACA,kBACA,mBAAmB,gCACY;CAC/B,MAAM,YAAY,YAA6B;EAC7C,IAAI;GACF,OAAO,MAAM,QAAQ;EACvB,SAAS,OAAO;GACd,IAAI,eAAe,KAAK,GAAG,mBAAmB;GAC9C,MAAM;EACR;CACF;CAEA,MAAM,gBAAgBC,eAAAA,OAAO,SAAS;CAEtC,MAAM,aAAa,WACjB,OAAO,WAAW,OAAO,YAAY,MAAO;CAE9C,MAAM,iBAAiB,OAAO,EAAE,eAAe,UAAU,CAAC,MAA8B;EACtF,MAAM,WAAW,SAAS;EAC1B,IAAI,aAAa,MAAM,OAAO;EAC9B,MAAM,EAAE,aAAa,WAAW;EAChC,IAAI,cAAc,OAAO,cAAc;EACvC,IAAI,KAAK,IAAI,IAAI,UAAU,MAAM,GAAG,OAAO;EAG3C,OAAO,cAAc,CAAC,CAAC,YAAY,WAAW;CAChD;CAEA,OAAO;EAAE;EAAgB,qBAAqB,mBAAmB;CAAE;AACrE"}
@@ -0,0 +1,33 @@
1
+ import { t as dedupe } from "./dedupe-DYIHgZoG.js";
2
+ import { d as HttpStatus, p as ApiError } from "./createFetchClient-BK0TZK-U.js";
3
+ //#region src/keboola/bearer/credential.ts
4
+ const DEFAULT_REFRESH_THRESHOLD = .9;
5
+ const isUnauthorized = (error) => error instanceof ApiError && error.response.status === HttpStatus.UNAUTHORIZED;
6
+ const createBearerCredential = ({ refresh, getToken, onSessionExpired, refreshThreshold = DEFAULT_REFRESH_THRESHOLD }) => {
7
+ const doRefresh = async () => {
8
+ try {
9
+ return await refresh();
10
+ } catch (error) {
11
+ if (isUnauthorized(error)) onSessionExpired?.();
12
+ throw error;
13
+ }
14
+ };
15
+ const refreshShared = dedupe(doRefresh);
16
+ const refreshAt = (timing) => timing.issuedAt + timing.expiresIn * 1e3 * refreshThreshold;
17
+ const getAccessToken = async ({ forceRefresh = false } = {}) => {
18
+ const snapshot = getToken();
19
+ if (snapshot === null) return null;
20
+ const { accessToken, timing } = snapshot;
21
+ if (forceRefresh) return refreshShared();
22
+ if (Date.now() < refreshAt(timing)) return accessToken;
23
+ return refreshShared().catch(() => accessToken);
24
+ };
25
+ return {
26
+ getAccessToken,
27
+ notifyExpired: () => onSessionExpired?.()
28
+ };
29
+ };
30
+ //#endregion
31
+ export { isUnauthorized as n, createBearerCredential as t };
32
+
33
+ //# sourceMappingURL=credential-kEGLnVez.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credential-kEGLnVez.js","names":[],"sources":["../src/keboola/bearer/credential.ts"],"sourcesContent":["import { ApiError } from '../../errors';\nimport { HttpStatus } from '../../internal';\nimport { dedupe } from '../../utils';\n\ntype TokenTiming = { issuedAt: number; expiresIn: number };\ntype TokenSnapshot = { accessToken: string; timing: TokenTiming };\n\ntype Options = {\n // Rotate the credential (single-use refresh-token flow); resolves to the fresh access token.\n refresh: () => Promise<string>;\n // Live read of the current token + timing from the single source of truth (config). `null` when the\n // session is anonymous (no credential yet) — e.g. a pre-auth `login` request.\n getToken: () => TokenSnapshot | null;\n // Called when the session is found dead (refresh or replay rejected). The caller owns the\n // fire-once latch + per-session re-arm (see `config.notifyExpired`), so this may fire more than once.\n onSessionExpired?: () => void;\n refreshThreshold?: number;\n};\n\nconst DEFAULT_REFRESH_THRESHOLD = 0.9;\n\nexport const isUnauthorized = (error: unknown): boolean =>\n error instanceof ApiError && error.response.status === HttpStatus.UNAUTHORIZED;\n\nexport type BearerCredential = {\n // Resolves the current access token, or `null` when the session is anonymous (nothing to stamp).\n getAccessToken: (options?: { forceRefresh?: boolean }) => Promise<string | null>;\n notifyExpired: () => void;\n};\n\nexport const createBearerCredential = ({\n refresh,\n getToken,\n onSessionExpired,\n refreshThreshold = DEFAULT_REFRESH_THRESHOLD,\n}: Options): BearerCredential => {\n const doRefresh = async (): Promise<string> => {\n try {\n return await refresh();\n } catch (error) {\n if (isUnauthorized(error)) onSessionExpired?.();\n throw error;\n }\n };\n\n const refreshShared = dedupe(doRefresh);\n\n const refreshAt = (timing: TokenTiming): number =>\n timing.issuedAt + timing.expiresIn * 1000 * refreshThreshold;\n\n const getAccessToken = async ({ forceRefresh = false } = {}): Promise<string | null> => {\n const snapshot = getToken();\n if (snapshot === null) return null; // anonymous: nothing to stamp (pre-auth request)\n const { accessToken, timing } = snapshot;\n if (forceRefresh) return refreshShared(); // 401 path: must succeed, propagate failure\n if (Date.now() < refreshAt(timing)) return accessToken; // still fresh: current token\n // Proactive: best-effort — if the ahead-of-time refresh fails, proceed with the current token\n // and let a real 401 drive the mandatory refresh.\n return refreshShared().catch(() => accessToken);\n };\n\n return { getAccessToken, notifyExpired: () => onSessionExpired?.() };\n};\n"],"mappings":";;;AAmBA,MAAM,4BAA4B;AAElC,MAAa,kBAAkB,UAC7B,iBAAiB,YAAY,MAAM,SAAS,WAAW,WAAW;AAQpE,MAAa,0BAA0B,EACrC,SACA,UACA,kBACA,mBAAmB,gCACY;CAC/B,MAAM,YAAY,YAA6B;EAC7C,IAAI;GACF,OAAO,MAAM,QAAQ;EACvB,SAAS,OAAO;GACd,IAAI,eAAe,KAAK,GAAG,mBAAmB;GAC9C,MAAM;EACR;CACF;CAEA,MAAM,gBAAgB,OAAO,SAAS;CAEtC,MAAM,aAAa,WACjB,OAAO,WAAW,OAAO,YAAY,MAAO;CAE9C,MAAM,iBAAiB,OAAO,EAAE,eAAe,UAAU,CAAC,MAA8B;EACtF,MAAM,WAAW,SAAS;EAC1B,IAAI,aAAa,MAAM,OAAO;EAC9B,MAAM,EAAE,aAAa,WAAW;EAChC,IAAI,cAAc,OAAO,cAAc;EACvC,IAAI,KAAK,IAAI,IAAI,UAAU,MAAM,GAAG,OAAO;EAG3C,OAAO,cAAc,CAAC,CAAC,YAAY,WAAW;CAChD;CAEA,OAAO;EAAE;EAAgB,qBAAqB,mBAAmB;CAAE;AACrE"}
@@ -1,19 +1,5 @@
1
- 'use strict';
2
-
3
- var chunkL262THNK_cjs = require('../chunk-L262THNK.cjs');
4
- require('../chunk-MRHQJNWF.cjs');
5
- require('../chunk-7RO6PKZ4.cjs');
6
- require('../chunk-MMOAH3EH.cjs');
7
-
8
-
9
-
10
- Object.defineProperty(exports, "createDataScienceClient", {
11
- enumerable: true,
12
- get: function () { return chunkL262THNK_cjs.createDataScienceClient; }
13
- });
14
- Object.defineProperty(exports, "parseLogLines", {
15
- enumerable: true,
16
- get: function () { return chunkL262THNK_cjs.parseLogLines; }
17
- });
18
- //# sourceMappingURL=index.cjs.map
19
- //# sourceMappingURL=index.cjs.map
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_appLogs = require("../appLogs-CNG3yby-.cjs");
3
+ const require_dataScience = require("../dataScience-C-JrA0Uk.cjs");
4
+ exports.createDataScienceClient = require_dataScience.createDataScienceClient;
5
+ exports.parseLogLines = require_appLogs.parseLogLines;