@lakutata/containerd 0.0.0-stage → 3.0.0-beta.1

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 (301) hide show
  1. package/LICENSE +23 -0
  2. package/README.md +409 -2
  3. package/THIRD_PARTY_NOTICES.md +310 -0
  4. package/dist/cjs/client/BuildKit.d.ts +176 -0
  5. package/dist/cjs/client/BuildKit.js +536 -0
  6. package/dist/cjs/client/BuildKitMessages.d.ts +35 -0
  7. package/dist/cjs/client/BuildKitMessages.js +123 -0
  8. package/dist/cjs/client/ContainerStore.d.ts +558 -0
  9. package/dist/cjs/client/ContainerStore.js +1384 -0
  10. package/dist/cjs/client/ContainerdClient.d.ts +244 -0
  11. package/dist/cjs/client/ContainerdClient.js +455 -0
  12. package/dist/cjs/client/DockerIgnore.d.ts +44 -0
  13. package/dist/cjs/client/DockerIgnore.js +186 -0
  14. package/dist/cjs/client/Fifo.d.ts +31 -0
  15. package/dist/cjs/client/Fifo.js +66 -0
  16. package/dist/cjs/client/ImageStore.d.ts +258 -0
  17. package/dist/cjs/client/ImageStore.js +636 -0
  18. package/dist/cjs/client/Messages.d.ts +103 -0
  19. package/dist/cjs/client/Messages.js +397 -0
  20. package/dist/cjs/client/Networks.d.ts +221 -0
  21. package/dist/cjs/client/Networks.js +630 -0
  22. package/dist/cjs/client/Platforms.d.ts +53 -0
  23. package/dist/cjs/client/Platforms.js +169 -0
  24. package/dist/cjs/client/Reference.d.ts +33 -0
  25. package/dist/cjs/client/Reference.js +70 -0
  26. package/dist/cjs/client/Registry.d.ts +145 -0
  27. package/dist/cjs/client/Registry.js +272 -0
  28. package/dist/cjs/client/Rootfs.d.ts +83 -0
  29. package/dist/cjs/client/Rootfs.js +245 -0
  30. package/dist/cjs/client/Seccomp.d.ts +36 -0
  31. package/dist/cjs/client/Seccomp.js +156 -0
  32. package/dist/cjs/client/Spec.d.ts +151 -0
  33. package/dist/cjs/client/Spec.js +227 -0
  34. package/dist/cjs/client/Volumes.d.ts +42 -0
  35. package/dist/cjs/client/Volumes.js +80 -0
  36. package/dist/cjs/containerd/Containerd.d.ts +442 -0
  37. package/dist/cjs/containerd/Containerd.js +929 -0
  38. package/dist/cjs/containerd/exceptions/ContainerdConnectionException.d.ts +9 -0
  39. package/dist/cjs/containerd/exceptions/ContainerdConnectionException.js +16 -0
  40. package/dist/cjs/containerd/exceptions/ContainerdContainerNameConflictException.d.ts +8 -0
  41. package/dist/cjs/containerd/exceptions/ContainerdContainerNameConflictException.js +15 -0
  42. package/dist/cjs/containerd/exceptions/ContainerdContainerNotFoundException.d.ts +9 -0
  43. package/dist/cjs/containerd/exceptions/ContainerdContainerNotFoundException.js +16 -0
  44. package/dist/cjs/containerd/exceptions/ContainerdContainerStateException.d.ts +10 -0
  45. package/dist/cjs/containerd/exceptions/ContainerdContainerStateException.js +17 -0
  46. package/dist/cjs/containerd/exceptions/ContainerdImageBuildException.d.ts +9 -0
  47. package/dist/cjs/containerd/exceptions/ContainerdImageBuildException.js +16 -0
  48. package/dist/cjs/containerd/exceptions/ContainerdImageExportException.d.ts +9 -0
  49. package/dist/cjs/containerd/exceptions/ContainerdImageExportException.js +16 -0
  50. package/dist/cjs/containerd/exceptions/ContainerdImageImportException.d.ts +9 -0
  51. package/dist/cjs/containerd/exceptions/ContainerdImageImportException.js +16 -0
  52. package/dist/cjs/containerd/exceptions/ContainerdImageNotFoundException.d.ts +9 -0
  53. package/dist/cjs/containerd/exceptions/ContainerdImageNotFoundException.js +16 -0
  54. package/dist/cjs/containerd/exceptions/ContainerdImagePullException.d.ts +9 -0
  55. package/dist/cjs/containerd/exceptions/ContainerdImagePullException.js +16 -0
  56. package/dist/cjs/containerd/exceptions/ContainerdImagePushException.d.ts +8 -0
  57. package/dist/cjs/containerd/exceptions/ContainerdImagePushException.js +15 -0
  58. package/dist/cjs/containerd/exceptions/ContainerdNetworkConflictException.d.ts +9 -0
  59. package/dist/cjs/containerd/exceptions/ContainerdNetworkConflictException.js +16 -0
  60. package/dist/cjs/containerd/exceptions/ContainerdNetworkNotFoundException.d.ts +9 -0
  61. package/dist/cjs/containerd/exceptions/ContainerdNetworkNotFoundException.js +16 -0
  62. package/dist/cjs/containerd/exceptions/ContainerdPathNotFoundException.d.ts +8 -0
  63. package/dist/cjs/containerd/exceptions/ContainerdPathNotFoundException.js +15 -0
  64. package/dist/cjs/containerd/exceptions/ContainerdPlatformException.d.ts +9 -0
  65. package/dist/cjs/containerd/exceptions/ContainerdPlatformException.js +16 -0
  66. package/dist/cjs/containerd/exceptions/ContainerdVolumeInUseException.d.ts +8 -0
  67. package/dist/cjs/containerd/exceptions/ContainerdVolumeInUseException.js +15 -0
  68. package/dist/cjs/containerd/exceptions/ContainerdVolumeNotFoundException.d.ts +8 -0
  69. package/dist/cjs/containerd/exceptions/ContainerdVolumeNotFoundException.js +15 -0
  70. package/dist/cjs/containerd/lib/ContainerdContainer.d.ts +292 -0
  71. package/dist/cjs/containerd/lib/ContainerdContainer.js +536 -0
  72. package/dist/cjs/containerd/lib/ContainerdContainerTTY.d.ts +116 -0
  73. package/dist/cjs/containerd/lib/ContainerdContainerTTY.js +178 -0
  74. package/dist/cjs/containerd/lib/ContainerdErrors.d.ts +6 -0
  75. package/dist/cjs/containerd/lib/ContainerdErrors.js +37 -0
  76. package/dist/cjs/containerd/lib/ContainerdImage.d.ts +149 -0
  77. package/dist/cjs/containerd/lib/ContainerdImage.js +222 -0
  78. package/dist/cjs/containerd/options/ContainerdPruneOptions.d.ts +44 -0
  79. package/dist/cjs/containerd/options/ContainerdPruneOptions.js +51 -0
  80. package/dist/cjs/containerd/options/ContainerdRegistryAuthOptions.d.ts +32 -0
  81. package/dist/cjs/containerd/options/ContainerdRegistryAuthOptions.js +45 -0
  82. package/dist/cjs/containerd/options/container/ContainerCommitOptions.d.ts +57 -0
  83. package/dist/cjs/containerd/options/container/ContainerCommitOptions.js +66 -0
  84. package/dist/cjs/containerd/options/container/ContainerCreateOptions.d.ts +273 -0
  85. package/dist/cjs/containerd/options/container/ContainerCreateOptions.js +239 -0
  86. package/dist/cjs/containerd/options/container/ContainerExecOptions.d.ts +53 -0
  87. package/dist/cjs/containerd/options/container/ContainerExecOptions.js +63 -0
  88. package/dist/cjs/containerd/options/container/ContainerExportDirectoryOptions.d.ts +32 -0
  89. package/dist/cjs/containerd/options/container/ContainerExportDirectoryOptions.js +45 -0
  90. package/dist/cjs/containerd/options/container/ContainerKillOptions.d.ts +30 -0
  91. package/dist/cjs/containerd/options/container/ContainerKillOptions.js +41 -0
  92. package/dist/cjs/containerd/options/container/ContainerLogsOptions.d.ts +34 -0
  93. package/dist/cjs/containerd/options/container/ContainerLogsOptions.js +44 -0
  94. package/dist/cjs/containerd/options/container/ContainerRemoveOptions.d.ts +22 -0
  95. package/dist/cjs/containerd/options/container/ContainerRemoveOptions.js +34 -0
  96. package/dist/cjs/containerd/options/container/ContainerResourceOptions.d.ts +63 -0
  97. package/dist/cjs/containerd/options/container/ContainerResourceOptions.js +67 -0
  98. package/dist/cjs/containerd/options/container/ContainerStopOptions.d.ts +30 -0
  99. package/dist/cjs/containerd/options/container/ContainerStopOptions.js +41 -0
  100. package/dist/cjs/containerd/options/container/ContainerTTYConsoleSizeOptions.d.ts +26 -0
  101. package/dist/cjs/containerd/options/container/ContainerTTYConsoleSizeOptions.js +40 -0
  102. package/dist/cjs/containerd/options/container/ContainerTTYOptions.d.ts +50 -0
  103. package/dist/cjs/containerd/options/container/ContainerTTYOptions.js +63 -0
  104. package/dist/cjs/containerd/options/image/ImageBuildOptions.d.ts +88 -0
  105. package/dist/cjs/containerd/options/image/ImageBuildOptions.js +95 -0
  106. package/dist/cjs/containerd/options/image/ImageExportOptions.d.ts +25 -0
  107. package/dist/cjs/containerd/options/image/ImageExportOptions.js +39 -0
  108. package/dist/cjs/containerd/options/image/ImageImportOptions.d.ts +38 -0
  109. package/dist/cjs/containerd/options/image/ImageImportOptions.js +47 -0
  110. package/dist/cjs/containerd/options/image/ImagePullOptions.d.ts +53 -0
  111. package/dist/cjs/containerd/options/image/ImagePullOptions.js +66 -0
  112. package/dist/cjs/containerd/options/image/ImagePushOptions.d.ts +44 -0
  113. package/dist/cjs/containerd/options/image/ImagePushOptions.js +58 -0
  114. package/dist/cjs/containerd/options/network/NetworkCreateOptions.d.ts +82 -0
  115. package/dist/cjs/containerd/options/network/NetworkCreateOptions.js +83 -0
  116. package/dist/cjs/containerd/options/volume/VolumeCreateOptions.d.ts +26 -0
  117. package/dist/cjs/containerd/options/volume/VolumeCreateOptions.js +40 -0
  118. package/dist/cjs/containerd/types/ContainerdBind.d.ts +28 -0
  119. package/dist/cjs/containerd/types/ContainerdBind.js +2 -0
  120. package/dist/cjs/containerd/types/ContainerdBuildOutputCallback.d.ts +6 -0
  121. package/dist/cjs/containerd/types/ContainerdBuildOutputCallback.js +2 -0
  122. package/dist/cjs/containerd/types/ContainerdContainerNetwork.d.ts +40 -0
  123. package/dist/cjs/containerd/types/ContainerdContainerNetwork.js +2 -0
  124. package/dist/cjs/containerd/types/ContainerdContainerPort.d.ts +22 -0
  125. package/dist/cjs/containerd/types/ContainerdContainerPort.js +2 -0
  126. package/dist/cjs/containerd/types/ContainerdContainerState.d.ts +42 -0
  127. package/dist/cjs/containerd/types/ContainerdContainerState.js +2 -0
  128. package/dist/cjs/containerd/types/ContainerdContainerStats.d.ts +107 -0
  129. package/dist/cjs/containerd/types/ContainerdContainerStats.js +2 -0
  130. package/dist/cjs/containerd/types/ContainerdDevice.d.ts +25 -0
  131. package/dist/cjs/containerd/types/ContainerdDevice.js +2 -0
  132. package/dist/cjs/containerd/types/ContainerdExecResult.d.ts +18 -0
  133. package/dist/cjs/containerd/types/ContainerdExecResult.js +2 -0
  134. package/dist/cjs/containerd/types/ContainerdImageConfig.d.ts +46 -0
  135. package/dist/cjs/containerd/types/ContainerdImageConfig.js +2 -0
  136. package/dist/cjs/containerd/types/ContainerdNetworkInfo.d.ts +49 -0
  137. package/dist/cjs/containerd/types/ContainerdNetworkInfo.js +2 -0
  138. package/dist/cjs/containerd/types/ContainerdProgressCallback.d.ts +29 -0
  139. package/dist/cjs/containerd/types/ContainerdProgressCallback.js +2 -0
  140. package/dist/cjs/containerd/types/ContainerdPruneResult.d.ts +21 -0
  141. package/dist/cjs/containerd/types/ContainerdPruneResult.js +2 -0
  142. package/dist/cjs/containerd/types/ContainerdRestartPolicy.d.ts +13 -0
  143. package/dist/cjs/containerd/types/ContainerdRestartPolicy.js +2 -0
  144. package/dist/cjs/containerd/types/ContainerdTmpfs.d.ts +20 -0
  145. package/dist/cjs/containerd/types/ContainerdTmpfs.js +2 -0
  146. package/dist/cjs/containerd/types/ContainerdVolume.d.ts +19 -0
  147. package/dist/cjs/containerd/types/ContainerdVolume.js +2 -0
  148. package/dist/cjs/containerd/types/ContainerdVolumeInfo.d.ts +26 -0
  149. package/dist/cjs/containerd/types/ContainerdVolumeInfo.js +2 -0
  150. package/dist/cjs/exports/Containerd.d.ts +69 -0
  151. package/dist/cjs/exports/Containerd.js +87 -0
  152. package/dist/cjs/package.json +1 -0
  153. package/dist/esm/client/BuildKit.js +488 -0
  154. package/dist/esm/client/BuildKitMessages.js +120 -0
  155. package/dist/esm/client/ContainerStore.js +1339 -0
  156. package/dist/esm/client/ContainerdClient.js +416 -0
  157. package/dist/esm/client/DockerIgnore.js +179 -0
  158. package/dist/esm/client/Fifo.js +59 -0
  159. package/dist/esm/client/ImageStore.js +628 -0
  160. package/dist/esm/client/Messages.js +393 -0
  161. package/dist/esm/client/Networks.js +621 -0
  162. package/dist/esm/client/Platforms.js +156 -0
  163. package/dist/esm/client/Reference.js +66 -0
  164. package/dist/esm/client/Registry.js +263 -0
  165. package/dist/esm/client/Rootfs.js +234 -0
  166. package/dist/esm/client/Seccomp.js +152 -0
  167. package/dist/esm/client/Spec.js +220 -0
  168. package/dist/esm/client/Volumes.js +73 -0
  169. package/dist/esm/containerd/Containerd.js +923 -0
  170. package/dist/esm/containerd/exceptions/ContainerdConnectionException.js +12 -0
  171. package/dist/esm/containerd/exceptions/ContainerdContainerNameConflictException.js +11 -0
  172. package/dist/esm/containerd/exceptions/ContainerdContainerNotFoundException.js +12 -0
  173. package/dist/esm/containerd/exceptions/ContainerdContainerStateException.js +13 -0
  174. package/dist/esm/containerd/exceptions/ContainerdImageBuildException.js +12 -0
  175. package/dist/esm/containerd/exceptions/ContainerdImageExportException.js +12 -0
  176. package/dist/esm/containerd/exceptions/ContainerdImageImportException.js +12 -0
  177. package/dist/esm/containerd/exceptions/ContainerdImageNotFoundException.js +12 -0
  178. package/dist/esm/containerd/exceptions/ContainerdImagePullException.js +12 -0
  179. package/dist/esm/containerd/exceptions/ContainerdImagePushException.js +11 -0
  180. package/dist/esm/containerd/exceptions/ContainerdNetworkConflictException.js +12 -0
  181. package/dist/esm/containerd/exceptions/ContainerdNetworkNotFoundException.js +12 -0
  182. package/dist/esm/containerd/exceptions/ContainerdPathNotFoundException.js +11 -0
  183. package/dist/esm/containerd/exceptions/ContainerdPlatformException.js +12 -0
  184. package/dist/esm/containerd/exceptions/ContainerdVolumeInUseException.js +11 -0
  185. package/dist/esm/containerd/exceptions/ContainerdVolumeNotFoundException.js +11 -0
  186. package/dist/esm/containerd/lib/ContainerdContainer.js +533 -0
  187. package/dist/esm/containerd/lib/ContainerdContainerTTY.js +175 -0
  188. package/dist/esm/containerd/lib/ContainerdErrors.js +34 -0
  189. package/dist/esm/containerd/lib/ContainerdImage.js +219 -0
  190. package/dist/esm/containerd/options/ContainerdPruneOptions.js +47 -0
  191. package/dist/esm/containerd/options/ContainerdRegistryAuthOptions.js +41 -0
  192. package/dist/esm/containerd/options/container/ContainerCommitOptions.js +62 -0
  193. package/dist/esm/containerd/options/container/ContainerCreateOptions.js +235 -0
  194. package/dist/esm/containerd/options/container/ContainerExecOptions.js +59 -0
  195. package/dist/esm/containerd/options/container/ContainerExportDirectoryOptions.js +41 -0
  196. package/dist/esm/containerd/options/container/ContainerKillOptions.js +37 -0
  197. package/dist/esm/containerd/options/container/ContainerLogsOptions.js +40 -0
  198. package/dist/esm/containerd/options/container/ContainerRemoveOptions.js +30 -0
  199. package/dist/esm/containerd/options/container/ContainerResourceOptions.js +63 -0
  200. package/dist/esm/containerd/options/container/ContainerStopOptions.js +37 -0
  201. package/dist/esm/containerd/options/container/ContainerTTYConsoleSizeOptions.js +36 -0
  202. package/dist/esm/containerd/options/container/ContainerTTYOptions.js +59 -0
  203. package/dist/esm/containerd/options/image/ImageBuildOptions.js +91 -0
  204. package/dist/esm/containerd/options/image/ImageExportOptions.js +35 -0
  205. package/dist/esm/containerd/options/image/ImageImportOptions.js +43 -0
  206. package/dist/esm/containerd/options/image/ImagePullOptions.js +62 -0
  207. package/dist/esm/containerd/options/image/ImagePushOptions.js +54 -0
  208. package/dist/esm/containerd/options/network/NetworkCreateOptions.js +79 -0
  209. package/dist/esm/containerd/options/volume/VolumeCreateOptions.js +36 -0
  210. package/dist/esm/containerd/types/ContainerdBind.js +1 -0
  211. package/dist/esm/containerd/types/ContainerdBuildOutputCallback.js +1 -0
  212. package/dist/esm/containerd/types/ContainerdContainerNetwork.js +1 -0
  213. package/dist/esm/containerd/types/ContainerdContainerPort.js +1 -0
  214. package/dist/esm/containerd/types/ContainerdContainerState.js +1 -0
  215. package/dist/esm/containerd/types/ContainerdContainerStats.js +1 -0
  216. package/dist/esm/containerd/types/ContainerdDevice.js +1 -0
  217. package/dist/esm/containerd/types/ContainerdExecResult.js +1 -0
  218. package/dist/esm/containerd/types/ContainerdImageConfig.js +1 -0
  219. package/dist/esm/containerd/types/ContainerdNetworkInfo.js +1 -0
  220. package/dist/esm/containerd/types/ContainerdProgressCallback.js +1 -0
  221. package/dist/esm/containerd/types/ContainerdPruneResult.js +1 -0
  222. package/dist/esm/containerd/types/ContainerdRestartPolicy.js +1 -0
  223. package/dist/esm/containerd/types/ContainerdTmpfs.js +1 -0
  224. package/dist/esm/containerd/types/ContainerdVolume.js +1 -0
  225. package/dist/esm/containerd/types/ContainerdVolumeInfo.js +1 -0
  226. package/dist/esm/exports/Containerd.js +68 -0
  227. package/dist/types/client/BuildKit.d.ts +176 -0
  228. package/dist/types/client/BuildKitMessages.d.ts +35 -0
  229. package/dist/types/client/ContainerStore.d.ts +558 -0
  230. package/dist/types/client/ContainerdClient.d.ts +244 -0
  231. package/dist/types/client/DockerIgnore.d.ts +44 -0
  232. package/dist/types/client/Fifo.d.ts +31 -0
  233. package/dist/types/client/ImageStore.d.ts +258 -0
  234. package/dist/types/client/Messages.d.ts +103 -0
  235. package/dist/types/client/Networks.d.ts +221 -0
  236. package/dist/types/client/Platforms.d.ts +53 -0
  237. package/dist/types/client/Reference.d.ts +33 -0
  238. package/dist/types/client/Registry.d.ts +145 -0
  239. package/dist/types/client/Rootfs.d.ts +83 -0
  240. package/dist/types/client/Seccomp.d.ts +36 -0
  241. package/dist/types/client/Spec.d.ts +151 -0
  242. package/dist/types/client/Volumes.d.ts +42 -0
  243. package/dist/types/containerd/Containerd.d.ts +442 -0
  244. package/dist/types/containerd/exceptions/ContainerdConnectionException.d.ts +9 -0
  245. package/dist/types/containerd/exceptions/ContainerdContainerNameConflictException.d.ts +8 -0
  246. package/dist/types/containerd/exceptions/ContainerdContainerNotFoundException.d.ts +9 -0
  247. package/dist/types/containerd/exceptions/ContainerdContainerStateException.d.ts +10 -0
  248. package/dist/types/containerd/exceptions/ContainerdImageBuildException.d.ts +9 -0
  249. package/dist/types/containerd/exceptions/ContainerdImageExportException.d.ts +9 -0
  250. package/dist/types/containerd/exceptions/ContainerdImageImportException.d.ts +9 -0
  251. package/dist/types/containerd/exceptions/ContainerdImageNotFoundException.d.ts +9 -0
  252. package/dist/types/containerd/exceptions/ContainerdImagePullException.d.ts +9 -0
  253. package/dist/types/containerd/exceptions/ContainerdImagePushException.d.ts +8 -0
  254. package/dist/types/containerd/exceptions/ContainerdNetworkConflictException.d.ts +9 -0
  255. package/dist/types/containerd/exceptions/ContainerdNetworkNotFoundException.d.ts +9 -0
  256. package/dist/types/containerd/exceptions/ContainerdPathNotFoundException.d.ts +8 -0
  257. package/dist/types/containerd/exceptions/ContainerdPlatformException.d.ts +9 -0
  258. package/dist/types/containerd/exceptions/ContainerdVolumeInUseException.d.ts +8 -0
  259. package/dist/types/containerd/exceptions/ContainerdVolumeNotFoundException.d.ts +8 -0
  260. package/dist/types/containerd/lib/ContainerdContainer.d.ts +292 -0
  261. package/dist/types/containerd/lib/ContainerdContainerTTY.d.ts +116 -0
  262. package/dist/types/containerd/lib/ContainerdErrors.d.ts +6 -0
  263. package/dist/types/containerd/lib/ContainerdImage.d.ts +149 -0
  264. package/dist/types/containerd/options/ContainerdPruneOptions.d.ts +44 -0
  265. package/dist/types/containerd/options/ContainerdRegistryAuthOptions.d.ts +32 -0
  266. package/dist/types/containerd/options/container/ContainerCommitOptions.d.ts +57 -0
  267. package/dist/types/containerd/options/container/ContainerCreateOptions.d.ts +273 -0
  268. package/dist/types/containerd/options/container/ContainerExecOptions.d.ts +53 -0
  269. package/dist/types/containerd/options/container/ContainerExportDirectoryOptions.d.ts +32 -0
  270. package/dist/types/containerd/options/container/ContainerKillOptions.d.ts +30 -0
  271. package/dist/types/containerd/options/container/ContainerLogsOptions.d.ts +34 -0
  272. package/dist/types/containerd/options/container/ContainerRemoveOptions.d.ts +22 -0
  273. package/dist/types/containerd/options/container/ContainerResourceOptions.d.ts +63 -0
  274. package/dist/types/containerd/options/container/ContainerStopOptions.d.ts +30 -0
  275. package/dist/types/containerd/options/container/ContainerTTYConsoleSizeOptions.d.ts +26 -0
  276. package/dist/types/containerd/options/container/ContainerTTYOptions.d.ts +50 -0
  277. package/dist/types/containerd/options/image/ImageBuildOptions.d.ts +88 -0
  278. package/dist/types/containerd/options/image/ImageExportOptions.d.ts +25 -0
  279. package/dist/types/containerd/options/image/ImageImportOptions.d.ts +38 -0
  280. package/dist/types/containerd/options/image/ImagePullOptions.d.ts +53 -0
  281. package/dist/types/containerd/options/image/ImagePushOptions.d.ts +44 -0
  282. package/dist/types/containerd/options/network/NetworkCreateOptions.d.ts +82 -0
  283. package/dist/types/containerd/options/volume/VolumeCreateOptions.d.ts +26 -0
  284. package/dist/types/containerd/types/ContainerdBind.d.ts +28 -0
  285. package/dist/types/containerd/types/ContainerdBuildOutputCallback.d.ts +6 -0
  286. package/dist/types/containerd/types/ContainerdContainerNetwork.d.ts +40 -0
  287. package/dist/types/containerd/types/ContainerdContainerPort.d.ts +22 -0
  288. package/dist/types/containerd/types/ContainerdContainerState.d.ts +42 -0
  289. package/dist/types/containerd/types/ContainerdContainerStats.d.ts +107 -0
  290. package/dist/types/containerd/types/ContainerdDevice.d.ts +25 -0
  291. package/dist/types/containerd/types/ContainerdExecResult.d.ts +18 -0
  292. package/dist/types/containerd/types/ContainerdImageConfig.d.ts +46 -0
  293. package/dist/types/containerd/types/ContainerdNetworkInfo.d.ts +49 -0
  294. package/dist/types/containerd/types/ContainerdProgressCallback.d.ts +29 -0
  295. package/dist/types/containerd/types/ContainerdPruneResult.d.ts +21 -0
  296. package/dist/types/containerd/types/ContainerdRestartPolicy.d.ts +13 -0
  297. package/dist/types/containerd/types/ContainerdTmpfs.d.ts +20 -0
  298. package/dist/types/containerd/types/ContainerdVolume.d.ts +19 -0
  299. package/dist/types/containerd/types/ContainerdVolumeInfo.d.ts +26 -0
  300. package/dist/types/exports/Containerd.d.ts +69 -0
  301. package/package.json +51 -4
@@ -0,0 +1,239 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.ContainerCreateOptions = void 0;
13
+ const core_1 = require("@lakutata/core");
14
+ const dto_1 = require("@lakutata/core/decorator/dto");
15
+ /**
16
+ * The settings of a container created by {@link Containerd.createContainer}: its image, its process, its mounts, its
17
+ * networks, its resources and its security. Only `image` is required; the container is created stopped (`start()` it)
18
+ * as a nerdctl container (`nerdctl ps` lists it), with an OCI runtime specification built as nerdctl builds it. The
19
+ * component keeps these settings: {@link ContainerdContainer.update} creates the container again with the ones it
20
+ * changes.
21
+ *
22
+ * As with the Docker component, the container joins the default network `bridge` unless `network` or `networks` is
23
+ * given (here a CNI network, the CNI plugins needed); its ports are published only on a CNI network, and its named volumes are directories the component keeps (not Docker's nor
24
+ * nerdctl's volumes).
25
+ * @example
26
+ * ```typescript
27
+ * import {Containerd} from 'lakutata/com/containerd'
28
+ *
29
+ * declare const containerd: Containerd
30
+ *
31
+ * await containerd.pullImage({image: 'nginx:1.27'})
32
+ * const container = await containerd.createContainer({
33
+ * image: 'nginx:1.27',
34
+ * name: 'web',
35
+ * env: {NGINX_PORT: '80'},
36
+ * binds: [{hostPath: '/srv/www', containerPath: '/usr/share/nginx/html', rw: false}],
37
+ * volumes: [{volumeName: 'web-cache', containerPath: '/var/cache/nginx'}],
38
+ * //The default nerdctl network, its port 80 published on the host port 8080
39
+ * networks: [{networkName: 'bridge'}],
40
+ * ports: [{port: 80, hostPorts: [8080]}],
41
+ * memoryLimit: 256 * 1024 * 1024,
42
+ * cpus: 0.5,
43
+ * restartPolicy: 'unless-stopped'
44
+ * })
45
+ * await container.start()
46
+ * ```
47
+ */
48
+ class ContainerCreateOptions extends core_1.DTO {
49
+ }
50
+ exports.ContainerCreateOptions = ContainerCreateOptions;
51
+ __decorate([
52
+ (0, dto_1.Expect)(core_1.DTO.String().required()),
53
+ __metadata("design:type", String)
54
+ ], ContainerCreateOptions.prototype, "image", void 0);
55
+ __decorate([
56
+ (0, dto_1.Expect)(core_1.DTO.String().optional()),
57
+ __metadata("design:type", String)
58
+ ], ContainerCreateOptions.prototype, "platform", void 0);
59
+ __decorate([
60
+ (0, dto_1.Expect)(core_1.DTO.String().pattern(/^[a-zA-Z0-9][a-zA-Z0-9_.-]*$/).optional()),
61
+ __metadata("design:type", String)
62
+ ], ContainerCreateOptions.prototype, "name", void 0);
63
+ __decorate([
64
+ (0, dto_1.Expect)(core_1.DTO.String().optional()),
65
+ __metadata("design:type", String)
66
+ ], ContainerCreateOptions.prototype, "hostname", void 0);
67
+ __decorate([
68
+ (0, dto_1.Expect)(core_1.DTO.Array(core_1.DTO.String()).optional()),
69
+ __metadata("design:type", Array)
70
+ ], ContainerCreateOptions.prototype, "cmd", void 0);
71
+ __decorate([
72
+ (0, dto_1.Expect)(core_1.DTO.Array(core_1.DTO.String()).optional()),
73
+ __metadata("design:type", Array)
74
+ ], ContainerCreateOptions.prototype, "entrypoint", void 0);
75
+ __decorate([
76
+ (0, dto_1.Expect)(core_1.DTO.Object().pattern(core_1.DTO.String(), core_1.DTO.String().allow('')).optional()),
77
+ __metadata("design:type", Object)
78
+ ], ContainerCreateOptions.prototype, "env", void 0);
79
+ __decorate([
80
+ (0, dto_1.Expect)(core_1.DTO.String().optional()),
81
+ __metadata("design:type", String)
82
+ ], ContainerCreateOptions.prototype, "workingDir", void 0);
83
+ __decorate([
84
+ (0, dto_1.Expect)(core_1.DTO.String().optional()),
85
+ __metadata("design:type", String)
86
+ ], ContainerCreateOptions.prototype, "user", void 0);
87
+ __decorate([
88
+ (0, dto_1.Expect)(core_1.DTO.Object().pattern(core_1.DTO.String(), core_1.DTO.String().allow('')).optional()),
89
+ __metadata("design:type", Object)
90
+ ], ContainerCreateOptions.prototype, "labels", void 0);
91
+ __decorate([
92
+ (0, dto_1.Expect)(core_1.DTO.Boolean().optional()),
93
+ __metadata("design:type", Boolean)
94
+ ], ContainerCreateOptions.prototype, "privileged", void 0);
95
+ __decorate([
96
+ (0, dto_1.Expect)(core_1.DTO.Boolean().optional()),
97
+ __metadata("design:type", Boolean)
98
+ ], ContainerCreateOptions.prototype, "readonlyRootfs", void 0);
99
+ __decorate([
100
+ (0, dto_1.Expect)(core_1.DTO.Array(core_1.DTO.String()).optional()),
101
+ __metadata("design:type", Array)
102
+ ], ContainerCreateOptions.prototype, "capabilities", void 0);
103
+ __decorate([
104
+ (0, dto_1.Expect)(core_1.DTO.Array(core_1.DTO.String()).optional()),
105
+ __metadata("design:type", Array)
106
+ ], ContainerCreateOptions.prototype, "capabilitiesDrop", void 0);
107
+ __decorate([
108
+ (0, dto_1.Expect)(core_1.DTO.String().optional().default('default')),
109
+ __metadata("design:type", String)
110
+ ], ContainerCreateOptions.prototype, "seccompProfile", void 0);
111
+ __decorate([
112
+ (0, dto_1.Expect)(core_1.DTO.Array(core_1.DTO.Object({
113
+ hostPath: core_1.DTO.String().required(),
114
+ containerPath: core_1.DTO.String().required(),
115
+ rw: core_1.DTO.Boolean().optional().default(true),
116
+ propagation: core_1.DTO.String().valid('private', 'rprivate', 'shared', 'rshared', 'slave', 'rslave').optional()
117
+ })).optional()),
118
+ __metadata("design:type", Array)
119
+ ], ContainerCreateOptions.prototype, "binds", void 0);
120
+ __decorate([
121
+ (0, dto_1.Expect)(core_1.DTO.Array(core_1.DTO.Object({
122
+ volumeName: core_1.DTO.String().pattern(/^[a-zA-Z0-9][a-zA-Z0-9_.-]*$/).required(),
123
+ containerPath: core_1.DTO.String().required(),
124
+ readonly: core_1.DTO.Boolean().optional()
125
+ })).optional()),
126
+ __metadata("design:type", Array)
127
+ ], ContainerCreateOptions.prototype, "volumes", void 0);
128
+ __decorate([
129
+ (0, dto_1.Expect)(core_1.DTO.Array(core_1.DTO.Object({
130
+ containerPath: core_1.DTO.String().required(),
131
+ size: core_1.DTO.Number().integer().positive().optional(),
132
+ mode: core_1.DTO.String().pattern(/^[0-7]{3,4}$/).optional()
133
+ })).optional()),
134
+ __metadata("design:type", Array)
135
+ ], ContainerCreateOptions.prototype, "tmpfs", void 0);
136
+ __decorate([
137
+ (0, dto_1.Expect)(core_1.DTO.Array(core_1.DTO.Object({
138
+ hostPath: core_1.DTO.String().required(),
139
+ containerPath: core_1.DTO.String().optional(),
140
+ cgroupPermissions: core_1.DTO.String().pattern(/^(?!.*(.).*\1)[rwm]{1,3}$/).optional().default('rwm')
141
+ })).optional()),
142
+ __metadata("design:type", Array)
143
+ ], ContainerCreateOptions.prototype, "devices", void 0);
144
+ __decorate([
145
+ (0, dto_1.Expect)(core_1.DTO.Array(core_1.DTO.String().pattern(/^[acb] (\*|\d+):(\*|\d+) (?!.*(.).*\3)[rwm]{1,3}$/)).optional()),
146
+ __metadata("design:type", Array)
147
+ ], ContainerCreateOptions.prototype, "deviceCgroupRules", void 0);
148
+ __decorate([
149
+ (0, dto_1.Expect)(core_1.DTO.String().valid('host', 'none').optional()),
150
+ __metadata("design:type", String)
151
+ ], ContainerCreateOptions.prototype, "network", void 0);
152
+ __decorate([
153
+ (0, dto_1.Expect)(core_1.DTO.Array(core_1.DTO.Object({
154
+ networkName: core_1.DTO.String().required(),
155
+ ip: core_1.DTO.String().allow('').ip({ version: 'ipv4' }).optional(),
156
+ ipv6: core_1.DTO.String().allow('').ip({ version: 'ipv6' }).optional()
157
+ })).optional()),
158
+ __metadata("design:type", Array)
159
+ ], ContainerCreateOptions.prototype, "networks", void 0);
160
+ __decorate([
161
+ (0, dto_1.Expect)(core_1.DTO.Array(core_1.DTO.Object({
162
+ port: core_1.DTO.Number().port().required(),
163
+ type: core_1.DTO.String().valid('tcp', 'udp', 'sctp').optional().default('tcp'),
164
+ hostPorts: core_1.DTO.Array(core_1.DTO.Number().port()).min(1).required(),
165
+ hostIP: core_1.DTO.String().ip().optional()
166
+ })).optional()),
167
+ __metadata("design:type", Array)
168
+ ], ContainerCreateOptions.prototype, "ports", void 0);
169
+ __decorate([
170
+ (0, dto_1.Expect)(core_1.DTO.String().valid('host').optional()),
171
+ __metadata("design:type", String)
172
+ ], ContainerCreateOptions.prototype, "pidMode", void 0);
173
+ __decorate([
174
+ (0, dto_1.Expect)(core_1.DTO.String().valid('host').optional()),
175
+ __metadata("design:type", String)
176
+ ], ContainerCreateOptions.prototype, "ipcMode", void 0);
177
+ __decorate([
178
+ (0, dto_1.Expect)(core_1.DTO.String().valid('private', 'host').optional().default('private')),
179
+ __metadata("design:type", String)
180
+ ], ContainerCreateOptions.prototype, "cgroupns", void 0);
181
+ __decorate([
182
+ (0, dto_1.Expect)(core_1.DTO.Number().integer().min(0).optional()),
183
+ __metadata("design:type", Number)
184
+ ], ContainerCreateOptions.prototype, "memoryLimit", void 0);
185
+ __decorate([
186
+ (0, dto_1.Expect)(core_1.DTO.Number().integer().min(-1).optional().custom((value, helpers) => {
187
+ const memoryLimit = helpers.state.ancestors?.[0]?.memoryLimit;
188
+ if (value > 0 && !memoryLimit)
189
+ return helpers.message({ custom: '"memorySwap" needs "memoryLimit"' });
190
+ if (value > 0 && value < memoryLimit)
191
+ return helpers.message({ custom: '"memorySwap" (the memory and the swap) must be at least "memoryLimit"' });
192
+ return value;
193
+ }, 'Swap Limit Validation')),
194
+ __metadata("design:type", Number)
195
+ ], ContainerCreateOptions.prototype, "memorySwap", void 0);
196
+ __decorate([
197
+ (0, dto_1.Expect)(core_1.DTO.Number().positive().optional()),
198
+ __metadata("design:type", Number)
199
+ ], ContainerCreateOptions.prototype, "cpus", void 0);
200
+ __decorate([
201
+ (0, dto_1.Expect)(core_1.DTO.Number().integer().positive().optional()),
202
+ __metadata("design:type", Number)
203
+ ], ContainerCreateOptions.prototype, "cpuShares", void 0);
204
+ __decorate([
205
+ (0, dto_1.Expect)(core_1.DTO.Array(core_1.DTO.Number().integer().min(0)).optional()),
206
+ __metadata("design:type", Array)
207
+ ], ContainerCreateOptions.prototype, "cpuSet", void 0);
208
+ __decorate([
209
+ (0, dto_1.Expect)(core_1.DTO.Number().integer().positive().optional()),
210
+ __metadata("design:type", Number)
211
+ ], ContainerCreateOptions.prototype, "pidsLimit", void 0);
212
+ __decorate([
213
+ (0, dto_1.Expect)(core_1.DTO.Boolean().optional()),
214
+ __metadata("design:type", Boolean)
215
+ ], ContainerCreateOptions.prototype, "OOMKillDisable", void 0);
216
+ __decorate([
217
+ (0, dto_1.Expect)(core_1.DTO.Object().pattern(core_1.DTO.String(), core_1.DTO.String()).optional()),
218
+ __metadata("design:type", Object)
219
+ ], ContainerCreateOptions.prototype, "sysctls", void 0);
220
+ __decorate([
221
+ (0, dto_1.Expect)(core_1.DTO.Number().integer().positive().optional()),
222
+ __metadata("design:type", Number)
223
+ ], ContainerCreateOptions.prototype, "shmSize", void 0);
224
+ __decorate([
225
+ (0, dto_1.Expect)(core_1.DTO.String().allow('').pattern(/^(no|always|unless-stopped|on-failure(:\d+)?)$/).optional()),
226
+ __metadata("design:type", String)
227
+ ], ContainerCreateOptions.prototype, "restartPolicy", void 0);
228
+ __decorate([
229
+ (0, dto_1.Expect)(core_1.DTO.String().optional()),
230
+ __metadata("design:type", String)
231
+ ], ContainerCreateOptions.prototype, "stopSignal", void 0);
232
+ __decorate([
233
+ (0, dto_1.Expect)(core_1.DTO.Object().pattern(core_1.DTO.String(), core_1.DTO.String().ip()).optional()),
234
+ __metadata("design:type", Object)
235
+ ], ContainerCreateOptions.prototype, "extraHosts", void 0);
236
+ __decorate([
237
+ (0, dto_1.Expect)(core_1.DTO.Array(core_1.DTO.String().ip()).optional()),
238
+ __metadata("design:type", Array)
239
+ ], ContainerCreateOptions.prototype, "dns", void 0);
@@ -0,0 +1,53 @@
1
+ import { DTO } from '@lakutata/core';
2
+ /**
3
+ * A command {@link ContainerdContainer.exec} runs in a running container (else it throws
4
+ * {@link ContainerdContainerStateException}), waiting for its exit and capturing its output in memory. Only `cmd` is
5
+ * required; the process gets the container's settings (environment, user, capabilities) unless changed here.
6
+ * Separating its standard error and giving it a standard input use FIFOs (`mkfifo` on the host). Unlike the Docker
7
+ * component's options, a string `cmd` is run by a shell, the process can get an environment, a user, a standard input
8
+ * and a timeout, and the result holds the exit code and the two outputs apart.
9
+ * @example
10
+ * ```typescript
11
+ * import {Containerd} from 'lakutata/com/containerd'
12
+ *
13
+ * declare const containerd: Containerd
14
+ *
15
+ * const container = await containerd.getContainer('db')
16
+ * const result = await container.exec({
17
+ * cmd: ['psql', '-U', 'postgres', '-f', '-'],
18
+ * stdin: 'SELECT 1;',
19
+ * timeout: 30000
20
+ * })
21
+ * if (result.exitCode !== 0) console.error(result.stderr)
22
+ * ```
23
+ */
24
+ export declare class ContainerExecOptions extends DTO {
25
+ /**
26
+ * The command: its arguments (`['ls', '-la', '/data']`, at least one), or a command line run by `/bin/sh -c`
27
+ * (`'ls -la /data | wc -l'`), which needs a shell in the container. Required.
28
+ */
29
+ cmd: string | string[];
30
+ /**
31
+ * Its environment variables, added to the container's ones (and replacing them by name).
32
+ */
33
+ env?: Record<string, string>;
34
+ /**
35
+ * Its working directory; the container's one by default.
36
+ */
37
+ workingDir?: string;
38
+ /**
39
+ * Its user: `'user'`, `'user:group'`, `'uid'` or `'uid:gid'`, the names resolved by the container's `/etc/passwd`
40
+ * and `/etc/group`; the container's user by default.
41
+ */
42
+ user?: string;
43
+ /**
44
+ * The data written to its standard input, which is closed after it. Without it, the process has no standard input.
45
+ * Needs `mkfifo` on the host.
46
+ */
47
+ stdin?: string | Buffer;
48
+ /**
49
+ * The milliseconds it may run, a positive integer: it is then killed (`SIGKILL`) and the result has its exit code
50
+ * (`137`) and its output so far. No limit by default.
51
+ */
52
+ timeout?: number;
53
+ }
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.ContainerExecOptions = void 0;
13
+ const core_1 = require("@lakutata/core");
14
+ const dto_1 = require("@lakutata/core/decorator/dto");
15
+ /**
16
+ * A command {@link ContainerdContainer.exec} runs in a running container (else it throws
17
+ * {@link ContainerdContainerStateException}), waiting for its exit and capturing its output in memory. Only `cmd` is
18
+ * required; the process gets the container's settings (environment, user, capabilities) unless changed here.
19
+ * Separating its standard error and giving it a standard input use FIFOs (`mkfifo` on the host). Unlike the Docker
20
+ * component's options, a string `cmd` is run by a shell, the process can get an environment, a user, a standard input
21
+ * and a timeout, and the result holds the exit code and the two outputs apart.
22
+ * @example
23
+ * ```typescript
24
+ * import {Containerd} from 'lakutata/com/containerd'
25
+ *
26
+ * declare const containerd: Containerd
27
+ *
28
+ * const container = await containerd.getContainer('db')
29
+ * const result = await container.exec({
30
+ * cmd: ['psql', '-U', 'postgres', '-f', '-'],
31
+ * stdin: 'SELECT 1;',
32
+ * timeout: 30000
33
+ * })
34
+ * if (result.exitCode !== 0) console.error(result.stderr)
35
+ * ```
36
+ */
37
+ class ContainerExecOptions extends core_1.DTO {
38
+ }
39
+ exports.ContainerExecOptions = ContainerExecOptions;
40
+ __decorate([
41
+ (0, dto_1.Expect)(core_1.DTO.Alternatives(core_1.DTO.String(), core_1.DTO.Array(core_1.DTO.String()).min(1)).required()),
42
+ __metadata("design:type", Object)
43
+ ], ContainerExecOptions.prototype, "cmd", void 0);
44
+ __decorate([
45
+ (0, dto_1.Expect)(core_1.DTO.Object().pattern(core_1.DTO.String(), core_1.DTO.String().allow('')).optional()),
46
+ __metadata("design:type", Object)
47
+ ], ContainerExecOptions.prototype, "env", void 0);
48
+ __decorate([
49
+ (0, dto_1.Expect)(core_1.DTO.String().optional()),
50
+ __metadata("design:type", String)
51
+ ], ContainerExecOptions.prototype, "workingDir", void 0);
52
+ __decorate([
53
+ (0, dto_1.Expect)(core_1.DTO.String().optional()),
54
+ __metadata("design:type", String)
55
+ ], ContainerExecOptions.prototype, "user", void 0);
56
+ __decorate([
57
+ (0, dto_1.Expect)(core_1.DTO.Alternatives(core_1.DTO.String().allow(''), core_1.DTO.Binary()).optional()),
58
+ __metadata("design:type", Object)
59
+ ], ContainerExecOptions.prototype, "stdin", void 0);
60
+ __decorate([
61
+ (0, dto_1.Expect)(core_1.DTO.Number().integer().positive().optional()),
62
+ __metadata("design:type", Number)
63
+ ], ContainerExecOptions.prototype, "timeout", void 0);
@@ -0,0 +1,32 @@
1
+ import { DTO } from '@lakutata/core';
2
+ /**
3
+ * What {@link ContainerdContainer.exportDirectory} archives (as tar) and where. A running container is read through
4
+ * its process root (its mounts included), a stopped one from its snapshot (its image layers and its changes, without
5
+ * its mounts). The directories, regular files and symbolic links are archived with their modes, owners and times; the
6
+ * devices, sockets and pipes are skipped. Both fields are required.
7
+ * @example
8
+ * ```typescript
9
+ * import {createWriteStream} from 'node:fs'
10
+ * import {Containerd} from 'lakutata/com/containerd'
11
+ *
12
+ * declare const containerd: Containerd
13
+ *
14
+ * const container = await containerd.getContainer('web')
15
+ * //Into a file
16
+ * await container.exportDirectory({path: '/etc/nginx', destination: '/tmp/nginx-config.tar'})
17
+ * //Into a stream
18
+ * await container.exportDirectory({path: '/var/log/nginx', destination: createWriteStream('/tmp/nginx-logs.tar')})
19
+ * ```
20
+ */
21
+ export declare class ContainerExportDirectoryOptions extends DTO {
22
+ /**
23
+ * The absolute path in the container of the directory or file archived, its symbolic links resolved in the
24
+ * container; it is the archive's top entry, named by its base name. A missing path fails the export.
25
+ */
26
+ path: string;
27
+ /**
28
+ * Where the tar archive is written: the path of a host file (created or replaced), or a writable stream, ended
29
+ * once the archive is written.
30
+ */
31
+ destination: string | NodeJS.WritableStream;
32
+ }
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.ContainerExportDirectoryOptions = void 0;
13
+ const core_1 = require("@lakutata/core");
14
+ const dto_1 = require("@lakutata/core/decorator/dto");
15
+ const node_stream_1 = require("node:stream");
16
+ /**
17
+ * What {@link ContainerdContainer.exportDirectory} archives (as tar) and where. A running container is read through
18
+ * its process root (its mounts included), a stopped one from its snapshot (its image layers and its changes, without
19
+ * its mounts). The directories, regular files and symbolic links are archived with their modes, owners and times; the
20
+ * devices, sockets and pipes are skipped. Both fields are required.
21
+ * @example
22
+ * ```typescript
23
+ * import {createWriteStream} from 'node:fs'
24
+ * import {Containerd} from 'lakutata/com/containerd'
25
+ *
26
+ * declare const containerd: Containerd
27
+ *
28
+ * const container = await containerd.getContainer('web')
29
+ * //Into a file
30
+ * await container.exportDirectory({path: '/etc/nginx', destination: '/tmp/nginx-config.tar'})
31
+ * //Into a stream
32
+ * await container.exportDirectory({path: '/var/log/nginx', destination: createWriteStream('/tmp/nginx-logs.tar')})
33
+ * ```
34
+ */
35
+ class ContainerExportDirectoryOptions extends core_1.DTO {
36
+ }
37
+ exports.ContainerExportDirectoryOptions = ContainerExportDirectoryOptions;
38
+ __decorate([
39
+ (0, dto_1.Expect)(core_1.DTO.String().required()),
40
+ __metadata("design:type", String)
41
+ ], ContainerExportDirectoryOptions.prototype, "path", void 0);
42
+ __decorate([
43
+ (0, dto_1.Expect)(core_1.DTO.Alternatives(core_1.DTO.String(), core_1.DTO.InstanceOf(node_stream_1.Stream)).required()),
44
+ __metadata("design:type", Object)
45
+ ], ContainerExportDirectoryOptions.prototype, "destination", void 0);
@@ -0,0 +1,30 @@
1
+ import { DTO } from '@lakutata/core';
2
+ /**
3
+ * The signal {@link ContainerdContainer.kill} sends to a running container, without waiting for it to exit. Every
4
+ * field is optional. A `SIGKILL` also tells containerd's restart monitor not to restart the container; the other
5
+ * signals do not. Unlike the Docker component's options, the signal may be a number, and all the processes can be
6
+ * signaled.
7
+ * @example
8
+ * ```typescript
9
+ * import {Containerd} from 'lakutata/com/containerd'
10
+ *
11
+ * declare const containerd: Containerd
12
+ *
13
+ * const container = await containerd.getContainer('web')
14
+ * //Reload nginx's configuration
15
+ * await container.kill({signal: 'SIGHUP'})
16
+ * ```
17
+ */
18
+ export declare class ContainerKillOptions extends DTO {
19
+ /**
20
+ * The signal: a name (`'SIGTERM'`, `'TERM'`), its number as a string (`'15'`), or a positive integer. An unknown
21
+ * name fails the call.
22
+ * @default 'SIGKILL'
23
+ */
24
+ signal?: string | number;
25
+ /**
26
+ * Send it to all the container's processes, not only to its main process.
27
+ * @default false
28
+ */
29
+ all?: boolean;
30
+ }
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.ContainerKillOptions = void 0;
13
+ const core_1 = require("@lakutata/core");
14
+ const dto_1 = require("@lakutata/core/decorator/dto");
15
+ /**
16
+ * The signal {@link ContainerdContainer.kill} sends to a running container, without waiting for it to exit. Every
17
+ * field is optional. A `SIGKILL` also tells containerd's restart monitor not to restart the container; the other
18
+ * signals do not. Unlike the Docker component's options, the signal may be a number, and all the processes can be
19
+ * signaled.
20
+ * @example
21
+ * ```typescript
22
+ * import {Containerd} from 'lakutata/com/containerd'
23
+ *
24
+ * declare const containerd: Containerd
25
+ *
26
+ * const container = await containerd.getContainer('web')
27
+ * //Reload nginx's configuration
28
+ * await container.kill({signal: 'SIGHUP'})
29
+ * ```
30
+ */
31
+ class ContainerKillOptions extends core_1.DTO {
32
+ }
33
+ exports.ContainerKillOptions = ContainerKillOptions;
34
+ __decorate([
35
+ (0, dto_1.Expect)(core_1.DTO.Alternatives(core_1.DTO.String(), core_1.DTO.Number().integer().positive()).optional().default('SIGKILL')),
36
+ __metadata("design:type", Object)
37
+ ], ContainerKillOptions.prototype, "signal", void 0);
38
+ __decorate([
39
+ (0, dto_1.Expect)(core_1.DTO.Boolean().optional().default(false)),
40
+ __metadata("design:type", Boolean)
41
+ ], ContainerKillOptions.prototype, "all", void 0);
@@ -0,0 +1,34 @@
1
+ import { DTO } from '@lakutata/core';
2
+ /**
3
+ * How {@link ContainerdContainer.logs} reads a container's logs: the file its containerd shim writes its standard
4
+ * output and error to, interleaved and raw (no timestamps, no stream prefix), with its previous rotated file (the
5
+ * component's `logMaxSize` option). Every field is optional. Unlike the Docker component's options, there is no
6
+ * `since`, `until` nor `timestamps`.
7
+ * @example
8
+ * ```typescript
9
+ * import {Containerd} from 'lakutata/com/containerd'
10
+ *
11
+ * declare const containerd: Containerd
12
+ *
13
+ * const container = await containerd.getContainer('web')
14
+ * //The last 100 lines, then the new ones while it runs
15
+ * const logs = await container.logs({tail: 100})
16
+ * logs.on('data', (chunk: Buffer): void => {
17
+ * process.stdout.write(chunk)
18
+ * })
19
+ * ```
20
+ */
21
+ export declare class ContainerLogsOptions extends DTO {
22
+ /**
23
+ * Keep the stream open and send the new output while the container runs (polled every 250 milliseconds); it ends
24
+ * once the container stops without its restart monitor restarting it. Without it, the stream ends after the
25
+ * existing logs.
26
+ * @default true
27
+ */
28
+ follow?: boolean;
29
+ /**
30
+ * The number of lines read from the end of the existing logs, a non-negative integer (`0`: none of them); all of
31
+ * them by default.
32
+ */
33
+ tail?: number;
34
+ }
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.ContainerLogsOptions = void 0;
13
+ const core_1 = require("@lakutata/core");
14
+ const dto_1 = require("@lakutata/core/decorator/dto");
15
+ /**
16
+ * How {@link ContainerdContainer.logs} reads a container's logs: the file its containerd shim writes its standard
17
+ * output and error to, interleaved and raw (no timestamps, no stream prefix), with its previous rotated file (the
18
+ * component's `logMaxSize` option). Every field is optional. Unlike the Docker component's options, there is no
19
+ * `since`, `until` nor `timestamps`.
20
+ * @example
21
+ * ```typescript
22
+ * import {Containerd} from 'lakutata/com/containerd'
23
+ *
24
+ * declare const containerd: Containerd
25
+ *
26
+ * const container = await containerd.getContainer('web')
27
+ * //The last 100 lines, then the new ones while it runs
28
+ * const logs = await container.logs({tail: 100})
29
+ * logs.on('data', (chunk: Buffer): void => {
30
+ * process.stdout.write(chunk)
31
+ * })
32
+ * ```
33
+ */
34
+ class ContainerLogsOptions extends core_1.DTO {
35
+ }
36
+ exports.ContainerLogsOptions = ContainerLogsOptions;
37
+ __decorate([
38
+ (0, dto_1.Expect)(core_1.DTO.Boolean().optional().default(true)),
39
+ __metadata("design:type", Boolean)
40
+ ], ContainerLogsOptions.prototype, "follow", void 0);
41
+ __decorate([
42
+ (0, dto_1.Expect)(core_1.DTO.Number().integer().min(0).optional()),
43
+ __metadata("design:type", Number)
44
+ ], ContainerLogsOptions.prototype, "tail", void 0);
@@ -0,0 +1,22 @@
1
+ import { DTO } from '@lakutata/core';
2
+ /**
3
+ * How {@link ContainerdContainer.remove} removes a container, with its snapshot, its network interfaces and its state
4
+ * directory (its logs); its named volumes are kept. The field is optional.
5
+ * @example
6
+ * ```typescript
7
+ * import {Containerd} from 'lakutata/com/containerd'
8
+ *
9
+ * declare const containerd: Containerd
10
+ *
11
+ * const container = await containerd.getContainer('web')
12
+ * await container.remove({force: true})
13
+ * ```
14
+ */
15
+ export declare class ContainerRemoveOptions extends DTO {
16
+ /**
17
+ * Remove a running or paused container: all its processes are killed (`SIGKILL`) first, and its restart monitor
18
+ * told not to restart it. Without it, such a container throws {@link ContainerdContainerStateException}.
19
+ * @default false
20
+ */
21
+ force?: boolean;
22
+ }
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.ContainerRemoveOptions = void 0;
13
+ const core_1 = require("@lakutata/core");
14
+ const dto_1 = require("@lakutata/core/decorator/dto");
15
+ /**
16
+ * How {@link ContainerdContainer.remove} removes a container, with its snapshot, its network interfaces and its state
17
+ * directory (its logs); its named volumes are kept. The field is optional.
18
+ * @example
19
+ * ```typescript
20
+ * import {Containerd} from 'lakutata/com/containerd'
21
+ *
22
+ * declare const containerd: Containerd
23
+ *
24
+ * const container = await containerd.getContainer('web')
25
+ * await container.remove({force: true})
26
+ * ```
27
+ */
28
+ class ContainerRemoveOptions extends core_1.DTO {
29
+ }
30
+ exports.ContainerRemoveOptions = ContainerRemoveOptions;
31
+ __decorate([
32
+ (0, dto_1.Expect)(core_1.DTO.Boolean().optional().default(false)),
33
+ __metadata("design:type", Boolean)
34
+ ], ContainerRemoveOptions.prototype, "force", void 0);