@xrystal/core 3.47.7 → 3.48.1

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "author": "Yusuf Yasir KAYGUSUZ",
3
3
  "name": "@xrystal/core",
4
- "version": "3.47.7",
4
+ "version": "3.48.1",
5
5
  "description": "microservice runtime library",
6
6
  "publishConfig": {
7
7
  "access": "public",
@@ -25,3 +25,5 @@ export * from '../../utils/helpers/state';
25
25
  export * from '../../utils/helpers/handlers';
26
26
  export * from '../../utils/helpers/runtime';
27
27
  export * from '../../utils/helpers/kafka';
28
+ export * from '../../utils/helpers/redis';
29
+ export * from '../../utils/helpers/mongo';
@@ -1 +1 @@
1
- export{default as pic}from"picocolors";export*from"../../utils/helpers/core";export*from"../../utils/helpers/path";export*from"../../utils/helpers/is";export*from"../../utils/helpers/id";export*from"../../utils/helpers/validates";export*from"../../utils/helpers/ip";export*from"../../utils/helpers/hash/crypto";export*from"../../utils/helpers/string";export*from"../../utils/helpers/objects";export*from"../../utils/helpers/locales";export*from"../../utils/helpers/timer";export*from"../../utils/helpers/date";export*from"../../utils/helpers/math";export*from"../../utils/helpers/regex/checkSpecialRegexControl";export*from"../../utils/helpers/filters";export*from"../../utils/helpers/framework";export*from"../../utils/helpers/protocol";export*from"../../utils/helpers/dto";export*from"../../utils/helpers/dispatch";export*from"../../utils/helpers/middleware";export*from"../../utils/helpers/context";export*from"../../utils/helpers/tmp";export*from"../../utils/helpers/state";export*from"../../utils/helpers/handlers";export*from"../../utils/helpers/runtime";export*from"../../utils/helpers/kafka";
1
+ export{default as pic}from"picocolors";export*from"../../utils/helpers/core";export*from"../../utils/helpers/path";export*from"../../utils/helpers/is";export*from"../../utils/helpers/id";export*from"../../utils/helpers/validates";export*from"../../utils/helpers/ip";export*from"../../utils/helpers/hash/crypto";export*from"../../utils/helpers/string";export*from"../../utils/helpers/objects";export*from"../../utils/helpers/locales";export*from"../../utils/helpers/timer";export*from"../../utils/helpers/date";export*from"../../utils/helpers/math";export*from"../../utils/helpers/regex/checkSpecialRegexControl";export*from"../../utils/helpers/filters";export*from"../../utils/helpers/framework";export*from"../../utils/helpers/protocol";export*from"../../utils/helpers/dto";export*from"../../utils/helpers/dispatch";export*from"../../utils/helpers/middleware";export*from"../../utils/helpers/context";export*from"../../utils/helpers/tmp";export*from"../../utils/helpers/state";export*from"../../utils/helpers/handlers";export*from"../../utils/helpers/runtime";export*from"../../utils/helpers/kafka";export*from"../../utils/helpers/redis";export*from"../../utils/helpers/mongo";
@@ -0,0 +1,8 @@
1
+ export type MongoConnectOptions = {
2
+ tls?: boolean;
3
+ tlsCAFile?: string;
4
+ tlsCertificateKeyFile?: string;
5
+ tlsAllowInvalidHostnames?: boolean;
6
+ };
7
+ /** Private CA client TLS for bare-metal Mongo / bare-metal Mongo TLS */
8
+ export declare function resolveMongoConnectOptions(mongodbUri?: string | null): MongoConnectOptions;
@@ -0,0 +1 @@
1
+ export function resolveMongoConnectOptions(e){if(!((e?.trim()??"").includes("tls=true")||process.env.MONGODB_SSL==="true"))return{};return{tls:!0,tlsCAFile:process.env.MONGODB_SSL_CA||process.env.KAFKA_SSL_CA||"/etc/tls/infra/ca.crt",tlsCertificateKeyFile:process.env.MONGODB_SSL_PEM||"/etc/tls/infra/mongodb.pem",tlsAllowInvalidHostnames:!0}}
@@ -0,0 +1,10 @@
1
+ export type RedisSocketOptions = {
2
+ connectTimeout?: number;
3
+ keepAlive?: boolean;
4
+ tls?: boolean | {
5
+ ca?: string[];
6
+ rejectUnauthorized?: boolean;
7
+ };
8
+ };
9
+ /** rediss:// + private CA from REDIS_SSL_CA / KAFKA_SSL_CA / infra-tls mount / ozel CA */
10
+ export declare function resolveRedisSocketOptions(redisUri?: string | null): RedisSocketOptions;
@@ -0,0 +1 @@
1
+ import q from"node:fs";export function resolveRedisSocketOptions(w){const j={connectTimeout:1e4,keepAlive:!0};if(!((w?.trim()??"").startsWith("rediss://")||process.env.REDIS_SSL==="true"))return j;const k=process.env.REDIS_SSL_CA||process.env.KAFKA_SSL_CA||"/etc/tls/infra/ca.crt";try{if(k&&q.existsSync(k))return{...j,tls:{ca:[q.readFileSync(k,"utf-8")],rejectUnauthorized:!1}}}catch{}return{...j,tls:{rejectUnauthorized:!1}}}