11"use strict" ;
22Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
3- exports . OPTION_TYPE_CHECKS = exports . LOG_LEVELS = exports . DEFAULT_OPTIONS_KEYS = exports . DEFAULT_OPTIONS_GENERATOR = exports . MIN_SUPPORTED_MYSQL = void 0 ;
3+ exports . MYSQL_LINUX_MINIMAL_REBUILD_VERSIONS = exports . MYSQL_LINUX_FILE_EXTENSIONS = exports . MYSQL_LINUX_MINIMAL_INSTALL_AVAILABLE_ARM64 = exports . MYSQL_LINUX_MINIMAL_INSTALL_AVAILABLE = exports . MYSQL_LINUX_GLIBC_VERSIONS = exports . MYSQL_MACOS_VERSIONS_IN_FILENAME = exports . RC_MYSQL_VERSIONS = exports . DMR_MYSQL_VERSIONS = exports . MYSQL_MIN_OS_SUPPORT = exports . MYSQL_ARCH_SUPPORT = exports . DOWNLOADABLE_MYSQL_VERSIONS = exports . archiveBaseURL = exports . downloadsBaseURL = exports . MIN_SUPPORTED_MYSQL = exports . OPTION_TYPE_CHECKS = exports . LOG_LEVELS = exports . DEFAULT_OPTIONS_KEYS = exports . DEFAULT_OPTIONS = void 0 ;
44exports . getInternalEnvVariable = getInternalEnvVariable ;
5- const crypto_1 = require ( "crypto" ) ;
65const path_1 = require ( "path" ) ;
76const os_1 = require ( "os" ) ;
87const semver_1 = require ( "semver" ) ;
9- exports . MIN_SUPPORTED_MYSQL = '8.0.20' ;
10- const DEFAULT_OPTIONS_GENERATOR = ( ) => ( {
8+ exports . DEFAULT_OPTIONS = {
119 version : undefined ,
1210 dbName : 'dbdata' ,
1311 logLevel : 'ERROR' ,
1412 portRetries : 10 ,
1513 downloadBinaryOnce : true ,
16- lockRetries : 1000 ,
17- lockRetryWait : 1000 ,
14+ lockRetries : 1_000 ,
15+ lockRetryWait : 1_000 ,
1816 username : 'root' ,
1917 ignoreUnsupportedSystemVersion : false ,
2018 port : 0 ,
2119 xPort : 0 ,
2220 downloadRetries : 10 ,
2321 initSQLString : '' ,
2422 arch : process . arch
25- } ) ;
26- exports . DEFAULT_OPTIONS_GENERATOR = DEFAULT_OPTIONS_GENERATOR ;
27- exports . DEFAULT_OPTIONS_KEYS = Object . freeze ( Object . keys ( ( 0 , exports . DEFAULT_OPTIONS_GENERATOR ) ( ) ) ) ;
23+ } ;
24+ exports . DEFAULT_OPTIONS_KEYS = Object . freeze ( Object . keys ( exports . DEFAULT_OPTIONS ) ) ;
2825exports . LOG_LEVELS = {
2926 'LOG' : 0 ,
3027 'WARN' : 1 ,
@@ -33,14 +30,14 @@ exports.LOG_LEVELS = {
3330const internalOptions = {
3431 deleteDBAfterStopped : 'true' ,
3532 //mysqlmsn = MySQL Memory Server Node.js
36- dbPath : ( 0 , path_1 . normalize ) ( `${ ( 0 , os_1 . tmpdir ) ( ) } /mysqlmsn/dbs/ ${ ( 0 , crypto_1 . randomUUID ) ( ) . replace ( / - / g , '' ) } ` ) ,
33+ databaseDirectoryPath : ( 0 , path_1 . normalize ) ( `${ ( 0 , os_1 . tmpdir ) ( ) } /mysqlmsn/dbs` ) ,
3734 binaryDirectoryPath : `${ ( 0 , os_1 . tmpdir ) ( ) } /mysqlmsn/binaries` ,
3835 cli : 'false'
3936} ;
4037function getInternalEnvVariable ( envVar ) {
4138 return process . env [ 'mysqlmsn_internal_DO_NOT_USE_' + envVar ] || internalOptions [ envVar ] ;
4239}
43- const allowedArches = [ 'x64' , 'arm64' , undefined ] ;
40+ const allowedArches = [ 'x64' , 'arm64' ] ;
4441exports . OPTION_TYPE_CHECKS = {
4542 version : {
4643 check : ( opt ) => opt === undefined || typeof opt === 'string' && ( 0 , semver_1 . valid ) ( ( 0 , semver_1 . coerce ) ( opt ) ) !== null ,
@@ -108,8 +105,88 @@ exports.OPTION_TYPE_CHECKS = {
108105 definedType : 'string'
109106 } ,
110107 arch : {
111- check : ( opt ) => allowedArches . includes ( opt ) ,
108+ check : ( opt ) => opt === undefined || allowedArches . includes ( opt ) ,
112109 errorMessage : `Option arch must be either of the following: ${ allowedArches . join ( ', ' ) } ` ,
113110 definedType : 'string'
114111 }
115112} ;
113+ exports . MIN_SUPPORTED_MYSQL = '5.7.19' ;
114+ exports . downloadsBaseURL = 'https://cdn.mysql.com//Downloads/MySQL-' ;
115+ exports . archiveBaseURL = 'https://cdn.mysql.com/archives/mysql-' ;
116+ // Versions 8.0.29, 8.0.38, 8.4.1, and 9.0.0 have been purposefully left out of this list as MySQL has removed them from the CDN due to critical issues.
117+ exports . DOWNLOADABLE_MYSQL_VERSIONS = [
118+ '5.7.19' , '5.7.20' , '5.7.21' , '5.7.22' , '5.7.23' , '5.7.24' , '5.7.25' , '5.7.26' , '5.7.27' , '5.7.28' , '5.7.29' , '5.7.30' , '5.7.31' , '5.7.32' , '5.7.33' , '5.7.34' , '5.7.35' , '5.7.36' , '5.7.37' , '5.7.38' , '5.7.39' , '5.7.40' , '5.7.41' , '5.7.42' , '5.7.43' , '5.7.44' ,
119+ '8.0.0' , '8.0.1' , '8.0.2' , '8.0.3' , '8.0.4' ,
120+ '8.0.11' , '8.0.12' , '8.0.13' , '8.0.14' , '8.0.15' , '8.0.16' , '8.0.17' , '8.0.18' , '8.0.19' , '8.0.20' , '8.0.21' , '8.0.22' , '8.0.23' , '8.0.24' , '8.0.25' , '8.0.26' , '8.0.27' , '8.0.28' , '8.0.30' , '8.0.31' , '8.0.32' , '8.0.33' , '8.0.34' , '8.0.35' , '8.0.36' , '8.0.37' , '8.0.39' , '8.0.40' , '8.0.41' ,
121+ '8.1.0' , '8.2.0' , '8.3.0' ,
122+ '8.4.0' , '8.4.2' , '8.4.3' , '8.4.4' ,
123+ '9.0.1' , '9.1.0' , '9.2.0'
124+ ] ;
125+ exports . MYSQL_ARCH_SUPPORT = {
126+ darwin : {
127+ arm64 : '8.0.26 - 9.2.0' ,
128+ x64 : '5.7.19 - 9.2.0'
129+ } ,
130+ linux : {
131+ arm64 : '8.0.31 - 9.2.0' ,
132+ x64 : '5.7.19 - 9.2.0'
133+ } ,
134+ win32 : {
135+ x64 : '5.7.19 - 9.2.0'
136+ }
137+ } ;
138+ exports . MYSQL_MIN_OS_SUPPORT = {
139+ win32 : {
140+ x : '0.0.0' // No minimum version is documented as far as I can tell, so allow any minimum version
141+ } ,
142+ linux : {
143+ x : '0.0.0' // No minimum version is documented as far as I can tell, so allow any minimum version
144+ } ,
145+ darwin : {
146+ '5.7.19 - 5.7.23 || 8.0.1 - 8.0.3 || 8.0.11 - 8.0.12' : '16.0.0' ,
147+ '5.7.24 - 5.7.29 || 8.0.4 || 8.0.13 - 8.0.18' : '17.0.0' ,
148+ '5.7.30 - 5.7.31 || 8.0.19 - 8.0.22' : '18.0.0' ,
149+ //5.7.32 - 5.7.44 is not supported for macOS by MySQL. Those versions are not appearing in this list
150+ '8.0.0' : '13.0.0' ,
151+ '8.0.23 - 8.0.27' : '19.0.0' ,
152+ '8.0.28 - 8.0.31' : '20.0.0' ,
153+ '8.0.32 - 8.0.34' : '21.0.0' ,
154+ '8.0.35 - 8.0.39 || 8.1.0 - 8.4.2 || 9.0.1' : '22.0.0' ,
155+ '8.0.40 - 8.0.41 || 8.4.3 - 8.4.4 || 9.1.0 - 9.2.0' : '23.0.0'
156+ }
157+ } ;
158+ exports . DMR_MYSQL_VERSIONS = '8.0.0 - 8.0.2' ;
159+ exports . RC_MYSQL_VERSIONS = '8.0.3 - 8.0.4' ;
160+ exports . MYSQL_MACOS_VERSIONS_IN_FILENAME = {
161+ '5.7.19 - 5.7.20 || 8.0.1 - 8.0.3' : 'macos10.12' ,
162+ '5.7.21 - 5.7.23 || 8.0.4 - 8.0.12' : 'macos10.13' ,
163+ '5.7.24 - 5.7.31 || 8.0.13 - 8.0.18' : 'macos10.14' ,
164+ '8.0.0' : 'osx10.11' ,
165+ '8.0.19 - 8.0.23' : 'macos10.15' ,
166+ '8.0.24 - 8.0.28' : 'macos11' ,
167+ '8.0.30 - 8.0.31' : 'macos12' ,
168+ '8.0.32 - 8.0.35 || 8.1.0 - 8.2.0' : 'macos13' ,
169+ '8.0.36 - 8.0.40 || 8.3.0 - 8.4.3 || 9.0.1 - 9.1.0' : 'macos14' ,
170+ '8.0.41 || 8.4.4 || 9.2.0' : 'macos15'
171+ } ;
172+ exports . MYSQL_LINUX_GLIBC_VERSIONS = {
173+ '5.7.19 - 8.0.20' : '2.12' ,
174+ '8.0.21 - 9.2.0' : '2.17'
175+ } ;
176+ exports . MYSQL_LINUX_MINIMAL_INSTALL_AVAILABLE = {
177+ '5.7.19 - 8.0.15' : 'no' ,
178+ '8.0.16 - 8.0.20' : 'no-glibc-tag' ,
179+ '8.0.21 - 9.2.0' : 'glibc-tag'
180+ } ;
181+ exports . MYSQL_LINUX_MINIMAL_INSTALL_AVAILABLE_ARM64 = '>=8.0.33' ;
182+ exports . MYSQL_LINUX_FILE_EXTENSIONS = {
183+ x64 : {
184+ '5.7.19 - 8.0.11' : 'gz' ,
185+ '8.0.12 - 9.2.0' : 'xz'
186+ } ,
187+ arm64 : {
188+ '8.0.31 - 8.0.32' : 'gz' ,
189+ '8.0.33 - 9.2.0' : 'xz'
190+ }
191+ } ;
192+ exports . MYSQL_LINUX_MINIMAL_REBUILD_VERSIONS = '8.0.26' ;
0 commit comments