@blazedpath/commons 0.0.4
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/README.md +3 -0
- package/blz-base/health/index.js +215 -0
- package/blz-base/index.js +1466 -0
- package/blz-cache/LruCache.js +44 -0
- package/blz-cache/index.js +29 -0
- package/blz-config/index.js +434 -0
- package/blz-core/index.js +364 -0
- package/blz-cryptography/index.js +54 -0
- package/blz-datetimes/index.js +356 -0
- package/blz-file/example.dat +2545 -0
- package/blz-file/fileService.js +205 -0
- package/blz-file/index.js +94 -0
- package/blz-file/index.test.js +31 -0
- package/blz-file/lab.js +33 -0
- package/blz-hazelcast/index.js +189 -0
- package/blz-hazelcast/lib/credentials.js +25 -0
- package/blz-hazelcast/lib/credentialsFactory.js +12 -0
- package/blz-hazelcast/lib/hazelcastCache.js +234 -0
- package/blz-iterable/index.js +446 -0
- package/blz-json-schema/index.js +11 -0
- package/blz-jwt/index.js +121 -0
- package/blz-kafka/index.js +522 -0
- package/blz-math/index.js +131 -0
- package/blz-mongodb/index.js +326 -0
- package/blz-rds/__test__/scape.test.js +58 -0
- package/blz-rds/blz-rds-executor.js +578 -0
- package/blz-rds/blz-rds-helper.js +310 -0
- package/blz-rds/commands/core/add.js +13 -0
- package/blz-rds/commands/core/and.js +18 -0
- package/blz-rds/commands/core/asc.js +10 -0
- package/blz-rds/commands/core/avg.js +10 -0
- package/blz-rds/commands/core/column-ref.js +8 -0
- package/blz-rds/commands/core/count-distinct.js +10 -0
- package/blz-rds/commands/core/count.js +10 -0
- package/blz-rds/commands/core/decimal.js +8 -0
- package/blz-rds/commands/core/desc.js +10 -0
- package/blz-rds/commands/core/distinct.js +10 -0
- package/blz-rds/commands/core/divide.js +11 -0
- package/blz-rds/commands/core/embedded-exists.js +17 -0
- package/blz-rds/commands/core/embedded-select.js +17 -0
- package/blz-rds/commands/core/equals.js +9 -0
- package/blz-rds/commands/core/false.js +8 -0
- package/blz-rds/commands/core/greater-or-equal.js +9 -0
- package/blz-rds/commands/core/greater.js +9 -0
- package/blz-rds/commands/core/in.js +9 -0
- package/blz-rds/commands/core/integer.js +8 -0
- package/blz-rds/commands/core/is-not-null.js +11 -0
- package/blz-rds/commands/core/is-null-or-value.js +10 -0
- package/blz-rds/commands/core/is-null.js +11 -0
- package/blz-rds/commands/core/less-or-equal.js +9 -0
- package/blz-rds/commands/core/less-unary.js +12 -0
- package/blz-rds/commands/core/less.js +9 -0
- package/blz-rds/commands/core/like.js +12 -0
- package/blz-rds/commands/core/max.js +10 -0
- package/blz-rds/commands/core/min.js +10 -0
- package/blz-rds/commands/core/multiply.js +13 -0
- package/blz-rds/commands/core/not-equals.js +9 -0
- package/blz-rds/commands/core/not-in.js +9 -0
- package/blz-rds/commands/core/not.js +13 -0
- package/blz-rds/commands/core/null.js +8 -0
- package/blz-rds/commands/core/nvl.js +11 -0
- package/blz-rds/commands/core/or.js +13 -0
- package/blz-rds/commands/core/parameter.js +34 -0
- package/blz-rds/commands/core/remainder.js +16 -0
- package/blz-rds/commands/core/string.js +8 -0
- package/blz-rds/commands/core/subtract.js +13 -0
- package/blz-rds/commands/core/sum.js +10 -0
- package/blz-rds/commands/core/true.js +8 -0
- package/blz-rds/commands/core/tuple.js +13 -0
- package/blz-rds/commands/datetimes/add-days.js +11 -0
- package/blz-rds/commands/datetimes/add-hours.js +11 -0
- package/blz-rds/commands/datetimes/add-milliseconds.js +11 -0
- package/blz-rds/commands/datetimes/add-minutes.js +11 -0
- package/blz-rds/commands/datetimes/add-months.js +11 -0
- package/blz-rds/commands/datetimes/add-seconds.js +11 -0
- package/blz-rds/commands/datetimes/add-years.js +11 -0
- package/blz-rds/commands/datetimes/date-diff.js +11 -0
- package/blz-rds/commands/datetimes/date.js +12 -0
- package/blz-rds/commands/datetimes/datetime-diff.js +11 -0
- package/blz-rds/commands/datetimes/datetime.js +15 -0
- package/blz-rds/commands/datetimes/day.js +10 -0
- package/blz-rds/commands/datetimes/hour.js +10 -0
- package/blz-rds/commands/datetimes/millisecond.js +10 -0
- package/blz-rds/commands/datetimes/minute.js +10 -0
- package/blz-rds/commands/datetimes/month-text.js +10 -0
- package/blz-rds/commands/datetimes/month.js +10 -0
- package/blz-rds/commands/datetimes/now.js +9 -0
- package/blz-rds/commands/datetimes/second.js +10 -0
- package/blz-rds/commands/datetimes/subtract-days.js +11 -0
- package/blz-rds/commands/datetimes/subtract-hours.js +11 -0
- package/blz-rds/commands/datetimes/subtract-milliseconds.js +11 -0
- package/blz-rds/commands/datetimes/subtract-minutes.js +11 -0
- package/blz-rds/commands/datetimes/subtract-seconds.js +11 -0
- package/blz-rds/commands/datetimes/time-diff.js +11 -0
- package/blz-rds/commands/datetimes/time.js +13 -0
- package/blz-rds/commands/datetimes/today.js +9 -0
- package/blz-rds/commands/datetimes/week-day-text.js +10 -0
- package/blz-rds/commands/datetimes/week-day.js +10 -0
- package/blz-rds/commands/datetimes/week.js +10 -0
- package/blz-rds/commands/datetimes/year.js +10 -0
- package/blz-rds/commands/math/abs.js +10 -0
- package/blz-rds/commands/math/acos.js +10 -0
- package/blz-rds/commands/math/asin.js +10 -0
- package/blz-rds/commands/math/atan.js +10 -0
- package/blz-rds/commands/math/atan2.js +11 -0
- package/blz-rds/commands/math/ceil.js +10 -0
- package/blz-rds/commands/math/cos.js +10 -0
- package/blz-rds/commands/math/cosh.js +10 -0
- package/blz-rds/commands/math/exp.js +10 -0
- package/blz-rds/commands/math/floor.js +10 -0
- package/blz-rds/commands/math/log.js +18 -0
- package/blz-rds/commands/math/log10.js +10 -0
- package/blz-rds/commands/math/pow.js +11 -0
- package/blz-rds/commands/math/random.js +9 -0
- package/blz-rds/commands/math/round.js +18 -0
- package/blz-rds/commands/math/sign.js +10 -0
- package/blz-rds/commands/math/sin.js +10 -0
- package/blz-rds/commands/math/sinh.js +10 -0
- package/blz-rds/commands/math/sqrt.js +10 -0
- package/blz-rds/commands/math/tan.js +10 -0
- package/blz-rds/commands/math/tanh.js +10 -0
- package/blz-rds/commands/math/trunc.js +18 -0
- package/blz-rds/commands/strings/concat.js +20 -0
- package/blz-rds/commands/strings/contains.js +12 -0
- package/blz-rds/commands/strings/ends-with.js +12 -0
- package/blz-rds/commands/strings/index-of.js +11 -0
- package/blz-rds/commands/strings/is-null-or-empty.js +11 -0
- package/blz-rds/commands/strings/is-null-or-white-space.js +11 -0
- package/blz-rds/commands/strings/join.js +22 -0
- package/blz-rds/commands/strings/last-index-of.js +11 -0
- package/blz-rds/commands/strings/length.js +10 -0
- package/blz-rds/commands/strings/pad-left.js +20 -0
- package/blz-rds/commands/strings/pad-right.js +20 -0
- package/blz-rds/commands/strings/replace.js +12 -0
- package/blz-rds/commands/strings/starts-with.js +12 -0
- package/blz-rds/commands/strings/substring.js +12 -0
- package/blz-rds/commands/strings/to-lower.js +10 -0
- package/blz-rds/commands/strings/to-upper.js +10 -0
- package/blz-rds/commands/strings/trim-end.js +10 -0
- package/blz-rds/commands/strings/trim-start.js +10 -0
- package/blz-rds/commands/strings/trim.js +10 -0
- package/blz-rds/index.js +744 -0
- package/blz-rds-mysql/base.js +857 -0
- package/blz-rds-mysql/connection-manager.js +129 -0
- package/blz-rds-mysql/execute-bulk-insert.js +35 -0
- package/blz-rds-mysql/execute-bulk-merge.js +45 -0
- package/blz-rds-mysql/execute-non-query.js +34 -0
- package/blz-rds-mysql/execute-query.js +50 -0
- package/blz-rds-mysql/index.js +41 -0
- package/blz-rds-mysql/stored-procedure.js +207 -0
- package/blz-rds-mysql/syntaxis.json +114 -0
- package/blz-rds-mysqlx/base.js +846 -0
- package/blz-rds-mysqlx/connection-manager.js +141 -0
- package/blz-rds-mysqlx/execute-bulk-insert.js +35 -0
- package/blz-rds-mysqlx/execute-bulk-merge.js +45 -0
- package/blz-rds-mysqlx/execute-non-query.js +29 -0
- package/blz-rds-mysqlx/execute-query.js +39 -0
- package/blz-rds-mysqlx/index.js +41 -0
- package/blz-rds-mysqlx/stored-procedure.js +179 -0
- package/blz-rds-mysqlx/syntaxis.json +105 -0
- package/blz-rds-oracle/index.js +540 -0
- package/blz-rds-oracle/syntaxis.json +112 -0
- package/blz-rds-postgres/base.js +861 -0
- package/blz-rds-postgres/connection-manager.js +225 -0
- package/blz-rds-postgres/execute-bulk-insert.js +81 -0
- package/blz-rds-postgres/execute-bulk-merge.js +93 -0
- package/blz-rds-postgres/execute-non-query.js +23 -0
- package/blz-rds-postgres/execute-query.js +37 -0
- package/blz-rds-postgres/index.js +41 -0
- package/blz-rds-postgres/result-set.js +51 -0
- package/blz-rds-postgres/stored-procedure.js +116 -0
- package/blz-rds-postgres/syntaxis.json +114 -0
- package/blz-redis/index.js +217 -0
- package/blz-redis/lib/redisCache.js +265 -0
- package/blz-regex/index.js +25 -0
- package/blz-security/.eslintrc.js +15 -0
- package/blz-security/__test__/AuthorizationKpn.yaml +1043 -0
- package/blz-security/__test__/FinancingSetting.yaml +177 -0
- package/blz-security/__test__/KpnConfigPortal.yaml +330 -0
- package/blz-security/__test__/OrderManagement.yaml +5190 -0
- package/blz-security/__test__/Security.yaml +128 -0
- package/blz-security/__test__/autorization.test.js +105 -0
- package/blz-security/__test__/orderManagement.test.js +26 -0
- package/blz-security/__test__/secureUrl.test.js +79 -0
- package/blz-security/__test__/solveMergeRule.test.js +109 -0
- package/blz-security/__test__/sqlInjectionGuard.test.js +203 -0
- package/blz-security/__test__/xssGuard.test.js +204 -0
- package/blz-security/authorizationService.js +536 -0
- package/blz-security/config/global.js +8 -0
- package/blz-security/config/welcome +8 -0
- package/blz-security/doc/README.md +75 -0
- package/blz-security/filescanner/index.js +46 -0
- package/blz-security/helpers/consts.js +229 -0
- package/blz-security/helpers/utils.js +267 -0
- package/blz-security/implementations/cache.js +90 -0
- package/blz-security/implementations/oidc.js +404 -0
- package/blz-security/implementations/pkceCacheStore.js +23 -0
- package/blz-security/implementations/saml.js +10 -0
- package/blz-security/implementations/uma.js +63 -0
- package/blz-security/implementations/webAuthn.js +9 -0
- package/blz-security/implementations/wstg.js +72 -0
- package/blz-security/index.js +77 -0
- package/blz-security/lab/index.js +27 -0
- package/blz-security/middleware/HapiServerAzureAd.js +641 -0
- package/blz-security/middleware/HapiServerKeycloak.js +840 -0
- package/blz-security/middleware/HapiServerSimToken.js +247 -0
- package/blz-security/middleware/hapi.js +515 -0
- package/blz-security/middleware/hapiServer.js +974 -0
- package/blz-security/navigationMemoryRepository.js +15 -0
- package/blz-security/navigationMongoDbRepository.js +73 -0
- package/blz-security/secureUrlService.js +47 -0
- package/blz-security/securityService.js +409 -0
- package/blz-security/sqlInjectionGuard.js +162 -0
- package/blz-security/templates/forbidden.html +0 -0
- package/blz-security/templates/session-iframe-azure-ad.html +7 -0
- package/blz-security/templates/session-iframe.html +73 -0
- package/blz-security/templates/unauthorized.html +1 -0
- package/blz-security/xssGuard.js +87 -0
- package/blz-strings/index.js +167 -0
- package/blz-uuid/index.js +7 -0
- package/blz-yaml/index.js +19 -0
- package/index.js +84 -0
- package/package.json +97 -0
- package/process-managers/index.js +422 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
getSql: function (rdsHelper, rdsNode, rdsSyntaxis, values) {
|
|
3
|
+
return rdsHelper.stringFormat(
|
|
4
|
+
rdsSyntaxis.math.ceil,
|
|
5
|
+
rdsHelper.getSql(rdsNode.children[0], rdsSyntaxis, values));
|
|
6
|
+
},
|
|
7
|
+
getType: function (rdsHelper, rdsNode) {
|
|
8
|
+
return 'integer';
|
|
9
|
+
}
|
|
10
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
getSql: function (rdsHelper, rdsNode, rdsSyntaxis, values) {
|
|
3
|
+
return rdsHelper.stringFormat(
|
|
4
|
+
rdsSyntaxis.math.cos,
|
|
5
|
+
rdsHelper.getSql(rdsNode.children[0], rdsSyntaxis, values));
|
|
6
|
+
},
|
|
7
|
+
getType: function (rdsHelper, rdsNode) {
|
|
8
|
+
return 'decimal';
|
|
9
|
+
}
|
|
10
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
getSql: function (rdsHelper, rdsNode, rdsSyntaxis, values) {
|
|
3
|
+
return rdsHelper.stringFormat(
|
|
4
|
+
rdsSyntaxis.math.cosh,
|
|
5
|
+
rdsHelper.getSql(rdsNode.children[0], rdsSyntaxis, values));
|
|
6
|
+
},
|
|
7
|
+
getType: function (rdsHelper, rdsNode) {
|
|
8
|
+
return 'decimal';
|
|
9
|
+
}
|
|
10
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
getSql: function (rdsHelper, rdsNode, rdsSyntaxis, values) {
|
|
3
|
+
return rdsHelper.stringFormat(
|
|
4
|
+
rdsSyntaxis.math.exp,
|
|
5
|
+
rdsHelper.getSql(rdsNode.children[0], rdsSyntaxis, values));
|
|
6
|
+
},
|
|
7
|
+
getType: function (rdsHelper, rdsNode) {
|
|
8
|
+
return 'decimal';
|
|
9
|
+
}
|
|
10
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
getSql: function (rdsHelper, rdsNode, rdsSyntaxis, values) {
|
|
3
|
+
return rdsHelper.stringFormat(
|
|
4
|
+
rdsSyntaxis.math.floor,
|
|
5
|
+
rdsHelper.getSql(rdsNode.children[0], rdsSyntaxis, values));
|
|
6
|
+
},
|
|
7
|
+
getType: function (rdsHelper, rdsNode) {
|
|
8
|
+
return 'integer';
|
|
9
|
+
}
|
|
10
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
getSql: function (rdsHelper, rdsNode, rdsSyntaxis, values) {
|
|
3
|
+
if (rdsNode.children.length === 1) {
|
|
4
|
+
return rdsHelper.stringFormat(
|
|
5
|
+
rdsSyntaxis.math.log,
|
|
6
|
+
rdsHelper.getSql(rdsNode.children[0], rdsSyntaxis, values));
|
|
7
|
+
}
|
|
8
|
+
else {
|
|
9
|
+
return rdsHelper.stringFormat(
|
|
10
|
+
rdsSyntaxis.math.logBase,
|
|
11
|
+
rdsHelper.getSql(rdsNode.children[0], rdsSyntaxis, values),
|
|
12
|
+
rdsHelper.getSql(rdsNode.children[1], rdsSyntaxis, values));
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
getType: function (rdsHelper, rdsNode) {
|
|
16
|
+
return 'decimal';
|
|
17
|
+
}
|
|
18
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
getSql: function (rdsHelper, rdsNode, rdsSyntaxis, values) {
|
|
3
|
+
return rdsHelper.stringFormat(
|
|
4
|
+
rdsSyntaxis.math.log10,
|
|
5
|
+
rdsHelper.getSql(rdsNode.children[0], rdsSyntaxis, values));
|
|
6
|
+
},
|
|
7
|
+
getType: function (rdsHelper, rdsNode) {
|
|
8
|
+
return 'decimal';
|
|
9
|
+
}
|
|
10
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
getSql: function (rdsHelper, rdsNode, rdsSyntaxis, values) {
|
|
3
|
+
return rdsHelper.stringFormat(
|
|
4
|
+
rdsSyntaxis.math.pow,
|
|
5
|
+
rdsHelper.getSql(rdsNode.children[0], rdsSyntaxis, values),
|
|
6
|
+
rdsHelper.getSql(rdsNode.children[1], rdsSyntaxis, values));
|
|
7
|
+
},
|
|
8
|
+
getType: function (rdsHelper, rdsNode) {
|
|
9
|
+
return 'decimal';
|
|
10
|
+
}
|
|
11
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
getSql: function (rdsHelper, rdsNode, rdsSyntaxis, values) {
|
|
3
|
+
if (rdsNode.children.length === 1) {
|
|
4
|
+
return rdsHelper.stringFormat(
|
|
5
|
+
rdsSyntaxis.math.round,
|
|
6
|
+
rdsHelper.getSql(rdsNode.children[0], rdsSyntaxis, values));
|
|
7
|
+
}
|
|
8
|
+
else {
|
|
9
|
+
return rdsHelper.stringFormat(
|
|
10
|
+
rdsSyntaxis.math.roundWithDecimals,
|
|
11
|
+
rdsHelper.getSql(rdsNode.children[0], rdsSyntaxis, values),
|
|
12
|
+
rdsHelper.getSql(rdsNode.children[1], rdsSyntaxis, values));
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
getType: function (rdsHelper, rdsNode) {
|
|
16
|
+
return 'decimal';
|
|
17
|
+
}
|
|
18
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
getSql: function (rdsHelper, rdsNode, rdsSyntaxis, values) {
|
|
3
|
+
return rdsHelper.stringFormat(
|
|
4
|
+
rdsSyntaxis.math.sign,
|
|
5
|
+
rdsHelper.getSql(rdsNode.children[0], rdsSyntaxis, values));
|
|
6
|
+
},
|
|
7
|
+
getType: function (rdsHelper, rdsNode) {
|
|
8
|
+
return 'integer';
|
|
9
|
+
}
|
|
10
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
getSql: function (rdsHelper, rdsNode, rdsSyntaxis, values) {
|
|
3
|
+
return rdsHelper.stringFormat(
|
|
4
|
+
rdsSyntaxis.math.sin,
|
|
5
|
+
rdsHelper.getSql(rdsNode.children[0], rdsSyntaxis, values));
|
|
6
|
+
},
|
|
7
|
+
getType: function (rdsHelper, rdsNode) {
|
|
8
|
+
return 'decimal';
|
|
9
|
+
}
|
|
10
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
getSql: function (rdsHelper, rdsNode, rdsSyntaxis, values) {
|
|
3
|
+
return rdsHelper.stringFormat(
|
|
4
|
+
rdsSyntaxis.math.sinh,
|
|
5
|
+
rdsHelper.getSql(rdsNode.children[0], rdsSyntaxis, values));
|
|
6
|
+
},
|
|
7
|
+
getType: function (rdsHelper, rdsNode) {
|
|
8
|
+
return 'decimal';
|
|
9
|
+
}
|
|
10
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
getSql: function (rdsHelper, rdsNode, rdsSyntaxis, values) {
|
|
3
|
+
return rdsHelper.stringFormat(
|
|
4
|
+
rdsSyntaxis.math.sqrt,
|
|
5
|
+
rdsHelper.getSql(rdsNode.children[0], rdsSyntaxis, values));
|
|
6
|
+
},
|
|
7
|
+
getType: function (rdsHelper, rdsNode) {
|
|
8
|
+
return 'decimal';
|
|
9
|
+
}
|
|
10
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
getSql: function (rdsHelper, rdsNode, rdsSyntaxis, values) {
|
|
3
|
+
return rdsHelper.stringFormat(
|
|
4
|
+
rdsSyntaxis.math.tan,
|
|
5
|
+
rdsHelper.getSql(rdsNode.children[0], rdsSyntaxis, values));
|
|
6
|
+
},
|
|
7
|
+
getType: function (rdsHelper, rdsNode) {
|
|
8
|
+
return 'decimal';
|
|
9
|
+
}
|
|
10
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
getSql: function (rdsHelper, rdsNode, rdsSyntaxis, values) {
|
|
3
|
+
return rdsHelper.stringFormat(
|
|
4
|
+
rdsSyntaxis.math.tanh,
|
|
5
|
+
rdsHelper.getSql(rdsNode.children[0], rdsSyntaxis, values));
|
|
6
|
+
},
|
|
7
|
+
getType: function (rdsHelper, rdsNode) {
|
|
8
|
+
return 'decimal';
|
|
9
|
+
}
|
|
10
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
getSql: function (rdsHelper, rdsNode, rdsSyntaxis, values) {
|
|
3
|
+
if (rdsNode.children.length === 1) {
|
|
4
|
+
return rdsHelper.stringFormat(
|
|
5
|
+
rdsSyntaxis.math.trunc,
|
|
6
|
+
rdsHelper.getSql(rdsNode.children[0], rdsSyntaxis, values));
|
|
7
|
+
}
|
|
8
|
+
else {
|
|
9
|
+
return rdsHelper.stringFormat(
|
|
10
|
+
rdsSyntaxis.math.truncWithDecimals,
|
|
11
|
+
rdsHelper.getSql(rdsNode.children[0], rdsSyntaxis, values),
|
|
12
|
+
rdsHelper.getSql(rdsNode.children[1], rdsSyntaxis, values));
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
getType: function (rdsHelper, rdsNode) {
|
|
16
|
+
return 'decimal';
|
|
17
|
+
}
|
|
18
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
getSql: function (rdsHelper, rdsNode, rdsSyntaxis, values) {
|
|
3
|
+
let parts = [];
|
|
4
|
+
for (let i = 0; i < rdsNode.children.length; i++) {
|
|
5
|
+
parts.push(rdsHelper.getSql(rdsNode.children[i], rdsSyntaxis, values));
|
|
6
|
+
}
|
|
7
|
+
let formatConcat = rdsSyntaxis.strings.concat;
|
|
8
|
+
let beginIndex = formatConcat.indexOf("{[");
|
|
9
|
+
let endIndex = formatConcat.indexOf("]}");
|
|
10
|
+
if (beginIndex === -1 || endIndex === -1)
|
|
11
|
+
throw new Error('Invalid RDS syntaxis for concat');
|
|
12
|
+
let beginConcat = formatConcat.substring(0, beginIndex);
|
|
13
|
+
let separatorConcat = formatConcat.substring(beginIndex + 2, endIndex);
|
|
14
|
+
let endConcat = formatConcat.substring(endIndex + 2, formatConcat.length);
|
|
15
|
+
return beginConcat + parts.join(separatorConcat) + endConcat;
|
|
16
|
+
},
|
|
17
|
+
getType: function (rdsHelper, rdsNode) {
|
|
18
|
+
return 'string';
|
|
19
|
+
}
|
|
20
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
getSql: function (rdsHelper, rdsNode, rdsSyntaxis, values) {
|
|
3
|
+
return rdsHelper.stringFormat(
|
|
4
|
+
rdsSyntaxis.strings.contains,
|
|
5
|
+
rdsHelper.getSql(rdsNode.children[0], rdsSyntaxis, values),
|
|
6
|
+
rdsHelper.getSql(rdsNode.children[1], rdsSyntaxis, values));
|
|
7
|
+
},
|
|
8
|
+
getType: function (rdsHelper, rdsNode) {
|
|
9
|
+
return 'boolean';
|
|
10
|
+
},
|
|
11
|
+
logical: true
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
getSql: function (rdsHelper, rdsNode, rdsSyntaxis, values) {
|
|
3
|
+
return rdsHelper.stringFormat(
|
|
4
|
+
rdsSyntaxis.strings.endsWith,
|
|
5
|
+
rdsHelper.getSql(rdsNode.children[0], rdsSyntaxis, values),
|
|
6
|
+
rdsHelper.getSql(rdsNode.children[1], rdsSyntaxis, values));
|
|
7
|
+
},
|
|
8
|
+
getType: function (rdsHelper, rdsNode) {
|
|
9
|
+
return 'boolean';
|
|
10
|
+
},
|
|
11
|
+
logical: true
|
|
12
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
getSql: function (rdsHelper, rdsNode, rdsSyntaxis, values) {
|
|
3
|
+
return rdsHelper.stringFormat(
|
|
4
|
+
rdsSyntaxis.strings.indexOf,
|
|
5
|
+
rdsHelper.getSql(rdsNode.children[0], rdsSyntaxis, values),
|
|
6
|
+
rdsHelper.getSql(rdsNode.children[1], rdsSyntaxis, values));
|
|
7
|
+
},
|
|
8
|
+
getType: function (rdsHelper, rdsNode) {
|
|
9
|
+
return 'integer';
|
|
10
|
+
}
|
|
11
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
getSql: function (rdsHelper, rdsNode, rdsSyntaxis, values) {
|
|
3
|
+
return rdsHelper.stringFormat(
|
|
4
|
+
rdsSyntaxis.strings.isNullOrEmpty,
|
|
5
|
+
rdsHelper.getSql(rdsNode.children[0], rdsSyntaxis, values));
|
|
6
|
+
},
|
|
7
|
+
getType: function (rdsHelper, rdsNode) {
|
|
8
|
+
return 'boolean';
|
|
9
|
+
},
|
|
10
|
+
logical: true
|
|
11
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
getSql: function (rdsHelper, rdsNode, rdsSyntaxis, values) {
|
|
3
|
+
return rdsHelper.stringFormat(
|
|
4
|
+
rdsSyntaxis.strings.isNullOrWhiteSpace,
|
|
5
|
+
rdsHelper.getSql(rdsNode.children[0], rdsSyntaxis, values));
|
|
6
|
+
},
|
|
7
|
+
getType: function (rdsHelper, rdsNode) {
|
|
8
|
+
return 'boolean';
|
|
9
|
+
},
|
|
10
|
+
logical: true
|
|
11
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
getSql: function (rdsHelper, rdsNode, rdsSyntaxis, values) {
|
|
3
|
+
let parts = [];
|
|
4
|
+
for (let i = 0; i < rdsNode.children[0].children.length; i++) {
|
|
5
|
+
parts.push(rdsHelper.getSql(rdsNode.children[0].children[i], rdsSyntaxis, values));
|
|
6
|
+
}
|
|
7
|
+
let formatConcat = rdsHelper.stringFormat(
|
|
8
|
+
rdsSyntaxis.strings.join,
|
|
9
|
+
rdsHelper.getSql(rdsNode.children[1], rdsSyntaxis, values));
|
|
10
|
+
let beginIndex = formatConcat.indexOf("{[");
|
|
11
|
+
let endIndex = formatConcat.indexOf("]}");
|
|
12
|
+
if (beginIndex === -1 || endIndex === -1)
|
|
13
|
+
throw new Error('Invalid RDS syntaxis for join');
|
|
14
|
+
let beginConcat = formatConcat.substring(0, beginIndex);
|
|
15
|
+
let separatorConcat = formatConcat.substring(beginIndex + 2, endIndex);
|
|
16
|
+
let endConcat = formatConcat.substring(endIndex + 2, formatConcat.length);
|
|
17
|
+
return beginConcat + parts.join(separatorConcat) + endConcat;
|
|
18
|
+
},
|
|
19
|
+
getType: function (rdsHelper, rdsNode) {
|
|
20
|
+
return 'string';
|
|
21
|
+
}
|
|
22
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
getSql: function (rdsHelper, rdsNode, rdsSyntaxis, values) {
|
|
3
|
+
return rdsHelper.stringFormat(
|
|
4
|
+
rdsSyntaxis.strings.lastIndexOf,
|
|
5
|
+
rdsHelper.getSql(rdsNode.children[0], rdsSyntaxis, values),
|
|
6
|
+
rdsHelper.getSql(rdsNode.children[1], rdsSyntaxis, values));
|
|
7
|
+
},
|
|
8
|
+
getType: function (rdsHelper, rdsNode) {
|
|
9
|
+
return 'integer';
|
|
10
|
+
}
|
|
11
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
getSql: function (rdsHelper, rdsNode, rdsSyntaxis, values) {
|
|
3
|
+
return rdsHelper.stringFormat(
|
|
4
|
+
rdsSyntaxis.strings.length,
|
|
5
|
+
rdsHelper.getSql(rdsNode.children[0], rdsSyntaxis, values));
|
|
6
|
+
},
|
|
7
|
+
getType: function (rdsHelper, rdsNode) {
|
|
8
|
+
return 'integer';
|
|
9
|
+
}
|
|
10
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
getSql: function (rdsHelper, rdsNode, rdsSyntaxis, values) {
|
|
3
|
+
if (rdsNode.children.length === 2) {
|
|
4
|
+
return rdsHelper.stringFormat(
|
|
5
|
+
rdsSyntaxis.strings.padLeft,
|
|
6
|
+
rdsHelper.getSql(rdsNode.children[0], rdsSyntaxis, values),
|
|
7
|
+
rdsHelper.getSql(rdsNode.children[1], rdsSyntaxis, values));
|
|
8
|
+
}
|
|
9
|
+
else {
|
|
10
|
+
return rdsHelper.stringFormat(
|
|
11
|
+
rdsSyntaxis.strings.padLeftPattern,
|
|
12
|
+
rdsHelper.getSql(rdsNode.children[0], rdsSyntaxis, values),
|
|
13
|
+
rdsHelper.getSql(rdsNode.children[1], rdsSyntaxis, values),
|
|
14
|
+
rdsHelper.getSql(rdsNode.children[2], rdsSyntaxis, values));
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
getType: function (rdsHelper, rdsNode) {
|
|
18
|
+
return 'string';
|
|
19
|
+
}
|
|
20
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
getSql: function (rdsHelper, rdsNode, rdsSyntaxis, values) {
|
|
3
|
+
if (rdsNode.children.length === 2) {
|
|
4
|
+
return rdsHelper.stringFormat(
|
|
5
|
+
rdsSyntaxis.strings.padRight,
|
|
6
|
+
rdsHelper.getSql(rdsNode.children[0], rdsSyntaxis, values),
|
|
7
|
+
rdsHelper.getSql(rdsNode.children[1], rdsSyntaxis, values));
|
|
8
|
+
}
|
|
9
|
+
else {
|
|
10
|
+
return rdsHelper.stringFormat(
|
|
11
|
+
rdsSyntaxis.strings.padRightPattern,
|
|
12
|
+
rdsHelper.getSql(rdsNode.children[0], rdsSyntaxis, values),
|
|
13
|
+
rdsHelper.getSql(rdsNode.children[1], rdsSyntaxis, values),
|
|
14
|
+
rdsHelper.getSql(rdsNode.children[2], rdsSyntaxis, values));
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
getType: function (rdsHelper, rdsNode) {
|
|
18
|
+
return 'string';
|
|
19
|
+
}
|
|
20
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
getSql: function (rdsHelper, rdsNode, rdsSyntaxis, values) {
|
|
3
|
+
return rdsHelper.stringFormat(
|
|
4
|
+
rdsSyntaxis.strings.replace,
|
|
5
|
+
rdsHelper.getSql(rdsNode.children[0], rdsSyntaxis, values),
|
|
6
|
+
rdsHelper.getSql(rdsNode.children[1], rdsSyntaxis, values),
|
|
7
|
+
rdsHelper.getSql(rdsNode.children[2], rdsSyntaxis, values));
|
|
8
|
+
},
|
|
9
|
+
getType: function (rdsHelper, rdsNode) {
|
|
10
|
+
return 'string';
|
|
11
|
+
}
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
getSql: function (rdsHelper, rdsNode, rdsSyntaxis, values) {
|
|
3
|
+
return rdsHelper.stringFormat(
|
|
4
|
+
rdsSyntaxis.strings.startsWith,
|
|
5
|
+
rdsHelper.getSql(rdsNode.children[0], rdsSyntaxis, values),
|
|
6
|
+
rdsHelper.getSql(rdsNode.children[1], rdsSyntaxis, values));
|
|
7
|
+
},
|
|
8
|
+
getType: function (rdsHelper, rdsNode) {
|
|
9
|
+
return 'boolean';
|
|
10
|
+
},
|
|
11
|
+
logical: true
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
getSql: function (rdsHelper, rdsNode, rdsSyntaxis, values) {
|
|
3
|
+
return rdsHelper.stringFormat(
|
|
4
|
+
rdsSyntaxis.strings.substring,
|
|
5
|
+
rdsHelper.getSql(rdsNode.children[0], rdsSyntaxis, values),
|
|
6
|
+
rdsHelper.getSql(rdsNode.children[1], rdsSyntaxis, values),
|
|
7
|
+
rdsHelper.getSql(rdsNode.children[2], rdsSyntaxis, values));
|
|
8
|
+
},
|
|
9
|
+
getType: function (rdsHelper, rdsNode) {
|
|
10
|
+
return 'string';
|
|
11
|
+
}
|
|
12
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
getSql: function (rdsHelper, rdsNode, rdsSyntaxis, values) {
|
|
3
|
+
return rdsHelper.stringFormat(
|
|
4
|
+
rdsSyntaxis.strings.toLower,
|
|
5
|
+
rdsHelper.getSql(rdsNode.children[0], rdsSyntaxis, values));
|
|
6
|
+
},
|
|
7
|
+
getType: function (rdsHelper, rdsNode) {
|
|
8
|
+
return 'string';
|
|
9
|
+
}
|
|
10
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
getSql: function (rdsHelper, rdsNode, rdsSyntaxis, values) {
|
|
3
|
+
return rdsHelper.stringFormat(
|
|
4
|
+
rdsSyntaxis.strings.toUpper,
|
|
5
|
+
rdsHelper.getSql(rdsNode.children[0], rdsSyntaxis, values));
|
|
6
|
+
},
|
|
7
|
+
getType: function (rdsHelper, rdsNode) {
|
|
8
|
+
return 'string';
|
|
9
|
+
}
|
|
10
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
getSql: function (rdsHelper, rdsNode, rdsSyntaxis, values) {
|
|
3
|
+
return rdsHelper.stringFormat(
|
|
4
|
+
rdsSyntaxis.strings.trimEnd,
|
|
5
|
+
rdsHelper.getSql(rdsNode.children[0], rdsSyntaxis, values));
|
|
6
|
+
},
|
|
7
|
+
getType: function (rdsHelper, rdsNode) {
|
|
8
|
+
return 'string';
|
|
9
|
+
}
|
|
10
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
getSql: function (rdsHelper, rdsNode, rdsSyntaxis, values) {
|
|
3
|
+
return rdsHelper.stringFormat(
|
|
4
|
+
rdsSyntaxis.strings.trimStart,
|
|
5
|
+
rdsHelper.getSql(rdsNode.children[0], rdsSyntaxis, values));
|
|
6
|
+
},
|
|
7
|
+
getType: function (rdsHelper, rdsNode) {
|
|
8
|
+
return 'string';
|
|
9
|
+
}
|
|
10
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
getSql: function (rdsHelper, rdsNode, rdsSyntaxis, values) {
|
|
3
|
+
return rdsHelper.stringFormat(
|
|
4
|
+
rdsSyntaxis.strings.trim,
|
|
5
|
+
rdsHelper.getSql(rdsNode.children[0], rdsSyntaxis, values));
|
|
6
|
+
},
|
|
7
|
+
getType: function (rdsHelper, rdsNode) {
|
|
8
|
+
return 'string';
|
|
9
|
+
}
|
|
10
|
+
};
|