opticore-webapp-core 1.0.18 → 1.0.20
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/dist/index.cjs +156 -568
- package/dist/index.d.cts +10 -68
- package/dist/index.d.ts +10 -68
- package/dist/index.js +163 -568
- package/package.json +10 -10
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import { StackTraceError } from 'opticore-catch-exception-error';
|
|
2
|
-
import mySQL from 'mysql';
|
|
3
|
-
import { ConnectionOptions } from 'tls';
|
|
4
|
-
import { CustomTypesConfig } from 'pg';
|
|
5
|
-
import stream from 'stream';
|
|
6
2
|
import { ServerResponse, IncomingMessage } from 'node:http';
|
|
7
3
|
|
|
8
4
|
declare class SAsymmetricCryptionDataWithPrivateRSAKey {
|
|
@@ -17,7 +13,7 @@ declare class SAsymmetricCryptionDataWithPrivateRSAKey {
|
|
|
17
13
|
*
|
|
18
14
|
* Return ErrorHandler | string
|
|
19
15
|
*/
|
|
20
|
-
protected verifyExistingKey(rsaKey: string, keyType: string):
|
|
16
|
+
protected verifyExistingKey(rsaKey: string, keyType: string): string | StackTraceError;
|
|
21
17
|
/**
|
|
22
18
|
*
|
|
23
19
|
* @param privateKey
|
|
@@ -107,33 +103,6 @@ declare class SAsymmetricCryptionDataWithPublicRSAKey {
|
|
|
107
103
|
private traceError;
|
|
108
104
|
}
|
|
109
105
|
|
|
110
|
-
/**
|
|
111
|
-
*
|
|
112
|
-
* @param url
|
|
113
|
-
* @param user
|
|
114
|
-
* @param password
|
|
115
|
-
* @param dbName
|
|
116
|
-
* @constructor
|
|
117
|
-
*/
|
|
118
|
-
declare function SCheckerMongoDatabaseConnection(url: string, user: string | any, password: string | any, dbName: string | any): Promise<void>;
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
*
|
|
122
|
-
* @param environnementPath
|
|
123
|
-
* @param dbConnection
|
|
124
|
-
* @param user
|
|
125
|
-
* @param database
|
|
126
|
-
* @param dbHost
|
|
127
|
-
* @param password
|
|
128
|
-
* @param localeLanguage
|
|
129
|
-
* @constructor
|
|
130
|
-
*
|
|
131
|
-
* Return void
|
|
132
|
-
*/
|
|
133
|
-
declare function SCheckerMySqlDatabaseConnection(localeLanguage: string, environnementPath: any, dbConnection: mySQL.Connection, user: string, database: string, dbHost: string, password: string): void;
|
|
134
|
-
|
|
135
|
-
declare function SCheckerPostgresDatabaseConnection(localeLanguage: string, environnementPath: any, connectionString: any, keepAlive?: boolean | undefined, stream?: any, statement_timeout?: false | number | undefined, ssl?: boolean | ConnectionOptions | undefined, query_timeout?: number | undefined, keepAliveInitialDelayMillis?: number | undefined, idle_in_transaction_session_timeout?: number | undefined, application_name?: string | undefined, connectionTimeoutMillis?: number | undefined, types?: CustomTypesConfig | undefined, options?: string | undefined): Promise<void>;
|
|
136
|
-
|
|
137
106
|
declare const CLogLevel: {
|
|
138
107
|
readonly debug: "DEBUG";
|
|
139
108
|
readonly info: "INFO";
|
|
@@ -141,27 +110,6 @@ declare const CLogLevel: {
|
|
|
141
110
|
readonly error: "ERROR";
|
|
142
111
|
};
|
|
143
112
|
|
|
144
|
-
/** --------------------------------------------------------------------------------------------------------------------------------
|
|
145
|
-
* Arguments: A connection URL can also take arguments. Here is the same example from above with placeholder
|
|
146
|
-
* values in uppercase letters for three arguments: mysql://USER:PASSWORD@HOST:PORT/DATABASE?KEY1=VALUE&KEY2=VALUE&KEY3=VALUE
|
|
147
|
-
*
|
|
148
|
-
* The following arguments can be used:
|
|
149
|
-
* connection_limit: Maximum size of the connection pool,
|
|
150
|
-
* connect_timeout: Maximum number of seconds to wait for a new connection to be opened, 0 means no timeout,
|
|
151
|
-
* pool_timeout: Maximum number of seconds to wait for a new connection from the pool, 0 means no timeout,
|
|
152
|
-
* sslcert: Path to the server certificate. Certificate paths are resolved relative to the ./prisma folder,
|
|
153
|
-
* sslidentity: Path to the PKCS12 certificate,
|
|
154
|
-
* sslpassword: Password that was used to secure the PKCS12 file,
|
|
155
|
-
* sslaccept: Configures whether to check for missing values in the certificate. Possible values: accept_invalid_certs, strict,
|
|
156
|
-
* socket: Points to a directory that contains a socket to be used for the connection,
|
|
157
|
-
* socket_timeout: Number of seconds to wait until a single query terminates
|
|
158
|
-
*
|
|
159
|
-
* So if you want to use argument: write it like this "?sslidentity=client-identity.p12&sslpassword=mypassword&sslcert=rootca.cert"
|
|
160
|
-
*
|
|
161
|
-
* ---------------------------------------------------------------------------------------------------------------------------------
|
|
162
|
-
*/
|
|
163
|
-
declare const UOptionalArgumentConnection: (environnementPath: any) => string;
|
|
164
|
-
|
|
165
113
|
/**
|
|
166
114
|
* This class contains methods that allow to decrypt data using public and private keys.
|
|
167
115
|
*/
|
|
@@ -182,7 +130,7 @@ declare class RSAKeyEncryption {
|
|
|
182
130
|
declare class YamlParsing {
|
|
183
131
|
private readonly logger;
|
|
184
132
|
private readonly localeLanguage;
|
|
185
|
-
constructor(localeLanguage: string,
|
|
133
|
+
constructor(localeLanguage: string, environmentPath: any);
|
|
186
134
|
absolutPath(): string;
|
|
187
135
|
readFile(filePath: string): Promise<void>;
|
|
188
136
|
/**
|
|
@@ -204,12 +152,6 @@ declare class Environment<T> {
|
|
|
204
152
|
get<K extends keyof T>(key: K): T[K];
|
|
205
153
|
}
|
|
206
154
|
|
|
207
|
-
declare const MMongoCheckerDatabase: (optionalArgumentConnection: string | any, localLanguage: string, environnementPath: any) => Promise<void>;
|
|
208
|
-
|
|
209
|
-
declare const MMySqlCheckerDatabase: (optionalArgumentConnection: string | any, localLanguage: string, environnementPath: any) => void;
|
|
210
|
-
|
|
211
|
-
declare const MPostgresCheckerDatabase: (localLanguage: string, environnementPath: any, keepAlive?: boolean | undefined, stream?: (() => (stream.Duplex | undefined)) | undefined, statement_timeout?: false | number | undefined, ssl?: boolean | ConnectionOptions | undefined, query_timeout?: number | undefined, keepAliveInitialDelayMillis?: number | undefined, idle_in_transaction_session_timeout?: number | undefined, application_name?: string | undefined, connectionTimeoutMillis?: number | undefined, types?: CustomTypesConfig | undefined, options?: string | undefined) => Promise<void>;
|
|
212
|
-
|
|
213
155
|
/**
|
|
214
156
|
*
|
|
215
157
|
* @param envDir
|
|
@@ -371,7 +313,7 @@ declare class Utility {
|
|
|
371
313
|
declare class PathModuleVerifier {
|
|
372
314
|
private log;
|
|
373
315
|
private readonly localeLanguage;
|
|
374
|
-
constructor(localeLanguage: string,
|
|
316
|
+
constructor(localeLanguage: string, environmentPath: any);
|
|
375
317
|
/**
|
|
376
318
|
* Verifies if modules at specific paths are loaded.
|
|
377
319
|
* If any module is not loaded, it throws an error.
|
|
@@ -388,8 +330,8 @@ declare class PathModuleVerifier {
|
|
|
388
330
|
|
|
389
331
|
declare class LocalLanguageLoader {
|
|
390
332
|
private readonly localeLanguage;
|
|
391
|
-
private readonly
|
|
392
|
-
constructor(localeLanguage: string,
|
|
333
|
+
private readonly environmentPath;
|
|
334
|
+
constructor(localeLanguage: string, environmentPath: any);
|
|
393
335
|
load(): void;
|
|
394
336
|
}
|
|
395
337
|
|
|
@@ -449,26 +391,26 @@ declare function TRawBodyParser(options: IBodyParserOptions, localLanguage: stri
|
|
|
449
391
|
*
|
|
450
392
|
* @param options
|
|
451
393
|
* @param localLanguage
|
|
452
|
-
* @param
|
|
394
|
+
* @param environmentPath
|
|
453
395
|
*
|
|
454
396
|
* Use by this: textBodyParserType({ type: 'text/html' })
|
|
455
397
|
*
|
|
456
398
|
* in express, it can be used like this: app.use(textBodyParserType({ type: 'text/html' }));
|
|
457
399
|
*
|
|
458
400
|
*/
|
|
459
|
-
declare function TTextBodyParser(options: IBodyParserOptions, localLanguage: string,
|
|
401
|
+
declare function TTextBodyParser(options: IBodyParserOptions, localLanguage: string, environmentPath: any): void;
|
|
460
402
|
|
|
461
403
|
/**
|
|
462
404
|
*
|
|
463
405
|
* @param options
|
|
464
406
|
* @param localLanguage
|
|
465
|
-
* @param
|
|
407
|
+
* @param environmentPath
|
|
466
408
|
*
|
|
467
409
|
* Use by this: urlencodedBodyParserType({ type: 'application/x-www-form-urlencoded' })
|
|
468
410
|
*
|
|
469
411
|
* in express, it can be used like this: app.use(urlencodedBodyParserType({ type: 'application/x-www-form-urlencoded' }));
|
|
470
412
|
*
|
|
471
413
|
*/
|
|
472
|
-
declare function TUrlencodedBodyParser(options: IBodyParserOptions, localLanguage: string,
|
|
414
|
+
declare function TUrlencodedBodyParser(options: IBodyParserOptions, localLanguage: string, environmentPath: any): void;
|
|
473
415
|
|
|
474
|
-
export { CLogLevel, CSignRSAKeyComponent, Environment, type IBodyParserOptions, type IResponseBodyEndFromResponseEvent, type IResponseBodyWriteFromResponseEvent, type IWrappingBodyResponse, LocalLanguageLoader,
|
|
416
|
+
export { CLogLevel, CSignRSAKeyComponent, Environment, type IBodyParserOptions, type IResponseBodyEndFromResponseEvent, type IResponseBodyWriteFromResponseEvent, type IWrappingBodyResponse, LocalLanguageLoader, PathModuleVerifier, RSAKeyDecryption, RSAKeyEncryption, SAsymmetricCryptionDataWithPrivateRSAKey, SAsymmetricCryptionDataWithPublicRSAKey, TJSONBodyParser, type TLogLevel, type TOriginalWriteEncoding, type TParseFunction, TRawBodyParser, TTextBodyParser, TUrlencodedBodyParser, Utility, YamlParsing, dateTimeFormatted, loggerConfig };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import { StackTraceError } from 'opticore-catch-exception-error';
|
|
2
|
-
import mySQL from 'mysql';
|
|
3
|
-
import { ConnectionOptions } from 'tls';
|
|
4
|
-
import { CustomTypesConfig } from 'pg';
|
|
5
|
-
import stream from 'stream';
|
|
6
2
|
import { ServerResponse, IncomingMessage } from 'node:http';
|
|
7
3
|
|
|
8
4
|
declare class SAsymmetricCryptionDataWithPrivateRSAKey {
|
|
@@ -17,7 +13,7 @@ declare class SAsymmetricCryptionDataWithPrivateRSAKey {
|
|
|
17
13
|
*
|
|
18
14
|
* Return ErrorHandler | string
|
|
19
15
|
*/
|
|
20
|
-
protected verifyExistingKey(rsaKey: string, keyType: string):
|
|
16
|
+
protected verifyExistingKey(rsaKey: string, keyType: string): string | StackTraceError;
|
|
21
17
|
/**
|
|
22
18
|
*
|
|
23
19
|
* @param privateKey
|
|
@@ -107,33 +103,6 @@ declare class SAsymmetricCryptionDataWithPublicRSAKey {
|
|
|
107
103
|
private traceError;
|
|
108
104
|
}
|
|
109
105
|
|
|
110
|
-
/**
|
|
111
|
-
*
|
|
112
|
-
* @param url
|
|
113
|
-
* @param user
|
|
114
|
-
* @param password
|
|
115
|
-
* @param dbName
|
|
116
|
-
* @constructor
|
|
117
|
-
*/
|
|
118
|
-
declare function SCheckerMongoDatabaseConnection(url: string, user: string | any, password: string | any, dbName: string | any): Promise<void>;
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
*
|
|
122
|
-
* @param environnementPath
|
|
123
|
-
* @param dbConnection
|
|
124
|
-
* @param user
|
|
125
|
-
* @param database
|
|
126
|
-
* @param dbHost
|
|
127
|
-
* @param password
|
|
128
|
-
* @param localeLanguage
|
|
129
|
-
* @constructor
|
|
130
|
-
*
|
|
131
|
-
* Return void
|
|
132
|
-
*/
|
|
133
|
-
declare function SCheckerMySqlDatabaseConnection(localeLanguage: string, environnementPath: any, dbConnection: mySQL.Connection, user: string, database: string, dbHost: string, password: string): void;
|
|
134
|
-
|
|
135
|
-
declare function SCheckerPostgresDatabaseConnection(localeLanguage: string, environnementPath: any, connectionString: any, keepAlive?: boolean | undefined, stream?: any, statement_timeout?: false | number | undefined, ssl?: boolean | ConnectionOptions | undefined, query_timeout?: number | undefined, keepAliveInitialDelayMillis?: number | undefined, idle_in_transaction_session_timeout?: number | undefined, application_name?: string | undefined, connectionTimeoutMillis?: number | undefined, types?: CustomTypesConfig | undefined, options?: string | undefined): Promise<void>;
|
|
136
|
-
|
|
137
106
|
declare const CLogLevel: {
|
|
138
107
|
readonly debug: "DEBUG";
|
|
139
108
|
readonly info: "INFO";
|
|
@@ -141,27 +110,6 @@ declare const CLogLevel: {
|
|
|
141
110
|
readonly error: "ERROR";
|
|
142
111
|
};
|
|
143
112
|
|
|
144
|
-
/** --------------------------------------------------------------------------------------------------------------------------------
|
|
145
|
-
* Arguments: A connection URL can also take arguments. Here is the same example from above with placeholder
|
|
146
|
-
* values in uppercase letters for three arguments: mysql://USER:PASSWORD@HOST:PORT/DATABASE?KEY1=VALUE&KEY2=VALUE&KEY3=VALUE
|
|
147
|
-
*
|
|
148
|
-
* The following arguments can be used:
|
|
149
|
-
* connection_limit: Maximum size of the connection pool,
|
|
150
|
-
* connect_timeout: Maximum number of seconds to wait for a new connection to be opened, 0 means no timeout,
|
|
151
|
-
* pool_timeout: Maximum number of seconds to wait for a new connection from the pool, 0 means no timeout,
|
|
152
|
-
* sslcert: Path to the server certificate. Certificate paths are resolved relative to the ./prisma folder,
|
|
153
|
-
* sslidentity: Path to the PKCS12 certificate,
|
|
154
|
-
* sslpassword: Password that was used to secure the PKCS12 file,
|
|
155
|
-
* sslaccept: Configures whether to check for missing values in the certificate. Possible values: accept_invalid_certs, strict,
|
|
156
|
-
* socket: Points to a directory that contains a socket to be used for the connection,
|
|
157
|
-
* socket_timeout: Number of seconds to wait until a single query terminates
|
|
158
|
-
*
|
|
159
|
-
* So if you want to use argument: write it like this "?sslidentity=client-identity.p12&sslpassword=mypassword&sslcert=rootca.cert"
|
|
160
|
-
*
|
|
161
|
-
* ---------------------------------------------------------------------------------------------------------------------------------
|
|
162
|
-
*/
|
|
163
|
-
declare const UOptionalArgumentConnection: (environnementPath: any) => string;
|
|
164
|
-
|
|
165
113
|
/**
|
|
166
114
|
* This class contains methods that allow to decrypt data using public and private keys.
|
|
167
115
|
*/
|
|
@@ -182,7 +130,7 @@ declare class RSAKeyEncryption {
|
|
|
182
130
|
declare class YamlParsing {
|
|
183
131
|
private readonly logger;
|
|
184
132
|
private readonly localeLanguage;
|
|
185
|
-
constructor(localeLanguage: string,
|
|
133
|
+
constructor(localeLanguage: string, environmentPath: any);
|
|
186
134
|
absolutPath(): string;
|
|
187
135
|
readFile(filePath: string): Promise<void>;
|
|
188
136
|
/**
|
|
@@ -204,12 +152,6 @@ declare class Environment<T> {
|
|
|
204
152
|
get<K extends keyof T>(key: K): T[K];
|
|
205
153
|
}
|
|
206
154
|
|
|
207
|
-
declare const MMongoCheckerDatabase: (optionalArgumentConnection: string | any, localLanguage: string, environnementPath: any) => Promise<void>;
|
|
208
|
-
|
|
209
|
-
declare const MMySqlCheckerDatabase: (optionalArgumentConnection: string | any, localLanguage: string, environnementPath: any) => void;
|
|
210
|
-
|
|
211
|
-
declare const MPostgresCheckerDatabase: (localLanguage: string, environnementPath: any, keepAlive?: boolean | undefined, stream?: (() => (stream.Duplex | undefined)) | undefined, statement_timeout?: false | number | undefined, ssl?: boolean | ConnectionOptions | undefined, query_timeout?: number | undefined, keepAliveInitialDelayMillis?: number | undefined, idle_in_transaction_session_timeout?: number | undefined, application_name?: string | undefined, connectionTimeoutMillis?: number | undefined, types?: CustomTypesConfig | undefined, options?: string | undefined) => Promise<void>;
|
|
212
|
-
|
|
213
155
|
/**
|
|
214
156
|
*
|
|
215
157
|
* @param envDir
|
|
@@ -371,7 +313,7 @@ declare class Utility {
|
|
|
371
313
|
declare class PathModuleVerifier {
|
|
372
314
|
private log;
|
|
373
315
|
private readonly localeLanguage;
|
|
374
|
-
constructor(localeLanguage: string,
|
|
316
|
+
constructor(localeLanguage: string, environmentPath: any);
|
|
375
317
|
/**
|
|
376
318
|
* Verifies if modules at specific paths are loaded.
|
|
377
319
|
* If any module is not loaded, it throws an error.
|
|
@@ -388,8 +330,8 @@ declare class PathModuleVerifier {
|
|
|
388
330
|
|
|
389
331
|
declare class LocalLanguageLoader {
|
|
390
332
|
private readonly localeLanguage;
|
|
391
|
-
private readonly
|
|
392
|
-
constructor(localeLanguage: string,
|
|
333
|
+
private readonly environmentPath;
|
|
334
|
+
constructor(localeLanguage: string, environmentPath: any);
|
|
393
335
|
load(): void;
|
|
394
336
|
}
|
|
395
337
|
|
|
@@ -449,26 +391,26 @@ declare function TRawBodyParser(options: IBodyParserOptions, localLanguage: stri
|
|
|
449
391
|
*
|
|
450
392
|
* @param options
|
|
451
393
|
* @param localLanguage
|
|
452
|
-
* @param
|
|
394
|
+
* @param environmentPath
|
|
453
395
|
*
|
|
454
396
|
* Use by this: textBodyParserType({ type: 'text/html' })
|
|
455
397
|
*
|
|
456
398
|
* in express, it can be used like this: app.use(textBodyParserType({ type: 'text/html' }));
|
|
457
399
|
*
|
|
458
400
|
*/
|
|
459
|
-
declare function TTextBodyParser(options: IBodyParserOptions, localLanguage: string,
|
|
401
|
+
declare function TTextBodyParser(options: IBodyParserOptions, localLanguage: string, environmentPath: any): void;
|
|
460
402
|
|
|
461
403
|
/**
|
|
462
404
|
*
|
|
463
405
|
* @param options
|
|
464
406
|
* @param localLanguage
|
|
465
|
-
* @param
|
|
407
|
+
* @param environmentPath
|
|
466
408
|
*
|
|
467
409
|
* Use by this: urlencodedBodyParserType({ type: 'application/x-www-form-urlencoded' })
|
|
468
410
|
*
|
|
469
411
|
* in express, it can be used like this: app.use(urlencodedBodyParserType({ type: 'application/x-www-form-urlencoded' }));
|
|
470
412
|
*
|
|
471
413
|
*/
|
|
472
|
-
declare function TUrlencodedBodyParser(options: IBodyParserOptions, localLanguage: string,
|
|
414
|
+
declare function TUrlencodedBodyParser(options: IBodyParserOptions, localLanguage: string, environmentPath: any): void;
|
|
473
415
|
|
|
474
|
-
export { CLogLevel, CSignRSAKeyComponent, Environment, type IBodyParserOptions, type IResponseBodyEndFromResponseEvent, type IResponseBodyWriteFromResponseEvent, type IWrappingBodyResponse, LocalLanguageLoader,
|
|
416
|
+
export { CLogLevel, CSignRSAKeyComponent, Environment, type IBodyParserOptions, type IResponseBodyEndFromResponseEvent, type IResponseBodyWriteFromResponseEvent, type IWrappingBodyResponse, LocalLanguageLoader, PathModuleVerifier, RSAKeyDecryption, RSAKeyEncryption, SAsymmetricCryptionDataWithPrivateRSAKey, SAsymmetricCryptionDataWithPublicRSAKey, TJSONBodyParser, type TLogLevel, type TOriginalWriteEncoding, type TParseFunction, TRawBodyParser, TTextBodyParser, TUrlencodedBodyParser, Utility, YamlParsing, dateTimeFormatted, loggerConfig };
|