emilsoftware-utilities 1.3.135 → 1.3.137
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/{UnifiedModule.d.ts → EmilsoftwareModule.d.ts} +3 -3
- package/dist/{UnifiedModule.js → EmilsoftwareModule.js} +7 -7
- package/dist/Orm.js +2 -2
- package/dist/accessi-module/Dtos/UserDto.d.ts +1 -0
- package/dist/accessi-module/Dtos/UserDto.js +4 -0
- package/dist/accessi-module/Services/UserService/UserService.js +9 -4
- package/dist/allegati-module/Services/AllegatiService/AllegatiService.js +1 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -2
- package/dist/{initializeUnifiedModule.d.ts → initEmilsoftwareModule.d.ts} +2 -2
- package/dist/{initializeUnifiedModule.js → initEmilsoftwareModule.js} +7 -7
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@ import { AllegatiOptions } from "./allegati-module/AllegatiModule";
|
|
|
4
4
|
/**
|
|
5
5
|
* Configuration options for the unified module that combines Accessi and Allegati functionality
|
|
6
6
|
*/
|
|
7
|
-
export interface
|
|
7
|
+
export interface EmilsoftwareOptions {
|
|
8
8
|
accessiOptions: AccessiOptions;
|
|
9
9
|
allegatiOptions: AllegatiOptions;
|
|
10
10
|
}
|
|
@@ -12,6 +12,6 @@ export interface UnifiedModuleOptions {
|
|
|
12
12
|
* Unified module that combines user access management (Accessi) and file attachment management (Allegati)
|
|
13
13
|
* into a single NestJS module with shared Swagger documentation
|
|
14
14
|
*/
|
|
15
|
-
export declare class
|
|
16
|
-
static forRoot(options:
|
|
15
|
+
export declare class EmilsoftwareModule {
|
|
16
|
+
static forRoot(options: EmilsoftwareOptions): DynamicModule;
|
|
17
17
|
}
|
|
@@ -5,9 +5,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
7
|
};
|
|
8
|
-
var
|
|
8
|
+
var EmilsoftwareModule_1;
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.
|
|
10
|
+
exports.EmilsoftwareModule = void 0;
|
|
11
11
|
const common_1 = require("@nestjs/common");
|
|
12
12
|
const AccessiModule_1 = require("./accessi-module/AccessiModule");
|
|
13
13
|
const AllegatiModule_1 = require("./allegati-module/AllegatiModule");
|
|
@@ -15,10 +15,10 @@ const AllegatiModule_1 = require("./allegati-module/AllegatiModule");
|
|
|
15
15
|
* Unified module that combines user access management (Accessi) and file attachment management (Allegati)
|
|
16
16
|
* into a single NestJS module with shared Swagger documentation
|
|
17
17
|
*/
|
|
18
|
-
let
|
|
18
|
+
let EmilsoftwareModule = EmilsoftwareModule_1 = class EmilsoftwareModule {
|
|
19
19
|
static forRoot(options) {
|
|
20
20
|
return {
|
|
21
|
-
module:
|
|
21
|
+
module: EmilsoftwareModule_1,
|
|
22
22
|
imports: [
|
|
23
23
|
AccessiModule_1.AccessiModule.forRoot(options.accessiOptions),
|
|
24
24
|
AllegatiModule_1.AllegatiModule.forRoot(options.allegatiOptions),
|
|
@@ -27,7 +27,7 @@ let UnifiedModule = UnifiedModule_1 = class UnifiedModule {
|
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
};
|
|
30
|
-
exports.
|
|
31
|
-
exports.
|
|
30
|
+
exports.EmilsoftwareModule = EmilsoftwareModule;
|
|
31
|
+
exports.EmilsoftwareModule = EmilsoftwareModule = EmilsoftwareModule_1 = __decorate([
|
|
32
32
|
(0, common_1.Module)({})
|
|
33
|
-
],
|
|
33
|
+
], EmilsoftwareModule);
|
package/dist/Orm.js
CHANGED
|
@@ -67,7 +67,7 @@ class Orm {
|
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
69
|
static query(options_1, query_1) {
|
|
70
|
-
return __awaiter(this, arguments, void 0, function* (options, query, parameters = [], logQuery =
|
|
70
|
+
return __awaiter(this, arguments, void 0, function* (options, query, parameters = [], logQuery = true) {
|
|
71
71
|
try {
|
|
72
72
|
return new Promise((resolve, reject) => {
|
|
73
73
|
Firebird.attach(options, (err, db) => {
|
|
@@ -96,7 +96,7 @@ class Orm {
|
|
|
96
96
|
});
|
|
97
97
|
}
|
|
98
98
|
static execute(options_1, query_1) {
|
|
99
|
-
return __awaiter(this, arguments, void 0, function* (options, query, parameters = [], logQuery =
|
|
99
|
+
return __awaiter(this, arguments, void 0, function* (options, query, parameters = [], logQuery = true) {
|
|
100
100
|
try {
|
|
101
101
|
return new Promise((resolve, reject) => {
|
|
102
102
|
Firebird.attach(options, (err, db) => {
|
|
@@ -89,6 +89,10 @@ __decorate([
|
|
|
89
89
|
(0, swagger_1.ApiPropertyOptional)({ description: "Metadata JSON personalizzato.", example: "{\"theme\": \"dark\"}" }),
|
|
90
90
|
__metadata("design:type", String)
|
|
91
91
|
], UserDto.prototype, "jsonMetadata", void 0);
|
|
92
|
+
__decorate([
|
|
93
|
+
(0, swagger_1.ApiPropertyOptional)({ description: "Ragione sociale cliente.", example: "ACME Corp SpA" }),
|
|
94
|
+
__metadata("design:type", String)
|
|
95
|
+
], UserDto.prototype, "ragSocCli", void 0);
|
|
92
96
|
__decorate([
|
|
93
97
|
(0, swagger_1.ApiPropertyOptional)({ description: "Ruoli assegnati all'utente.", example: ["admin", "editor"] }),
|
|
94
98
|
__metadata("design:type", Array)
|
|
@@ -56,11 +56,11 @@ let UserService = class UserService {
|
|
|
56
56
|
G.CELLULARE as cellulare,
|
|
57
57
|
G.FLGSUPER as flag_super,
|
|
58
58
|
G.PAGDEF as pagina_default,
|
|
59
|
-
G.JSON_METADATA as json_metadata
|
|
59
|
+
G.JSON_METADATA as json_metadata,
|
|
60
|
+
G.RAGSOCCLI as rag_soc_cli
|
|
60
61
|
FROM UTENTI U INNER JOIN UTENTI_CONFIG G ON U.CODUTE = G.CODUTE
|
|
61
|
-
WHERE STAREG <> ?
|
|
62
62
|
ORDER BY U.CODUTE`;
|
|
63
|
-
let users = yield Orm_1.Orm.query(this.accessiOptions.databaseOptions, query
|
|
63
|
+
let users = yield Orm_1.Orm.query(this.accessiOptions.databaseOptions, query);
|
|
64
64
|
users = users.map(Utilities_1.RestUtilities.convertKeysToCamelCase);
|
|
65
65
|
let usersResponse = [];
|
|
66
66
|
for (const user of users) {
|
|
@@ -112,7 +112,8 @@ let UserService = class UserService {
|
|
|
112
112
|
C.CODLINGUA AS codice_lingua,
|
|
113
113
|
C.CELLULARE AS cellulare,
|
|
114
114
|
C.FLGSUPER AS flag_super,
|
|
115
|
-
C.PAGDEF AS pagina_default
|
|
115
|
+
C.PAGDEF AS pagina_default,
|
|
116
|
+
C.RAGSOCCLI AS rag_soc_cli
|
|
116
117
|
FROM UTENTI U
|
|
117
118
|
INNER JOIN UTENTI_CONFIG C ON C.CODUTE = U.CODUTE
|
|
118
119
|
WHERE LOWER(U.USRNAME) = ?
|
|
@@ -303,6 +304,10 @@ let UserService = class UserService {
|
|
|
303
304
|
utentiConfigUpdates.push("json_metadata = ?");
|
|
304
305
|
utentiConfigParams.push(user.jsonMetadata);
|
|
305
306
|
}
|
|
307
|
+
if (user.ragSocCli !== undefined) {
|
|
308
|
+
utentiConfigUpdates.push("ragsoccli = ?");
|
|
309
|
+
utentiConfigParams.push(user.ragSocCli);
|
|
310
|
+
}
|
|
306
311
|
if (utentiConfigUpdates.length > 0) {
|
|
307
312
|
const queryUtentiConfig = `UPDATE UTENTI_CONFIG SET ${utentiConfigUpdates.join(", ")} WHERE CODUTE = ?`;
|
|
308
313
|
utentiConfigParams.push(codiceUtente);
|
|
@@ -49,7 +49,7 @@ let AllegatiService = class AllegatiService {
|
|
|
49
49
|
];
|
|
50
50
|
this.ensureTableExists().catch(error => {
|
|
51
51
|
console.error('[AllegatiService] Errore creazione tabella ALLEGATI:', error);
|
|
52
|
-
throw new
|
|
52
|
+
// throw new InternalServerErrorException('Errore durante l\'inizializzazione del servizio allegati');
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
55
|
validateFile(file) {
|
package/dist/index.d.ts
CHANGED
|
@@ -17,6 +17,4 @@ export * from "./accessi-module";
|
|
|
17
17
|
export * from "./allegati-module";
|
|
18
18
|
export * from "es-node-firebird";
|
|
19
19
|
export { autobind, ExecutionTimeLogger, Logger, LogLevels, Orm, DateUtilities, RestUtilities, DatabaseUtilities, DatabaseUpdater, StatusCode, DocumentGenerator };
|
|
20
|
-
export * from "./UnifiedModule";
|
|
21
|
-
export * from "./initializeUnifiedModule";
|
|
22
20
|
export * from "./swagger/SwaggerConfig";
|
package/dist/index.js
CHANGED
|
@@ -45,6 +45,4 @@ __exportStar(require("./accessi-module"), exports);
|
|
|
45
45
|
__exportStar(require("./allegati-module"), exports);
|
|
46
46
|
__exportStar(require("es-node-firebird"), exports);
|
|
47
47
|
// Unified module exports
|
|
48
|
-
__exportStar(require("./UnifiedModule"), exports);
|
|
49
|
-
__exportStar(require("./initializeUnifiedModule"), exports);
|
|
50
48
|
__exportStar(require("./swagger/SwaggerConfig"), exports);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Application } from "express";
|
|
2
|
-
import {
|
|
2
|
+
import { EmilsoftwareOptions } from "./EmilsoftwareModule";
|
|
3
3
|
/**
|
|
4
4
|
* Initializes the unified module that combines Accessi and Allegati functionality
|
|
5
5
|
* @param app Express application instance
|
|
6
6
|
* @param options Configuration options for both modules
|
|
7
7
|
*/
|
|
8
|
-
export declare function
|
|
8
|
+
export declare function initEmilsoftwareModule(app: Application, options: EmilsoftwareOptions): Promise<void>;
|
|
@@ -9,23 +9,23 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
12
|
+
exports.initEmilsoftwareModule = initEmilsoftwareModule;
|
|
13
13
|
const core_1 = require("@nestjs/core");
|
|
14
14
|
const platform_express_1 = require("@nestjs/platform-express");
|
|
15
|
-
const UnifiedModule_1 = require("./UnifiedModule");
|
|
16
15
|
const SwaggerConfig_1 = require("./swagger/SwaggerConfig");
|
|
17
16
|
const Logger_1 = require("./Logger");
|
|
17
|
+
const EmilsoftwareModule_1 = require("./EmilsoftwareModule");
|
|
18
18
|
/**
|
|
19
19
|
* Initializes the unified module that combines Accessi and Allegati functionality
|
|
20
20
|
* @param app Express application instance
|
|
21
21
|
* @param options Configuration options for both modules
|
|
22
22
|
*/
|
|
23
|
-
function
|
|
23
|
+
function initEmilsoftwareModule(app, options) {
|
|
24
24
|
return __awaiter(this, void 0, void 0, function* () {
|
|
25
|
-
const logger = new Logger_1.Logger(
|
|
25
|
+
const logger = new Logger_1.Logger(initEmilsoftwareModule.name);
|
|
26
26
|
try {
|
|
27
27
|
const nestExpressInstance = new platform_express_1.ExpressAdapter(app);
|
|
28
|
-
const nestApp = yield core_1.NestFactory.create(
|
|
28
|
+
const nestApp = yield core_1.NestFactory.create(EmilsoftwareModule_1.EmilsoftwareModule.forRoot(options), nestExpressInstance, {
|
|
29
29
|
bufferLogs: true
|
|
30
30
|
});
|
|
31
31
|
nestApp.enableCors();
|
|
@@ -35,10 +35,10 @@ function initializeUnifiedModule(app, options) {
|
|
|
35
35
|
// Setup unified Swagger documentation for all modules
|
|
36
36
|
(0, SwaggerConfig_1.setupSwagger)(nestApp);
|
|
37
37
|
yield nestApp.init();
|
|
38
|
-
logger.info("
|
|
38
|
+
logger.info("Emilsoftware module initialized successfully");
|
|
39
39
|
}
|
|
40
40
|
catch (error) {
|
|
41
|
-
logger.error("Error initializing
|
|
41
|
+
logger.error("Error initializing Emilsoftware Module:", error);
|
|
42
42
|
throw error;
|
|
43
43
|
}
|
|
44
44
|
});
|