dcdx 1.2.0-next.6 → 1.2.0-next.9

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 (119) hide show
  1. package/assets/versions.json +1 -1
  2. package/lib/commands/apt.js +11223 -0
  3. package/lib/commands/build.js +9566 -1
  4. package/lib/commands/database.js +9273 -1
  5. package/lib/commands/debug.js +10261 -0
  6. package/lib/commands/install.js +9453 -0
  7. package/lib/commands/profile.js +2 -1
  8. package/lib/commands/reset.js +10112 -1
  9. package/lib/commands/run.js +10138 -1
  10. package/lib/commands/stop.js +10109 -1
  11. package/lib/commands/update.js +9090 -0
  12. package/lib/index.js +164 -1
  13. package/lib/types/src/applications/bamboo.d.ts +3 -7
  14. package/lib/types/src/applications/base.d.ts +12 -15
  15. package/lib/types/src/applications/bitbucket.d.ts +3 -7
  16. package/lib/types/src/applications/confluence.d.ts +3 -7
  17. package/lib/types/src/applications/jira.d.ts +3 -7
  18. package/lib/types/src/apt/helpers/dcapt.d.ts +6 -0
  19. package/lib/types/src/apt/helpers/generatePerformanceReport.d.ts +2 -0
  20. package/lib/types/src/apt/helpers/generateScalabilityReport.d.ts +2 -0
  21. package/lib/types/src/apt/helpers/getAWSCredentials.d.ts +2 -0
  22. package/lib/types/src/apt/helpers/getAptDirectory.d.ts +1 -0
  23. package/lib/types/src/apt/helpers/getClusterURL.d.ts +2 -0
  24. package/lib/types/src/apt/helpers/getDuration.d.ts +3 -0
  25. package/lib/types/src/apt/helpers/getEnvironmentName.d.ts +1 -0
  26. package/lib/types/src/apt/helpers/getHostLicense.d.ts +4 -0
  27. package/lib/types/src/apt/helpers/getNodeNumberForStage.d.ts +2 -0
  28. package/lib/types/src/apt/helpers/getOutputDirectory.d.ts +1 -0
  29. package/lib/types/src/apt/helpers/getProduct.d.ts +2 -0
  30. package/lib/types/src/apt/helpers/getReindexProgress.d.ts +1 -0
  31. package/lib/types/src/apt/helpers/getReport.d.ts +2 -0
  32. package/lib/types/src/apt/helpers/getReportDirectory.d.ts +1 -0
  33. package/lib/types/src/apt/helpers/getResults.d.ts +2 -0
  34. package/lib/types/src/apt/helpers/getResultsDirectory.d.ts +2 -0
  35. package/lib/types/src/apt/helpers/getRunForStage.d.ts +2 -0
  36. package/lib/types/src/apt/helpers/installApp.d.ts +1 -0
  37. package/lib/types/src/apt/helpers/persistClusterConfiguration.d.ts +1 -0
  38. package/lib/types/src/apt/helpers/persistTestConfiguration.d.ts +2 -0
  39. package/lib/types/src/apt/helpers/persistsAWSCredentials.d.ts +1 -0
  40. package/lib/types/src/apt/helpers/provisionCluster.d.ts +8 -0
  41. package/lib/types/src/apt/helpers/reindex.d.ts +1 -0
  42. package/lib/types/src/apt/helpers/runPerformanceTest.d.ts +2 -0
  43. package/lib/types/src/apt/helpers/runScalabilityTest.d.ts +2 -0
  44. package/lib/types/src/apt/helpers/teardownCluster.d.ts +2 -0
  45. package/lib/types/src/apt/helpers/waitForUserInput.d.ts +2 -0
  46. package/lib/types/src/apt/messages.d.ts +30 -0
  47. package/lib/types/src/apt/performance.d.ts +2 -0
  48. package/lib/types/src/apt/scalability.d.ts +2 -0
  49. package/lib/types/src/databases/base.d.ts +7 -15
  50. package/lib/types/src/databases/mssql.d.ts +3 -12
  51. package/lib/types/src/databases/mysql.d.ts +3 -12
  52. package/lib/types/src/databases/postgres.d.ts +3 -12
  53. package/lib/types/src/helpers/ActionHandler.d.ts +44 -0
  54. package/lib/types/src/helpers/CustomBuilder.d.ts +12 -0
  55. package/lib/types/src/helpers/FileWatcher.d.ts +3 -0
  56. package/lib/types/src/helpers/Installer.d.ts +3 -0
  57. package/lib/types/src/helpers/amps.d.ts +23 -12
  58. package/lib/types/src/helpers/capitalize.d.ts +1 -0
  59. package/lib/types/src/helpers/docker.d.ts +3 -5
  60. package/lib/types/src/helpers/generateVersionList.d.ts +3 -0
  61. package/lib/types/src/helpers/getApplication.d.ts +2 -6
  62. package/lib/types/src/helpers/getDatabaseEngine.d.ts +2 -0
  63. package/lib/types/src/helpers/getVersions.d.ts +1 -0
  64. package/lib/types/src/helpers/getZodDefaults.d.ts +3 -0
  65. package/lib/types/src/helpers/isOfType.d.ts +1 -0
  66. package/lib/types/src/helpers/licences.d.ts +3 -2
  67. package/lib/types/src/helpers/readLinesInFile.d.ts +1 -0
  68. package/lib/types/src/helpers/replaceLinesInFile.d.ts +1 -0
  69. package/lib/types/src/helpers/showHelpWithDefaultCommandOptions.d.ts +2 -0
  70. package/lib/types/src/helpers/upm.d.ts +3 -0
  71. package/lib/types/src/types/AMPS.d.ts +123 -0
  72. package/lib/types/src/types/Application.d.ts +69 -0
  73. package/lib/types/src/types/DCAPT.d.ts +302 -0
  74. package/lib/types/src/types/Database.d.ts +169 -0
  75. package/package.json +24 -7
  76. package/lib/commands/database/mssql.js +0 -2
  77. package/lib/commands/database/mysql.js +0 -2
  78. package/lib/commands/database/postgres.js +0 -2
  79. package/lib/commands/reset/bamboo.js +0 -2
  80. package/lib/commands/reset/bitbucket.js +0 -2
  81. package/lib/commands/reset/command.js +0 -2
  82. package/lib/commands/reset/confluence.js +0 -2
  83. package/lib/commands/reset/jira.js +0 -2
  84. package/lib/commands/run/bamboo.js +0 -2
  85. package/lib/commands/run/bitbucket.js +0 -2
  86. package/lib/commands/run/command.js +0 -2
  87. package/lib/commands/run/confluence.js +0 -2
  88. package/lib/commands/run/jira.js +0 -2
  89. package/lib/commands/start.js +0 -2
  90. package/lib/commands/stop/bamboo.js +0 -2
  91. package/lib/commands/stop/bitbucket.js +0 -2
  92. package/lib/commands/stop/command.js +0 -2
  93. package/lib/commands/stop/confluence.js +0 -2
  94. package/lib/commands/stop/jira.js +0 -2
  95. package/lib/types/src/commands/reset/bitbucket.d.ts +0 -2
  96. package/lib/types/src/commands/reset/command.d.ts +0 -3
  97. package/lib/types/src/commands/reset/confluence.d.ts +0 -2
  98. package/lib/types/src/commands/reset/jira.d.ts +0 -2
  99. package/lib/types/src/commands/run/bamboo.d.ts +0 -2
  100. package/lib/types/src/commands/run/bitbucket.d.ts +0 -2
  101. package/lib/types/src/commands/run/command.d.ts +0 -3
  102. package/lib/types/src/commands/run/confluence.d.ts +0 -2
  103. package/lib/types/src/commands/run/jira.d.ts +0 -2
  104. package/lib/types/src/commands/start.d.ts +0 -2
  105. package/lib/types/src/commands/stop/bamboo.d.ts +0 -2
  106. package/lib/types/src/commands/stop/bitbucket.d.ts +0 -2
  107. package/lib/types/src/commands/stop/command.d.ts +0 -3
  108. package/lib/types/src/commands/stop/confluence.d.ts +0 -2
  109. package/lib/types/src/commands/stop/jira.d.ts +0 -2
  110. package/lib/types/src/types/ApplicationOptions.d.ts +0 -13
  111. package/lib/types/src/types/DatabaseEngine.d.ts +0 -17
  112. package/lib/types/src/types/DatabaseOptions.d.ts +0 -9
  113. package/lib/types/src/types/SupportedApplications.d.ts +0 -6
  114. package/lib/types/src/types/SupportedDatabaseDrivers.d.ts +0 -1
  115. package/lib/types/src/types/SupportedDatabaseEngines.d.ts +0 -1
  116. /package/lib/types/src/commands/{database/mssql.d.ts → apt.d.ts} +0 -0
  117. /package/lib/types/src/commands/{database/mysql.d.ts → debug.d.ts} +0 -0
  118. /package/lib/types/src/commands/{database/postgres.d.ts → install.d.ts} +0 -0
  119. /package/lib/types/src/commands/{reset/bamboo.d.ts → update.d.ts} +0 -0
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import{program as e,Option as a}from"commander";import{gracefulExit as l,asyncExitHook as n}from"exit-hook";import{spawn as i}from"child_process";import{upAll as p}from"docker-compose";import{stop as t,downAll as s,ps as o}from"docker-compose/dist/v2.js";import r from"events";import{dump as b}from"js-yaml";import{cwd as c}from"process";import{Sequelize as u,ConnectionError as d,TimeoutError as y,ConnectionTimedOutError as m,ConnectionRefusedError as h,ConnectionAcquireTimeoutError as w}from"sequelize";var g=["latest","bullseye","bookworm","alpine3.19","alpine3.18","alpine","16.2-bullseye","16.2-bookworm","16.2-alpine3.19","16.2-alpine3.18","16.2-alpine","16.2","16-bullseye","16-bookworm","16-alpine3.19","16-alpine3.18","16-alpine","16","15.6-bullseye","15.6-bookworm","15.6-alpine3.19","15.6-alpine3.18","15.6-alpine","15.6","15-bullseye","15-bookworm","15-alpine3.19","15-alpine3.18","15-alpine","15","14.11-bullseye","14.11-bookworm","14.11-alpine3.19","14.11-alpine3.18","14.11-alpine","14.11","14-bullseye","14-bookworm","14-alpine3.19","14-alpine3.18","14-alpine","14","13.14-bullseye","13.14-bookworm","13.14-alpine3.19","13.14-alpine3.18","13.14-alpine","13.14","13-bullseye","13-bookworm","13-alpine3.19","13-alpine3.18","13-alpine","13","12.18-bullseye","12.18-bookworm","12.18-alpine3.19","12.18-alpine3.18","12.18-alpine","12.18","12-bullseye","12-bookworm","12-alpine3.19","12-alpine3.18","12-alpine","12","16.1-bullseye","15.5-bullseye","15.5-bookworm","15.5","14.10-bullseye","14.10-bookworm","14.10","13.13-bullseye","13.13-bookworm","13.13","12.17-bullseye","12.17-bookworm","12.17","16.1-bookworm","16.1","16.1-alpine3.19","16.1-alpine3.18","16.1-alpine","15.5-alpine3.19","15.5-alpine3.18","15.5-alpine","14.10-alpine3.19","14.10-alpine3.18","14.10-alpine","13.13-alpine3.19","13.13-alpine3.18","13.13-alpine","12.17-alpine3.19","12.17-alpine3.18","12.17-alpine","11.22-bullseye","11.22-bookworm","11-bullseye","11-bookworm","11.22-alpine3.19","11.22-alpine","11-alpine3.19","11-alpine","12.17-alpine3.17","12-alpine3.17","11.22-alpine3.18","11.22-alpine3.17","11-alpine3.18","11-alpine3.17","alpine3.17","16.1-alpine3.17","16-alpine3.17","15.5-alpine3.17","15-alpine3.17","13.13-alpine3.17","13-alpine3.17","14.10-alpine3.17","14-alpine3.17","12.16-bullseye","11.21-bullseye","11.21-bookworm","13.12-bullseye","13.12-bookworm","13.12","12.16-bookworm","12.16","14.9-bullseye","14.9-bookworm","14.9","16.0-bullseye","15.4-bullseye","15.4-bookworm","15.4","16.0-bookworm","16.0","16.0-alpine3.18","16.0-alpine3.17","16.0-alpine","15.4-alpine3.18","15.4-alpine3.17","15.4-alpine","14.9-alpine3.18","14.9-alpine3.17","14.9-alpine","13.12-alpine3.18","13.12-alpine3.17","13.12-alpine","12.16-alpine3.18","12.16-alpine3.17","12.16-alpine","11.21-alpine3.18","11.21-alpine3.17","11.21-alpine","16rc1-bullseye","16rc1-bookworm","16rc1","16rc1-alpine3.18","16rc1-alpine3.17","16rc1-alpine","16beta3-bullseye","16beta3-bookworm","16beta3","16beta3-alpine3.18","16beta3-alpine3.17","16beta3-alpine","16beta2-alpine3.18","16beta2-alpine3.17","16beta2-alpine","15.3-alpine3.18","15.3-alpine3.17","15.3-alpine","14.8-alpine3.18","14.8-alpine3.17","14.8-alpine","13.11-alpine3.18","13.11-alpine3.17","13.11-alpine","12.15-alpine3.18","12.15-alpine3.17","12.15-alpine","11.20-alpine3.18","11.20-alpine3.17","11.20-alpine","16beta2-bullseye","16beta2-bookworm","16beta2","15.3-bullseye","15.3-bookworm","15.3","14.8-bullseye","14.8-bookworm","14.8","13.11-bullseye","13.11-bookworm","13.11","12.15-bullseye","12.15-bookworm","12.15","11.20-bullseye","11.20-bookworm","16beta1-bookworm","16beta1-alpine3.18","16beta1-alpine3.17","16beta1-alpine","16beta1","16beta1-bullseye","15.2-bullseye","15.2-alpine3.17","15.2-alpine","15.2","14.7-bullseye","14.7-alpine3.17","14.7-alpine","14.7","13.10-bullseye","13.10-alpine3.17","13.10-alpine","13.10","12.14-bullseye","12.14-alpine3.17","12.14-alpine","12.14","11.19-bullseye","11.19-alpine3.17","11.19-alpine","15.1-bullseye","15.1","14.6-bullseye","14.6","13.9-bullseye","13.9","12.13-bullseye","12.13","11.18-bullseye","15.1-alpine3.17","15.1-alpine","14.6-alpine3.17","14.6-alpine","13.9-alpine3.17","13.9-alpine","12.13-alpine3.17","12.13-alpine","11.18-alpine3.17","11.18-alpine","alpine3.16","15.1-alpine3.16","15-alpine3.16","14.6-alpine3.16","14-alpine3.16","13.9-alpine3.16","13-alpine3.16","12.13-alpine3.16","12-alpine3.16","11.18-alpine3.16","11-alpine3.16","10.23-alpine3.16","10.23-alpine","10-alpine3.16","10-alpine","10.23-bullseye","10-bullseye","15.0-bullseye","14.5-bullseye","14.5","13.8-bullseye","13.8","12.12-bullseye","12.12","11.17-bullseye","10.22-bullseye","15.0","15.0-alpine3.16","15.0-alpine","14.5-alpine3.16","14.5-alpine","13.8-alpine3.16","13.8-alpine","12.12-alpine3.16","12.12-alpine","11.17-alpine3.16","11.17-alpine","10.22-alpine3.16","10.22-alpine","15rc2-alpine3.16","15rc2-alpine","15rc2-bullseye","15rc2","15rc1-alpine3.16","15rc1-alpine","15rc1-bullseye","15rc1","15beta4-bullseye","15beta4","15beta4-alpine3.16","15beta4-alpine","15beta3-bullseye","15beta3","15beta3-alpine3.16","15beta3-alpine","15beta2-alpine3.16","15beta2-alpine","14.4-alpine3.16","14.4-alpine","13.7-alpine3.16","13.7-alpine","12.11-alpine3.16","12.11-alpine","11.16-alpine3.16","11.16-alpine","10.21-alpine3.16","10.21-alpine","12.11-bullseye","12.11","15beta2-bullseye","15beta2","14.4-bullseye","14.4","13.7-bullseye","13.7","11.16-bullseye","10.21-bullseye","15beta1-bullseye","15beta1","11.16-stretch","11.16","11-stretch","11","10.21-stretch","10.21","10-stretch","10","15beta1-alpine3.16","15beta1-alpine","14.3-alpine3.16","14.3-alpine","14.3-bullseye","14.3","15beta1-alpine3.15","alpine3.15","14.3-alpine3.15","14-alpine3.15","13.7-alpine3.15","13-alpine3.15","12.11-alpine3.15","12-alpine3.15","11.16-alpine3.15","11-alpine3.15","10.21-alpine3.15","10-alpine3.15","14.2-bullseye","14.2","13.6-bullseye","13.6","12.10-bullseye","12.10","11.15-bullseye","10.20-bullseye","11.15-stretch","11.15","10.20-stretch","10.20","14.2-alpine3.15","14.2-alpine","13.6-alpine3.15","13.6-alpine","12.10-alpine3.15","12.10-alpine","11.15-alpine3.15","11.15-alpine","10.20-alpine3.15","10.20-alpine","9.6.24-bullseye","9.6-bullseye","9-bullseye","9.6.24-stretch","9.6.24","9.6-stretch","9.6","9-stretch","9","14.1-bullseye","14.1","13.5-bullseye","13.5","12.9-bullseye","12.9","11.14-stretch","11.14-bullseye","11.14","10.19-stretch","10.19-bullseye","10.19","9.6.24-alpine3.15","9.6.24-alpine","9.6-alpine3.15","9.6-alpine","9-alpine3.15","9-alpine","14.1-alpine3.15","14.1-alpine","13.5-alpine3.15","13.5-alpine","12.9-alpine3.15","12.9-alpine","11.14-alpine3.15","11.14-alpine","10.19-alpine3.15","10.19-alpine","alpine3.14","9.6.24-alpine3.14","9.6-alpine3.14","9-alpine3.14","14.1-alpine3.14","14-alpine3.14","13.5-alpine3.14","13-alpine3.14","12.9-alpine3.14","12-alpine3.14","11.14-alpine3.14","11-alpine3.14","10.19-alpine3.14","10-alpine3.14","9.6.23-stretch","9.6.23-bullseye","9.6.23-alpine3.14","9.6.23-alpine","9.6.23","14.0-bullseye","14.0-alpine3.14","14.0-alpine","14.0","13.4-bullseye","13.4-alpine3.14","13.4-alpine","13.4","12.8-bullseye","12.8-alpine3.14","12.8-alpine","12.8","11.13-stretch","11.13-bullseye","11.13-alpine3.14","11.13-alpine","11.13","10.18-stretch","10.18-bullseye","10.18-alpine3.14","10.18-alpine","10.18","14rc1-bullseye","14rc1","14rc1-alpine3.14","14rc1-alpine","buster","9.6.23-buster","9.6-buster","9-buster","14beta3-buster","14beta3","13.4-buster","13-buster","12.8-buster","12-buster","11.13-buster","11-buster","10.18-buster","10-buster","14beta3-alpine3.14","14beta3-alpine","9.6.22-alpine3.14","9.6.22-alpine","14beta2-alpine3.14","14beta2-alpine","13.3-alpine3.14","13.3-alpine","12.7-alpine3.14","12.7-alpine","11.12-alpine3.14","11.12-alpine","10.17-alpine3.14","10.17-alpine","9.6.22-stretch","9.6.22-buster","9.6.22","14beta2-buster","14beta2","13.3-buster","13.3","12.7-buster","12.7","11.12-stretch","11.12-buster","11.12","10.17-stretch","10.17-buster","10.17","alpine3.13","9-alpine3.13","13.3-alpine3.13","13-alpine3.13","12.7-alpine3.13","12-alpine3.13","11.12-alpine3.13","11-alpine3.13","10.17-alpine3.13","10-alpine3.13","9.6.22-alpine3.13","9.6-alpine3.13","9.6.21","9.5.25","9.5","13.2","12.6","11.11","10.16","9.6.21-alpine","9.5.25-alpine","9.5-alpine","13.2-alpine","12.6-alpine","11.11-alpine","10.16-alpine","9.6.20","9.5.24","13.1","12.5","11.10","10.15","9.6.20-alpine","9.5.24-alpine","13.1-alpine","12.5-alpine","11.10-alpine","10.15-alpine","9.6.19-alpine","9.5.23-alpine","13.0-alpine","12.4-alpine","11.9-alpine","10.14-alpine","9.6.19","9.5.23","13.0","12.4","11.9","10.14","13-rc1-alpine","13-rc1","13-beta3","13-beta3-alpine","9.6.18","9.5.22","13-beta2","12.3","11.8","10.13","9.6.18-alpine","9.5.22-alpine","13-beta2-alpine","12.3-alpine","11.8-alpine","10.13-alpine","13-beta1-alpine","13-beta1","9.6.17","9.5.21","11.7","10.12","9.6.17-alpine","9.5.21-alpine","12.2-alpine","11.7-alpine","10.12-alpine","12.2","9.4.26-alpine","9.4.26","9.4-alpine","9.4","9.6.16","9.5.20","9.4.25","12.1","11.6","10.11","9.6.16-alpine","9.5.20-alpine","9.4.25-alpine","12.1-alpine","11.6-alpine","10.11-alpine","9.6.15-alpine","9.5.19-alpine","9.4.24-alpine","12.0-alpine","11.5-alpine","10.10-alpine","9.6.15","9.5.19","9.4.24","12.0","11.5","10.10","12-rc1-alpine","12-rc1","12-beta4-alpine","12-beta4","12-beta3","12-beta3-alpine","9.6.14-alpine","9.5.18-alpine","9.4.23-alpine","12-beta2-alpine","11.4-alpine","10.9-alpine","9.6.14","9.5.18","9.4.23","11.4","10.9","12-beta2","9.6.13-alpine","9.5.17-alpine","9.4.22-alpine","12-beta1-alpine","11.3-alpine","10.8-alpine","9.6.13","9.5.17","9.4.22","12-beta1","11.3","10.8","11.2","9.4.21","9.5.16","9.6.12","10.7","9.4.21-alpine","9.5.16-alpine","9.6.12-alpine","10.7-alpine","11.2-alpine","9.4.20","9.5.15","9.6.11","10.6","11.1","9.4.20-alpine","9.5.15-alpine","9.6.11-alpine","10.6-alpine","11.1-alpine","9.3","9.3.25","9.3-alpine","9.3.25-alpine","10.5-alpine","10.5","11.0","11.0-alpine","9.3.24","9.4.19","9.5.14","9.6.10","11-rc1","11-rc1-alpine","11-beta4-alpine","9.4.19-alpine","11-beta4","9.3.24-alpine","9.5.14-alpine","9.6.10-alpine","11-beta3-alpine","11-beta3","9.3.23","9.5.13","9.5.13-alpine","9.4.18","9.6.9","10.4-alpine","10.4","11-beta2-alpine","11-beta2","9.4.18-alpine","9.3.23-alpine","9.6.9-alpine","11-beta1","11-beta1-alpine","9.6.8","10.3","9.3.22-alpine","9.3.22","9.4.17-alpine","9.4.17","9.5.12-alpine","9.5.12","9.6.8-alpine","10.3-alpine","9.3.21","9.4.16","9.5.11","9.6.7","10.2-alpine","10.2","9.5.11-alpine","9.5.10","9.3.21-alpine","9.4.16-alpine","9.6.7-alpine","9.3.20-alpine","9.4.15-alpine","9.5.10-alpine","9.6.6-alpine","10.1-alpine","9.3.20","9.4.15","9.6.6","10.1","9.3.19-alpine","9.3.19","9.4.14-alpine","9.4.14","9.5.9-alpine","9.5.9","9.6.5-alpine","9.6.5","10.0-alpine","10.0","9.2","9.2.23","10-rc1","9.2-alpine","9.2.23-alpine","10-rc1-alpine","10-beta4","10-beta4-alpine","9.2.22-alpine","9.2.22","9.3.18-alpine","9.3.18","9.4.13-alpine","9.4.13","9.5.8-alpine","9.5.8","9.6.4-alpine","9.6.4","10-beta3-alpine","10-beta3","9.2.21-alpine","9.2.21","9.3.17-alpine","9.3.17","9.4.12-alpine","9.4.12","9.5.7-alpine","9.5.7","9.6.3-alpine","9.6.3","10-beta2-alpine","10-beta2","10-beta1-alpine","10-beta1","9.2.20-alpine","9.2.20","9.3.16-alpine","9.3.16","9.4.11-alpine","9.4.11","9.5.6-alpine","9.5.6","9.6.2-alpine","9.6.2","9.2.19-alpine","9.2.19","9.3.15-alpine","9.3.15","9.4.10-alpine","9.4.10","9.5.5-alpine","9.5.5","9.6.1-alpine","9.6.1","9.1.24","9.1","9.5.4","9.4.9","9.3.14","9.2.18","9.1.23","9.6.0","9.6-rc1","9.6-beta4","9.4.8","9.1.22","9.6-beta3","9.5.3","9.3.13","9.2.17","9.6-beta2","9.6-beta1","9.5.2","9.4.7","9.3.12","9.2.16","9.1.21","9.5.1","9.4.6","9.3.11","9.2.15","9.1.20","9.5.0","9.4.5","9.3.10","9.2.14","9.1.19","9.0","9.0.22","9.5-rc1","9.5-beta2","9.5-beta1","9.4-rc1","9.3.5","9.4-beta2","9.2.9","9.4.0","9.1.14","9.4-beta3","9.0.18","9.5-alpha2","9.4.4","9.3.9","9.2.13","9.1.18","9.5-alpha1","9.4.3","9.3.8","9.2.12","9.1.17","9.0.21","9.4.2","9.3.7","9.2.11","9.1.16","9.0.20","8","8.4","8.4.22","9.4.1","9.3.6","9.2.10","9.1.15","9.0.19"];const k={name:"shared",driver:"bridge"};class Base extends r{options;sequelize=null;constructor(e){super(),this.options=e}async run(e,a){try{if(!this.sequelize)throw new Error("Database connection does not exist");await this.sequelize.query(e,{logging:a})}catch(a){console.error("An error occurred while trying to run the following SQL query:",e,a),l()}return null}async start(e=this.options.clean){console.log(`Starting instance of ${this.name} ⏳`),e&&await this.down(),await this.up(),this.emit(`${this.name}:up`);if(await this.waitUntilReady()){if(console.log(`Database is ready and accepting connections on localhost:${this.options.port} 🗄️`),await this.onDatabaseReady(),this.emit("db:ready"),this.options.logging){const e=await this.getServiceState();e&&await this.showDockerLogs(e.name)}}else console.log(`Failed to start database ${this.name} ⛔`),l(0)}async stop(e=this.options.prune){if(e)await this.down();else{const e=b(this.getDockerComposeConfig());await t({cwd:c(),configAsString:e,log:!0})}this.emit("db:stopped")}async onDatabaseReady(){}getDockerComposeConfig(){return{version:"3.8",services:{db:this.getService()},networks:{shared:k}}}async up(){const e=b(this.getDockerComposeConfig());return p({cwd:c(),configAsString:e,log:!0})}async down(){const e=b(this.getDockerComposeConfig());return s({cwd:c(),configAsString:e,commandOptions:["-v","--remove-orphans","--rmi","local"],log:!0})}async waitUntilReady(){try{const e="mssql"===this.name?"master":this.options.database;return this.sequelize=new u(e,this.options.username,this.options.password,{host:"localhost",port:this.options.port,dialect:this.name.replace("postgresql","postgres"),retry:{max:30,match:[d,y,m,h,w],backoffBase:1e3,backoffExponent:1},logging:!1}),this.sequelize.authenticate().then((()=>!0)).catch((e=>(console.log(e),!1)))}catch(e){return!1}}async getServiceState(){const e=b(this.getDockerComposeConfig());return(await o({configAsString:e,log:!1,commandOptions:["--all"]})).data.services.find((e=>e.name.includes(this.name)))}async showDockerLogs(e){return new Promise(((a,l)=>{i("docker",["logs","-f","-n","5000",e],{cwd:c(),stdio:"inherit"}).on("exit",(e=>0===e?a():l(new Error(`Docker exited with code ${e}`))))}))}}const f={version:"15",database:"dcdx",port:5432,username:"dcdx",password:"dcdx"};class Postgres extends Base{name="postgresql";driver="org.postgresql.Driver";options=f;version="15";get url(){return`jdbc:postgresql://db:${this.options.port}/${this.options.database}`}constructor(e=f){super({...f,...e})}getService=()=>({image:`postgres:${this.version}`,ports:[`${this.options.port||5432}:5432`],environment:{POSTGRES_USER:this.options.username||"dcdx",POSTGRES_PASSWORD:this.options.password||"dcdx",POSTGRES_DB:this.options.database||"dcdx",POSTGRES_HOST_AUTH_METHOD:"md5",POSTGRES_INITDB_ARGS:"--encoding=UTF-8 --lc-collate=C --lc-ctype=C"},networks:{shared:{aliases:["db","database"]}}})}(async()=>{const l=e.showHelpAfterError(!0).addOption(new a("-v, --version <version>","The version of Postgres").choices(g).default("latest")).addOption(new a("-d, --database <database>","The value passed to POSTGRES_DB environment variable").default("dcdx")).addOption(new a("-p, --port <port>","The port on which the database will be accessible").default("5432")).addOption(new a("-U, --username <username>","The value passed to POSTGRES_USER environment variable").default("dcdx")).addOption(new a("-P, --password <password>","The value passed to POSTGRES_PASSWORD environment variable").default("dcdx")).addOption(new a("--clean","Remove data files before starting the database").default(!1)).addOption(new a("--prune","Remove data files when stopping the database").default(!1)).parse(process.argv).opts(),i=new Postgres({version:l.version,database:l.database,port:Number(l.port),username:l.username,password:l.password,clean:l.clean,prune:l.prune,logging:!0});n((async()=>{console.log(`Stopping ${i.name}... ⏳`),await i.stop(),console.log(`Stopped ${i.name} 💪`)}),{wait:3e4}),await i.start()})(),process.on("SIGINT",(()=>{console.log("Received term signal, trying to stop gracefully 💪"),l()})),setInterval((()=>{}),1<<30);