rez_core 3.1.162 → 3.1.164
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/module/integration/service/wrapper.service.js +10 -0
- package/dist/module/integration/service/wrapper.service.js.map +1 -1
- package/dist/module/listmaster/controller/list-master.controller.js +18 -2
- package/dist/module/listmaster/controller/list-master.controller.js.map +1 -1
- package/dist/module/listmaster/service/list-master.service.d.ts +1 -1
- package/dist/module/listmaster/service/list-master.service.js +9 -4
- package/dist/module/listmaster/service/list-master.service.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/module/integration/service/wrapper.service.ts +16 -1
- package/src/module/listmaster/controller/list-master.controller.ts +40 -22
- package/src/module/listmaster/service/list-master.service.ts +14 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Injectable, Logger } from '@nestjs/common';
|
|
2
2
|
import { DataSource } from 'typeorm';
|
|
3
|
-
import {
|
|
3
|
+
import { GenericMessageDto, IntegrationService } from './integration.service';
|
|
4
4
|
import { GoogleService } from './calendar-event.service';
|
|
5
5
|
import { IcsMeetingService } from 'src/module/ics/service/ics.service';
|
|
6
6
|
|
|
@@ -384,6 +384,21 @@ export class WrapperService {
|
|
|
384
384
|
`Generating ICS file. Payload: ${JSON.stringify(payload)}`,
|
|
385
385
|
);
|
|
386
386
|
|
|
387
|
+
if (payload.template_code) {
|
|
388
|
+
let templates = await this.datasource.query(
|
|
389
|
+
`SELECT id FROM cr_wf_comm_template
|
|
390
|
+
WHERE code = ?
|
|
391
|
+
AND level_id = ?
|
|
392
|
+
AND level_type = ?
|
|
393
|
+
LIMIT 1`,
|
|
394
|
+
[payload.template_code, levelId, levelType],
|
|
395
|
+
);
|
|
396
|
+
|
|
397
|
+
if (templates && templates.length > 0) {
|
|
398
|
+
payload['templateId'] = templates[0].id;
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
|
|
387
402
|
let activeConfig = await this.integrationService.getSingleActiveConfig(levelId, levelType, appCode, 'EMAIL');
|
|
388
403
|
const base64String = await this.icsService.generateIcs(payload, activeConfig?.config_json);
|
|
389
404
|
this.logger.debug(`ICS generated (base64 length: ${base64String?.length})`);
|
|
@@ -50,31 +50,49 @@ export class ListMasterController {
|
|
|
50
50
|
);
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
53
|
+
// Public/internal endpoint (no JWT required)
|
|
54
|
+
@Get('/getDropdownDataPublic/:type')
|
|
55
|
+
@HttpCode(HttpStatus.OK)
|
|
56
|
+
async getDropdownDataPublic(
|
|
57
|
+
@Param('type') type: string,
|
|
58
|
+
@Query() queryParams: Record<string, string>,
|
|
59
|
+
) {
|
|
60
|
+
const {
|
|
61
|
+
inactiveIds,
|
|
62
|
+
loggedInUser: loggedInUserParam,
|
|
63
|
+
...params
|
|
64
|
+
} = queryParams;
|
|
65
|
+
|
|
66
|
+
const inactiveIdsArray = inactiveIds
|
|
67
|
+
? inactiveIds.split(',').map((id) => parseInt(id, 10))
|
|
68
|
+
: [];
|
|
69
|
+
|
|
70
|
+
// Default user object (if organization_id or appcode is needed in service)
|
|
71
|
+
let loggedInUser: any = {};
|
|
72
|
+
|
|
73
|
+
if (typeof loggedInUserParam === 'string') {
|
|
74
|
+
try {
|
|
75
|
+
loggedInUser = JSON.parse(loggedInUserParam);
|
|
76
|
+
} catch (e) {
|
|
77
|
+
loggedInUser = {};
|
|
78
|
+
}
|
|
79
|
+
} else if (
|
|
80
|
+
typeof loggedInUserParam === 'object' &&
|
|
81
|
+
loggedInUserParam !== null
|
|
59
82
|
) {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
? inactiveIds.split(',').map((id) => parseInt(id, 10))
|
|
64
|
-
: [];
|
|
65
|
-
|
|
66
|
-
// Default user object (if organization_id or appcode is needed in service)
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
return await this.service.getDropdownOptions(
|
|
70
|
-
type,
|
|
71
|
-
params,
|
|
72
|
-
inactiveIdsArray,
|
|
73
|
-
loggedInUser,
|
|
74
|
-
);
|
|
83
|
+
loggedInUser = loggedInUserParam;
|
|
84
|
+
} else {
|
|
85
|
+
loggedInUser = {};
|
|
75
86
|
}
|
|
76
|
-
|
|
77
87
|
|
|
88
|
+
return await this.service.getDropdownOptions(
|
|
89
|
+
type,
|
|
90
|
+
params,
|
|
91
|
+
inactiveIdsArray,
|
|
92
|
+
loggedInUser,
|
|
93
|
+
true, // publicCall flag set to true
|
|
94
|
+
);
|
|
95
|
+
}
|
|
78
96
|
|
|
79
97
|
@Get('/getDataSourceList/:source')
|
|
80
98
|
@UseGuards(JwtAuthGuard)
|
|
@@ -68,6 +68,7 @@ export class ListMasterService {
|
|
|
68
68
|
params: Record<string, string>,
|
|
69
69
|
inactiveIdsArray?: number[],
|
|
70
70
|
loggedInUser?,
|
|
71
|
+
publicCall = false,
|
|
71
72
|
) {
|
|
72
73
|
const config = await this.listMasterRepo.findByType(
|
|
73
74
|
type,
|
|
@@ -76,15 +77,23 @@ export class ListMasterService {
|
|
|
76
77
|
|
|
77
78
|
if (!config) throw new NotFoundException(`Type ${type} not found`);
|
|
78
79
|
|
|
79
|
-
if (config.appcode != loggedInUser?.appcode) {
|
|
80
|
+
if (config.appcode != loggedInUser?.appcode && !publicCall) {
|
|
80
81
|
// Call internal API for appcode mismatch
|
|
81
82
|
try {
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
const baseUrl = this.configService.get<string>('REDIRECT_BE_URL');
|
|
84
|
+
|
|
85
|
+
// Prepare the query string
|
|
86
|
+
const queryParams = new URLSearchParams({
|
|
87
|
+
inactiveIds: inactiveIdsArray?.join(',') || '',
|
|
88
|
+
loggedInUser: JSON.stringify(loggedInUser),
|
|
89
|
+
...params, // Spread other params into the query string
|
|
90
|
+
}).toString();
|
|
91
|
+
|
|
92
|
+
// Make the GET request with query parameters
|
|
93
|
+
const response = await axios.get(
|
|
94
|
+
`${baseUrl}/list-master/getDropdownDataPublic/${type}?${queryParams}`,
|
|
85
95
|
{
|
|
86
96
|
headers: {
|
|
87
|
-
Authorization: `Bearer ${loggedInUser?.token || ''}`,
|
|
88
97
|
'Content-Type': 'application/json',
|
|
89
98
|
},
|
|
90
99
|
},
|