@mittwald/cli 1.0.0-alpha.3

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 (549) hide show
  1. package/.deps/client.tgz +0 -0
  2. package/.deps/commons.tgz +0 -0
  3. package/LICENSE +21 -0
  4. package/README.md +2716 -0
  5. package/bin/dev +17 -0
  6. package/bin/dev.cmd +3 -0
  7. package/bin/mw.cmd +3 -0
  8. package/bin/run.js +9 -0
  9. package/dist/esm/BaseCommand.d.ts +11 -0
  10. package/dist/esm/BaseCommand.js +44 -0
  11. package/dist/esm/DeleteBaseCommand.d.ts +15 -0
  12. package/dist/esm/DeleteBaseCommand.js +37 -0
  13. package/dist/esm/ExtendedBaseCommand.d.ts +7 -0
  14. package/dist/esm/ExtendedBaseCommand.js +16 -0
  15. package/dist/esm/Flags.d.ts +1 -0
  16. package/dist/esm/Flags.js +1 -0
  17. package/dist/esm/Formatter.d.ts +15 -0
  18. package/dist/esm/Formatter.js +28 -0
  19. package/dist/esm/GetBaseCommand.d.ts +17 -0
  20. package/dist/esm/GetBaseCommand.js +27 -0
  21. package/dist/esm/Helpers.d.ts +5 -0
  22. package/dist/esm/Helpers.js +24 -0
  23. package/dist/esm/ListBaseCommand.d.ts +20 -0
  24. package/dist/esm/ListBaseCommand.js +60 -0
  25. package/dist/esm/Printer.d.ts +16 -0
  26. package/dist/esm/Printer.js +30 -0
  27. package/dist/esm/Translator.d.ts +5 -0
  28. package/dist/esm/Translator.js +53 -0
  29. package/dist/esm/commands/app/delete.d.ts +12 -0
  30. package/dist/esm/commands/app/delete.js +45 -0
  31. package/dist/esm/commands/app/getApp.d.ts +3 -0
  32. package/dist/esm/commands/app/getApp.js +6 -0
  33. package/dist/esm/commands/app/getAppinstallation.d.ts +3 -0
  34. package/dist/esm/commands/app/getAppinstallation.js +6 -0
  35. package/dist/esm/commands/app/getAppversion.d.ts +3 -0
  36. package/dist/esm/commands/app/getAppversion.js +6 -0
  37. package/dist/esm/commands/app/getSystemsoftware.d.ts +3 -0
  38. package/dist/esm/commands/app/getSystemsoftware.js +6 -0
  39. package/dist/esm/commands/app/getSystemsoftwareversion.d.ts +3 -0
  40. package/dist/esm/commands/app/getSystemsoftwareversion.js +6 -0
  41. package/dist/esm/commands/app/list.d.ts +16 -0
  42. package/dist/esm/commands/app/list.js +64 -0
  43. package/dist/esm/commands/app/listAppinstallations.d.ts +9 -0
  44. package/dist/esm/commands/app/listAppinstallations.js +6 -0
  45. package/dist/esm/commands/app/listApps.d.ts +9 -0
  46. package/dist/esm/commands/app/listApps.js +6 -0
  47. package/dist/esm/commands/app/listAppversions.d.ts +9 -0
  48. package/dist/esm/commands/app/listAppversions.js +6 -0
  49. package/dist/esm/commands/app/listSystemsoftwares.d.ts +9 -0
  50. package/dist/esm/commands/app/listSystemsoftwares.js +6 -0
  51. package/dist/esm/commands/app/listSystemsoftwareversions.d.ts +9 -0
  52. package/dist/esm/commands/app/listSystemsoftwareversions.js +6 -0
  53. package/dist/esm/commands/app/retrieveStatus.d.ts +3 -0
  54. package/dist/esm/commands/app/retrieveStatus.js +6 -0
  55. package/dist/esm/commands/article/getArticle.d.ts +3 -0
  56. package/dist/esm/commands/article/getArticle.js +6 -0
  57. package/dist/esm/commands/article/listArticles.d.ts +9 -0
  58. package/dist/esm/commands/article/listArticles.js +6 -0
  59. package/dist/esm/commands/contract/getBaseItemOfContract.d.ts +3 -0
  60. package/dist/esm/commands/contract/getBaseItemOfContract.js +6 -0
  61. package/dist/esm/commands/contract/getDetailOfContract.d.ts +3 -0
  62. package/dist/esm/commands/contract/getDetailOfContract.js +6 -0
  63. package/dist/esm/commands/contract/getDetailOfContractByDomain.d.ts +3 -0
  64. package/dist/esm/commands/contract/getDetailOfContractByDomain.js +6 -0
  65. package/dist/esm/commands/contract/getDetailOfContractByProject.d.ts +3 -0
  66. package/dist/esm/commands/contract/getDetailOfContractByProject.js +6 -0
  67. package/dist/esm/commands/contract/getDetailOfContractByServer.d.ts +3 -0
  68. package/dist/esm/commands/contract/getDetailOfContractByServer.js +6 -0
  69. package/dist/esm/commands/contract/getDetailOfContractItem.d.ts +3 -0
  70. package/dist/esm/commands/contract/getDetailOfContractItem.js +6 -0
  71. package/dist/esm/commands/contract/getNextTerminationDateForItem.d.ts +3 -0
  72. package/dist/esm/commands/contract/getNextTerminationDateForItem.js +6 -0
  73. package/dist/esm/commands/contract/invoiceDetailOfInvoice.d.ts +3 -0
  74. package/dist/esm/commands/contract/invoiceDetailOfInvoice.js +6 -0
  75. package/dist/esm/commands/contract/invoiceGetDetailOfInvoiceSettings.d.ts +3 -0
  76. package/dist/esm/commands/contract/invoiceGetDetailOfInvoiceSettings.js +6 -0
  77. package/dist/esm/commands/contract/invoiceListCustomerInvoices.d.ts +9 -0
  78. package/dist/esm/commands/contract/invoiceListCustomerInvoices.js +6 -0
  79. package/dist/esm/commands/contract/listContracts.d.ts +9 -0
  80. package/dist/esm/commands/contract/listContracts.js +6 -0
  81. package/dist/esm/commands/contract/orderGetOrder.d.ts +3 -0
  82. package/dist/esm/commands/contract/orderGetOrder.js +6 -0
  83. package/dist/esm/commands/contract/orderListCustomerOrders.d.ts +9 -0
  84. package/dist/esm/commands/contract/orderListCustomerOrders.js +6 -0
  85. package/dist/esm/commands/contract/orderListProjectOrders.d.ts +9 -0
  86. package/dist/esm/commands/contract/orderListProjectOrders.js +6 -0
  87. package/dist/esm/commands/conversation/categories.d.ts +11 -0
  88. package/dist/esm/commands/conversation/categories.js +16 -0
  89. package/dist/esm/commands/conversation/close.d.ts +8 -0
  90. package/dist/esm/commands/conversation/close.js +24 -0
  91. package/dist/esm/commands/conversation/create.d.ts +13 -0
  92. package/dist/esm/commands/conversation/create.js +50 -0
  93. package/dist/esm/commands/conversation/list.d.ts +11 -0
  94. package/dist/esm/commands/conversation/list.js +28 -0
  95. package/dist/esm/commands/conversation/reply.d.ts +13 -0
  96. package/dist/esm/commands/conversation/reply.js +30 -0
  97. package/dist/esm/commands/conversation/show.d.ts +8 -0
  98. package/dist/esm/commands/conversation/show.js +78 -0
  99. package/dist/esm/commands/conversation/show2.d.ts +11 -0
  100. package/dist/esm/commands/conversation/show2.js +37 -0
  101. package/dist/esm/commands/cronjob/getCronjob.d.ts +3 -0
  102. package/dist/esm/commands/cronjob/getCronjob.js +6 -0
  103. package/dist/esm/commands/cronjob/getExecution.d.ts +3 -0
  104. package/dist/esm/commands/cronjob/getExecution.js +6 -0
  105. package/dist/esm/commands/cronjob/listCronjobs.d.ts +9 -0
  106. package/dist/esm/commands/cronjob/listCronjobs.js +6 -0
  107. package/dist/esm/commands/cronjob/listExecutions.d.ts +9 -0
  108. package/dist/esm/commands/cronjob/listExecutions.js +6 -0
  109. package/dist/esm/commands/customer/getCustomer.d.ts +3 -0
  110. package/dist/esm/commands/customer/getCustomer.js +6 -0
  111. package/dist/esm/commands/customer/getCustomerCategory.d.ts +3 -0
  112. package/dist/esm/commands/customer/getCustomerCategory.js +6 -0
  113. package/dist/esm/commands/customer/getCustomerInvite.d.ts +3 -0
  114. package/dist/esm/commands/customer/getCustomerInvite.js +6 -0
  115. package/dist/esm/commands/customer/getCustomerMembership.d.ts +3 -0
  116. package/dist/esm/commands/customer/getCustomerMembership.js +6 -0
  117. package/dist/esm/commands/customer/getCustomerTokenInvite.d.ts +3 -0
  118. package/dist/esm/commands/customer/getCustomerTokenInvite.js +6 -0
  119. package/dist/esm/commands/customer/isCustomerLegallyCompetent.d.ts +3 -0
  120. package/dist/esm/commands/customer/isCustomerLegallyCompetent.js +6 -0
  121. package/dist/esm/commands/customer/listCustomerInvites.d.ts +9 -0
  122. package/dist/esm/commands/customer/listCustomerInvites.js +6 -0
  123. package/dist/esm/commands/customer/listCustomerMemberships.d.ts +9 -0
  124. package/dist/esm/commands/customer/listCustomerMemberships.js +6 -0
  125. package/dist/esm/commands/customer/listCustomers.d.ts +9 -0
  126. package/dist/esm/commands/customer/listCustomers.js +6 -0
  127. package/dist/esm/commands/customer/listInvitesForCustomer.d.ts +9 -0
  128. package/dist/esm/commands/customer/listInvitesForCustomer.js +6 -0
  129. package/dist/esm/commands/customer/listMembershipsForCustomer.d.ts +9 -0
  130. package/dist/esm/commands/customer/listMembershipsForCustomer.js +6 -0
  131. package/dist/esm/commands/customer/listOfCustomerCategories.d.ts +9 -0
  132. package/dist/esm/commands/customer/listOfCustomerCategories.js +6 -0
  133. package/dist/esm/commands/database/mysql/charsets.d.ts +9 -0
  134. package/dist/esm/commands/database/mysql/charsets.js +6 -0
  135. package/dist/esm/commands/database/mysql/get.d.ts +3 -0
  136. package/dist/esm/commands/database/mysql/get.js +6 -0
  137. package/dist/esm/commands/database/mysql/list.d.ts +11 -0
  138. package/dist/esm/commands/database/mysql/list.js +54 -0
  139. package/dist/esm/commands/database/mysql/user/get.d.ts +3 -0
  140. package/dist/esm/commands/database/mysql/user/get.js +6 -0
  141. package/dist/esm/commands/database/mysql/user/getMysqlUserPhpMyAdminUrl.d.ts +3 -0
  142. package/dist/esm/commands/database/mysql/user/getMysqlUserPhpMyAdminUrl.js +7 -0
  143. package/dist/esm/commands/database/mysql/user/list.d.ts +9 -0
  144. package/dist/esm/commands/database/mysql/user/list.js +6 -0
  145. package/dist/esm/commands/database/mysql/versions.d.ts +9 -0
  146. package/dist/esm/commands/database/mysql/versions.js +6 -0
  147. package/dist/esm/commands/database/redis/get.d.ts +3 -0
  148. package/dist/esm/commands/database/redis/get.js +6 -0
  149. package/dist/esm/commands/database/redis/list.d.ts +9 -0
  150. package/dist/esm/commands/database/redis/list.js +6 -0
  151. package/dist/esm/commands/database/redis/versions.d.ts +9 -0
  152. package/dist/esm/commands/database/redis/versions.js +6 -0
  153. package/dist/esm/commands/domain/dnsZoneGetSpecific.d.ts +3 -0
  154. package/dist/esm/commands/domain/dnsZoneGetSpecific.js +6 -0
  155. package/dist/esm/commands/domain/dnsZonesForProject.d.ts +3 -0
  156. package/dist/esm/commands/domain/dnsZonesForProject.js +6 -0
  157. package/dist/esm/commands/domain/get.d.ts +3 -0
  158. package/dist/esm/commands/domain/get.js +6 -0
  159. package/dist/esm/commands/domain/getHandleFields.d.ts +3 -0
  160. package/dist/esm/commands/domain/getHandleFields.js +6 -0
  161. package/dist/esm/commands/domain/getSpecificDomainOwnership.d.ts +3 -0
  162. package/dist/esm/commands/domain/getSpecificDomainOwnership.js +6 -0
  163. package/dist/esm/commands/domain/list.d.ts +9 -0
  164. package/dist/esm/commands/domain/list.js +6 -0
  165. package/dist/esm/commands/domain/listDomainOwnerships.d.ts +9 -0
  166. package/dist/esm/commands/domain/listDomainOwnerships.js +6 -0
  167. package/dist/esm/commands/domain/tld/get.d.ts +3 -0
  168. package/dist/esm/commands/domain/tld/get.js +6 -0
  169. package/dist/esm/commands/domain/tld/list.d.ts +9 -0
  170. package/dist/esm/commands/domain/tld/list.js +6 -0
  171. package/dist/esm/commands/domain/virtualhost/get.d.ts +3 -0
  172. package/dist/esm/commands/domain/virtualhost/get.js +6 -0
  173. package/dist/esm/commands/domain/virtualhost/list.d.ts +20 -0
  174. package/dist/esm/commands/domain/virtualhost/list.js +49 -0
  175. package/dist/esm/commands/login/status.d.ts +5 -0
  176. package/dist/esm/commands/login/status.js +29 -0
  177. package/dist/esm/commands/login/token.d.ts +9 -0
  178. package/dist/esm/commands/login/token.js +39 -0
  179. package/dist/esm/commands/mail/address/create.d.ts +12 -0
  180. package/dist/esm/commands/mail/address/create.js +52 -0
  181. package/dist/esm/commands/mail/address/delete.d.ts +12 -0
  182. package/dist/esm/commands/mail/address/delete.js +22 -0
  183. package/dist/esm/commands/mail/address/get.d.ts +3 -0
  184. package/dist/esm/commands/mail/address/get.js +6 -0
  185. package/dist/esm/commands/mail/address/list.d.ts +12 -0
  186. package/dist/esm/commands/mail/address/list.js +47 -0
  187. package/dist/esm/commands/mail/deliverybox/get.d.ts +3 -0
  188. package/dist/esm/commands/mail/deliverybox/get.js +6 -0
  189. package/dist/esm/commands/mail/deliverybox/list.d.ts +12 -0
  190. package/dist/esm/commands/mail/deliverybox/list.js +25 -0
  191. package/dist/esm/commands/project/backup/get.d.ts +3 -0
  192. package/dist/esm/commands/project/backup/get.js +6 -0
  193. package/dist/esm/commands/project/backup/list.d.ts +12 -0
  194. package/dist/esm/commands/project/backup/list.js +24 -0
  195. package/dist/esm/commands/project/backupschedule/get.d.ts +3 -0
  196. package/dist/esm/commands/project/backupschedule/get.js +6 -0
  197. package/dist/esm/commands/project/backupschedule/list.d.ts +13 -0
  198. package/dist/esm/commands/project/backupschedule/list.js +21 -0
  199. package/dist/esm/commands/project/create.d.ts +10 -0
  200. package/dist/esm/commands/project/create.js +59 -0
  201. package/dist/esm/commands/project/delete.d.ts +13 -0
  202. package/dist/esm/commands/project/delete.js +26 -0
  203. package/dist/esm/commands/project/filesystem/directories.d.ts +3 -0
  204. package/dist/esm/commands/project/filesystem/directories.js +6 -0
  205. package/dist/esm/commands/project/filesystem/file-content.d.ts +3 -0
  206. package/dist/esm/commands/project/filesystem/file-content.js +6 -0
  207. package/dist/esm/commands/project/filesystem/files.d.ts +16 -0
  208. package/dist/esm/commands/project/filesystem/files.js +25 -0
  209. package/dist/esm/commands/project/filesystem/usage.d.ts +4 -0
  210. package/dist/esm/commands/project/filesystem/usage.js +11 -0
  211. package/dist/esm/commands/project/get.d.ts +4 -0
  212. package/dist/esm/commands/project/get.js +11 -0
  213. package/dist/esm/commands/project/invite/get.d.ts +3 -0
  214. package/dist/esm/commands/project/invite/get.js +6 -0
  215. package/dist/esm/commands/project/invite/list-own.d.ts +11 -0
  216. package/dist/esm/commands/project/invite/list-own.js +29 -0
  217. package/dist/esm/commands/project/invite/list.d.ts +12 -0
  218. package/dist/esm/commands/project/invite/list.js +32 -0
  219. package/dist/esm/commands/project/list.d.ts +12 -0
  220. package/dist/esm/commands/project/list.js +33 -0
  221. package/dist/esm/commands/project/list1.d.ts +7 -0
  222. package/dist/esm/commands/project/list1.js +18 -0
  223. package/dist/esm/commands/project/list2.d.ts +9 -0
  224. package/dist/esm/commands/project/list2.js +26 -0
  225. package/dist/esm/commands/project/membership/get-own.d.ts +4 -0
  226. package/dist/esm/commands/project/membership/get-own.js +11 -0
  227. package/dist/esm/commands/project/membership/get.d.ts +3 -0
  228. package/dist/esm/commands/project/membership/get.js +6 -0
  229. package/dist/esm/commands/project/membership/list-own.d.ts +11 -0
  230. package/dist/esm/commands/project/membership/list-own.js +28 -0
  231. package/dist/esm/commands/project/membership/list.d.ts +25 -0
  232. package/dist/esm/commands/project/membership/list.js +46 -0
  233. package/dist/esm/commands/project/sftp-user/list.d.ts +13 -0
  234. package/dist/esm/commands/project/sftp-user/list.js +24 -0
  235. package/dist/esm/commands/project/ssh-user/list.d.ts +13 -0
  236. package/dist/esm/commands/project/ssh-user/list.js +24 -0
  237. package/dist/esm/commands/project/ssh.d.ts +8 -0
  238. package/dist/esm/commands/project/ssh.js +31 -0
  239. package/dist/esm/commands/project/update.d.ts +8 -0
  240. package/dist/esm/commands/project/update.js +15 -0
  241. package/dist/esm/commands/server/get.d.ts +3 -0
  242. package/dist/esm/commands/server/get.js +6 -0
  243. package/dist/esm/commands/server/list.d.ts +11 -0
  244. package/dist/esm/commands/server/list.js +41 -0
  245. package/dist/esm/commands/user/api-token/create.d.ts +11 -0
  246. package/dist/esm/commands/user/api-token/create.js +46 -0
  247. package/dist/esm/commands/user/api-token/get.d.ts +3 -0
  248. package/dist/esm/commands/user/api-token/get.js +6 -0
  249. package/dist/esm/commands/user/api-token/list.d.ts +11 -0
  250. package/dist/esm/commands/user/api-token/list.js +21 -0
  251. package/dist/esm/commands/user/api-token/revoke.d.ts +8 -0
  252. package/dist/esm/commands/user/api-token/revoke.js +21 -0
  253. package/dist/esm/commands/user/get.d.ts +3 -0
  254. package/dist/esm/commands/user/get.js +6 -0
  255. package/dist/esm/commands/user/session/get.d.ts +3 -0
  256. package/dist/esm/commands/user/session/get.js +6 -0
  257. package/dist/esm/commands/user/session/list.d.ts +11 -0
  258. package/dist/esm/commands/user/session/list.js +24 -0
  259. package/dist/esm/commands/user/ssh-key/create.d.ts +10 -0
  260. package/dist/esm/commands/user/ssh-key/create.js +60 -0
  261. package/dist/esm/commands/user/ssh-key/delete.d.ts +12 -0
  262. package/dist/esm/commands/user/ssh-key/delete.js +41 -0
  263. package/dist/esm/commands/user/ssh-key/get.d.ts +3 -0
  264. package/dist/esm/commands/user/ssh-key/get.js +6 -0
  265. package/dist/esm/commands/user/ssh-key/list.d.ts +11 -0
  266. package/dist/esm/commands/user/ssh-key/list.js +21 -0
  267. package/dist/esm/generated/app/getApp.d.ts +16 -0
  268. package/dist/esm/generated/app/getApp.js +25 -0
  269. package/dist/esm/generated/app/getAppinstallation.d.ts +16 -0
  270. package/dist/esm/generated/app/getAppinstallation.js +25 -0
  271. package/dist/esm/generated/app/getAppversion.d.ts +16 -0
  272. package/dist/esm/generated/app/getAppversion.js +29 -0
  273. package/dist/esm/generated/app/getSystemsoftware.d.ts +16 -0
  274. package/dist/esm/generated/app/getSystemsoftware.js +25 -0
  275. package/dist/esm/generated/app/getSystemsoftwareversion.d.ts +16 -0
  276. package/dist/esm/generated/app/getSystemsoftwareversion.js +29 -0
  277. package/dist/esm/generated/app/listAppinstallations.d.ts +13 -0
  278. package/dist/esm/generated/app/listAppinstallations.js +24 -0
  279. package/dist/esm/generated/app/listApps.d.ts +13 -0
  280. package/dist/esm/generated/app/listApps.js +17 -0
  281. package/dist/esm/generated/app/listAppversions.d.ts +13 -0
  282. package/dist/esm/generated/app/listAppversions.js +24 -0
  283. package/dist/esm/generated/app/listSystemsoftwares.d.ts +13 -0
  284. package/dist/esm/generated/app/listSystemsoftwares.js +17 -0
  285. package/dist/esm/generated/app/listSystemsoftwareversions.d.ts +13 -0
  286. package/dist/esm/generated/app/listSystemsoftwareversions.js +24 -0
  287. package/dist/esm/generated/app/retrieveStatus.d.ts +14 -0
  288. package/dist/esm/generated/app/retrieveStatus.js +24 -0
  289. package/dist/esm/generated/article/getArticle.d.ts +16 -0
  290. package/dist/esm/generated/article/getArticle.js +25 -0
  291. package/dist/esm/generated/article/listArticles.d.ts +13 -0
  292. package/dist/esm/generated/article/listArticles.js +17 -0
  293. package/dist/esm/generated/backup/getProjectBackup.d.ts +16 -0
  294. package/dist/esm/generated/backup/getProjectBackup.js +25 -0
  295. package/dist/esm/generated/backup/getProjectBackupSchedule.d.ts +16 -0
  296. package/dist/esm/generated/backup/getProjectBackupSchedule.js +25 -0
  297. package/dist/esm/generated/backup/listProjectBackupSchedules.d.ts +13 -0
  298. package/dist/esm/generated/backup/listProjectBackupSchedules.js +24 -0
  299. package/dist/esm/generated/backup/listProjectBackups.d.ts +13 -0
  300. package/dist/esm/generated/backup/listProjectBackups.js +24 -0
  301. package/dist/esm/generated/contract/getBaseItemOfContract.d.ts +14 -0
  302. package/dist/esm/generated/contract/getBaseItemOfContract.js +24 -0
  303. package/dist/esm/generated/contract/getDetailOfContract.d.ts +16 -0
  304. package/dist/esm/generated/contract/getDetailOfContract.js +25 -0
  305. package/dist/esm/generated/contract/getDetailOfContractByDomain.d.ts +14 -0
  306. package/dist/esm/generated/contract/getDetailOfContractByDomain.js +24 -0
  307. package/dist/esm/generated/contract/getDetailOfContractByProject.d.ts +14 -0
  308. package/dist/esm/generated/contract/getDetailOfContractByProject.js +24 -0
  309. package/dist/esm/generated/contract/getDetailOfContractByServer.d.ts +14 -0
  310. package/dist/esm/generated/contract/getDetailOfContractByServer.js +24 -0
  311. package/dist/esm/generated/contract/getDetailOfContractItem.d.ts +16 -0
  312. package/dist/esm/generated/contract/getDetailOfContractItem.js +29 -0
  313. package/dist/esm/generated/contract/getNextTerminationDateForItem.d.ts +15 -0
  314. package/dist/esm/generated/contract/getNextTerminationDateForItem.js +28 -0
  315. package/dist/esm/generated/contract/invoiceDetailOfInvoice.d.ts +16 -0
  316. package/dist/esm/generated/contract/invoiceDetailOfInvoice.js +29 -0
  317. package/dist/esm/generated/contract/invoiceGetDetailOfInvoiceSettings.d.ts +14 -0
  318. package/dist/esm/generated/contract/invoiceGetDetailOfInvoiceSettings.js +24 -0
  319. package/dist/esm/generated/contract/invoiceListCustomerInvoices.d.ts +13 -0
  320. package/dist/esm/generated/contract/invoiceListCustomerInvoices.js +24 -0
  321. package/dist/esm/generated/contract/listContracts.d.ts +13 -0
  322. package/dist/esm/generated/contract/listContracts.js +24 -0
  323. package/dist/esm/generated/contract/orderGetOrder.d.ts +16 -0
  324. package/dist/esm/generated/contract/orderGetOrder.js +25 -0
  325. package/dist/esm/generated/contract/orderListCustomerOrders.d.ts +13 -0
  326. package/dist/esm/generated/contract/orderListCustomerOrders.js +24 -0
  327. package/dist/esm/generated/contract/orderListProjectOrders.d.ts +13 -0
  328. package/dist/esm/generated/contract/orderListProjectOrders.js +24 -0
  329. package/dist/esm/generated/conversation/getCategory.d.ts +16 -0
  330. package/dist/esm/generated/conversation/getCategory.js +25 -0
  331. package/dist/esm/generated/conversation/getConversation.d.ts +16 -0
  332. package/dist/esm/generated/conversation/getConversation.js +25 -0
  333. package/dist/esm/generated/conversation/listCategories.d.ts +13 -0
  334. package/dist/esm/generated/conversation/listCategories.js +17 -0
  335. package/dist/esm/generated/conversation/listConversations.d.ts +13 -0
  336. package/dist/esm/generated/conversation/listConversations.js +17 -0
  337. package/dist/esm/generated/conversation/listMessagesByConversation.d.ts +13 -0
  338. package/dist/esm/generated/conversation/listMessagesByConversation.js +24 -0
  339. package/dist/esm/generated/cronjob/getCronjob.d.ts +16 -0
  340. package/dist/esm/generated/cronjob/getCronjob.js +25 -0
  341. package/dist/esm/generated/cronjob/getExecution.d.ts +16 -0
  342. package/dist/esm/generated/cronjob/getExecution.js +29 -0
  343. package/dist/esm/generated/cronjob/listCronjobs.d.ts +13 -0
  344. package/dist/esm/generated/cronjob/listCronjobs.js +24 -0
  345. package/dist/esm/generated/cronjob/listExecutions.d.ts +13 -0
  346. package/dist/esm/generated/cronjob/listExecutions.js +24 -0
  347. package/dist/esm/generated/customer/getCustomer.d.ts +16 -0
  348. package/dist/esm/generated/customer/getCustomer.js +25 -0
  349. package/dist/esm/generated/customer/getCustomerCategory.d.ts +16 -0
  350. package/dist/esm/generated/customer/getCustomerCategory.js +25 -0
  351. package/dist/esm/generated/customer/getCustomerInvite.d.ts +16 -0
  352. package/dist/esm/generated/customer/getCustomerInvite.js +25 -0
  353. package/dist/esm/generated/customer/getCustomerMembership.d.ts +16 -0
  354. package/dist/esm/generated/customer/getCustomerMembership.js +25 -0
  355. package/dist/esm/generated/customer/getCustomerTokenInvite.d.ts +14 -0
  356. package/dist/esm/generated/customer/getCustomerTokenInvite.js +16 -0
  357. package/dist/esm/generated/customer/isCustomerLegallyCompetent.d.ts +14 -0
  358. package/dist/esm/generated/customer/isCustomerLegallyCompetent.js +24 -0
  359. package/dist/esm/generated/customer/listCustomerInvites.d.ts +13 -0
  360. package/dist/esm/generated/customer/listCustomerInvites.js +17 -0
  361. package/dist/esm/generated/customer/listCustomerMemberships.d.ts +13 -0
  362. package/dist/esm/generated/customer/listCustomerMemberships.js +17 -0
  363. package/dist/esm/generated/customer/listCustomers.d.ts +13 -0
  364. package/dist/esm/generated/customer/listCustomers.js +17 -0
  365. package/dist/esm/generated/customer/listInvitesForCustomer.d.ts +13 -0
  366. package/dist/esm/generated/customer/listInvitesForCustomer.js +24 -0
  367. package/dist/esm/generated/customer/listMembershipsForCustomer.d.ts +13 -0
  368. package/dist/esm/generated/customer/listMembershipsForCustomer.js +24 -0
  369. package/dist/esm/generated/customer/listOfCustomerCategories.d.ts +13 -0
  370. package/dist/esm/generated/customer/listOfCustomerCategories.js +17 -0
  371. package/dist/esm/generated/database/getMysqlDatabase.d.ts +16 -0
  372. package/dist/esm/generated/database/getMysqlDatabase.js +25 -0
  373. package/dist/esm/generated/database/getMysqlUser.d.ts +16 -0
  374. package/dist/esm/generated/database/getMysqlUser.js +25 -0
  375. package/dist/esm/generated/database/getMysqlUserPhpMyAdminUrl.d.ts +14 -0
  376. package/dist/esm/generated/database/getMysqlUserPhpMyAdminUrl.js +24 -0
  377. package/dist/esm/generated/database/getRedisDatabase.d.ts +16 -0
  378. package/dist/esm/generated/database/getRedisDatabase.js +25 -0
  379. package/dist/esm/generated/database/listMysqlCharsets.d.ts +13 -0
  380. package/dist/esm/generated/database/listMysqlCharsets.js +17 -0
  381. package/dist/esm/generated/database/listMysqlDatabases.d.ts +13 -0
  382. package/dist/esm/generated/database/listMysqlDatabases.js +24 -0
  383. package/dist/esm/generated/database/listMysqlUsers.d.ts +13 -0
  384. package/dist/esm/generated/database/listMysqlUsers.js +24 -0
  385. package/dist/esm/generated/database/listMysqlVersions.d.ts +13 -0
  386. package/dist/esm/generated/database/listMysqlVersions.js +17 -0
  387. package/dist/esm/generated/database/listRedisDatabases.d.ts +13 -0
  388. package/dist/esm/generated/database/listRedisDatabases.js +24 -0
  389. package/dist/esm/generated/database/listRedisVersions.d.ts +13 -0
  390. package/dist/esm/generated/database/listRedisVersions.js +17 -0
  391. package/dist/esm/generated/domain/dnsZoneGetSpecific.d.ts +16 -0
  392. package/dist/esm/generated/domain/dnsZoneGetSpecific.js +25 -0
  393. package/dist/esm/generated/domain/dnsZonesForProject.d.ts +14 -0
  394. package/dist/esm/generated/domain/dnsZonesForProject.js +24 -0
  395. package/dist/esm/generated/domain/getDomain.d.ts +16 -0
  396. package/dist/esm/generated/domain/getDomain.js +25 -0
  397. package/dist/esm/generated/domain/getHandleFields.d.ts +16 -0
  398. package/dist/esm/generated/domain/getHandleFields.js +25 -0
  399. package/dist/esm/generated/domain/getSpecificDomainOwnership.d.ts +16 -0
  400. package/dist/esm/generated/domain/getSpecificDomainOwnership.js +25 -0
  401. package/dist/esm/generated/domain/getToplevelDomain.d.ts +16 -0
  402. package/dist/esm/generated/domain/getToplevelDomain.js +25 -0
  403. package/dist/esm/generated/domain/ingressGetSpecific.d.ts +16 -0
  404. package/dist/esm/generated/domain/ingressGetSpecific.js +25 -0
  405. package/dist/esm/generated/domain/ingressListAccessible.d.ts +13 -0
  406. package/dist/esm/generated/domain/ingressListAccessible.js +17 -0
  407. package/dist/esm/generated/domain/ingressListForProject.d.ts +13 -0
  408. package/dist/esm/generated/domain/ingressListForProject.js +24 -0
  409. package/dist/esm/generated/domain/listDomainOwnerships.d.ts +13 -0
  410. package/dist/esm/generated/domain/listDomainOwnerships.js +24 -0
  411. package/dist/esm/generated/domain/listDomains.d.ts +13 -0
  412. package/dist/esm/generated/domain/listDomains.js +24 -0
  413. package/dist/esm/generated/domain/listToplevelDomains.d.ts +13 -0
  414. package/dist/esm/generated/domain/listToplevelDomains.js +17 -0
  415. package/dist/esm/generated/file/getFile.d.ts +16 -0
  416. package/dist/esm/generated/file/getFile.js +25 -0
  417. package/dist/esm/generated/file/getFileMeta.d.ts +14 -0
  418. package/dist/esm/generated/file/getFileMeta.js +24 -0
  419. package/dist/esm/generated/file/getFileTokenRules.d.ts +16 -0
  420. package/dist/esm/generated/file/getFileTokenRules.js +25 -0
  421. package/dist/esm/generated/file/getFileTypeRules.d.ts +16 -0
  422. package/dist/esm/generated/file/getFileTypeRules.js +25 -0
  423. package/dist/esm/generated/mail/deliveryboxGetSpecific.d.ts +16 -0
  424. package/dist/esm/generated/mail/deliveryboxGetSpecific.js +25 -0
  425. package/dist/esm/generated/mail/deliveryboxList.d.ts +13 -0
  426. package/dist/esm/generated/mail/deliveryboxList.js +24 -0
  427. package/dist/esm/generated/mail/mailaddressGetSpecific.d.ts +16 -0
  428. package/dist/esm/generated/mail/mailaddressGetSpecific.js +25 -0
  429. package/dist/esm/generated/mail/mailaddressList.d.ts +13 -0
  430. package/dist/esm/generated/mail/mailaddressList.js +24 -0
  431. package/dist/esm/generated/mail/projectsettingGetSpecific.d.ts +14 -0
  432. package/dist/esm/generated/mail/projectsettingGetSpecific.js +24 -0
  433. package/dist/esm/generated/notification/newsletterGetInfo.d.ts +14 -0
  434. package/dist/esm/generated/notification/newsletterGetInfo.js +16 -0
  435. package/dist/esm/generated/notification/scountUnreadNotifications.d.ts +14 -0
  436. package/dist/esm/generated/notification/scountUnreadNotifications.js +16 -0
  437. package/dist/esm/generated/notification/slistNotifications.d.ts +13 -0
  438. package/dist/esm/generated/notification/slistNotifications.js +17 -0
  439. package/dist/esm/generated/project/getProject.d.ts +16 -0
  440. package/dist/esm/generated/project/getProject.js +25 -0
  441. package/dist/esm/generated/project/getProjectInvite.d.ts +16 -0
  442. package/dist/esm/generated/project/getProjectInvite.js +25 -0
  443. package/dist/esm/generated/project/getProjectMembership.d.ts +16 -0
  444. package/dist/esm/generated/project/getProjectMembership.js +25 -0
  445. package/dist/esm/generated/project/getProjectTokenInvite.d.ts +14 -0
  446. package/dist/esm/generated/project/getProjectTokenInvite.js +16 -0
  447. package/dist/esm/generated/project/getSelfMembershipForProject.d.ts +14 -0
  448. package/dist/esm/generated/project/getSelfMembershipForProject.js +24 -0
  449. package/dist/esm/generated/project/getServer.d.ts +16 -0
  450. package/dist/esm/generated/project/getServer.js +25 -0
  451. package/dist/esm/generated/project/listInvitesForProject.d.ts +13 -0
  452. package/dist/esm/generated/project/listInvitesForProject.js +24 -0
  453. package/dist/esm/generated/project/listMembershipsForProject.d.ts +13 -0
  454. package/dist/esm/generated/project/listMembershipsForProject.js +24 -0
  455. package/dist/esm/generated/project/listProjectInvites.d.ts +13 -0
  456. package/dist/esm/generated/project/listProjectInvites.js +17 -0
  457. package/dist/esm/generated/project/listProjectMemberships.d.ts +13 -0
  458. package/dist/esm/generated/project/listProjectMemberships.js +17 -0
  459. package/dist/esm/generated/project/listProjects.d.ts +13 -0
  460. package/dist/esm/generated/project/listProjects.js +17 -0
  461. package/dist/esm/generated/project/listServers.d.ts +13 -0
  462. package/dist/esm/generated/project/listServers.js +17 -0
  463. package/dist/esm/generated/projectFileSystem/getDirectories.d.ts +14 -0
  464. package/dist/esm/generated/projectFileSystem/getDirectories.js +24 -0
  465. package/dist/esm/generated/projectFileSystem/getDiskUsage.d.ts +14 -0
  466. package/dist/esm/generated/projectFileSystem/getDiskUsage.js +24 -0
  467. package/dist/esm/generated/projectFileSystem/getFileContent.d.ts +14 -0
  468. package/dist/esm/generated/projectFileSystem/getFileContent.js +24 -0
  469. package/dist/esm/generated/projectFileSystem/getJwt.d.ts +14 -0
  470. package/dist/esm/generated/projectFileSystem/getJwt.js +24 -0
  471. package/dist/esm/generated/projectFileSystem/listFiles.d.ts +13 -0
  472. package/dist/esm/generated/projectFileSystem/listFiles.js +24 -0
  473. package/dist/esm/generated/sshsftpUser/sftpUserGetSftpUser.d.ts +16 -0
  474. package/dist/esm/generated/sshsftpUser/sftpUserGetSftpUser.js +25 -0
  475. package/dist/esm/generated/sshsftpUser/sftpUserListSftpUsers.d.ts +13 -0
  476. package/dist/esm/generated/sshsftpUser/sftpUserListSftpUsers.js +24 -0
  477. package/dist/esm/generated/sshsftpUser/sshUserGetSshUser.d.ts +16 -0
  478. package/dist/esm/generated/sshsftpUser/sshUserGetSshUser.js +25 -0
  479. package/dist/esm/generated/sshsftpUser/sshUserListSshUsers.d.ts +13 -0
  480. package/dist/esm/generated/sshsftpUser/sshUserListSshUsers.js +24 -0
  481. package/dist/esm/generated/user/getApiToken.d.ts +16 -0
  482. package/dist/esm/generated/user/getApiToken.js +25 -0
  483. package/dist/esm/generated/user/getEmail.d.ts +14 -0
  484. package/dist/esm/generated/user/getEmail.js +16 -0
  485. package/dist/esm/generated/user/getMfaStatus.d.ts +14 -0
  486. package/dist/esm/generated/user/getMfaStatus.js +16 -0
  487. package/dist/esm/generated/user/getOwnProfile.d.ts +14 -0
  488. package/dist/esm/generated/user/getOwnProfile.js +16 -0
  489. package/dist/esm/generated/user/getPasswordUpdatedAt.d.ts +14 -0
  490. package/dist/esm/generated/user/getPasswordUpdatedAt.js +16 -0
  491. package/dist/esm/generated/user/getPersonalizedSettings.d.ts +14 -0
  492. package/dist/esm/generated/user/getPersonalizedSettings.js +24 -0
  493. package/dist/esm/generated/user/getSession.d.ts +16 -0
  494. package/dist/esm/generated/user/getSession.js +25 -0
  495. package/dist/esm/generated/user/getSshKey.d.ts +16 -0
  496. package/dist/esm/generated/user/getSshKey.js +25 -0
  497. package/dist/esm/generated/user/getUser.d.ts +14 -0
  498. package/dist/esm/generated/user/getUser.js +16 -0
  499. package/dist/esm/generated/user/listApiTokens.d.ts +13 -0
  500. package/dist/esm/generated/user/listApiTokens.js +17 -0
  501. package/dist/esm/generated/user/listFeedback.d.ts +13 -0
  502. package/dist/esm/generated/user/listFeedback.js +24 -0
  503. package/dist/esm/generated/user/listSessions.d.ts +13 -0
  504. package/dist/esm/generated/user/listSessions.js +17 -0
  505. package/dist/esm/generated/user/listSshKeys.d.ts +13 -0
  506. package/dist/esm/generated/user/listSshKeys.js +17 -0
  507. package/dist/esm/generated/user/supportCodeRequest.d.ts +14 -0
  508. package/dist/esm/generated/user/supportCodeRequest.js +16 -0
  509. package/dist/esm/lib/conversation/message_input.d.ts +10 -0
  510. package/dist/esm/lib/conversation/message_input.js +49 -0
  511. package/dist/esm/lib/handleError.d.ts +4 -0
  512. package/dist/esm/lib/handleError.js +17 -0
  513. package/dist/esm/lib/mergeObjects.d.ts +1 -0
  514. package/dist/esm/lib/mergeObjects.js +6 -0
  515. package/dist/esm/lib/notify.d.ts +2 -0
  516. package/dist/esm/lib/notify.js +5 -0
  517. package/dist/esm/lib/viewhelpers/date.d.ts +4 -0
  518. package/dist/esm/lib/viewhelpers/date.js +16 -0
  519. package/dist/esm/lib/viewhelpers/size.d.ts +1 -0
  520. package/dist/esm/lib/viewhelpers/size.js +4 -0
  521. package/dist/esm/lib/viewhelpers/tui.d.ts +2 -0
  522. package/dist/esm/lib/viewhelpers/tui.js +13 -0
  523. package/dist/esm/rendering/oclif/components/table.d.ts +11 -0
  524. package/dist/esm/rendering/oclif/components/table.js +49 -0
  525. package/dist/esm/rendering/react/RenderBaseCommand.d.ts +7 -0
  526. package/dist/esm/rendering/react/RenderBaseCommand.js +13 -0
  527. package/dist/esm/rendering/react/components/ConversationMessage.d.ts +8 -0
  528. package/dist/esm/rendering/react/components/ConversationMessage.js +12 -0
  529. package/dist/esm/rendering/react/components/ConversationMeta.d.ts +6 -0
  530. package/dist/esm/rendering/react/components/ConversationMeta.js +21 -0
  531. package/dist/esm/rendering/react/components/ConversationStatusUpdate.d.ts +8 -0
  532. package/dist/esm/rendering/react/components/ConversationStatusUpdate.js +6 -0
  533. package/dist/esm/rendering/react/components/Header.d.ts +6 -0
  534. package/dist/esm/rendering/react/components/Header.js +6 -0
  535. package/dist/esm/rendering/react/components/Table.d.ts +7 -0
  536. package/dist/esm/rendering/react/components/Table.js +4 -0
  537. package/dist/esm/rendering/react/context.d.ts +8 -0
  538. package/dist/esm/rendering/react/context.js +4 -0
  539. package/dist/esm/rendering/react/hooks/useMyUserProfile.d.ts +2 -0
  540. package/dist/esm/rendering/react/hooks/useMyUserProfile.js +11 -0
  541. package/dist/esm/rendering/setup/FlagSupportedSetup.d.ts +13 -0
  542. package/dist/esm/rendering/setup/FlagSupportedSetup.js +22 -0
  543. package/dist/esm/rendering/setup/TableRenderSetup.d.ts +13 -0
  544. package/dist/esm/rendering/setup/TableRenderSetup.js +11 -0
  545. package/dist/esm/rendering/setup/usePromiseSetup.d.ts +11 -0
  546. package/dist/esm/rendering/setup/usePromiseSetup.js +11 -0
  547. package/dist/esm/types.d.ts +8 -0
  548. package/dist/esm/types.js +1 -0
  549. package/package.json +126 -0
package/bin/dev ADDED
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env node
2
+
3
+ const oclif = require('@oclif/core')
4
+
5
+ const path = require('path')
6
+ const project = path.join(__dirname, '..', 'tsconfig.json')
7
+
8
+ // In dev mode -> use ts-node and dev plugins
9
+ process.env.NODE_ENV = 'development'
10
+
11
+ require('ts-node').register({project})
12
+
13
+ // In dev mode, always show stack traces
14
+ oclif.settings.debug = true;
15
+
16
+ // Start the CLI
17
+ oclif.run().then(oclif.flush).catch(oclif.Errors.handle)
package/bin/dev.cmd ADDED
@@ -0,0 +1,3 @@
1
+ @echo off
2
+
3
+ node "%~dp0\dev" %*
package/bin/mw.cmd ADDED
@@ -0,0 +1,3 @@
1
+ @echo off
2
+
3
+ node "%~dp0\run.js" %*
package/bin/run.js ADDED
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env node
2
+
3
+ import oclif from "@oclif/core";
4
+ import { handleError } from "../dist/esm/lib/handleError.js";
5
+
6
+ oclif
7
+ .run(process.argv.slice(2), import.meta.url)
8
+ .then(oclif.flush)
9
+ .catch(handleError);
@@ -0,0 +1,11 @@
1
+ import { Command } from "@oclif/core";
2
+ import { MittwaldAPIV2Client } from "@mittwald/api-client";
3
+ export declare abstract class BaseCommand<T extends typeof Command> extends Command {
4
+ protected authenticationRequired: boolean;
5
+ protected apiClient: MittwaldAPIV2Client;
6
+ init(): Promise<void>;
7
+ protected getTokenFilename(): string;
8
+ private readApiToken;
9
+ private readApiTokenFromEnvironment;
10
+ private readApiTokenFromConfig;
11
+ }
@@ -0,0 +1,44 @@
1
+ import { Command } from "@oclif/core";
2
+ import * as fs from "fs/promises";
3
+ import * as path from "path";
4
+ import { MittwaldAPIV2Client } from "@mittwald/api-client";
5
+ export class BaseCommand extends Command {
6
+ authenticationRequired = true;
7
+ apiClient = MittwaldAPIV2Client.newUnauthenticated();
8
+ async init() {
9
+ await super.init();
10
+ if (this.authenticationRequired) {
11
+ const token = await this.readApiToken();
12
+ if (token === undefined) {
13
+ throw new Error(`Could not get token from either config file (${this.getTokenFilename()}) or environment`);
14
+ }
15
+ this.apiClient = MittwaldAPIV2Client.newWithToken(token);
16
+ }
17
+ }
18
+ getTokenFilename() {
19
+ return path.join(this.config.configDir, "token");
20
+ }
21
+ async readApiToken() {
22
+ return (this.readApiTokenFromEnvironment() ??
23
+ (await this.readApiTokenFromConfig()));
24
+ }
25
+ readApiTokenFromEnvironment() {
26
+ const token = process.env.MITTWALD_API_TOKEN;
27
+ if (token === undefined) {
28
+ return undefined;
29
+ }
30
+ return token.trim();
31
+ }
32
+ async readApiTokenFromConfig() {
33
+ try {
34
+ const tokenFileContents = await fs.readFile(this.getTokenFilename(), "utf-8");
35
+ return tokenFileContents.trim();
36
+ }
37
+ catch (err) {
38
+ if (err instanceof Error && "code" in err && err.code === "ENOENT") {
39
+ return undefined;
40
+ }
41
+ throw err;
42
+ }
43
+ }
44
+ }
@@ -0,0 +1,15 @@
1
+ import { Command, Interfaces } from "@oclif/core";
2
+ import { BaseCommand } from "./BaseCommand.js";
3
+ export type DeleteFlags<T extends typeof Command> = Interfaces.InferredFlags<(typeof DeleteBaseCommand)["baseFlags"] & T["flags"]>;
4
+ export type DeleteArgs<T extends typeof Command> = Interfaces.InferredArgs<T["args"]>;
5
+ export declare abstract class DeleteBaseCommand<T extends typeof Command> extends BaseCommand<T> {
6
+ static resourceName: string;
7
+ static baseFlags: {
8
+ force: Interfaces.BooleanFlag<boolean>;
9
+ };
10
+ protected flags: DeleteFlags<T>;
11
+ protected args: DeleteArgs<T>;
12
+ init(): Promise<void>;
13
+ run(): Promise<void>;
14
+ protected abstract deleteResource(): Promise<void>;
15
+ }
@@ -0,0 +1,37 @@
1
+ import { Flags, ux } from "@oclif/core";
2
+ import { BaseCommand } from "./BaseCommand.js";
3
+ export class DeleteBaseCommand extends BaseCommand {
4
+ static resourceName = "object";
5
+ static baseFlags = {
6
+ force: Flags.boolean({
7
+ description: "Do not ask for confirmation",
8
+ }),
9
+ };
10
+ flags;
11
+ args;
12
+ async init() {
13
+ await super.init();
14
+ const { args, flags } = await this.parse({
15
+ flags: this.ctor.flags,
16
+ baseFlags: super.ctor.baseFlags,
17
+ args: this.ctor.args,
18
+ strict: this.ctor.strict,
19
+ });
20
+ this.args = args;
21
+ this.flags = flags;
22
+ }
23
+ async run() {
24
+ const resourceName = this.ctor.resourceName;
25
+ if (!this.flags.force) {
26
+ const confirmed = await ux.confirm(`Do you really want to delete this ${resourceName}?`);
27
+ if (!confirmed) {
28
+ this.log("aborting");
29
+ ux.exit(1);
30
+ return;
31
+ }
32
+ }
33
+ ux.action.start(`deleting ${resourceName}`);
34
+ await this.deleteResource();
35
+ ux.action.stop();
36
+ }
37
+ }
@@ -0,0 +1,7 @@
1
+ import { BaseCommand } from "./BaseCommand.js";
2
+ import { CommandArgs, CommandFlags } from "./types.js";
3
+ export declare abstract class ExtendedBaseCommand<T extends typeof BaseCommand> extends BaseCommand<T> {
4
+ protected flags: CommandFlags<T>;
5
+ protected args: CommandArgs<T>;
6
+ init(): Promise<void>;
7
+ }
@@ -0,0 +1,16 @@
1
+ import { BaseCommand } from "./BaseCommand.js";
2
+ export class ExtendedBaseCommand extends BaseCommand {
3
+ flags;
4
+ args;
5
+ async init() {
6
+ await super.init();
7
+ const { args, flags } = await this.parse({
8
+ flags: this.ctor.flags,
9
+ baseFlags: super.ctor.baseFlags,
10
+ args: this.ctor.args,
11
+ strict: this.ctor.strict,
12
+ });
13
+ this.args = args;
14
+ this.flags = flags;
15
+ }
16
+ }
@@ -0,0 +1 @@
1
+ export declare const mwFlags: {};
@@ -0,0 +1 @@
1
+ export const mwFlags = {};
@@ -0,0 +1,15 @@
1
+ import { FlagInput } from "@oclif/core/lib/interfaces/parser.js";
2
+ import { ux } from "@oclif/core";
3
+ export interface GetOptions {
4
+ outputFormat: string;
5
+ }
6
+ export type ListOptions = ux.Table.table.Options;
7
+ export type ListColumns<TItem extends Record<string, unknown>> = ux.Table.table.Columns<TItem>;
8
+ export declare class GetFormatter {
9
+ static get flags(): FlagInput;
10
+ log(output: unknown, opts?: GetOptions): void;
11
+ }
12
+ export declare class ListFormatter {
13
+ static get flags(): FlagInput;
14
+ log<T extends Record<string, unknown>>(output: T[], columns: ListColumns<T>, opts?: ListOptions): void;
15
+ }
@@ -0,0 +1,28 @@
1
+ import { ux } from "@oclif/core";
2
+ import { PrinterFactory } from "./Printer.js";
3
+ export class GetFormatter {
4
+ static get flags() {
5
+ return {
6
+ output: {
7
+ ...ux.table.flags().output,
8
+ options: ["json", "yaml"],
9
+ },
10
+ };
11
+ }
12
+ log(output, opts) {
13
+ PrinterFactory.build(opts?.outputFormat).log(output);
14
+ }
15
+ }
16
+ export class ListFormatter {
17
+ static get flags() {
18
+ return {
19
+ ...ux.table.flags(),
20
+ };
21
+ }
22
+ log(output, columns, opts) {
23
+ ux.table(output, columns, {
24
+ printLine: console.log,
25
+ ...opts,
26
+ });
27
+ }
28
+ }
@@ -0,0 +1,17 @@
1
+ import { Command, Interfaces } from "@oclif/core";
2
+ import { BaseCommand } from "./BaseCommand.js";
3
+ import { GetFormatter } from "./Formatter.js";
4
+ import { Response } from "@mittwald/api-client-commons";
5
+ export type Flags<T extends typeof Command> = Interfaces.InferredFlags<(typeof GetBaseCommand)["baseFlags"] & T["flags"]>;
6
+ export type Args<T extends typeof Command> = Interfaces.InferredArgs<T["args"]>;
7
+ export declare abstract class GetBaseCommand<T extends typeof BaseCommand, TAPIResponse extends Response> extends BaseCommand<T> {
8
+ static baseFlags: {
9
+ [x: string]: import("@oclif/core/lib/interfaces/parser.js").CompletableFlag<any>;
10
+ };
11
+ protected flags: Flags<T>;
12
+ protected args: Args<T>;
13
+ protected formatter: GetFormatter;
14
+ init(): Promise<void>;
15
+ run(): Promise<void>;
16
+ protected abstract getData(): Promise<TAPIResponse>;
17
+ }
@@ -0,0 +1,27 @@
1
+ import { BaseCommand } from "./BaseCommand.js";
2
+ import { GetFormatter } from "./Formatter.js";
3
+ import { assertStatus } from "@mittwald/api-client-commons";
4
+ export class GetBaseCommand extends BaseCommand {
5
+ static baseFlags = {
6
+ ...GetFormatter.flags,
7
+ };
8
+ flags;
9
+ args;
10
+ formatter = new GetFormatter();
11
+ async init() {
12
+ await super.init();
13
+ const { args, flags } = await this.parse({
14
+ flags: this.ctor.flags,
15
+ baseFlags: super.ctor.baseFlags,
16
+ args: this.ctor.args,
17
+ strict: this.ctor.strict,
18
+ });
19
+ this.args = args;
20
+ this.flags = flags;
21
+ }
22
+ async run() {
23
+ const response = await this.getData();
24
+ assertStatus(response, 200);
25
+ this.formatter.log(response.data, { outputFormat: this.flags.output });
26
+ }
27
+ }
@@ -0,0 +1,5 @@
1
+ import { MittwaldAPIV2Client } from "@mittwald/api-client";
2
+ export declare function isUuid(id: string): boolean;
3
+ export declare function isProjectShortId(id: string): boolean;
4
+ export declare function normalizeProjectIdToUuid(apiClient: MittwaldAPIV2Client, uuidOrShortId: string): Promise<string>;
5
+ export declare function normalizeConversationIdToUuid(apiClient: MittwaldAPIV2Client, uuidOrShortId: string): Promise<string>;
@@ -0,0 +1,24 @@
1
+ import { getConversationUuidFromShortId, getProjectUuidFromShortId, } from "./Translator.js";
2
+ const uuidRegex = RegExp("^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$");
3
+ const projectShortIdRegex = RegExp("p-[0-9a-zA-Z]{6}");
4
+ export function isUuid(id) {
5
+ return uuidRegex.test(id);
6
+ }
7
+ export function isProjectShortId(id) {
8
+ return projectShortIdRegex.test(id);
9
+ }
10
+ export async function normalizeProjectIdToUuid(apiClient, uuidOrShortId) {
11
+ if (isUuid(uuidOrShortId)) {
12
+ return uuidOrShortId;
13
+ }
14
+ if (isProjectShortId(uuidOrShortId)) {
15
+ return await getProjectUuidFromShortId(apiClient, uuidOrShortId);
16
+ }
17
+ throw new Error(`Given ID ${uuidOrShortId} does not seem to be valid`);
18
+ }
19
+ export async function normalizeConversationIdToUuid(apiClient, uuidOrShortId) {
20
+ if (isUuid(uuidOrShortId)) {
21
+ return uuidOrShortId;
22
+ }
23
+ return await getConversationUuidFromShortId(apiClient, uuidOrShortId);
24
+ }
@@ -0,0 +1,20 @@
1
+ import { Command, Interfaces } from "@oclif/core";
2
+ import { BaseCommand } from "./BaseCommand.js";
3
+ import { ListColumns, ListFormatter } from "./Formatter.js";
4
+ import { Response } from "@mittwald/api-client-commons";
5
+ import { SuccessfulResponse } from "./types.js";
6
+ export type Flags<T extends typeof Command> = Interfaces.InferredFlags<(typeof ListBaseCommand)["baseFlags"] & T["flags"]>;
7
+ export type Args<T extends typeof Command> = Interfaces.InferredArgs<T["args"]>;
8
+ export declare abstract class ListBaseCommand<T extends typeof BaseCommand, TItem extends Record<string, unknown>, TAPIResponse extends Response> extends BaseCommand<T> {
9
+ static baseFlags: {
10
+ [x: string]: import("@oclif/core/lib/interfaces/parser.js").CompletableFlag<any>;
11
+ };
12
+ protected flags: Flags<T>;
13
+ protected args: Args<T>;
14
+ protected formatter: ListFormatter;
15
+ init(): Promise<void>;
16
+ run(): Promise<void>;
17
+ protected abstract getData(): Promise<TAPIResponse>;
18
+ protected abstract mapData(data: SuccessfulResponse<TAPIResponse, 200>["data"]): TItem[] | Promise<TItem[]>;
19
+ protected getColumns(data: TItem[]): ListColumns<TItem>;
20
+ }
@@ -0,0 +1,60 @@
1
+ import { BaseCommand } from "./BaseCommand.js";
2
+ import { ListFormatter } from "./Formatter.js";
3
+ import { assertStatus } from "@mittwald/api-client-commons";
4
+ import { formatDate } from "./lib/viewhelpers/date.js";
5
+ export class ListBaseCommand extends BaseCommand {
6
+ static baseFlags = {
7
+ ...ListFormatter.flags,
8
+ };
9
+ flags;
10
+ args;
11
+ formatter = new ListFormatter();
12
+ async init() {
13
+ await super.init();
14
+ const { args, flags } = await this.parse({
15
+ flags: this.ctor.flags,
16
+ baseFlags: super.ctor.baseFlags,
17
+ args: this.ctor.args,
18
+ strict: this.ctor.strict,
19
+ });
20
+ this.args = args;
21
+ this.flags = flags;
22
+ }
23
+ async run() {
24
+ const response = await this.getData();
25
+ assertStatus(response, 200);
26
+ const data = await this.mapData(response.data);
27
+ this.formatter.log(data, this.getColumns(data), { ...this.flags });
28
+ }
29
+ getColumns(data) {
30
+ if (data.length === 0) {
31
+ return {};
32
+ }
33
+ // define some default columns, can be overwritten by child class
34
+ let columns = {
35
+ id: {
36
+ header: "ID",
37
+ minWidth: 36,
38
+ },
39
+ };
40
+ if ("shortId" in data[0]) {
41
+ columns = {
42
+ ...columns,
43
+ shortId: {
44
+ header: "Short ID",
45
+ minWidth: 8,
46
+ },
47
+ };
48
+ }
49
+ if ("createdAt" in data[0]) {
50
+ columns = {
51
+ ...columns,
52
+ createdAt: {
53
+ header: "Created at",
54
+ get: (row) => formatDate(new Date(`${row.createdAt}`)),
55
+ },
56
+ };
57
+ }
58
+ return columns;
59
+ }
60
+ }
@@ -0,0 +1,16 @@
1
+ interface Printer {
2
+ log(content: unknown): void;
3
+ }
4
+ export declare class PrinterFactory {
5
+ static build(outputFormat: string | undefined): Printer;
6
+ }
7
+ export declare class YamlPrinter implements Printer {
8
+ log(content: unknown): void;
9
+ }
10
+ export declare class JsonPrinter implements Printer {
11
+ log(content: unknown): void;
12
+ }
13
+ export declare class DefaultPrinter implements Printer {
14
+ log(content: unknown): void;
15
+ }
16
+ export {};
@@ -0,0 +1,30 @@
1
+ import * as yaml from "js-yaml";
2
+ import { ux, stdout } from "@oclif/core";
3
+ export class PrinterFactory {
4
+ static build(outputFormat) {
5
+ switch (outputFormat) {
6
+ case "yaml":
7
+ return new YamlPrinter();
8
+ case "json":
9
+ return new JsonPrinter();
10
+ default:
11
+ return new DefaultPrinter();
12
+ }
13
+ }
14
+ }
15
+ export class YamlPrinter {
16
+ log(content) {
17
+ stdout.write(yaml.dump(content));
18
+ }
19
+ }
20
+ export class JsonPrinter {
21
+ log(content) {
22
+ ux.styledJSON(content);
23
+ }
24
+ }
25
+ // csvn't
26
+ export class DefaultPrinter {
27
+ log(content) {
28
+ ux.styledObject(content);
29
+ }
30
+ }
@@ -0,0 +1,5 @@
1
+ import { MittwaldAPIV2Client } from "@mittwald/api-client";
2
+ export declare function getProjectUuidFromShortId(apiClient: MittwaldAPIV2Client, shortId: string): Promise<string>;
3
+ export declare function getConversationUuidFromShortId(apiClient: MittwaldAPIV2Client, shortId: string): Promise<string>;
4
+ export declare function getAppNameFromUuid(apiClient: MittwaldAPIV2Client, uuid: string): Promise<string>;
5
+ export declare function getAppVersionFromUuid(apiClient: MittwaldAPIV2Client, appId: string, appVersionId: string): Promise<string>;
@@ -0,0 +1,53 @@
1
+ import { assertStatus } from "@mittwald/api-client-commons";
2
+ import { isUuid, isProjectShortId } from "./Helpers.js";
3
+ export async function getProjectUuidFromShortId(apiClient, shortId) {
4
+ if (!isProjectShortId(shortId)) {
5
+ throw new Error("Given ShortID not valid.");
6
+ }
7
+ const projects = await apiClient.project.listProjects();
8
+ assertStatus(projects, 200);
9
+ const foundProject = projects.data.find((item) => {
10
+ return item.shortId === shortId;
11
+ });
12
+ if (foundProject) {
13
+ return foundProject.id;
14
+ }
15
+ throw new Error("Access Denied.");
16
+ }
17
+ export async function getConversationUuidFromShortId(apiClient, shortId) {
18
+ const conversations = await apiClient.conversation.listConversations();
19
+ assertStatus(conversations, 200);
20
+ const foundConversation = conversations.data.find((item) => {
21
+ return item.shortId === shortId;
22
+ });
23
+ if (foundConversation) {
24
+ return foundConversation.conversationId;
25
+ }
26
+ throw new Error("Access Denied.");
27
+ }
28
+ export async function getAppNameFromUuid(apiClient, uuid) {
29
+ if (!isUuid(uuid)) {
30
+ throw new Error("Given UUID not valid.");
31
+ }
32
+ const apps = await apiClient.app.listApps();
33
+ assertStatus(apps, 200);
34
+ const foundApp = apps.data.find((item) => {
35
+ return item.id === uuid;
36
+ });
37
+ if (foundApp) {
38
+ return foundApp.name;
39
+ }
40
+ throw new Error("App not found.");
41
+ }
42
+ export async function getAppVersionFromUuid(apiClient, appId, appVersionId) {
43
+ if (!isUuid(appId) && !isUuid(appVersionId)) {
44
+ throw new Error("Given UUID not valid.");
45
+ }
46
+ const appVersion = await apiClient.app.getAppversion({
47
+ pathParameters: { appId: appId, appVersionId: appVersionId },
48
+ });
49
+ if (appVersion.data.externalVersion) {
50
+ return appVersion.data.externalVersion;
51
+ }
52
+ throw new Error("AppVersion not found.");
53
+ }
@@ -0,0 +1,12 @@
1
+ import { BaseCommand } from "../../BaseCommand.js";
2
+ export default class Delete extends BaseCommand<typeof Delete> {
3
+ static description: string;
4
+ static args: {
5
+ id: import("@oclif/core/lib/interfaces/parser.js").Arg<string, Record<string, unknown>>;
6
+ };
7
+ static flags: {
8
+ force: import("@oclif/core/lib/interfaces/parser.js").BooleanFlag<boolean>;
9
+ };
10
+ run(): Promise<void>;
11
+ private confirmDeletion;
12
+ }
@@ -0,0 +1,45 @@
1
+ import { Flags, Args, ux } from "@oclif/core";
2
+ import { BaseCommand } from "../../BaseCommand.js";
3
+ import { assertStatus } from "@mittwald/api-client-commons";
4
+ import { isUuid } from "../../Helpers.js";
5
+ export default class Delete extends BaseCommand {
6
+ static description = "Delete an app";
7
+ static args = {
8
+ id: Args.string({
9
+ required: true,
10
+ description: "ID of the app to be deleted.",
11
+ }),
12
+ };
13
+ static flags = {
14
+ force: Flags.boolean({
15
+ char: "f",
16
+ description: "delete without prompting for confirmation",
17
+ }),
18
+ };
19
+ async run() {
20
+ const { args, flags } = await this.parse(Delete);
21
+ const { id } = args;
22
+ if (!isUuid(id)) {
23
+ throw new Error("AppID does not seem to be valid");
24
+ }
25
+ if (!(await this.confirmDeletion(flags.force))) {
26
+ this.log("aborting.");
27
+ return;
28
+ }
29
+ ux.action.start("deleting app");
30
+ const project = await this.apiClient.app.uninstallAppinstallation({
31
+ pathParameters: { appInstallationId: id },
32
+ });
33
+ assertStatus(project, 204);
34
+ ux.action.stop(`deleted app ${id}`);
35
+ }
36
+ async confirmDeletion(force) {
37
+ if (force) {
38
+ return true;
39
+ }
40
+ const promptResult = await ux.prompt("Are you sure you want to delete this app? y/n", {
41
+ type: "single",
42
+ });
43
+ return promptResult === "y";
44
+ }
45
+ }
@@ -0,0 +1,3 @@
1
+ import { GeneratedAppGetApp } from "../../generated/app/getApp.js";
2
+ export default class Get extends GeneratedAppGetApp {
3
+ }
@@ -0,0 +1,6 @@
1
+ /* eslint-disable */
2
+ /* prettier-ignore */
3
+ /* This file is auto-generated with acg (@mittwald/api-code-generator) */
4
+ import { GeneratedAppGetApp } from "../../generated/app/getApp.js";
5
+ export default class Get extends GeneratedAppGetApp {
6
+ }
@@ -0,0 +1,3 @@
1
+ import { GeneratedAppGetAppinstallation } from "../../generated/app/getAppinstallation.js";
2
+ export default class Get extends GeneratedAppGetAppinstallation {
3
+ }
@@ -0,0 +1,6 @@
1
+ /* eslint-disable */
2
+ /* prettier-ignore */
3
+ /* This file is auto-generated with acg (@mittwald/api-code-generator) */
4
+ import { GeneratedAppGetAppinstallation } from "../../generated/app/getAppinstallation.js";
5
+ export default class Get extends GeneratedAppGetAppinstallation {
6
+ }
@@ -0,0 +1,3 @@
1
+ import { GeneratedAppGetAppversion } from "../../generated/app/getAppversion.js";
2
+ export default class Get extends GeneratedAppGetAppversion {
3
+ }
@@ -0,0 +1,6 @@
1
+ /* eslint-disable */
2
+ /* prettier-ignore */
3
+ /* This file is auto-generated with acg (@mittwald/api-code-generator) */
4
+ import { GeneratedAppGetAppversion } from "../../generated/app/getAppversion.js";
5
+ export default class Get extends GeneratedAppGetAppversion {
6
+ }
@@ -0,0 +1,3 @@
1
+ import { GeneratedAppGetSystemsoftware } from "../../generated/app/getSystemsoftware.js";
2
+ export default class Get extends GeneratedAppGetSystemsoftware {
3
+ }
@@ -0,0 +1,6 @@
1
+ /* eslint-disable */
2
+ /* prettier-ignore */
3
+ /* This file is auto-generated with acg (@mittwald/api-code-generator) */
4
+ import { GeneratedAppGetSystemsoftware } from "../../generated/app/getSystemsoftware.js";
5
+ export default class Get extends GeneratedAppGetSystemsoftware {
6
+ }
@@ -0,0 +1,3 @@
1
+ import { GeneratedAppGetSystemsoftwareversion } from "../../generated/app/getSystemsoftwareversion.js";
2
+ export default class Get extends GeneratedAppGetSystemsoftwareversion {
3
+ }
@@ -0,0 +1,6 @@
1
+ /* eslint-disable */
2
+ /* prettier-ignore */
3
+ /* This file is auto-generated with acg (@mittwald/api-code-generator) */
4
+ import { GeneratedAppGetSystemsoftwareversion } from "../../generated/app/getSystemsoftwareversion.js";
5
+ export default class Get extends GeneratedAppGetSystemsoftwareversion {
6
+ }
@@ -0,0 +1,16 @@
1
+ import { BaseCommand } from "../../BaseCommand.js";
2
+ export default class List extends BaseCommand<typeof List> {
3
+ static description: string;
4
+ static flags: {
5
+ project: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string, import("@oclif/core/lib/interfaces/parser.js").CustomOptions>;
6
+ columns: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined>;
7
+ sort: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined>;
8
+ filter: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined>;
9
+ csv: import("@oclif/core/lib/interfaces/parser.js").Flag<boolean>;
10
+ output: import("@oclif/core/lib/interfaces/parser.js").OptionFlag<string | undefined>;
11
+ extended: import("@oclif/core/lib/interfaces/parser.js").Flag<boolean>;
12
+ 'no-truncate': import("@oclif/core/lib/interfaces/parser.js").Flag<boolean>;
13
+ 'no-header': import("@oclif/core/lib/interfaces/parser.js").Flag<boolean>;
14
+ };
15
+ run(): Promise<void>;
16
+ }