rez_core 1.0.56 → 1.0.58
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/listmaster/controller/list-master.controller.d.ts +4 -1
- package/dist/module/listmaster/service/list-master.service.d.ts +4 -1
- package/dist/module/listmaster/service/list-master.service.js +11 -5
- package/dist/module/listmaster/service/list-master.service.js.map +1 -1
- package/dist/resources/dev.properties.yaml +21 -0
- package/dist/resources/uat.properties.yaml +15 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/app.controller.ts +12 -12
- package/src/app.service.ts +8 -8
- package/src/module/listmaster/service/list-master.service.ts +15 -5
package/package.json
CHANGED
package/src/app.controller.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { Controller, Get } from '@nestjs/common';
|
|
2
|
-
import { AppService } from './app.service';
|
|
3
|
-
|
|
4
|
-
@Controller()
|
|
5
|
-
export class AppController {
|
|
6
|
-
constructor(private readonly appService: AppService) {}
|
|
7
|
-
|
|
8
|
-
@Get()
|
|
9
|
-
getHello(): string {
|
|
10
|
-
return this.appService.getHello();
|
|
11
|
-
}
|
|
12
|
-
}
|
|
1
|
+
import { Controller, Get } from '@nestjs/common';
|
|
2
|
+
import { AppService } from './app.service';
|
|
3
|
+
|
|
4
|
+
@Controller()
|
|
5
|
+
export class AppController {
|
|
6
|
+
constructor(private readonly appService: AppService) {}
|
|
7
|
+
|
|
8
|
+
@Get()
|
|
9
|
+
getHello(): string {
|
|
10
|
+
return this.appService.getHello();
|
|
11
|
+
}
|
|
12
|
+
}
|
package/src/app.service.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Injectable } from '@nestjs/common';
|
|
2
|
-
|
|
3
|
-
@Injectable()
|
|
4
|
-
export class AppService {
|
|
5
|
-
getHello(): string {
|
|
6
|
-
return 'Hello World!';
|
|
7
|
-
}
|
|
8
|
-
}
|
|
1
|
+
import { Injectable } from '@nestjs/common';
|
|
2
|
+
|
|
3
|
+
@Injectable()
|
|
4
|
+
export class AppService {
|
|
5
|
+
getHello(): string {
|
|
6
|
+
return 'Hello World!';
|
|
7
|
+
}
|
|
8
|
+
}
|
|
@@ -67,7 +67,7 @@ export class ListMasterService extends EntityServiceImpl {
|
|
|
67
67
|
let apiRegistry = await this.apiRegistryService.findById(customSourceId);
|
|
68
68
|
if (!apiRegistry) return [];
|
|
69
69
|
|
|
70
|
-
const url = `${apiRegistry.base_url}${apiRegistry.endpoint}`;
|
|
70
|
+
const url = `${apiRegistry.base_url}${apiRegistry.endpoint.replace(/{{(.*?)}}/g, (_, key) => params?.[key.trim()] || '')}`;
|
|
71
71
|
const payload = this.injectDynamicParams(apiRegistry.request_payload_schema, params);
|
|
72
72
|
|
|
73
73
|
const response = await firstValueFrom(
|
|
@@ -81,7 +81,11 @@ export class ListMasterService extends EntityServiceImpl {
|
|
|
81
81
|
|
|
82
82
|
const data = this.extractByPath(response.data, apiRegistry.response_data_path);
|
|
83
83
|
|
|
84
|
-
if (Array.isArray(data)
|
|
84
|
+
if (!Array.isArray(data)) {
|
|
85
|
+
return [{ label: data, value: data }];
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
if (typeof data[0] === 'string') {
|
|
85
89
|
return data.map((item: string) => ({ label: item, value: item }));
|
|
86
90
|
}
|
|
87
91
|
|
|
@@ -104,11 +108,17 @@ export class ListMasterService extends EntityServiceImpl {
|
|
|
104
108
|
if (!path || !obj) return obj;
|
|
105
109
|
|
|
106
110
|
return path.split('.').reduce((acc, key) => {
|
|
107
|
-
if (acc
|
|
108
|
-
|
|
111
|
+
if (acc == null) return undefined;
|
|
112
|
+
|
|
113
|
+
// Try to convert to number if it's a numeric string (for array indexes)
|
|
114
|
+
const index = Number(key);
|
|
115
|
+
if (!isNaN(index) && Array.isArray(acc)) {
|
|
116
|
+
return acc[index];
|
|
109
117
|
}
|
|
110
|
-
|
|
118
|
+
|
|
119
|
+
return acc[key];
|
|
111
120
|
}, obj);
|
|
112
121
|
}
|
|
113
122
|
|
|
123
|
+
|
|
114
124
|
}
|