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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rez_core",
3
- "version": "1.0.56",
3
+ "version": "1.0.58",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -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
+ }
@@ -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) && typeof data[0] === 'string') {
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 && typeof acc === 'object') {
108
- return acc[key];
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
- return undefined;
118
+
119
+ return acc[key];
111
120
  }, obj);
112
121
  }
113
122
 
123
+
114
124
  }