imagekitio 3.0.0 → 4.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 (483) hide show
  1. checksums.yaml +4 -4
  2. data/.ignore +2 -0
  3. data/CHANGELOG.md +116 -0
  4. data/README.md +538 -679
  5. data/SECURITY.md +27 -0
  6. data/lib/imagekitio/client.rb +122 -195
  7. data/lib/imagekitio/errors.rb +226 -2
  8. data/lib/imagekitio/file_part.rb +58 -0
  9. data/lib/imagekitio/helpers/crypto_utils.rb +25 -0
  10. data/lib/imagekitio/helpers/helper.rb +689 -0
  11. data/lib/imagekitio/helpers/transformation_utils.rb +164 -0
  12. data/lib/imagekitio/helpers/uuid_utils.rb +18 -0
  13. data/lib/imagekitio/internal/transport/base_client.rb +567 -0
  14. data/lib/imagekitio/internal/transport/pooled_net_requester.rb +217 -0
  15. data/lib/imagekitio/internal/type/array_of.rb +168 -0
  16. data/lib/imagekitio/internal/type/base_model.rb +530 -0
  17. data/lib/imagekitio/internal/type/base_page.rb +55 -0
  18. data/lib/imagekitio/internal/type/boolean.rb +77 -0
  19. data/lib/imagekitio/internal/type/converter.rb +327 -0
  20. data/lib/imagekitio/internal/type/enum.rb +156 -0
  21. data/lib/imagekitio/internal/type/file_input.rb +111 -0
  22. data/lib/imagekitio/internal/type/hash_of.rb +188 -0
  23. data/lib/imagekitio/internal/type/request_parameters.rb +42 -0
  24. data/lib/imagekitio/internal/type/union.rb +250 -0
  25. data/lib/imagekitio/internal/type/unknown.rb +81 -0
  26. data/lib/imagekitio/internal/util.rb +915 -0
  27. data/lib/imagekitio/internal.rb +20 -0
  28. data/lib/imagekitio/models/accounts/origin_create_params.rb +24 -0
  29. data/lib/imagekitio/models/accounts/origin_delete_params.rb +16 -0
  30. data/lib/imagekitio/models/accounts/origin_get_params.rb +16 -0
  31. data/lib/imagekitio/models/accounts/origin_list_params.rb +16 -0
  32. data/lib/imagekitio/models/accounts/origin_list_response.rb +11 -0
  33. data/lib/imagekitio/models/accounts/origin_request.rb +547 -0
  34. data/lib/imagekitio/models/accounts/origin_response.rb +568 -0
  35. data/lib/imagekitio/models/accounts/origin_update_params.rb +24 -0
  36. data/lib/imagekitio/models/accounts/url_endpoint_create_params.rb +16 -0
  37. data/lib/imagekitio/models/accounts/url_endpoint_delete_params.rb +16 -0
  38. data/lib/imagekitio/models/accounts/url_endpoint_get_params.rb +16 -0
  39. data/lib/imagekitio/models/accounts/url_endpoint_list_params.rb +16 -0
  40. data/lib/imagekitio/models/accounts/url_endpoint_list_response.rb +11 -0
  41. data/lib/imagekitio/models/accounts/url_endpoint_request.rb +110 -0
  42. data/lib/imagekitio/models/accounts/url_endpoint_response.rb +123 -0
  43. data/lib/imagekitio/models/accounts/url_endpoint_update_params.rb +16 -0
  44. data/lib/imagekitio/models/accounts/usage_get_params.rb +37 -0
  45. data/lib/imagekitio/models/accounts/usage_get_response.rb +51 -0
  46. data/lib/imagekitio/models/asset_list_params.rb +158 -0
  47. data/lib/imagekitio/models/asset_list_response.rb +24 -0
  48. data/lib/imagekitio/models/base_overlay.rb +21 -0
  49. data/lib/imagekitio/models/base_webhook_event.rb +24 -0
  50. data/lib/imagekitio/models/beta/v2/file_upload_params.rb +510 -0
  51. data/lib/imagekitio/models/beta/v2/file_upload_response.rb +618 -0
  52. data/lib/imagekitio/models/cache/invalidation_create_params.rb +27 -0
  53. data/lib/imagekitio/models/cache/invalidation_create_response.rb +23 -0
  54. data/lib/imagekitio/models/cache/invalidation_get_params.rb +16 -0
  55. data/lib/imagekitio/models/cache/invalidation_get_response.rb +35 -0
  56. data/lib/imagekitio/models/custom_metadata_field.rb +243 -0
  57. data/lib/imagekitio/models/custom_metadata_field_create_params.rb +238 -0
  58. data/lib/imagekitio/models/custom_metadata_field_delete_params.rb +14 -0
  59. data/lib/imagekitio/models/custom_metadata_field_delete_response.rb +10 -0
  60. data/lib/imagekitio/models/custom_metadata_field_list_params.rb +36 -0
  61. data/lib/imagekitio/models/custom_metadata_field_list_response.rb +9 -0
  62. data/lib/imagekitio/models/custom_metadata_field_update_params.rb +212 -0
  63. data/lib/imagekitio/models/extensions.rb +136 -0
  64. data/lib/imagekitio/models/file.rb +497 -0
  65. data/lib/imagekitio/models/file_copy_params.rb +43 -0
  66. data/lib/imagekitio/models/file_copy_response.rb +10 -0
  67. data/lib/imagekitio/models/file_delete_params.rb +14 -0
  68. data/lib/imagekitio/models/file_get_params.rb +14 -0
  69. data/lib/imagekitio/models/file_move_params.rb +33 -0
  70. data/lib/imagekitio/models/file_move_response.rb +10 -0
  71. data/lib/imagekitio/models/file_rename_params.rb +61 -0
  72. data/lib/imagekitio/models/file_rename_response.rb +21 -0
  73. data/lib/imagekitio/models/file_update_params.rb +22 -0
  74. data/lib/imagekitio/models/file_update_response.rb +104 -0
  75. data/lib/imagekitio/models/file_upload_params.rb +540 -0
  76. data/lib/imagekitio/models/file_upload_response.rb +611 -0
  77. data/lib/imagekitio/models/files/bulk_add_tags_params.rb +35 -0
  78. data/lib/imagekitio/models/files/bulk_add_tags_response.rb +24 -0
  79. data/lib/imagekitio/models/files/bulk_delete_params.rb +27 -0
  80. data/lib/imagekitio/models/files/bulk_delete_response.rb +24 -0
  81. data/lib/imagekitio/models/files/bulk_remove_ai_tags_params.rb +35 -0
  82. data/lib/imagekitio/models/files/bulk_remove_ai_tags_response.rb +24 -0
  83. data/lib/imagekitio/models/files/bulk_remove_tags_params.rb +35 -0
  84. data/lib/imagekitio/models/files/bulk_remove_tags_response.rb +24 -0
  85. data/lib/imagekitio/models/files/metadata_get_from_url_params.rb +28 -0
  86. data/lib/imagekitio/models/files/metadata_get_params.rb +16 -0
  87. data/lib/imagekitio/models/files/version_delete_params.rb +22 -0
  88. data/lib/imagekitio/models/files/version_delete_response.rb +12 -0
  89. data/lib/imagekitio/models/files/version_get_params.rb +22 -0
  90. data/lib/imagekitio/models/files/version_list_params.rb +16 -0
  91. data/lib/imagekitio/models/files/version_list_response.rb +10 -0
  92. data/lib/imagekitio/models/files/version_restore_params.rb +22 -0
  93. data/lib/imagekitio/models/folder.rb +76 -0
  94. data/lib/imagekitio/models/folder_copy_params.rb +44 -0
  95. data/lib/imagekitio/models/folder_copy_response.rb +23 -0
  96. data/lib/imagekitio/models/folder_create_params.rb +43 -0
  97. data/lib/imagekitio/models/folder_create_response.rb +10 -0
  98. data/lib/imagekitio/models/folder_delete_params.rb +25 -0
  99. data/lib/imagekitio/models/folder_delete_response.rb +10 -0
  100. data/lib/imagekitio/models/folder_move_params.rb +34 -0
  101. data/lib/imagekitio/models/folder_move_response.rb +23 -0
  102. data/lib/imagekitio/models/folder_rename_params.rb +59 -0
  103. data/lib/imagekitio/models/folder_rename_response.rb +23 -0
  104. data/lib/imagekitio/models/folders/job_get_params.rb +16 -0
  105. data/lib/imagekitio/models/folders/job_get_response.rb +74 -0
  106. data/lib/imagekitio/models/get_image_attributes_options.rb +68 -0
  107. data/lib/imagekitio/models/image_overlay.rb +66 -0
  108. data/lib/imagekitio/models/metadata.rb +483 -0
  109. data/lib/imagekitio/models/overlay.rb +28 -0
  110. data/lib/imagekitio/models/overlay_position.rb +101 -0
  111. data/lib/imagekitio/models/overlay_timing.rb +97 -0
  112. data/lib/imagekitio/models/responsive_image_attributes.rb +48 -0
  113. data/lib/imagekitio/models/solid_color_overlay.rb +42 -0
  114. data/lib/imagekitio/models/solid_color_overlay_transformation.rb +135 -0
  115. data/lib/imagekitio/models/src_options.rb +96 -0
  116. data/lib/imagekitio/models/streaming_resolution.rb +22 -0
  117. data/lib/imagekitio/models/subtitle_overlay.rb +64 -0
  118. data/lib/imagekitio/models/subtitle_overlay_transformation.rb +113 -0
  119. data/lib/imagekitio/models/text_overlay.rb +65 -0
  120. data/lib/imagekitio/models/text_overlay_transformation.rb +267 -0
  121. data/lib/imagekitio/models/transformation.rb +1100 -0
  122. data/lib/imagekitio/models/transformation_position.rb +19 -0
  123. data/lib/imagekitio/models/unsafe_unwrap_webhook_event.rb +36 -0
  124. data/lib/imagekitio/models/unwrap_webhook_event.rb +36 -0
  125. data/lib/imagekitio/models/update_file_request.rb +164 -0
  126. data/lib/imagekitio/models/upload_post_transform_error_event.rb +180 -0
  127. data/lib/imagekitio/models/upload_post_transform_success_event.rb +143 -0
  128. data/lib/imagekitio/models/upload_pre_transform_error_event.rb +108 -0
  129. data/lib/imagekitio/models/upload_pre_transform_success_event.rb +690 -0
  130. data/lib/imagekitio/models/video_overlay.rb +64 -0
  131. data/lib/imagekitio/models/video_transformation_accepted_event.rb +279 -0
  132. data/lib/imagekitio/models/video_transformation_error_event.rb +326 -0
  133. data/lib/imagekitio/models/video_transformation_ready_event.rb +379 -0
  134. data/lib/imagekitio/models/webhook_unsafe_unwrap_params.rb +14 -0
  135. data/lib/imagekitio/models/webhook_unwrap_params.rb +14 -0
  136. data/lib/imagekitio/models.rb +160 -0
  137. data/lib/imagekitio/request_options.rb +77 -0
  138. data/lib/imagekitio/resources/accounts/origins.rb +145 -0
  139. data/lib/imagekitio/resources/accounts/url_endpoints.rb +151 -0
  140. data/lib/imagekitio/resources/accounts/usage.rb +46 -0
  141. data/lib/imagekitio/resources/accounts.rb +26 -0
  142. data/lib/imagekitio/resources/assets.rb +54 -0
  143. data/lib/imagekitio/resources/beta/v2/files.rb +110 -0
  144. data/lib/imagekitio/resources/beta/v2.rb +20 -0
  145. data/lib/imagekitio/resources/beta.rb +18 -0
  146. data/lib/imagekitio/resources/cache/invalidation.rb +66 -0
  147. data/lib/imagekitio/resources/cache.rb +18 -0
  148. data/lib/imagekitio/resources/custom_metadata_fields.rb +133 -0
  149. data/lib/imagekitio/resources/files/bulk.rb +131 -0
  150. data/lib/imagekitio/resources/files/metadata.rb +69 -0
  151. data/lib/imagekitio/resources/files/versions.rb +132 -0
  152. data/lib/imagekitio/resources/files.rb +305 -0
  153. data/lib/imagekitio/resources/folders/job.rb +39 -0
  154. data/lib/imagekitio/resources/folders.rb +166 -0
  155. data/lib/imagekitio/resources/webhooks.rb +30 -0
  156. data/lib/imagekitio/version.rb +5 -0
  157. data/lib/imagekitio.rb +181 -13
  158. data/manifest.yaml +15 -0
  159. data/rbi/imagekitio/client.rbi +92 -0
  160. data/rbi/imagekitio/errors.rbi +205 -0
  161. data/rbi/imagekitio/file_part.rbi +37 -0
  162. data/rbi/imagekitio/helpers/helper.rbi +41 -0
  163. data/rbi/imagekitio/internal/transport/base_client.rbi +295 -0
  164. data/rbi/imagekitio/internal/transport/pooled_net_requester.rbi +80 -0
  165. data/rbi/imagekitio/internal/type/array_of.rbi +104 -0
  166. data/rbi/imagekitio/internal/type/base_model.rbi +304 -0
  167. data/rbi/imagekitio/internal/type/base_page.rbi +42 -0
  168. data/rbi/imagekitio/internal/type/boolean.rbi +58 -0
  169. data/rbi/imagekitio/internal/type/converter.rbi +216 -0
  170. data/rbi/imagekitio/internal/type/enum.rbi +82 -0
  171. data/rbi/imagekitio/internal/type/file_input.rbi +59 -0
  172. data/rbi/imagekitio/internal/type/hash_of.rbi +104 -0
  173. data/rbi/imagekitio/internal/type/request_parameters.rbi +29 -0
  174. data/rbi/imagekitio/internal/type/union.rbi +128 -0
  175. data/rbi/imagekitio/internal/type/unknown.rbi +58 -0
  176. data/rbi/imagekitio/internal/util.rbi +487 -0
  177. data/rbi/imagekitio/internal.rbi +18 -0
  178. data/rbi/imagekitio/models/accounts/origin_create_params.rbi +81 -0
  179. data/rbi/imagekitio/models/accounts/origin_delete_params.rbi +34 -0
  180. data/rbi/imagekitio/models/accounts/origin_get_params.rbi +34 -0
  181. data/rbi/imagekitio/models/accounts/origin_list_params.rbi +34 -0
  182. data/rbi/imagekitio/models/accounts/origin_list_response.rbi +15 -0
  183. data/rbi/imagekitio/models/accounts/origin_request.rbi +775 -0
  184. data/rbi/imagekitio/models/accounts/origin_response.rbi +718 -0
  185. data/rbi/imagekitio/models/accounts/origin_update_params.rbi +81 -0
  186. data/rbi/imagekitio/models/accounts/url_endpoint_create_params.rbi +34 -0
  187. data/rbi/imagekitio/models/accounts/url_endpoint_delete_params.rbi +34 -0
  188. data/rbi/imagekitio/models/accounts/url_endpoint_get_params.rbi +34 -0
  189. data/rbi/imagekitio/models/accounts/url_endpoint_list_params.rbi +34 -0
  190. data/rbi/imagekitio/models/accounts/url_endpoint_list_response.rbi +15 -0
  191. data/rbi/imagekitio/models/accounts/url_endpoint_request.rbi +218 -0
  192. data/rbi/imagekitio/models/accounts/url_endpoint_response.rbi +213 -0
  193. data/rbi/imagekitio/models/accounts/url_endpoint_update_params.rbi +34 -0
  194. data/rbi/imagekitio/models/accounts/usage_get_params.rbi +60 -0
  195. data/rbi/imagekitio/models/accounts/usage_get_response.rbi +89 -0
  196. data/rbi/imagekitio/models/asset_list_params.rbi +281 -0
  197. data/rbi/imagekitio/models/asset_list_response.rbi +28 -0
  198. data/rbi/imagekitio/models/base_overlay.rbi +44 -0
  199. data/rbi/imagekitio/models/base_webhook_event.rbi +33 -0
  200. data/rbi/imagekitio/models/beta/v2/file_upload_params.rbi +861 -0
  201. data/rbi/imagekitio/models/beta/v2/file_upload_response.rbi +1197 -0
  202. data/rbi/imagekitio/models/cache/invalidation_create_params.rbi +45 -0
  203. data/rbi/imagekitio/models/cache/invalidation_create_response.rbi +37 -0
  204. data/rbi/imagekitio/models/cache/invalidation_get_params.rbi +34 -0
  205. data/rbi/imagekitio/models/cache/invalidation_get_response.rbi +93 -0
  206. data/rbi/imagekitio/models/custom_metadata_field.rbi +422 -0
  207. data/rbi/imagekitio/models/custom_metadata_field_create_params.rbi +443 -0
  208. data/rbi/imagekitio/models/custom_metadata_field_delete_params.rbi +30 -0
  209. data/rbi/imagekitio/models/custom_metadata_field_delete_response.rbi +23 -0
  210. data/rbi/imagekitio/models/custom_metadata_field_list_params.rbi +66 -0
  211. data/rbi/imagekitio/models/custom_metadata_field_list_response.rbi +11 -0
  212. data/rbi/imagekitio/models/custom_metadata_field_update_params.rbi +376 -0
  213. data/rbi/imagekitio/models/extensions.rbi +274 -0
  214. data/rbi/imagekitio/models/file.rbi +789 -0
  215. data/rbi/imagekitio/models/file_copy_params.rbi +66 -0
  216. data/rbi/imagekitio/models/file_copy_response.rbi +23 -0
  217. data/rbi/imagekitio/models/file_delete_params.rbi +27 -0
  218. data/rbi/imagekitio/models/file_get_params.rbi +27 -0
  219. data/rbi/imagekitio/models/file_move_params.rbi +51 -0
  220. data/rbi/imagekitio/models/file_move_response.rbi +23 -0
  221. data/rbi/imagekitio/models/file_rename_params.rbi +102 -0
  222. data/rbi/imagekitio/models/file_rename_response.rbi +35 -0
  223. data/rbi/imagekitio/models/file_update_params.rbi +58 -0
  224. data/rbi/imagekitio/models/file_update_response.rbi +322 -0
  225. data/rbi/imagekitio/models/file_upload_params.rbi +897 -0
  226. data/rbi/imagekitio/models/file_upload_response.rbi +1176 -0
  227. data/rbi/imagekitio/models/files/bulk_add_tags_params.rbi +56 -0
  228. data/rbi/imagekitio/models/files/bulk_add_tags_response.rbi +41 -0
  229. data/rbi/imagekitio/models/files/bulk_delete_params.rbi +48 -0
  230. data/rbi/imagekitio/models/files/bulk_delete_response.rbi +41 -0
  231. data/rbi/imagekitio/models/files/bulk_remove_ai_tags_params.rbi +56 -0
  232. data/rbi/imagekitio/models/files/bulk_remove_ai_tags_response.rbi +41 -0
  233. data/rbi/imagekitio/models/files/bulk_remove_tags_params.rbi +56 -0
  234. data/rbi/imagekitio/models/files/bulk_remove_tags_response.rbi +41 -0
  235. data/rbi/imagekitio/models/files/metadata_get_from_url_params.rbi +47 -0
  236. data/rbi/imagekitio/models/files/metadata_get_params.rbi +34 -0
  237. data/rbi/imagekitio/models/files/version_delete_params.rbi +40 -0
  238. data/rbi/imagekitio/models/files/version_delete_response.rbi +25 -0
  239. data/rbi/imagekitio/models/files/version_get_params.rbi +40 -0
  240. data/rbi/imagekitio/models/files/version_list_params.rbi +34 -0
  241. data/rbi/imagekitio/models/files/version_list_response.rbi +13 -0
  242. data/rbi/imagekitio/models/files/version_restore_params.rbi +40 -0
  243. data/rbi/imagekitio/models/folder.rbi +121 -0
  244. data/rbi/imagekitio/models/folder_copy_params.rbi +68 -0
  245. data/rbi/imagekitio/models/folder_copy_response.rbi +33 -0
  246. data/rbi/imagekitio/models/folder_create_params.rbi +71 -0
  247. data/rbi/imagekitio/models/folder_create_response.rbi +23 -0
  248. data/rbi/imagekitio/models/folder_delete_params.rbi +40 -0
  249. data/rbi/imagekitio/models/folder_delete_response.rbi +23 -0
  250. data/rbi/imagekitio/models/folder_move_params.rbi +53 -0
  251. data/rbi/imagekitio/models/folder_move_response.rbi +33 -0
  252. data/rbi/imagekitio/models/folder_rename_params.rbi +98 -0
  253. data/rbi/imagekitio/models/folder_rename_response.rbi +33 -0
  254. data/rbi/imagekitio/models/folders/job_get_params.rbi +34 -0
  255. data/rbi/imagekitio/models/folders/job_get_response.rbi +173 -0
  256. data/rbi/imagekitio/models/get_image_attributes_options.rbi +121 -0
  257. data/rbi/imagekitio/models/image_overlay.rbi +109 -0
  258. data/rbi/imagekitio/models/metadata.rbi +813 -0
  259. data/rbi/imagekitio/models/overlay.rbi +28 -0
  260. data/rbi/imagekitio/models/overlay_position.rbi +148 -0
  261. data/rbi/imagekitio/models/overlay_timing.rbi +135 -0
  262. data/rbi/imagekitio/models/responsive_image_attributes.rbi +74 -0
  263. data/rbi/imagekitio/models/solid_color_overlay.rbi +79 -0
  264. data/rbi/imagekitio/models/solid_color_overlay_transformation.rbi +218 -0
  265. data/rbi/imagekitio/models/src_options.rbi +159 -0
  266. data/rbi/imagekitio/models/streaming_resolution.rbi +38 -0
  267. data/rbi/imagekitio/models/subtitle_overlay.rbi +114 -0
  268. data/rbi/imagekitio/models/subtitle_overlay_transformation.rbi +215 -0
  269. data/rbi/imagekitio/models/text_overlay.rbi +110 -0
  270. data/rbi/imagekitio/models/text_overlay_transformation.rbi +451 -0
  271. data/rbi/imagekitio/models/transformation.rbi +1646 -0
  272. data/rbi/imagekitio/models/transformation_position.rbi +28 -0
  273. data/rbi/imagekitio/models/unsafe_unwrap_webhook_event.rbi +33 -0
  274. data/rbi/imagekitio/models/unwrap_webhook_event.rbi +31 -0
  275. data/rbi/imagekitio/models/update_file_request.rbi +316 -0
  276. data/rbi/imagekitio/models/upload_post_transform_error_event.rbi +434 -0
  277. data/rbi/imagekitio/models/upload_post_transform_success_event.rbi +327 -0
  278. data/rbi/imagekitio/models/upload_pre_transform_error_event.rbi +244 -0
  279. data/rbi/imagekitio/models/upload_pre_transform_success_event.rbi +1300 -0
  280. data/rbi/imagekitio/models/video_overlay.rbi +105 -0
  281. data/rbi/imagekitio/models/video_transformation_accepted_event.rbi +659 -0
  282. data/rbi/imagekitio/models/video_transformation_error_event.rbi +772 -0
  283. data/rbi/imagekitio/models/video_transformation_ready_event.rbi +864 -0
  284. data/rbi/imagekitio/models/webhook_unsafe_unwrap_params.rbi +30 -0
  285. data/rbi/imagekitio/models/webhook_unwrap_params.rbi +27 -0
  286. data/rbi/imagekitio/models.rbi +135 -0
  287. data/rbi/imagekitio/request_options.rbi +59 -0
  288. data/rbi/imagekitio/resources/accounts/origins.rbi +91 -0
  289. data/rbi/imagekitio/resources/accounts/url_endpoints.rbi +129 -0
  290. data/rbi/imagekitio/resources/accounts/usage.rbi +36 -0
  291. data/rbi/imagekitio/resources/accounts.rbi +21 -0
  292. data/rbi/imagekitio/resources/assets.rbi +74 -0
  293. data/rbi/imagekitio/resources/beta/v2/files.rbi +193 -0
  294. data/rbi/imagekitio/resources/beta/v2.rbi +17 -0
  295. data/rbi/imagekitio/resources/beta.rbi +15 -0
  296. data/rbi/imagekitio/resources/cache/invalidation.rbi +44 -0
  297. data/rbi/imagekitio/resources/cache.rbi +15 -0
  298. data/rbi/imagekitio/resources/custom_metadata_fields.rbi +106 -0
  299. data/rbi/imagekitio/resources/files/bulk.rbi +88 -0
  300. data/rbi/imagekitio/resources/files/metadata.rbi +49 -0
  301. data/rbi/imagekitio/resources/files/versions.rbi +89 -0
  302. data/rbi/imagekitio/resources/files.rbi +364 -0
  303. data/rbi/imagekitio/resources/folders/job.rbi +29 -0
  304. data/rbi/imagekitio/resources/folders.rbi +146 -0
  305. data/rbi/imagekitio/resources/webhooks.rbi +50 -0
  306. data/rbi/imagekitio/version.rbi +5 -0
  307. data/sig/imagekitio/client.rbs +47 -0
  308. data/sig/imagekitio/errors.rbs +117 -0
  309. data/sig/imagekitio/file_part.rbs +21 -0
  310. data/sig/imagekitio/helpers/helper.rbs +24 -0
  311. data/sig/imagekitio/internal/transport/base_client.rbs +131 -0
  312. data/sig/imagekitio/internal/transport/pooled_net_requester.rbs +45 -0
  313. data/sig/imagekitio/internal/type/array_of.rbs +48 -0
  314. data/sig/imagekitio/internal/type/base_model.rbs +102 -0
  315. data/sig/imagekitio/internal/type/base_page.rbs +24 -0
  316. data/sig/imagekitio/internal/type/boolean.rbs +26 -0
  317. data/sig/imagekitio/internal/type/converter.rbs +79 -0
  318. data/sig/imagekitio/internal/type/enum.rbs +32 -0
  319. data/sig/imagekitio/internal/type/file_input.rbs +25 -0
  320. data/sig/imagekitio/internal/type/hash_of.rbs +48 -0
  321. data/sig/imagekitio/internal/type/request_parameters.rbs +19 -0
  322. data/sig/imagekitio/internal/type/union.rbs +52 -0
  323. data/sig/imagekitio/internal/type/unknown.rbs +26 -0
  324. data/sig/imagekitio/internal/util.rbs +185 -0
  325. data/sig/imagekitio/internal.rbs +9 -0
  326. data/sig/imagekitio/models/accounts/origin_create_params.rbs +30 -0
  327. data/sig/imagekitio/models/accounts/origin_delete_params.rbs +17 -0
  328. data/sig/imagekitio/models/accounts/origin_get_params.rbs +17 -0
  329. data/sig/imagekitio/models/accounts/origin_list_params.rbs +17 -0
  330. data/sig/imagekitio/models/accounts/origin_list_response.rbs +10 -0
  331. data/sig/imagekitio/models/accounts/origin_request.rbs +468 -0
  332. data/sig/imagekitio/models/accounts/origin_response.rbs +418 -0
  333. data/sig/imagekitio/models/accounts/origin_update_params.rbs +30 -0
  334. data/sig/imagekitio/models/accounts/url_endpoint_create_params.rbs +17 -0
  335. data/sig/imagekitio/models/accounts/url_endpoint_delete_params.rbs +17 -0
  336. data/sig/imagekitio/models/accounts/url_endpoint_get_params.rbs +17 -0
  337. data/sig/imagekitio/models/accounts/url_endpoint_list_params.rbs +17 -0
  338. data/sig/imagekitio/models/accounts/url_endpoint_list_response.rbs +10 -0
  339. data/sig/imagekitio/models/accounts/url_endpoint_request.rbs +97 -0
  340. data/sig/imagekitio/models/accounts/url_endpoint_response.rbs +96 -0
  341. data/sig/imagekitio/models/accounts/url_endpoint_update_params.rbs +17 -0
  342. data/sig/imagekitio/models/accounts/usage_get_params.rbs +30 -0
  343. data/sig/imagekitio/models/accounts/usage_get_response.rbs +52 -0
  344. data/sig/imagekitio/models/asset_list_params.rbs +138 -0
  345. data/sig/imagekitio/models/asset_list_response.rbs +16 -0
  346. data/sig/imagekitio/models/base_overlay.rbs +31 -0
  347. data/sig/imagekitio/models/base_webhook_event.rbs +15 -0
  348. data/sig/imagekitio/models/beta/v2/file_upload_params.rbs +310 -0
  349. data/sig/imagekitio/models/beta/v2/file_upload_response.rbs +487 -0
  350. data/sig/imagekitio/models/cache/invalidation_create_params.rbs +25 -0
  351. data/sig/imagekitio/models/cache/invalidation_create_response.rbs +17 -0
  352. data/sig/imagekitio/models/cache/invalidation_get_params.rbs +17 -0
  353. data/sig/imagekitio/models/cache/invalidation_get_response.rbs +35 -0
  354. data/sig/imagekitio/models/custom_metadata_field.rbs +178 -0
  355. data/sig/imagekitio/models/custom_metadata_field_create_params.rbs +179 -0
  356. data/sig/imagekitio/models/custom_metadata_field_delete_params.rbs +15 -0
  357. data/sig/imagekitio/models/custom_metadata_field_delete_response.rbs +11 -0
  358. data/sig/imagekitio/models/custom_metadata_field_list_params.rbs +32 -0
  359. data/sig/imagekitio/models/custom_metadata_field_list_response.rbs +8 -0
  360. data/sig/imagekitio/models/custom_metadata_field_update_params.rbs +152 -0
  361. data/sig/imagekitio/models/extensions.rbs +132 -0
  362. data/sig/imagekitio/models/file.rbs +384 -0
  363. data/sig/imagekitio/models/file_copy_params.rbs +38 -0
  364. data/sig/imagekitio/models/file_copy_response.rbs +11 -0
  365. data/sig/imagekitio/models/file_delete_params.rbs +15 -0
  366. data/sig/imagekitio/models/file_get_params.rbs +14 -0
  367. data/sig/imagekitio/models/file_move_params.rbs +28 -0
  368. data/sig/imagekitio/models/file_move_response.rbs +11 -0
  369. data/sig/imagekitio/models/file_rename_params.rbs +34 -0
  370. data/sig/imagekitio/models/file_rename_response.rbs +15 -0
  371. data/sig/imagekitio/models/file_update_params.rbs +28 -0
  372. data/sig/imagekitio/models/file_update_response.rbs +120 -0
  373. data/sig/imagekitio/models/file_upload_params.rbs +327 -0
  374. data/sig/imagekitio/models/file_upload_response.rbs +483 -0
  375. data/sig/imagekitio/models/files/bulk_add_tags_params.rbs +30 -0
  376. data/sig/imagekitio/models/files/bulk_add_tags_response.rbs +20 -0
  377. data/sig/imagekitio/models/files/bulk_delete_params.rbs +26 -0
  378. data/sig/imagekitio/models/files/bulk_delete_response.rbs +20 -0
  379. data/sig/imagekitio/models/files/bulk_remove_ai_tags_params.rbs +30 -0
  380. data/sig/imagekitio/models/files/bulk_remove_ai_tags_response.rbs +20 -0
  381. data/sig/imagekitio/models/files/bulk_remove_tags_params.rbs +30 -0
  382. data/sig/imagekitio/models/files/bulk_remove_tags_response.rbs +20 -0
  383. data/sig/imagekitio/models/files/metadata_get_from_url_params.rbs +25 -0
  384. data/sig/imagekitio/models/files/metadata_get_params.rbs +17 -0
  385. data/sig/imagekitio/models/files/version_delete_params.rbs +25 -0
  386. data/sig/imagekitio/models/files/version_delete_response.rbs +13 -0
  387. data/sig/imagekitio/models/files/version_get_params.rbs +25 -0
  388. data/sig/imagekitio/models/files/version_list_params.rbs +17 -0
  389. data/sig/imagekitio/models/files/version_list_response.rbs +9 -0
  390. data/sig/imagekitio/models/files/version_restore_params.rbs +25 -0
  391. data/sig/imagekitio/models/folder.rbs +69 -0
  392. data/sig/imagekitio/models/folder_copy_params.rbs +38 -0
  393. data/sig/imagekitio/models/folder_copy_response.rbs +13 -0
  394. data/sig/imagekitio/models/folder_create_params.rbs +28 -0
  395. data/sig/imagekitio/models/folder_create_response.rbs +11 -0
  396. data/sig/imagekitio/models/folder_delete_params.rbs +23 -0
  397. data/sig/imagekitio/models/folder_delete_response.rbs +11 -0
  398. data/sig/imagekitio/models/folder_move_params.rbs +28 -0
  399. data/sig/imagekitio/models/folder_move_response.rbs +13 -0
  400. data/sig/imagekitio/models/folder_rename_params.rbs +34 -0
  401. data/sig/imagekitio/models/folder_rename_response.rbs +13 -0
  402. data/sig/imagekitio/models/folders/job_get_params.rbs +17 -0
  403. data/sig/imagekitio/models/folders/job_get_response.rbs +72 -0
  404. data/sig/imagekitio/models/get_image_attributes_options.rbs +43 -0
  405. data/sig/imagekitio/models/image_overlay.rbs +59 -0
  406. data/sig/imagekitio/models/metadata.rbs +546 -0
  407. data/sig/imagekitio/models/overlay.rbs +16 -0
  408. data/sig/imagekitio/models/overlay_position.rbs +85 -0
  409. data/sig/imagekitio/models/overlay_timing.rbs +66 -0
  410. data/sig/imagekitio/models/responsive_image_attributes.rbs +36 -0
  411. data/sig/imagekitio/models/solid_color_overlay.rbs +38 -0
  412. data/sig/imagekitio/models/solid_color_overlay_transformation.rbs +97 -0
  413. data/sig/imagekitio/models/src_options.rbs +64 -0
  414. data/sig/imagekitio/models/streaming_resolution.rbs +20 -0
  415. data/sig/imagekitio/models/subtitle_overlay.rbs +59 -0
  416. data/sig/imagekitio/models/subtitle_overlay_transformation.rbs +78 -0
  417. data/sig/imagekitio/models/text_overlay.rbs +59 -0
  418. data/sig/imagekitio/models/text_overlay_transformation.rbs +195 -0
  419. data/sig/imagekitio/models/transformation.rbs +763 -0
  420. data/sig/imagekitio/models/transformation_position.rbs +14 -0
  421. data/sig/imagekitio/models/unsafe_unwrap_webhook_event.rbs +18 -0
  422. data/sig/imagekitio/models/unwrap_webhook_event.rbs +18 -0
  423. data/sig/imagekitio/models/update_file_request.rbs +122 -0
  424. data/sig/imagekitio/models/upload_post_transform_error_event.rbs +192 -0
  425. data/sig/imagekitio/models/upload_post_transform_success_event.rbs +142 -0
  426. data/sig/imagekitio/models/upload_pre_transform_error_event.rbs +115 -0
  427. data/sig/imagekitio/models/upload_pre_transform_success_event.rbs +541 -0
  428. data/sig/imagekitio/models/video_overlay.rbs +59 -0
  429. data/sig/imagekitio/models/video_transformation_accepted_event.rbs +261 -0
  430. data/sig/imagekitio/models/video_transformation_error_event.rbs +300 -0
  431. data/sig/imagekitio/models/video_transformation_ready_event.rbs +359 -0
  432. data/sig/imagekitio/models/webhook_unsafe_unwrap_params.rbs +15 -0
  433. data/sig/imagekitio/models/webhook_unwrap_params.rbs +15 -0
  434. data/sig/imagekitio/models.rbs +119 -0
  435. data/sig/imagekitio/request_options.rbs +36 -0
  436. data/sig/imagekitio/resources/accounts/origins.rbs +34 -0
  437. data/sig/imagekitio/resources/accounts/url_endpoints.rbs +40 -0
  438. data/sig/imagekitio/resources/accounts/usage.rbs +15 -0
  439. data/sig/imagekitio/resources/accounts.rbs +13 -0
  440. data/sig/imagekitio/resources/assets.rbs +18 -0
  441. data/sig/imagekitio/resources/beta/v2/files.rbs +35 -0
  442. data/sig/imagekitio/resources/beta/v2.rbs +11 -0
  443. data/sig/imagekitio/resources/beta.rbs +9 -0
  444. data/sig/imagekitio/resources/cache/invalidation.rbs +19 -0
  445. data/sig/imagekitio/resources/cache.rbs +9 -0
  446. data/sig/imagekitio/resources/custom_metadata_fields.rbs +32 -0
  447. data/sig/imagekitio/resources/files/bulk.rbs +32 -0
  448. data/sig/imagekitio/resources/files/metadata.rbs +19 -0
  449. data/sig/imagekitio/resources/files/versions.rbs +32 -0
  450. data/sig/imagekitio/resources/files.rbs +76 -0
  451. data/sig/imagekitio/resources/folders/job.rbs +14 -0
  452. data/sig/imagekitio/resources/folders.rbs +40 -0
  453. data/sig/imagekitio/resources/webhooks.rbs +27 -0
  454. data/sig/imagekitio/version.rbs +3 -0
  455. metadata +470 -136
  456. data/Rakefile +0 -27
  457. data/lib/active_storage/active_storage.rb +0 -7
  458. data/lib/active_storage/service/ik_file.rb +0 -115
  459. data/lib/active_storage/service/image_kit_io_service.rb +0 -188
  460. data/lib/carrierwave/carrierwave.rb +0 -83
  461. data/lib/carrierwave/storage/ik_file.rb +0 -51
  462. data/lib/carrierwave/storage/imagekit_store.rb +0 -68
  463. data/lib/carrierwave/support/uri_filename.rb +0 -12
  464. data/lib/imagekitio/api_service/bulk.rb +0 -58
  465. data/lib/imagekitio/api_service/custom_metadata_field.rb +0 -52
  466. data/lib/imagekitio/api_service/file.rb +0 -221
  467. data/lib/imagekitio/api_service/folder.rb +0 -49
  468. data/lib/imagekitio/base.rb +0 -12
  469. data/lib/imagekitio/configurable.rb +0 -43
  470. data/lib/imagekitio/constant.rb +0 -36
  471. data/lib/imagekitio/constants/default.rb +0 -22
  472. data/lib/imagekitio/constants/error.rb +0 -69
  473. data/lib/imagekitio/constants/file.rb +0 -11
  474. data/lib/imagekitio/constants/supported_transformation.rb +0 -39
  475. data/lib/imagekitio/constants/url.rb +0 -14
  476. data/lib/imagekitio/railtie.rb +0 -4
  477. data/lib/imagekitio/request.rb +0 -98
  478. data/lib/imagekitio/sdk/version.rb +0 -5
  479. data/lib/imagekitio/url.rb +0 -216
  480. data/lib/imagekitio/utils/calculation.rb +0 -45
  481. data/lib/imagekitio/utils/formatter.rb +0 -48
  482. data/lib/imagekitio/utils/option_validator.rb +0 -36
  483. data/lib/tasks/imagekitio/imagekitio_tasks.rake +0 -4
@@ -0,0 +1,364 @@
1
+ # typed: strong
2
+
3
+ module Imagekitio
4
+ module Resources
5
+ class Files
6
+ sig { returns(Imagekitio::Resources::Files::Bulk) }
7
+ attr_reader :bulk
8
+
9
+ sig { returns(Imagekitio::Resources::Files::Versions) }
10
+ attr_reader :versions
11
+
12
+ sig { returns(Imagekitio::Resources::Files::Metadata) }
13
+ attr_reader :metadata
14
+
15
+ # This API updates the details or attributes of the current version of the file.
16
+ # You can update `tags`, `customCoordinates`, `customMetadata`, publication
17
+ # status, remove existing `AITags` and apply extensions using this API.
18
+ sig do
19
+ params(
20
+ file_id: String,
21
+ update_file_request: Imagekitio::UpdateFileRequest,
22
+ request_options: Imagekitio::RequestOptions::OrHash
23
+ ).returns(Imagekitio::Models::FileUpdateResponse)
24
+ end
25
+ def update(
26
+ # The unique `fileId` of the uploaded file. `fileId` is returned in list and
27
+ # search assets API and upload API.
28
+ file_id,
29
+ # Schema for update file update request.
30
+ update_file_request:,
31
+ request_options: {}
32
+ )
33
+ end
34
+
35
+ # This API deletes the file and all its file versions permanently.
36
+ #
37
+ # Note: If a file or specific transformation has been requested in the past, then
38
+ # the response is cached. Deleting a file does not purge the cache. You can purge
39
+ # the cache using purge cache API.
40
+ sig do
41
+ params(
42
+ file_id: String,
43
+ request_options: Imagekitio::RequestOptions::OrHash
44
+ ).void
45
+ end
46
+ def delete(
47
+ # The unique `fileId` of the uploaded file. `fileId` is returned in list and
48
+ # search assets API and upload API.
49
+ file_id,
50
+ request_options: {}
51
+ )
52
+ end
53
+
54
+ # This will copy a file from one folder to another.
55
+ #
56
+ # Note: If any file at the destination has the same name as the source file, then
57
+ # the source file and its versions (if `includeFileVersions` is set to true) will
58
+ # be appended to the destination file version history.
59
+ sig do
60
+ params(
61
+ destination_path: String,
62
+ source_file_path: String,
63
+ include_file_versions: T::Boolean,
64
+ request_options: Imagekitio::RequestOptions::OrHash
65
+ ).returns(Imagekitio::Models::FileCopyResponse)
66
+ end
67
+ def copy(
68
+ # Full path to the folder you want to copy the above file into.
69
+ destination_path:,
70
+ # The full path of the file you want to copy.
71
+ source_file_path:,
72
+ # Option to copy all versions of a file. By default, only the current version of
73
+ # the file is copied. When set to true, all versions of the file will be copied.
74
+ # Default value - `false`.
75
+ include_file_versions: nil,
76
+ request_options: {}
77
+ )
78
+ end
79
+
80
+ # This API returns an object with details or attributes about the current version
81
+ # of the file.
82
+ sig do
83
+ params(
84
+ file_id: String,
85
+ request_options: Imagekitio::RequestOptions::OrHash
86
+ ).returns(Imagekitio::File)
87
+ end
88
+ def get(
89
+ # The unique `fileId` of the uploaded file. `fileId` is returned in the list and
90
+ # search assets API and upload API.
91
+ file_id,
92
+ request_options: {}
93
+ )
94
+ end
95
+
96
+ # This will move a file and all its versions from one folder to another.
97
+ #
98
+ # Note: If any file at the destination has the same name as the source file, then
99
+ # the source file and its versions will be appended to the destination file.
100
+ sig do
101
+ params(
102
+ destination_path: String,
103
+ source_file_path: String,
104
+ request_options: Imagekitio::RequestOptions::OrHash
105
+ ).returns(Imagekitio::Models::FileMoveResponse)
106
+ end
107
+ def move(
108
+ # Full path to the folder you want to move the above file into.
109
+ destination_path:,
110
+ # The full path of the file you want to move.
111
+ source_file_path:,
112
+ request_options: {}
113
+ )
114
+ end
115
+
116
+ # You can rename an already existing file in the media library using rename file
117
+ # API. This operation would rename all file versions of the file.
118
+ #
119
+ # Note: The old URLs will stop working. The file/file version URLs cached on CDN
120
+ # will continue to work unless a purge is requested.
121
+ sig do
122
+ params(
123
+ file_path: String,
124
+ new_file_name: String,
125
+ purge_cache: T::Boolean,
126
+ request_options: Imagekitio::RequestOptions::OrHash
127
+ ).returns(Imagekitio::Models::FileRenameResponse)
128
+ end
129
+ def rename(
130
+ # The full path of the file you want to rename.
131
+ file_path:,
132
+ # The new name of the file. A filename can contain:
133
+ #
134
+ # Alphanumeric Characters: `a-z`, `A-Z`, `0-9` (including Unicode letters, marks,
135
+ # and numerals in other languages). Special Characters: `.`, `_`, and `-`.
136
+ #
137
+ # Any other character, including space, will be replaced by `_`.
138
+ new_file_name:,
139
+ # Option to purge cache for the old file and its versions' URLs.
140
+ #
141
+ # When set to true, it will internally issue a purge cache request on CDN to
142
+ # remove cached content of old file and its versions. This purge request is
143
+ # counted against your monthly purge quota.
144
+ #
145
+ # Note: If the old file were accessible at
146
+ # `https://ik.imagekit.io/demo/old-filename.jpg`, a purge cache request would be
147
+ # issued against `https://ik.imagekit.io/demo/old-filename.jpg*` (with a wildcard
148
+ # at the end). It will remove the file and its versions' URLs and any
149
+ # transformations made using query parameters on this file or its versions.
150
+ # However, the cache for file transformations made using path parameters will
151
+ # persist. You can purge them using the purge API. For more details, refer to the
152
+ # purge API documentation.
153
+ #
154
+ # Default value - `false`
155
+ purge_cache: nil,
156
+ request_options: {}
157
+ )
158
+ end
159
+
160
+ # ImageKit.io allows you to upload files directly from both the server and client
161
+ # sides. For server-side uploads, private API key authentication is used. For
162
+ # client-side uploads, generate a one-time `token`, `signature`, and `expire` from
163
+ # your secure backend using private API.
164
+ # [Learn more](/docs/api-reference/upload-file/upload-file#how-to-implement-client-side-file-upload)
165
+ # about how to implement client-side file upload.
166
+ #
167
+ # The [V2 API](/docs/api-reference/upload-file/upload-file-v2) enhances security
168
+ # by verifying the entire payload using JWT.
169
+ #
170
+ # **File size limit** \
171
+ # On the free plan, the maximum upload file sizes are 20MB for images, audio, and raw
172
+ # files and 100MB for videos. On the paid plan, these limits increase to 40MB for images,
173
+ # audio, and raw files and 2GB for videos. These limits can be further increased with
174
+ # higher-tier plans.
175
+ #
176
+ # **Version limit** \
177
+ # A file can have a maximum of 100 versions.
178
+ #
179
+ # **Demo applications**
180
+ #
181
+ # - A full-fledged
182
+ # [upload widget using Uppy](https://github.com/imagekit-samples/uppy-uploader),
183
+ # supporting file selections from local storage, URL, Dropbox, Google Drive,
184
+ # Instagram, and more.
185
+ # - [Quick start guides](/docs/quick-start-guides) for various frameworks and
186
+ # technologies.
187
+ sig do
188
+ params(
189
+ file: Imagekitio::Internal::FileInput,
190
+ file_name: String,
191
+ token: String,
192
+ checks: String,
193
+ custom_coordinates: String,
194
+ custom_metadata: T::Hash[Symbol, T.anything],
195
+ description: String,
196
+ expire: Integer,
197
+ extensions:
198
+ T::Array[
199
+ T.any(
200
+ Imagekitio::ExtensionItem::RemoveBg::OrHash,
201
+ Imagekitio::ExtensionItem::AIAutoDescription::OrHash,
202
+ Imagekitio::ExtensionItem::AutoTaggingExtension::OrHash
203
+ )
204
+ ],
205
+ folder: String,
206
+ is_private_file: T::Boolean,
207
+ is_published: T::Boolean,
208
+ overwrite_ai_tags: T::Boolean,
209
+ overwrite_custom_metadata: T::Boolean,
210
+ overwrite_file: T::Boolean,
211
+ overwrite_tags: T::Boolean,
212
+ public_key: String,
213
+ response_fields:
214
+ T::Array[Imagekitio::FileUploadParams::ResponseField::OrSymbol],
215
+ signature: String,
216
+ tags: T::Array[String],
217
+ transformation: Imagekitio::FileUploadParams::Transformation::OrHash,
218
+ use_unique_file_name: T::Boolean,
219
+ webhook_url: String,
220
+ request_options: Imagekitio::RequestOptions::OrHash
221
+ ).returns(Imagekitio::Models::FileUploadResponse)
222
+ end
223
+ def upload(
224
+ # The API accepts any of the following:
225
+ #
226
+ # - **Binary data** – send the raw bytes as `multipart/form-data`.
227
+ # - **HTTP / HTTPS URL** – a publicly reachable URL that ImageKit’s servers can
228
+ # fetch.
229
+ # - **Base64 string** – the file encoded as a Base64 data URI or plain Base64.
230
+ #
231
+ # When supplying a URL, the server must receive the response headers within 8
232
+ # seconds; otherwise the request fails with 400 Bad Request.
233
+ file:,
234
+ # The name with which the file has to be uploaded. The file name can contain:
235
+ #
236
+ # - Alphanumeric Characters: `a-z`, `A-Z`, `0-9`.
237
+ # - Special Characters: `.`, `-`
238
+ #
239
+ # Any other character including space will be replaced by `_`
240
+ file_name:,
241
+ # A unique value that the ImageKit.io server will use to recognize and prevent
242
+ # subsequent retries for the same request. We suggest using V4 UUIDs, or another
243
+ # random string with enough entropy to avoid collisions. This field is only
244
+ # required for authentication when uploading a file from the client side.
245
+ #
246
+ # **Note**: Sending a value that has been used in the past will result in a
247
+ # validation error. Even if your previous request resulted in an error, you should
248
+ # always send a new value for this field.
249
+ token: nil,
250
+ # Server-side checks to run on the asset. Read more about
251
+ # [Upload API checks](/docs/api-reference/upload-file/upload-file#upload-api-checks).
252
+ checks: nil,
253
+ # Define an important area in the image. This is only relevant for image type
254
+ # files.
255
+ #
256
+ # - To be passed as a string with the x and y coordinates of the top-left corner,
257
+ # and width and height of the area of interest in the format `x,y,width,height`.
258
+ # For example - `10,10,100,100`
259
+ # - Can be used with fo-customtransformation.
260
+ # - If this field is not specified and the file is overwritten, then
261
+ # customCoordinates will be removed.
262
+ custom_coordinates: nil,
263
+ # JSON key-value pairs to associate with the asset. Create the custom metadata
264
+ # fields before setting these values.
265
+ custom_metadata: nil,
266
+ # Optional text to describe the contents of the file.
267
+ description: nil,
268
+ # The time until your signature is valid. It must be a
269
+ # [Unix time](https://en.wikipedia.org/wiki/Unix_time) in less than 1 hour into
270
+ # the future. It should be in seconds. This field is only required for
271
+ # authentication when uploading a file from the client side.
272
+ expire: nil,
273
+ # Array of extensions to be applied to the asset. Each extension can be configured
274
+ # with specific parameters based on the extension type.
275
+ extensions: nil,
276
+ # The folder path in which the image has to be uploaded. If the folder(s) didn't
277
+ # exist before, a new folder(s) is created.
278
+ #
279
+ # The folder name can contain:
280
+ #
281
+ # - Alphanumeric Characters: `a-z` , `A-Z` , `0-9`
282
+ # - Special Characters: `/` , `_` , `-`
283
+ #
284
+ # Using multiple `/` creates a nested folder.
285
+ folder: nil,
286
+ # Whether to mark the file as private or not.
287
+ #
288
+ # If `true`, the file is marked as private and is accessible only using named
289
+ # transformation or signed URL.
290
+ is_private_file: nil,
291
+ # Whether to upload file as published or not.
292
+ #
293
+ # If `false`, the file is marked as unpublished, which restricts access to the
294
+ # file only via the media library. Files in draft or unpublished state can only be
295
+ # publicly accessed after being published.
296
+ #
297
+ # The option to upload in draft state is only available in custom enterprise
298
+ # pricing plans.
299
+ is_published: nil,
300
+ # If set to `true` and a file already exists at the exact location, its AITags
301
+ # will be removed. Set `overwriteAITags` to `false` to preserve AITags.
302
+ overwrite_ai_tags: nil,
303
+ # If the request does not have `customMetadata`, and a file already exists at the
304
+ # exact location, existing customMetadata will be removed.
305
+ overwrite_custom_metadata: nil,
306
+ # If `false` and `useUniqueFileName` is also `false`, and a file already exists at
307
+ # the exact location, upload API will return an error immediately.
308
+ overwrite_file: nil,
309
+ # If the request does not have `tags`, and a file already exists at the exact
310
+ # location, existing tags will be removed.
311
+ overwrite_tags: nil,
312
+ # Your ImageKit.io public key. This field is only required for authentication when
313
+ # uploading a file from the client side.
314
+ public_key: nil,
315
+ # Array of response field keys to include in the API response body.
316
+ response_fields: nil,
317
+ # HMAC-SHA1 digest of the token+expire using your ImageKit.io private API key as a
318
+ # key. Learn how to create a signature on the page below. This should be in
319
+ # lowercase.
320
+ #
321
+ # Signature must be calculated on the server-side. This field is only required for
322
+ # authentication when uploading a file from the client side.
323
+ signature: nil,
324
+ # Set the tags while uploading the file. Provide an array of tag strings (e.g.
325
+ # `["tag1", "tag2", "tag3"]`). The combined length of all tag characters must not
326
+ # exceed 500, and the `%` character is not allowed. If this field is not specified
327
+ # and the file is overwritten, the existing tags will be removed.
328
+ tags: nil,
329
+ # Configure pre-processing (`pre`) and post-processing (`post`) transformations.
330
+ #
331
+ # - `pre` — applied before the file is uploaded to the Media Library.
332
+ # Useful for reducing file size or applying basic optimizations upfront (e.g.,
333
+ # resize, compress).
334
+ #
335
+ # - `post` — applied immediately after upload.
336
+ # Ideal for generating transformed versions (like video encodes or thumbnails)
337
+ # in advance, so they're ready for delivery without delay.
338
+ #
339
+ # You can mix and match any combination of post-processing types.
340
+ transformation: nil,
341
+ # Whether to use a unique filename for this file or not.
342
+ #
343
+ # If `true`, ImageKit.io will add a unique suffix to the filename parameter to get
344
+ # a unique filename.
345
+ #
346
+ # If `false`, then the image is uploaded with the provided filename parameter, and
347
+ # any existing file with the same name is replaced.
348
+ use_unique_file_name: nil,
349
+ # The final status of extensions after they have completed execution will be
350
+ # delivered to this endpoint as a POST request.
351
+ # [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure)
352
+ # about the webhook payload structure.
353
+ webhook_url: nil,
354
+ request_options: {}
355
+ )
356
+ end
357
+
358
+ # @api private
359
+ sig { params(client: Imagekitio::Client).returns(T.attached_class) }
360
+ def self.new(client:)
361
+ end
362
+ end
363
+ end
364
+ end
@@ -0,0 +1,29 @@
1
+ # typed: strong
2
+
3
+ module Imagekitio
4
+ module Resources
5
+ class Folders
6
+ class Job
7
+ # This API returns the status of a bulk job like copy and move folder operations.
8
+ sig do
9
+ params(
10
+ job_id: String,
11
+ request_options: Imagekitio::RequestOptions::OrHash
12
+ ).returns(Imagekitio::Models::Folders::JobGetResponse)
13
+ end
14
+ def get(
15
+ # The `jobId` is returned in the response of bulk job API e.g. copy folder or move
16
+ # folder API.
17
+ job_id,
18
+ request_options: {}
19
+ )
20
+ end
21
+
22
+ # @api private
23
+ sig { params(client: Imagekitio::Client).returns(T.attached_class) }
24
+ def self.new(client:)
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,146 @@
1
+ # typed: strong
2
+
3
+ module Imagekitio
4
+ module Resources
5
+ class Folders
6
+ sig { returns(Imagekitio::Resources::Folders::Job) }
7
+ attr_reader :job
8
+
9
+ # This will create a new folder. You can specify the folder name and location of
10
+ # the parent folder where this new folder should be created.
11
+ sig do
12
+ params(
13
+ folder_name: String,
14
+ parent_folder_path: String,
15
+ request_options: Imagekitio::RequestOptions::OrHash
16
+ ).returns(Imagekitio::Models::FolderCreateResponse)
17
+ end
18
+ def create(
19
+ # The folder will be created with this name.
20
+ #
21
+ # All characters except alphabets and numbers (inclusive of unicode letters,
22
+ # marks, and numerals in other languages) will be replaced by an underscore i.e.
23
+ # `_`.
24
+ folder_name:,
25
+ # The folder where the new folder should be created, for root use `/` else the
26
+ # path e.g. `containing/folder/`.
27
+ #
28
+ # Note: If any folder(s) is not present in the parentFolderPath parameter, it will
29
+ # be automatically created. For example, if you pass `/product/images/summer`,
30
+ # then `product`, `images`, and `summer` folders will be created if they don't
31
+ # already exist.
32
+ parent_folder_path:,
33
+ request_options: {}
34
+ )
35
+ end
36
+
37
+ # This will delete a folder and all its contents permanently. The API returns an
38
+ # empty response.
39
+ sig do
40
+ params(
41
+ folder_path: String,
42
+ request_options: Imagekitio::RequestOptions::OrHash
43
+ ).returns(Imagekitio::Models::FolderDeleteResponse)
44
+ end
45
+ def delete(
46
+ # Full path to the folder you want to delete. For example `/folder/to/delete/`.
47
+ folder_path:,
48
+ request_options: {}
49
+ )
50
+ end
51
+
52
+ # This will copy one folder into another. The selected folder, its nested folders,
53
+ # files, and their versions (in `includeVersions` is set to true) are copied in
54
+ # this operation. Note: If any file at the destination has the same name as the
55
+ # source file, then the source file and its versions will be appended to the
56
+ # destination file version history.
57
+ sig do
58
+ params(
59
+ destination_path: String,
60
+ source_folder_path: String,
61
+ include_versions: T::Boolean,
62
+ request_options: Imagekitio::RequestOptions::OrHash
63
+ ).returns(Imagekitio::Models::FolderCopyResponse)
64
+ end
65
+ def copy(
66
+ # Full path to the destination folder where you want to copy the source folder
67
+ # into.
68
+ destination_path:,
69
+ # The full path to the source folder you want to copy.
70
+ source_folder_path:,
71
+ # Option to copy all versions of files that are nested inside the selected folder.
72
+ # By default, only the current version of each file will be copied. When set to
73
+ # true, all versions of each file will be copied. Default value - `false`.
74
+ include_versions: nil,
75
+ request_options: {}
76
+ )
77
+ end
78
+
79
+ # This will move one folder into another. The selected folder, its nested folders,
80
+ # files, and their versions are moved in this operation. Note: If any file at the
81
+ # destination has the same name as the source file, then the source file and its
82
+ # versions will be appended to the destination file version history.
83
+ sig do
84
+ params(
85
+ destination_path: String,
86
+ source_folder_path: String,
87
+ request_options: Imagekitio::RequestOptions::OrHash
88
+ ).returns(Imagekitio::Models::FolderMoveResponse)
89
+ end
90
+ def move(
91
+ # Full path to the destination folder where you want to move the source folder
92
+ # into.
93
+ destination_path:,
94
+ # The full path to the source folder you want to move.
95
+ source_folder_path:,
96
+ request_options: {}
97
+ )
98
+ end
99
+
100
+ # This API allows you to rename an existing folder. The folder and all its nested
101
+ # assets and sub-folders will remain unchanged, but their paths will be updated to
102
+ # reflect the new folder name.
103
+ sig do
104
+ params(
105
+ folder_path: String,
106
+ new_folder_name: String,
107
+ purge_cache: T::Boolean,
108
+ request_options: Imagekitio::RequestOptions::OrHash
109
+ ).returns(Imagekitio::Models::FolderRenameResponse)
110
+ end
111
+ def rename(
112
+ # The full path to the folder you want to rename.
113
+ folder_path:,
114
+ # The new name for the folder.
115
+ #
116
+ # All characters except alphabets and numbers (inclusive of unicode letters,
117
+ # marks, and numerals in other languages) and `-` will be replaced by an
118
+ # underscore i.e. `_`.
119
+ new_folder_name:,
120
+ # Option to purge cache for the old nested files and their versions' URLs.
121
+ #
122
+ # When set to true, it will internally issue a purge cache request on CDN to
123
+ # remove the cached content of the old nested files and their versions. There will
124
+ # only be one purge request for all the nested files, which will be counted
125
+ # against your monthly purge quota.
126
+ #
127
+ # Note: A purge cache request will be issued against
128
+ # `https://ik.imagekit.io/old/folder/path*` (with a wildcard at the end). This
129
+ # will remove all nested files, their versions' URLs, and any transformations made
130
+ # using query parameters on these files or their versions. However, the cache for
131
+ # file transformations made using path parameters will persist. You can purge them
132
+ # using the purge API. For more details, refer to the purge API documentation.
133
+ #
134
+ # Default value - `false`
135
+ purge_cache: nil,
136
+ request_options: {}
137
+ )
138
+ end
139
+
140
+ # @api private
141
+ sig { params(client: Imagekitio::Client).returns(T.attached_class) }
142
+ def self.new(client:)
143
+ end
144
+ end
145
+ end
146
+ end
@@ -0,0 +1,50 @@
1
+ # typed: strong
2
+
3
+ module Imagekitio
4
+ module Resources
5
+ class Webhooks
6
+ sig do
7
+ params(payload: String).returns(
8
+ T.any(
9
+ Imagekitio::VideoTransformationAcceptedEvent,
10
+ Imagekitio::VideoTransformationReadyEvent,
11
+ Imagekitio::VideoTransformationErrorEvent,
12
+ Imagekitio::UploadPreTransformSuccessEvent,
13
+ Imagekitio::UploadPreTransformErrorEvent,
14
+ Imagekitio::UploadPostTransformSuccessEvent,
15
+ Imagekitio::UploadPostTransformErrorEvent
16
+ )
17
+ )
18
+ end
19
+ def unsafe_unwrap(
20
+ # The raw webhook payload as a string
21
+ payload
22
+ )
23
+ end
24
+
25
+ sig do
26
+ params(payload: String).returns(
27
+ T.any(
28
+ Imagekitio::VideoTransformationAcceptedEvent,
29
+ Imagekitio::VideoTransformationReadyEvent,
30
+ Imagekitio::VideoTransformationErrorEvent,
31
+ Imagekitio::UploadPreTransformSuccessEvent,
32
+ Imagekitio::UploadPreTransformErrorEvent,
33
+ Imagekitio::UploadPostTransformSuccessEvent,
34
+ Imagekitio::UploadPostTransformErrorEvent
35
+ )
36
+ )
37
+ end
38
+ def unwrap(
39
+ # The raw webhook payload as a string
40
+ payload
41
+ )
42
+ end
43
+
44
+ # @api private
45
+ sig { params(client: Imagekitio::Client).returns(T.attached_class) }
46
+ def self.new(client:)
47
+ end
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,5 @@
1
+ # typed: strong
2
+
3
+ module Imagekitio
4
+ VERSION = T.let(T.unsafe(nil), String)
5
+ end
@@ -0,0 +1,47 @@
1
+ module Imagekitio
2
+ class Client < Imagekitio::Internal::Transport::BaseClient
3
+ DEFAULT_MAX_RETRIES: 2
4
+
5
+ DEFAULT_TIMEOUT_IN_SECONDS: Float
6
+
7
+ DEFAULT_INITIAL_RETRY_DELAY: Float
8
+
9
+ DEFAULT_MAX_RETRY_DELAY: Float
10
+
11
+ attr_reader private_key: String
12
+
13
+ attr_reader password: String?
14
+
15
+ attr_reader custom_metadata_fields: Imagekitio::Resources::CustomMetadataFields
16
+
17
+ attr_reader files: Imagekitio::Resources::Files
18
+
19
+ attr_reader assets: Imagekitio::Resources::Assets
20
+
21
+ attr_reader cache: Imagekitio::Resources::Cache
22
+
23
+ attr_reader folders: Imagekitio::Resources::Folders
24
+
25
+ attr_reader accounts: Imagekitio::Resources::Accounts
26
+
27
+ attr_reader beta: Imagekitio::Resources::Beta
28
+
29
+ attr_reader webhooks: Imagekitio::Resources::Webhooks
30
+
31
+ attr_reader helper: Imagekitio::Helper
32
+
33
+ private def auth_headers: -> ::Hash[String, String]
34
+
35
+ def base_url_overridden?: -> bool
36
+
37
+ def initialize: (
38
+ ?private_key: String?,
39
+ ?password: String?,
40
+ ?base_url: String?,
41
+ ?max_retries: Integer,
42
+ ?timeout: Float,
43
+ ?initial_retry_delay: Float,
44
+ ?max_retry_delay: Float
45
+ ) -> void
46
+ end
47
+ end