node-server-engine 1.7.4 → 1.9.0
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 +712 -67
- package/dist/entities/AWSS3/AWSS3.d.ts +157 -0
- package/dist/entities/AWSS3/AWSS3.js +426 -0
- package/dist/entities/AWSS3/AWSS3.js.map +1 -0
- package/dist/entities/AWSS3/AWSS3.types.d.ts +78 -0
- package/dist/entities/AWSS3/AWSS3.types.js +2 -0
- package/dist/entities/AWSS3/AWSS3.types.js.map +1 -0
- package/dist/entities/AWSS3/index.d.ts +2 -0
- package/dist/entities/{Storage → AWSS3}/index.js +8 -8
- package/dist/entities/AWSS3/index.js.map +1 -0
- package/dist/entities/ElasticSearch/ElasticSearch.d.ts +5 -0
- package/dist/entities/ElasticSearch/ElasticSearch.js +137 -38
- package/dist/entities/ElasticSearch/ElasticSearch.js.map +1 -1
- package/dist/entities/GoogleCloudStorage/GoogleCloudStorage.d.ts +141 -0
- package/dist/entities/GoogleCloudStorage/GoogleCloudStorage.js +351 -0
- package/dist/entities/GoogleCloudStorage/GoogleCloudStorage.js.map +1 -0
- package/dist/entities/{Storage/Storage.types.d.ts → GoogleCloudStorage/GoogleCloudStorage.types.d.ts} +14 -0
- package/dist/entities/GoogleCloudStorage/GoogleCloudStorage.types.js +2 -0
- package/dist/entities/GoogleCloudStorage/GoogleCloudStorage.types.js.map +1 -0
- package/dist/entities/GoogleCloudStorage/index.d.ts +2 -0
- package/dist/entities/GoogleCloudStorage/index.js +28 -0
- package/dist/entities/GoogleCloudStorage/index.js.map +1 -0
- package/dist/entities/Localizator/Localizator.js +2 -2
- package/dist/entities/Localizator/Localizator.js.map +1 -1
- package/dist/entities/Redis/Redis.d.ts +10 -2
- package/dist/entities/Redis/Redis.js +104 -9
- package/dist/entities/Redis/Redis.js.map +1 -1
- package/dist/entities/Redis/Redis.types.d.ts +6 -0
- package/dist/entities/Redis/Redis.types.js.map +1 -1
- package/dist/entities/Redis/index.d.ts +1 -1
- package/dist/entities/Redis/index.js +22 -1
- package/dist/entities/Redis/index.js.map +1 -1
- package/dist/entities/index.d.ts +2 -1
- package/dist/entities/index.js +15 -4
- package/dist/entities/index.js.map +1 -1
- package/package.json +12 -11
- package/dist/entities/Storage/Storage.d.ts +0 -38
- package/dist/entities/Storage/Storage.js +0 -214
- package/dist/entities/Storage/Storage.js.map +0 -1
- package/dist/entities/Storage/Storage.types.js +0 -2
- package/dist/entities/Storage/Storage.types.js.map +0 -1
- package/dist/entities/Storage/index.d.ts +0 -2
- package/dist/entities/Storage/index.js.map +0 -1
|
@@ -5,6 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.Redis = void 0;
|
|
7
7
|
exports.createRedisClient = createRedisClient;
|
|
8
|
+
exports.createRedisInstance = createRedisInstance;
|
|
9
|
+
exports.getClient = getClient;
|
|
8
10
|
exports.init = init;
|
|
9
11
|
exports.redisClient = void 0;
|
|
10
12
|
exports.shutdown = shutdown;
|
|
@@ -12,8 +14,16 @@ var _ioredis = require("ioredis");
|
|
|
12
14
|
var _Redis = require("./Redis.validate");
|
|
13
15
|
var _EngineError = require("../EngineError");
|
|
14
16
|
var _LifecycleController = require("../LifecycleController");
|
|
17
|
+
var _report = require("../../utils/report");
|
|
15
18
|
let redisClient = exports.redisClient = void 0;
|
|
16
19
|
|
|
20
|
+
/**
|
|
21
|
+
* Factory function to create a new Redis instance (exported for testing)
|
|
22
|
+
*/
|
|
23
|
+
function createRedisInstance(config) {
|
|
24
|
+
return new _ioredis.Redis(config);
|
|
25
|
+
}
|
|
26
|
+
|
|
17
27
|
/**
|
|
18
28
|
* We use a proxy to extend the Redis behavior and allow initialization of the client only when needed while keeping the same interface
|
|
19
29
|
*/
|
|
@@ -25,6 +35,7 @@ const Redis = exports.Redis = new Proxy(
|
|
|
25
35
|
get: function (target, property) {
|
|
26
36
|
if (property === 'init') return init;
|
|
27
37
|
if (property === 'shutdown') return shutdown;
|
|
38
|
+
if (property === 'getClient') return getClient;
|
|
28
39
|
// Create the redis client if it does not exist
|
|
29
40
|
if (!redisClient) throw new _EngineError.EngineError({
|
|
30
41
|
message: 'Redis client was not initialized'
|
|
@@ -37,12 +48,59 @@ const Redis = exports.Redis = new Proxy(
|
|
|
37
48
|
});
|
|
38
49
|
|
|
39
50
|
/**
|
|
40
|
-
*
|
|
51
|
+
* Get the underlying Redis client (for advanced use cases)
|
|
52
|
+
*/
|
|
53
|
+
function getClient() {
|
|
54
|
+
return redisClient;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* On init create client and connect
|
|
41
59
|
*/
|
|
42
60
|
function init() {
|
|
43
61
|
// Ignore if already initialized
|
|
44
|
-
if (redisClient)
|
|
62
|
+
if (redisClient) {
|
|
63
|
+
(0, _report.reportDebug)({
|
|
64
|
+
namespace: 'engine:redis',
|
|
65
|
+
message: 'Redis client already initialized'
|
|
66
|
+
});
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
45
69
|
exports.redisClient = redisClient = createRedisClient();
|
|
70
|
+
|
|
71
|
+
// Setup event listeners
|
|
72
|
+
redisClient.on('connect', () => {
|
|
73
|
+
(0, _report.reportDebug)({
|
|
74
|
+
namespace: 'engine:redis',
|
|
75
|
+
message: 'Redis client connecting'
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
redisClient.on('ready', () => {
|
|
79
|
+
(0, _report.reportDebug)({
|
|
80
|
+
namespace: 'engine:redis',
|
|
81
|
+
message: 'Redis client ready'
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
redisClient.on('error', err => {
|
|
85
|
+
(0, _report.reportError)(new _EngineError.EngineError({
|
|
86
|
+
message: 'Redis client error',
|
|
87
|
+
data: {
|
|
88
|
+
error: err.message
|
|
89
|
+
}
|
|
90
|
+
}));
|
|
91
|
+
});
|
|
92
|
+
redisClient.on('close', () => {
|
|
93
|
+
(0, _report.reportDebug)({
|
|
94
|
+
namespace: 'engine:redis',
|
|
95
|
+
message: 'Redis connection closed'
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
redisClient.on('reconnecting', () => {
|
|
99
|
+
(0, _report.reportDebug)({
|
|
100
|
+
namespace: 'engine:redis',
|
|
101
|
+
message: 'Redis client reconnecting'
|
|
102
|
+
});
|
|
103
|
+
});
|
|
46
104
|
_LifecycleController.LifecycleController.register(Redis);
|
|
47
105
|
}
|
|
48
106
|
|
|
@@ -50,26 +108,63 @@ function init() {
|
|
|
50
108
|
* On shutdown close connection and clear client
|
|
51
109
|
*/
|
|
52
110
|
async function shutdown() {
|
|
53
|
-
if (redisClient)
|
|
111
|
+
if (redisClient) {
|
|
112
|
+
try {
|
|
113
|
+
await redisClient.quit();
|
|
114
|
+
(0, _report.reportDebug)({
|
|
115
|
+
namespace: 'engine:redis',
|
|
116
|
+
message: 'Redis client disconnected'
|
|
117
|
+
});
|
|
118
|
+
} catch (error) {
|
|
119
|
+
(0, _report.reportError)(new _EngineError.EngineError({
|
|
120
|
+
message: 'Error during Redis shutdown',
|
|
121
|
+
data: {
|
|
122
|
+
error: error.message
|
|
123
|
+
}
|
|
124
|
+
}));
|
|
125
|
+
}
|
|
126
|
+
}
|
|
54
127
|
exports.redisClient = redisClient = undefined;
|
|
55
128
|
}
|
|
56
129
|
|
|
57
130
|
/**
|
|
58
|
-
* Create Redis client
|
|
131
|
+
* Create Redis client with enhanced configuration
|
|
59
132
|
*/
|
|
60
133
|
function createRedisClient(options = {}) {
|
|
61
134
|
// Check that environment variables are correctly set
|
|
62
135
|
(0, _Redis.validateRedisEnvironment)(options);
|
|
63
|
-
|
|
136
|
+
|
|
137
|
+
// Throw an error if there is no host
|
|
64
138
|
if (!process.env.REDIS_HOST) throw new _EngineError.EngineError({
|
|
65
139
|
message: 'Host required to initialize Redis connection'
|
|
66
140
|
});
|
|
67
|
-
|
|
68
|
-
port: process.env.REDIS_PORT ? parseInt(process.env.REDIS_PORT) :
|
|
141
|
+
const config = {
|
|
142
|
+
port: process.env.REDIS_PORT ? parseInt(process.env.REDIS_PORT) : 6379,
|
|
69
143
|
host: process.env.REDIS_HOST,
|
|
70
144
|
username: process.env.REDIS_USERNAME,
|
|
71
145
|
password: process.env.REDIS_PASSWORD,
|
|
72
|
-
db: 0
|
|
73
|
-
|
|
146
|
+
db: options.db ?? 0,
|
|
147
|
+
retryStrategy: times => {
|
|
148
|
+
const delay = Math.min(times * 50, 2000);
|
|
149
|
+
return delay;
|
|
150
|
+
},
|
|
151
|
+
reconnectOnError: err => {
|
|
152
|
+
const targetErrors = ['READONLY', 'ECONNRESET', 'ETIMEDOUT'];
|
|
153
|
+
return targetErrors.some(targetError => err.message.includes(targetError));
|
|
154
|
+
},
|
|
155
|
+
maxRetriesPerRequest: 3,
|
|
156
|
+
enableReadyCheck: options.enableReadyCheck ?? true,
|
|
157
|
+
lazyConnect: options.lazyConnect ?? process.env.NODE_ENV === 'test',
|
|
158
|
+
...options.redis
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
// Add TLS configuration if TLS_CA is provided
|
|
162
|
+
if (process.env.TLS_CA) {
|
|
163
|
+
config.tls = {
|
|
164
|
+
ca: process.env.TLS_CA,
|
|
165
|
+
rejectUnauthorized: process.env.NODE_ENV === 'production'
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
return createRedisInstance(config);
|
|
74
169
|
}
|
|
75
170
|
//# sourceMappingURL=Redis.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Redis.js","names":["_ioredis","require","_Redis","_EngineError","_LifecycleController","redisClient","exports","Redis","Proxy","get","target","property","init","shutdown","EngineError","message","createRedisClient","LifecycleController","register","quit","undefined","options","validateRedisEnvironment","process","env","REDIS_HOST","
|
|
1
|
+
{"version":3,"file":"Redis.js","names":["_ioredis","require","_Redis","_EngineError","_LifecycleController","_report","redisClient","exports","createRedisInstance","config","RedisClient","Redis","Proxy","get","target","property","init","shutdown","getClient","EngineError","message","reportDebug","namespace","createRedisClient","on","err","reportError","data","error","LifecycleController","register","quit","undefined","options","validateRedisEnvironment","process","env","REDIS_HOST","port","REDIS_PORT","parseInt","host","username","REDIS_USERNAME","password","REDIS_PASSWORD","db","retryStrategy","times","delay","Math","min","reconnectOnError","targetErrors","some","targetError","includes","maxRetriesPerRequest","enableReadyCheck","lazyConnect","NODE_ENV","redis","TLS_CA","tls","ca","rejectUnauthorized"],"sources":["../../../src/entities/Redis/Redis.ts"],"sourcesContent":["import { Redis as RedisClient } from 'ioredis';\nimport { RedisInterface, RedisCreateOptions } from './Redis.types';\nimport { validateRedisEnvironment } from './Redis.validate';\nimport { EngineError } from 'entities/EngineError';\nimport { LifecycleController } from 'entities/LifecycleController';\nimport { reportDebug, reportError } from 'utils/report';\n\nexport let redisClient: undefined | RedisClient;\n\n/**\n * Factory function to create a new Redis instance (exported for testing)\n */\nexport function createRedisInstance(config: any): RedisClient {\n return new RedisClient(config);\n}\n\n/**\n * We use a proxy to extend the Redis behavior and allow initialization of the client only when needed while keeping the same interface\n */\nexport const Redis = new Proxy<RedisInterface>(\n // Due to how we do the proxying, we are forced to ignore ts-errors, we could never create an object that respects the interface properly\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n {},\n {\n get: function (target, property): unknown {\n if (property === 'init') return init;\n if (property === 'shutdown') return shutdown;\n if (property === 'getClient') return getClient;\n // Create the redis client if it does not exist\n if (!redisClient)\n throw new EngineError({ message: 'Redis client was not initialized' });\n // Call the function on the redis client\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n return redisClient[property] as unknown;\n }\n }\n);\n\n/**\n * Get the underlying Redis client (for advanced use cases)\n */\nexport function getClient(): RedisClient | undefined {\n return redisClient;\n}\n\n/**\n * On init create client and connect\n */\nexport function init(): void {\n // Ignore if already initialized\n if (redisClient) {\n reportDebug({\n namespace: 'engine:redis',\n message: 'Redis client already initialized'\n });\n return;\n }\n \n redisClient = createRedisClient();\n \n // Setup event listeners\n redisClient.on('connect', () => {\n reportDebug({\n namespace: 'engine:redis',\n message: 'Redis client connecting'\n });\n });\n \n redisClient.on('ready', () => {\n reportDebug({\n namespace: 'engine:redis',\n message: 'Redis client ready'\n });\n });\n \n redisClient.on('error', (err) => {\n reportError(new EngineError({\n message: 'Redis client error',\n data: { error: err.message }\n }));\n });\n \n redisClient.on('close', () => {\n reportDebug({\n namespace: 'engine:redis',\n message: 'Redis connection closed'\n });\n });\n \n redisClient.on('reconnecting', () => {\n reportDebug({\n namespace: 'engine:redis',\n message: 'Redis client reconnecting'\n });\n });\n \n LifecycleController.register(Redis);\n}\n\n/**\n * On shutdown close connection and clear client\n */\nexport async function shutdown(): Promise<void> {\n if (redisClient) {\n try {\n await redisClient.quit();\n reportDebug({\n namespace: 'engine:redis',\n message: 'Redis client disconnected'\n });\n } catch (error) {\n reportError(new EngineError({\n message: 'Error during Redis shutdown',\n data: { error: (error as Error).message }\n }));\n }\n }\n redisClient = undefined;\n}\n\n/**\n * Create Redis client with enhanced configuration\n */\nexport function createRedisClient(\n options: RedisCreateOptions = {}\n): RedisClient {\n // Check that environment variables are correctly set\n validateRedisEnvironment(options);\n \n // Throw an error if there is no host\n if (!process.env.REDIS_HOST)\n throw new EngineError({\n message: 'Host required to initialize Redis connection'\n });\n\n const config: any = {\n port: process.env.REDIS_PORT ? parseInt(process.env.REDIS_PORT) : 6379,\n host: process.env.REDIS_HOST,\n username: process.env.REDIS_USERNAME,\n password: process.env.REDIS_PASSWORD,\n db: options.db ?? 0,\n retryStrategy: (times: number) => {\n const delay = Math.min(times * 50, 2000);\n return delay;\n },\n reconnectOnError: (err: Error) => {\n const targetErrors = ['READONLY', 'ECONNRESET', 'ETIMEDOUT'];\n return targetErrors.some(targetError => err.message.includes(targetError));\n },\n maxRetriesPerRequest: 3,\n enableReadyCheck: options.enableReadyCheck ?? true,\n lazyConnect: options.lazyConnect ?? (process.env.NODE_ENV === 'test'),\n ...options.redis\n };\n\n // Add TLS configuration if TLS_CA is provided\n if (process.env.TLS_CA) {\n config.tls = {\n ca: process.env.TLS_CA,\n rejectUnauthorized: process.env.NODE_ENV === 'production'\n };\n }\n\n return createRedisInstance(config);\n}\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,oBAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAEO,IAAIK,WAAoC,GAAAC,OAAA,CAAAD,WAAA;;AAE/C;AACA;AACA;AACO,SAASE,mBAAmBA,CAACC,MAAW,EAAe;EAC5D,OAAO,IAAIC,cAAW,CAACD,MAAM,CAAC;AAChC;;AAEA;AACA;AACA;AACO,MAAME,KAAK,GAAAJ,OAAA,CAAAI,KAAA,GAAG,IAAIC,KAAK;AAC5B;AACA;AACA;AACA,CAAC,CAAC,EACF;EACEC,GAAG,EAAE,SAAAA,CAAUC,MAAM,EAAEC,QAAQ,EAAW;IACxC,IAAIA,QAAQ,KAAK,MAAM,EAAE,OAAOC,IAAI;IACpC,IAAID,QAAQ,KAAK,UAAU,EAAE,OAAOE,QAAQ;IAC5C,IAAIF,QAAQ,KAAK,WAAW,EAAE,OAAOG,SAAS;IAC9C;IACA,IAAI,CAACZ,WAAW,EACd,MAAM,IAAIa,wBAAW,CAAC;MAAEC,OAAO,EAAE;IAAmC,CAAC,CAAC;IACxE;IACA;IACA;IACA,OAAOd,WAAW,CAACS,QAAQ,CAAC;EAC9B;AACF,CACF,CAAC;;AAED;AACA;AACA;AACO,SAASG,SAASA,CAAA,EAA4B;EACnD,OAAOZ,WAAW;AACpB;;AAEA;AACA;AACA;AACO,SAASU,IAAIA,CAAA,EAAS;EAC3B;EACA,IAAIV,WAAW,EAAE;IACf,IAAAe,mBAAW,EAAC;MACVC,SAAS,EAAE,cAAc;MACzBF,OAAO,EAAE;IACX,CAAC,CAAC;IACF;EACF;EAEAb,OAAA,CAAAD,WAAA,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EAAEzB,OAAO,CAACyB,gBAAgB,IAAI,IAAI;IAClDC,WAAW,EAAE1B,OAAO,CAAC0B,WAAW,IAAKxB,OAAO,CAACC,GAAG,CAACwB,QAAQ,KAAK,MAAO;IACrE,GAAG3B,OAAO,CAAC4B;EACb,CAAC;;EAED;EACA,IAAI1B,OAAO,CAACC,GAAG,CAAC0B,MAAM,EAAE;IACtBrD,MAAM,CAACsD,GAAG,GAAG;MACXC,EAAE,EAAE7B,OAAO,CAACC,GAAG,CAAC0B,MAAM;MACtBG,kBAAkB,EAAE9B,OAAO,CAACC,GAAG,CAACwB,QAAQ,KAAK;IAC/C,CAAC;EACH;EAEA,OAAOpD,mBAAmB,CAACC,MAAM,CAAC;AACpC","ignoreList":[]}
|
|
@@ -4,6 +4,8 @@ export type RedisInterface = IoRedis & Cluster & {
|
|
|
4
4
|
init: () => void;
|
|
5
5
|
/** Stop the redis service */
|
|
6
6
|
shutdown: () => Promise<void>;
|
|
7
|
+
/** Get the underlying Redis client */
|
|
8
|
+
getClient: () => IoRedis | undefined;
|
|
7
9
|
};
|
|
8
10
|
/** Options to initialize a Redis client */
|
|
9
11
|
export interface RedisCreateOptions {
|
|
@@ -13,4 +15,8 @@ export interface RedisCreateOptions {
|
|
|
13
15
|
enableReadyCheck?: boolean;
|
|
14
16
|
/** Cluster mode read operation settings, can make reads on masters, slaves, or both */
|
|
15
17
|
scaleReads?: string;
|
|
18
|
+
/** Database index to use (default: 0) */
|
|
19
|
+
db?: number;
|
|
20
|
+
/** Lazy connect - don't connect until first command (default: false) */
|
|
21
|
+
lazyConnect?: boolean;
|
|
16
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Redis.types.js","names":[],"sources":["../../../src/entities/Redis/Redis.types.ts"],"sourcesContent":["import { Redis as IoRedis, Cluster, RedisOptions } from 'ioredis';\n\nexport type RedisInterface = IoRedis &\n Cluster & {\n /** Start the redis service */\n init: () => void;\n /** Stop the redis service */\n shutdown: () => Promise<void>;\n };\n\n/** Options to initialize a Redis client */\nexport interface RedisCreateOptions {\n /** Redis client settings */\n redis?: RedisOptions;\n /** Should the client perform readiness check when establishing the connection */\n enableReadyCheck?: boolean;\n /** Cluster mode read operation settings, can make reads on masters, slaves, or both */\n scaleReads?: string;\n}\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"Redis.types.js","names":[],"sources":["../../../src/entities/Redis/Redis.types.ts"],"sourcesContent":["import { Redis as IoRedis, Cluster, RedisOptions } from 'ioredis';\n\nexport type RedisInterface = IoRedis &\n Cluster & {\n /** Start the redis service */\n init: () => void;\n /** Stop the redis service */\n shutdown: () => Promise<void>;\n /** Get the underlying Redis client */\n getClient: () => IoRedis | undefined;\n };\n\n/** Options to initialize a Redis client */\nexport interface RedisCreateOptions {\n /** Redis client settings */\n redis?: RedisOptions;\n /** Should the client perform readiness check when establishing the connection */\n enableReadyCheck?: boolean;\n /** Cluster mode read operation settings, can make reads on masters, slaves, or both */\n scaleReads?: string;\n /** Database index to use (default: 0) */\n db?: number;\n /** Lazy connect - don't connect until first command (default: false) */\n lazyConnect?: boolean;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Redis, createRedisClient } from './Redis';
|
|
1
|
+
export { Redis, createRedisClient, getClient, init, shutdown } from './Redis';
|
|
2
2
|
export * from './Redis.types';
|
|
@@ -5,7 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
var _exportNames = {
|
|
7
7
|
Redis: true,
|
|
8
|
-
createRedisClient: true
|
|
8
|
+
createRedisClient: true,
|
|
9
|
+
getClient: true,
|
|
10
|
+
init: true,
|
|
11
|
+
shutdown: true
|
|
9
12
|
};
|
|
10
13
|
Object.defineProperty(exports, "Redis", {
|
|
11
14
|
enumerable: true,
|
|
@@ -19,6 +22,24 @@ Object.defineProperty(exports, "createRedisClient", {
|
|
|
19
22
|
return _Redis.createRedisClient;
|
|
20
23
|
}
|
|
21
24
|
});
|
|
25
|
+
Object.defineProperty(exports, "getClient", {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function () {
|
|
28
|
+
return _Redis.getClient;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
Object.defineProperty(exports, "init", {
|
|
32
|
+
enumerable: true,
|
|
33
|
+
get: function () {
|
|
34
|
+
return _Redis.init;
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
Object.defineProperty(exports, "shutdown", {
|
|
38
|
+
enumerable: true,
|
|
39
|
+
get: function () {
|
|
40
|
+
return _Redis.shutdown;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
22
43
|
var _Redis = require("./Redis");
|
|
23
44
|
var _Redis2 = require("./Redis.types");
|
|
24
45
|
Object.keys(_Redis2).forEach(function (key) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_Redis","require","_Redis2","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get"],"sources":["../../../src/entities/Redis/index.ts"],"sourcesContent":["export { Redis, createRedisClient } from './Redis';\nexport * from './Redis.types';\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","names":["_Redis","require","_Redis2","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get"],"sources":["../../../src/entities/Redis/index.ts"],"sourcesContent":["export { Redis, createRedisClient, getClient, init, shutdown } from './Redis';\nexport * from './Redis.types';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAAAE,MAAA,CAAAC,IAAA,CAAAF,OAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,OAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAZ,OAAA,CAAAI,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
package/dist/entities/index.d.ts
CHANGED
|
@@ -8,7 +8,8 @@ export * from './SocketClient';
|
|
|
8
8
|
export * from './Server';
|
|
9
9
|
export * from './Redis';
|
|
10
10
|
export * from './Localizator';
|
|
11
|
-
export * from './
|
|
11
|
+
export * from './GoogleCloudStorage';
|
|
12
|
+
export * from './AWSS3';
|
|
12
13
|
export * from './Sequelize';
|
|
13
14
|
export * from './ElasticSearch';
|
|
14
15
|
export * from './LifecycleController';
|
package/dist/entities/index.js
CHANGED
|
@@ -113,14 +113,25 @@ Object.keys(_Localizator).forEach(function (key) {
|
|
|
113
113
|
}
|
|
114
114
|
});
|
|
115
115
|
});
|
|
116
|
-
var
|
|
117
|
-
Object.keys(
|
|
116
|
+
var _GoogleCloudStorage = require("./GoogleCloudStorage");
|
|
117
|
+
Object.keys(_GoogleCloudStorage).forEach(function (key) {
|
|
118
118
|
if (key === "default" || key === "__esModule") return;
|
|
119
|
-
if (key in exports && exports[key] ===
|
|
119
|
+
if (key in exports && exports[key] === _GoogleCloudStorage[key]) return;
|
|
120
120
|
Object.defineProperty(exports, key, {
|
|
121
121
|
enumerable: true,
|
|
122
122
|
get: function () {
|
|
123
|
-
return
|
|
123
|
+
return _GoogleCloudStorage[key];
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
var _AWSS = require("./AWSS3");
|
|
128
|
+
Object.keys(_AWSS).forEach(function (key) {
|
|
129
|
+
if (key === "default" || key === "__esModule") return;
|
|
130
|
+
if (key in exports && exports[key] === _AWSS[key]) return;
|
|
131
|
+
Object.defineProperty(exports, key, {
|
|
132
|
+
enumerable: true,
|
|
133
|
+
get: function () {
|
|
134
|
+
return _AWSS[key];
|
|
124
135
|
}
|
|
125
136
|
});
|
|
126
137
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_EngineError","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_WebError","_ValidationError","_KeySet","_Endpoint","_MessageHandler","_SocketClient","_Server","_Redis","_Localizator","
|
|
1
|
+
{"version":3,"file":"index.js","names":["_EngineError","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_WebError","_ValidationError","_KeySet","_Endpoint","_MessageHandler","_SocketClient","_Server","_Redis","_Localizator","_GoogleCloudStorage","_AWSS","_Sequelize","_ElasticSearch","_LifecycleController","_PubSub","_PushNotification"],"sources":["../../src/entities/index.ts"],"sourcesContent":["export * from './EngineError';\nexport * from './WebError';\nexport * from './ValidationError';\nexport * from './KeySet';\nexport * from './Endpoint';\nexport * from './MessageHandler';\nexport * from './SocketClient';\nexport * from './Server';\nexport * from './Redis';\nexport * from './Localizator';\nexport * from './GoogleCloudStorage';\nexport * from './AWSS3';\nexport * from './Sequelize';\nexport * from './ElasticSearch';\nexport * from './LifecycleController';\nexport * from './PubSub';\nexport * from './PushNotification';\n"],"mappings":";;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,YAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,YAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,YAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,SAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,SAAA,E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AAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAc,oBAAA,CAAAlB,GAAA;IAAA;EAAA;AAAA;AACA,IAAAmB,OAAA,GAAAvB,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAqB,OAAA,EAAApB,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAmB,OAAA,CAAAnB,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAe,OAAA,CAAAnB,GAAA;IAAA;EAAA;AAAA;AACA,IAAAoB,iBAAA,GAAAxB,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAsB,iBAAA,EAAArB,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAoB,iBAAA,CAAApB,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAgB,iBAAA,CAAApB,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-server-engine",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.0",
|
|
4
4
|
"description": "Framework used to develop backend services. This package ships with a lot of features to standardize the creation of services, letting you focus on the business logic.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -44,15 +44,16 @@
|
|
|
44
44
|
},
|
|
45
45
|
"homepage": "https://github.com/prakashmahendran/node-server-engine#readme",
|
|
46
46
|
"dependencies": {
|
|
47
|
+
"@aws-sdk/client-s3": "^3.948.0",
|
|
47
48
|
"@babel/runtime": "^7.26.0",
|
|
48
|
-
"@elastic/elasticsearch": "^
|
|
49
|
-
"@google-cloud/pubsub": "^4.
|
|
49
|
+
"@elastic/elasticsearch": "^9.2.0",
|
|
50
|
+
"@google-cloud/pubsub": "^4.11.0",
|
|
50
51
|
"@google-cloud/secret-manager": "^6.1.0",
|
|
51
52
|
"@google-cloud/storage": "^7.14.0",
|
|
52
|
-
"@google/generative-ai": "^0.
|
|
53
|
+
"@google/generative-ai": "^0.24.1",
|
|
53
54
|
"ajv": "^8.17.1",
|
|
54
55
|
"axios": "^1.7.9",
|
|
55
|
-
"backend-test-tools": "^1.
|
|
56
|
+
"backend-test-tools": "^1.2.0",
|
|
56
57
|
"bytes": "^3.1.2",
|
|
57
58
|
"callsite": "^1.0.0",
|
|
58
59
|
"cors": "^2.8.5",
|
|
@@ -62,7 +63,7 @@
|
|
|
62
63
|
"filesize-parser": "^1.5.1",
|
|
63
64
|
"fs-extra": "^11.3.0",
|
|
64
65
|
"glob": "^11.0.0",
|
|
65
|
-
"ioredis": "^5.
|
|
66
|
+
"ioredis": "^5.8.2",
|
|
66
67
|
"json-stringify-safe": "^5.0.1",
|
|
67
68
|
"jsonwebtoken": "^9.0.2",
|
|
68
69
|
"mime-types": "^2.1.35",
|
|
@@ -76,7 +77,7 @@
|
|
|
76
77
|
"sequelize-typescript": "^2.1.6",
|
|
77
78
|
"swagger-ui-express": "^5.0.1",
|
|
78
79
|
"validator": "^13.12.0",
|
|
79
|
-
"ws": "^8.18.
|
|
80
|
+
"ws": "^8.18.3",
|
|
80
81
|
"yamljs": "^0.3.0"
|
|
81
82
|
},
|
|
82
83
|
"devDependencies": {
|
|
@@ -88,10 +89,10 @@
|
|
|
88
89
|
"@babel/preset-env": "^7.26.0",
|
|
89
90
|
"@babel/preset-typescript": "^7.26.0",
|
|
90
91
|
"@babel/register": "^7.25.9",
|
|
91
|
-
"@commitlint/cli": "^
|
|
92
|
-
"@commitlint/config-conventional": "^
|
|
93
|
-
"@faker-js/faker": "^
|
|
94
|
-
"@google-cloud/precise-date": "^
|
|
92
|
+
"@commitlint/cli": "^20.2.0",
|
|
93
|
+
"@commitlint/config-conventional": "^20.2.0",
|
|
94
|
+
"@faker-js/faker": "^10.1.0",
|
|
95
|
+
"@google-cloud/precise-date": "^5.0.0",
|
|
95
96
|
"@semantic-release/changelog": "^6.0.3",
|
|
96
97
|
"@semantic-release/git": "^10.0.1",
|
|
97
98
|
"@types/busboy": "^1.5.4",
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { Readable } from 'stream';
|
|
2
|
-
import { Storage as CloudStorage, CreateWriteStreamOptions } from '@google-cloud/storage';
|
|
3
|
-
import { UploadDestinationOptions, StorageUploadedFile, UploaderOptions, StorageGetResponse, StorageDownloadResponse } from './Storage.types';
|
|
4
|
-
export declare const Storage: {
|
|
5
|
-
cloudStorage: CloudStorage;
|
|
6
|
-
/**
|
|
7
|
-
* Upload a file to the cloud storage
|
|
8
|
-
* @param readStream - Stream of the file content
|
|
9
|
-
* @param bucket - Bucket in which the file should be stored
|
|
10
|
-
* @param destinationOptions - Options for the destination generator [see: generateFileDestination(options)]
|
|
11
|
-
* @param storageOptions - Storage library options
|
|
12
|
-
* @param uploaderOptions - Options for this service's specific behavior
|
|
13
|
-
* @return {Promise<Object>} - Details regarding the uploaded file's metadata
|
|
14
|
-
*/
|
|
15
|
-
upload(readStream: Readable, bucket: string, destinationOptions?: UploadDestinationOptions, storageOptions?: CreateWriteStreamOptions, uploaderOptions?: UploaderOptions): Promise<StorageUploadedFile>;
|
|
16
|
-
/**
|
|
17
|
-
* Return the read stream for a given file and bucket
|
|
18
|
-
*/
|
|
19
|
-
get(bucket: string, path: string): Promise<StorageGetResponse>;
|
|
20
|
-
/**
|
|
21
|
-
* Return the read stream for a given file and bucket
|
|
22
|
-
*/
|
|
23
|
-
download(bucket: string, path: string): Promise<StorageDownloadResponse>;
|
|
24
|
-
/**
|
|
25
|
-
* Return the read stream for a given file path and bucket
|
|
26
|
-
* @param {String} bucket
|
|
27
|
-
* @param {String} path
|
|
28
|
-
*/
|
|
29
|
-
getFileStream(bucket: string, path: string): Readable;
|
|
30
|
-
/**
|
|
31
|
-
* Delete a file from the cloud storage
|
|
32
|
-
*/
|
|
33
|
-
delete(bucket: string, path: string): Promise<void>;
|
|
34
|
-
/**
|
|
35
|
-
* Builds the full file path on the cloud and generates it a random name
|
|
36
|
-
*/
|
|
37
|
-
generateFileDestination(options?: UploadDestinationOptions): string;
|
|
38
|
-
};
|