@tachybase/module-multi-app 0.23.8
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.
- package/.turbo/turbo-build.log +14 -0
- package/README.md +34 -0
- package/README.zh-CN.md +34 -0
- package/client.d.ts +1 -0
- package/client.js +1 -0
- package/dist/client/AppManager.d.ts +2 -0
- package/dist/client/AppNameInput.d.ts +2 -0
- package/dist/client/MultiAppBlockInitializer.d.ts +2 -0
- package/dist/client/MultiAppManagerProvider.d.ts +2 -0
- package/dist/client/MultiAppManagerProvider.style.d.ts +5 -0
- package/dist/client/Settings.d.ts +2 -0
- package/dist/client/index.d.ts +6 -0
- package/dist/client/index.js +1 -0
- package/dist/client/settings/schemas/applications.d.ts +13 -0
- package/dist/client/utils.d.ts +4 -0
- package/dist/constants.d.ts +1 -0
- package/dist/constants.js +27 -0
- package/dist/externalVersion.js +16 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +39 -0
- package/dist/locale/en-US.json +27 -0
- package/dist/locale/es-ES.json +9 -0
- package/dist/locale/ko_KR.json +11 -0
- package/dist/locale/pt-BR.json +9 -0
- package/dist/locale/zh-CN.json +27 -0
- package/dist/node_modules/mariadb/LICENSE +502 -0
- package/dist/node_modules/mariadb/callback.js +41 -0
- package/dist/node_modules/mariadb/lib/cmd/batch-bulk.js +278 -0
- package/dist/node_modules/mariadb/lib/cmd/batch-rewrite.js +372 -0
- package/dist/node_modules/mariadb/lib/cmd/change-user.js +149 -0
- package/dist/node_modules/mariadb/lib/cmd/class/ok-packet.js +17 -0
- package/dist/node_modules/mariadb/lib/cmd/column-definition.js +102 -0
- package/dist/node_modules/mariadb/lib/cmd/command.js +168 -0
- package/dist/node_modules/mariadb/lib/cmd/common-binary-cmd.js +327 -0
- package/dist/node_modules/mariadb/lib/cmd/common-text-cmd.js +427 -0
- package/dist/node_modules/mariadb/lib/cmd/handshake/auth/caching-sha2-password-auth.js +168 -0
- package/dist/node_modules/mariadb/lib/cmd/handshake/auth/clear-password-auth.js +23 -0
- package/dist/node_modules/mariadb/lib/cmd/handshake/auth/ed25519-password-auth.js +761 -0
- package/dist/node_modules/mariadb/lib/cmd/handshake/auth/native-password-auth.js +55 -0
- package/dist/node_modules/mariadb/lib/cmd/handshake/auth/pam-password-auth.js +58 -0
- package/dist/node_modules/mariadb/lib/cmd/handshake/auth/plugin-auth.js +19 -0
- package/dist/node_modules/mariadb/lib/cmd/handshake/auth/sha256-password-auth.js +142 -0
- package/dist/node_modules/mariadb/lib/cmd/handshake/client-capabilities.js +74 -0
- package/dist/node_modules/mariadb/lib/cmd/handshake/client-handshake-response.js +126 -0
- package/dist/node_modules/mariadb/lib/cmd/handshake/handshake.js +292 -0
- package/dist/node_modules/mariadb/lib/cmd/handshake/initial-handshake.js +74 -0
- package/dist/node_modules/mariadb/lib/cmd/handshake/ssl-request.js +29 -0
- package/dist/node_modules/mariadb/lib/cmd/ping.js +52 -0
- package/dist/node_modules/mariadb/lib/cmd/query.js +255 -0
- package/dist/node_modules/mariadb/lib/cmd/quit.js +28 -0
- package/dist/node_modules/mariadb/lib/cmd/reset.js +54 -0
- package/dist/node_modules/mariadb/lib/cmd/resultset.js +607 -0
- package/dist/node_modules/mariadb/lib/cmd/stream.js +45 -0
- package/dist/node_modules/mariadb/lib/config/connection-options.js +258 -0
- package/dist/node_modules/mariadb/lib/config/pool-cluster-options.js +19 -0
- package/dist/node_modules/mariadb/lib/config/pool-options.js +47 -0
- package/dist/node_modules/mariadb/lib/connection-callback.js +160 -0
- package/dist/node_modules/mariadb/lib/connection.js +1460 -0
- package/dist/node_modules/mariadb/lib/const/capabilities.js +64 -0
- package/dist/node_modules/mariadb/lib/const/collations.js +473 -0
- package/dist/node_modules/mariadb/lib/const/connection_status.js +13 -0
- package/dist/node_modules/mariadb/lib/const/error-code.js +1282 -0
- package/dist/node_modules/mariadb/lib/const/field-detail.js +35 -0
- package/dist/node_modules/mariadb/lib/const/field-type.js +71 -0
- package/dist/node_modules/mariadb/lib/const/server-status.js +30 -0
- package/dist/node_modules/mariadb/lib/const/state-change.js +12 -0
- package/dist/node_modules/mariadb/lib/filtered-pool-cluster.js +81 -0
- package/dist/node_modules/mariadb/lib/io/bulk-packet.js +590 -0
- package/dist/node_modules/mariadb/lib/io/compression-input-stream.js +141 -0
- package/dist/node_modules/mariadb/lib/io/compression-output-stream.js +171 -0
- package/dist/node_modules/mariadb/lib/io/packet-input-stream.js +193 -0
- package/dist/node_modules/mariadb/lib/io/packet-node-encoded.js +36 -0
- package/dist/node_modules/mariadb/lib/io/packet-node-iconv.js +37 -0
- package/dist/node_modules/mariadb/lib/io/packet-output-stream.js +502 -0
- package/dist/node_modules/mariadb/lib/io/packet.js +515 -0
- package/dist/node_modules/mariadb/lib/io/rewrite-packet.js +481 -0
- package/dist/node_modules/mariadb/lib/misc/connection-information.js +96 -0
- package/dist/node_modules/mariadb/lib/misc/errors.js +123 -0
- package/dist/node_modules/mariadb/lib/misc/parse.js +1033 -0
- package/dist/node_modules/mariadb/lib/misc/utils.js +298 -0
- package/dist/node_modules/mariadb/lib/pool-base.js +611 -0
- package/dist/node_modules/mariadb/lib/pool-callback.js +202 -0
- package/dist/node_modules/mariadb/lib/pool-cluster-callback.js +66 -0
- package/dist/node_modules/mariadb/lib/pool-cluster.js +407 -0
- package/dist/node_modules/mariadb/lib/pool-promise.js +108 -0
- package/dist/node_modules/mariadb/package.json +1 -0
- package/dist/node_modules/mariadb/promise.js +34 -0
- package/dist/node_modules/mariadb/types/index.d.ts +870 -0
- package/dist/server/actions/apps.d.ts +5 -0
- package/dist/server/actions/apps.js +117 -0
- package/dist/server/app-lifecycle.d.ts +8 -0
- package/dist/server/app-lifecycle.js +99 -0
- package/dist/server/app-start-env.d.ts +2 -0
- package/dist/server/app-start-env.js +105 -0
- package/dist/server/collections/applications.d.ts +2 -0
- package/dist/server/collections/applications.js +82 -0
- package/dist/server/index.d.ts +4 -0
- package/dist/server/index.js +29 -0
- package/dist/server/middlewares/app-selector.d.ts +1 -0
- package/dist/server/middlewares/app-selector.js +47 -0
- package/dist/server/middlewares/index.d.ts +2 -0
- package/dist/server/middlewares/index.js +23 -0
- package/dist/server/middlewares/inject-app-list.d.ts +1 -0
- package/dist/server/middlewares/inject-app-list.js +48 -0
- package/dist/server/migrations/20240820153000-add-apps-tmpl.d.ts +6 -0
- package/dist/server/migrations/20240820153000-add-apps-tmpl.js +47 -0
- package/dist/server/migrations/20241126124904-add-createdBy.d.ts +6 -0
- package/dist/server/migrations/20241126124904-add-createdBy.js +41 -0
- package/dist/server/models/application.d.ts +10 -0
- package/dist/server/models/application.js +57 -0
- package/dist/server/server.d.ts +19 -0
- package/dist/server/server.js +246 -0
- package/dist/swagger/index.d.ts +197 -0
- package/dist/swagger/index.js +227 -0
- package/package.json +38 -0
- package/server.d.ts +2 -0
- package/server.js +1 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Column definition packet "Field detail" flag value
|
|
3
|
+
* see : https://mariadb.com/kb/en/library/resultset/#field-detail-flag
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
// field cannot be null
|
|
7
|
+
module.exports.NOT_NULL = 1;
|
|
8
|
+
// field is a primary key
|
|
9
|
+
module.exports.PRIMARY_KEY = 2;
|
|
10
|
+
//field is unique
|
|
11
|
+
module.exports.UNIQUE_KEY = 4;
|
|
12
|
+
//field is in a multiple key
|
|
13
|
+
module.exports.MULTIPLE_KEY = 8;
|
|
14
|
+
//is this field a Blob
|
|
15
|
+
module.exports.BLOB = 1 << 4;
|
|
16
|
+
// is this field unsigned
|
|
17
|
+
module.exports.UNSIGNED = 1 << 5;
|
|
18
|
+
//is this field a zerofill
|
|
19
|
+
module.exports.ZEROFILL_FLAG = 1 << 6;
|
|
20
|
+
//whether this field has a binary collation
|
|
21
|
+
module.exports.BINARY_COLLATION = 1 << 7;
|
|
22
|
+
//Field is an enumeration
|
|
23
|
+
module.exports.ENUM = 1 << 8;
|
|
24
|
+
//field auto-increment
|
|
25
|
+
module.exports.AUTO_INCREMENT = 1 << 9;
|
|
26
|
+
//field is a timestamp value
|
|
27
|
+
module.exports.TIMESTAMP = 1 << 10;
|
|
28
|
+
//field is a SET
|
|
29
|
+
module.exports.SET = 1 << 11;
|
|
30
|
+
//field doesn't have default value
|
|
31
|
+
module.exports.NO_DEFAULT_VALUE_FLAG = 1 << 12;
|
|
32
|
+
//field is set to NOW on UPDATE
|
|
33
|
+
module.exports.ON_UPDATE_NOW_FLAG = 1 << 13;
|
|
34
|
+
//field is num
|
|
35
|
+
module.exports.NUM_FLAG = 1 << 14;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Field types
|
|
3
|
+
* see https://mariadb.com/kb/en/library/resultset/#field-types
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
module.exports.DECIMAL = 0;
|
|
7
|
+
module.exports.TINY = 1;
|
|
8
|
+
module.exports.SHORT = 2;
|
|
9
|
+
module.exports.LONG = 3;
|
|
10
|
+
module.exports.FLOAT = 4;
|
|
11
|
+
module.exports.DOUBLE = 5;
|
|
12
|
+
module.exports.NULL = 6;
|
|
13
|
+
module.exports.TIMESTAMP = 7;
|
|
14
|
+
module.exports.LONGLONG = 8;
|
|
15
|
+
module.exports.INT24 = 9;
|
|
16
|
+
module.exports.DATE = 10;
|
|
17
|
+
module.exports.TIME = 11;
|
|
18
|
+
module.exports.DATETIME = 12;
|
|
19
|
+
module.exports.YEAR = 13;
|
|
20
|
+
module.exports.NEWDATE = 14;
|
|
21
|
+
module.exports.VARCHAR = 15;
|
|
22
|
+
module.exports.BIT = 16;
|
|
23
|
+
module.exports.TIMESTAMP2 = 17;
|
|
24
|
+
module.exports.DATETIME2 = 18;
|
|
25
|
+
module.exports.TIME2 = 19;
|
|
26
|
+
module.exports.JSON = 245; //only for MySQL
|
|
27
|
+
module.exports.NEWDECIMAL = 246;
|
|
28
|
+
module.exports.ENUM = 247;
|
|
29
|
+
module.exports.SET = 248;
|
|
30
|
+
module.exports.TINY_BLOB = 249;
|
|
31
|
+
module.exports.MEDIUM_BLOB = 250;
|
|
32
|
+
module.exports.LONG_BLOB = 251;
|
|
33
|
+
module.exports.BLOB = 252;
|
|
34
|
+
module.exports.VAR_STRING = 253;
|
|
35
|
+
module.exports.STRING = 254;
|
|
36
|
+
module.exports.GEOMETRY = 255;
|
|
37
|
+
|
|
38
|
+
const typeNames = [];
|
|
39
|
+
typeNames[0] = 'DECIMAL';
|
|
40
|
+
typeNames[1] = 'TINY';
|
|
41
|
+
typeNames[2] = 'SHORT';
|
|
42
|
+
typeNames[3] = 'LONG';
|
|
43
|
+
typeNames[4] = 'FLOAT';
|
|
44
|
+
typeNames[5] = 'DOUBLE';
|
|
45
|
+
typeNames[6] = 'NULL';
|
|
46
|
+
typeNames[7] = 'TIMESTAMP';
|
|
47
|
+
typeNames[8] = 'LONGLONG';
|
|
48
|
+
typeNames[9] = 'INT24';
|
|
49
|
+
typeNames[10] = 'DATE';
|
|
50
|
+
typeNames[11] = 'TIME';
|
|
51
|
+
typeNames[12] = 'DATETIME';
|
|
52
|
+
typeNames[13] = 'YEAR';
|
|
53
|
+
typeNames[14] = 'NEWDATE';
|
|
54
|
+
typeNames[15] = 'VARCHAR';
|
|
55
|
+
typeNames[16] = 'BIT';
|
|
56
|
+
typeNames[17] = 'TIMESTAMP2';
|
|
57
|
+
typeNames[18] = 'DATETIME2';
|
|
58
|
+
typeNames[19] = 'TIME2';
|
|
59
|
+
typeNames[245] = 'JSON';
|
|
60
|
+
typeNames[246] = 'NEWDECIMAL';
|
|
61
|
+
typeNames[247] = 'ENUM';
|
|
62
|
+
typeNames[248] = 'SET';
|
|
63
|
+
typeNames[249] = 'TINY_BLOB';
|
|
64
|
+
typeNames[250] = 'MEDIUM_BLOB';
|
|
65
|
+
typeNames[251] = 'LONG_BLOB';
|
|
66
|
+
typeNames[252] = 'BLOB';
|
|
67
|
+
typeNames[253] = 'VAR_STRING';
|
|
68
|
+
typeNames[254] = 'STRING';
|
|
69
|
+
typeNames[255] = 'GEOMETRY';
|
|
70
|
+
|
|
71
|
+
module.exports.TYPES = typeNames;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* possible server status flag value
|
|
3
|
+
* see https://mariadb.com/kb/en/library/ok_packet/#server-status-flag
|
|
4
|
+
* @type {number}
|
|
5
|
+
*/
|
|
6
|
+
//A transaction is currently active
|
|
7
|
+
module.exports.STATUS_IN_TRANS = 1;
|
|
8
|
+
//Autocommit mode is set
|
|
9
|
+
module.exports.STATUS_AUTOCOMMIT = 2;
|
|
10
|
+
//more results exists (more packet follow)
|
|
11
|
+
module.exports.MORE_RESULTS_EXISTS = 8;
|
|
12
|
+
module.exports.QUERY_NO_GOOD_INDEX_USED = 16;
|
|
13
|
+
module.exports.QUERY_NO_INDEX_USED = 32;
|
|
14
|
+
//when using COM_STMT_FETCH, indicate that current cursor still has result (deprecated)
|
|
15
|
+
module.exports.STATUS_CURSOR_EXISTS = 64;
|
|
16
|
+
//when using COM_STMT_FETCH, indicate that current cursor has finished to send results (deprecated)
|
|
17
|
+
module.exports.STATUS_LAST_ROW_SENT = 128;
|
|
18
|
+
//database has been dropped
|
|
19
|
+
module.exports.STATUS_DB_DROPPED = 1 << 8;
|
|
20
|
+
//current escape mode is "no backslash escape"
|
|
21
|
+
module.exports.STATUS_NO_BACKSLASH_ESCAPES = 1 << 9;
|
|
22
|
+
//A DDL change did have an impact on an existing PREPARE (an automatic reprepare has been executed)
|
|
23
|
+
module.exports.STATUS_METADATA_CHANGED = 1 << 10;
|
|
24
|
+
module.exports.QUERY_WAS_SLOW = 1 << 11;
|
|
25
|
+
//this result-set contain stored procedure output parameter
|
|
26
|
+
module.exports.PS_OUT_PARAMS = 1 << 12;
|
|
27
|
+
//current transaction is a read-only transaction
|
|
28
|
+
module.exports.STATUS_IN_TRANS_READONLY = 1 << 13;
|
|
29
|
+
//session state change. see Session change type for more information
|
|
30
|
+
module.exports.SESSION_STATE_CHANGED = 1 << 14;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session change type.
|
|
3
|
+
* see : https://mariadb.com/kb/en/library/ok_packet/#session-change-type
|
|
4
|
+
* @type {number}
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
module.exports.SESSION_TRACK_SYSTEM_VARIABLES = 0;
|
|
8
|
+
module.exports.SESSION_TRACK_SCHEMA = 1;
|
|
9
|
+
module.exports.SESSION_TRACK_STATE_CHANGE = 2;
|
|
10
|
+
module.exports.SESSION_TRACK_GTIDS = 3;
|
|
11
|
+
module.exports.SESSION_TRACK_TRANSACTION_CHARACTERISTICS = 4;
|
|
12
|
+
module.exports.SESSION_TRACK_TRANSACTION_STATE = 5;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Similar to pool cluster with pre-set pattern and selector.
|
|
3
|
+
* Additional method query
|
|
4
|
+
*
|
|
5
|
+
* @param poolCluster cluster
|
|
6
|
+
* @param patternArg pre-set pattern
|
|
7
|
+
* @param selectorArg pre-set selector
|
|
8
|
+
* @constructor
|
|
9
|
+
*/
|
|
10
|
+
function FilteredPoolCluster(poolCluster, patternArg, selectorArg) {
|
|
11
|
+
const cluster = poolCluster;
|
|
12
|
+
const pattern = patternArg;
|
|
13
|
+
const selector = selectorArg;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Get a connection according to previously indicated pattern and selector.
|
|
17
|
+
*
|
|
18
|
+
* @return {Promise}
|
|
19
|
+
*/
|
|
20
|
+
this.getConnection = () => {
|
|
21
|
+
return cluster.getConnection(pattern, selector);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Execute a query on one connection from available pools matching pattern
|
|
26
|
+
* in cluster.
|
|
27
|
+
*
|
|
28
|
+
* @param sql sql command
|
|
29
|
+
* @param value parameter value of sql command (not mandatory)
|
|
30
|
+
* @return {Promise}
|
|
31
|
+
*/
|
|
32
|
+
this.query = function (sql, value) {
|
|
33
|
+
return cluster
|
|
34
|
+
.getConnection(pattern, selector)
|
|
35
|
+
.then((conn) => {
|
|
36
|
+
return conn
|
|
37
|
+
.query(sql, value)
|
|
38
|
+
.then((res) => {
|
|
39
|
+
conn.end();
|
|
40
|
+
return res;
|
|
41
|
+
})
|
|
42
|
+
.catch((err) => {
|
|
43
|
+
conn.end();
|
|
44
|
+
return Promise.reject(err);
|
|
45
|
+
});
|
|
46
|
+
})
|
|
47
|
+
.catch((err) => {
|
|
48
|
+
return Promise.reject(err);
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Execute a batch on one connection from available pools matching pattern
|
|
54
|
+
* in cluster.
|
|
55
|
+
*
|
|
56
|
+
* @param sql sql command
|
|
57
|
+
* @param value parameter value of sql command
|
|
58
|
+
* @return {Promise}
|
|
59
|
+
*/
|
|
60
|
+
this.batch = function (sql, value) {
|
|
61
|
+
return cluster
|
|
62
|
+
.getConnection(pattern, selector)
|
|
63
|
+
.then((conn) => {
|
|
64
|
+
return conn
|
|
65
|
+
.batch(sql, value)
|
|
66
|
+
.then((res) => {
|
|
67
|
+
conn.end();
|
|
68
|
+
return res;
|
|
69
|
+
})
|
|
70
|
+
.catch((err) => {
|
|
71
|
+
conn.end();
|
|
72
|
+
return Promise.reject(err);
|
|
73
|
+
});
|
|
74
|
+
})
|
|
75
|
+
.catch((err) => {
|
|
76
|
+
return Promise.reject(err);
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
module.exports = FilteredPoolCluster;
|