rez_core 7.1.83 → 7.1.85

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.
Files changed (33) hide show
  1. package/dist/module/entity/data/controller/entity-filter.controller.d.ts +6 -1
  2. package/dist/module/entity/data/controller/entity-filter.controller.js +1 -1
  3. package/dist/module/entity/data/controller/entity-filter.controller.js.map +1 -1
  4. package/dist/module/entity/data/filter/service/entity-filter.service.d.ts +1 -1
  5. package/dist/module/entity/data/filter/service/entity-filter.service.js.map +1 -1
  6. package/dist/module/entity/data/filter/service/helpers/flatjson.helper.js +21 -8
  7. package/dist/module/entity/data/filter/service/helpers/flatjson.helper.js.map +1 -1
  8. package/dist/module/entity/data/service/resolver.service.js +1 -1
  9. package/dist/module/entity/data/service/resolver.service.js.map +1 -1
  10. package/dist/module/entity/meta/meta/service/listing-layout.service.d.ts +2 -1
  11. package/dist/module/entity/meta/meta/service/listing-layout.service.js +6 -2
  12. package/dist/module/entity/meta/meta/service/listing-layout.service.js.map +1 -1
  13. package/dist/tsconfig.build.tsbuildinfo +1 -1
  14. package/package.json +1 -1
  15. package/src/module/entity/data/controller/entity-filter.controller.ts +2 -2
  16. package/src/module/entity/data/filter/service/entity-filter.service.ts +1 -1
  17. package/src/module/entity/data/filter/service/helpers/flatjson.helper.ts +26 -11
  18. package/src/module/entity/data/service/resolver.service.ts +1 -1
  19. package/src/module/entity/meta/meta/service/listing-layout.service.ts +11 -0
  20. package/.claude/settings.local.json +0 -26
  21. package/.idea/250218_nodejs_core.iml +0 -9
  22. package/.idea/codeStyles/Project.xml +0 -59
  23. package/.idea/codeStyles/codeStyleConfig.xml +0 -5
  24. package/.idea/copilot.data.migration.agent.xml +0 -6
  25. package/.idea/copilot.data.migration.ask.xml +0 -6
  26. package/.idea/copilot.data.migration.ask2agent.xml +0 -6
  27. package/.idea/copilot.data.migration.edit.xml +0 -6
  28. package/.idea/inspectionProfiles/Project_Default.xml +0 -6
  29. package/.idea/misc.xml +0 -6
  30. package/.idea/modules.xml +0 -8
  31. package/.idea/prettier.xml +0 -6
  32. package/.idea/vcs.xml +0 -6
  33. package/server.log +0 -850
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rez_core",
3
- "version": "7.1.83",
3
+ "version": "7.1.85",
4
4
  "description": "",
5
5
  "author": "",
6
6
  "private": false,
@@ -111,7 +111,7 @@ export class EntityFilterController {
111
111
  sortColumn?: { column: string; order: 'ASC' | 'DESC' };
112
112
  pagination?: { page: number; size: number };
113
113
  flatJson?: boolean;
114
- jsonColumn?: string;
114
+ tabs?: { columnName: string; value: any; name: string; sortBy?: string };
115
115
  },
116
116
  @Req() req: Request & { user: any },
117
117
  ) {
@@ -125,7 +125,7 @@ export class EntityFilterController {
125
125
  body.sortColumn,
126
126
  body.pagination,
127
127
  loggedInUser,
128
- undefined, // tabs
128
+ body.tabs, // Pass tabs from request body
129
129
  body.flatJson || false
130
130
  );
131
131
 
@@ -489,7 +489,7 @@ export class EntityFilterService {
489
489
  sortColumn?: { column: string; order: 'ASC' | 'DESC' },
490
490
  pagination?: PaginationParams,
491
491
  userData?: any,
492
- tabs?: { columnName: string; value: any, name: string, sortBy: string },
492
+ tabs?: { columnName: string; value: any, name: string, sortBy?: string },
493
493
  flatJson: boolean = false,
494
494
  disableDefaultFilter: boolean = false,
495
495
  ): Promise<FilterDataResult> {
@@ -42,6 +42,8 @@ export function buildFlatJsonCondition(
42
42
  const key = `param_${attr}_${Math.random().toString(36).substring(2, 8)}`;
43
43
  const jsonColumn = 'json_data';
44
44
 
45
+ console.log(`🔸 [FlatJson] Building condition for attribute: ${attr}, element_type: ${meta.element_type}, operator: ${op}, value:`, val);
46
+
45
47
  switch (meta.element_type) {
46
48
  case 'text':
47
49
  case 'textarea':
@@ -268,43 +270,56 @@ export function buildFlatJsonSelectCondition(
268
270
  switch (op) {
269
271
  case 'equal':
270
272
  case 'contains':
271
- // Check if JSON array contains the value
272
- // Using @> operator: jsonb @> '["value"]'::jsonb
273
+ // Check if value matches - handles both string and array storage
274
+ // For string: e.json_data->>'attr' = 'value'
275
+ // For array: e.json_data->'attr' @> '["value"]'::jsonb
273
276
  return {
274
- query: `(e.${jsonColumn}->>'${attr}')::jsonb @> :${key}::jsonb`,
275
- params: { [key]: JSON.stringify([arr[0]]) },
277
+ query: `(
278
+ e.${jsonColumn}->>'${attr}' = :${key}_str
279
+ OR (e.${jsonColumn}->'${attr}')::jsonb @> :${key}_arr::jsonb
280
+ )`,
281
+ params: {
282
+ [`${key}_str`]: arr[0],
283
+ [`${key}_arr`]: JSON.stringify([arr[0]])
284
+ },
276
285
  };
277
286
  case 'not_equal':
278
287
  case 'not_contains':
279
- // Check if JSON array does NOT contain the value
288
+ // Check if value does NOT match - handles both string and array storage
280
289
  return {
281
- query: `NOT ((e.${jsonColumn}->>'${attr}')::jsonb @> :${key}::jsonb)`,
282
- params: { [key]: JSON.stringify([arr[0]]) },
290
+ query: `(
291
+ e.${jsonColumn}->>'${attr}' != :${key}_str
292
+ AND NOT ((e.${jsonColumn}->'${attr}')::jsonb @> :${key}_arr::jsonb)
293
+ )`,
294
+ params: {
295
+ [`${key}_str`]: arr[0],
296
+ [`${key}_arr`]: JSON.stringify([arr[0]])
297
+ },
283
298
  };
284
299
  case 'contains_any':
285
300
  // Check if array contains ANY of the provided values
286
301
  // Using ?| operator: jsonb ?| array['value1','value2']
287
302
  return {
288
- query: `(e.${jsonColumn}->>'${attr}')::jsonb ?| :${key}`,
303
+ query: `(e.${jsonColumn}->'${attr}')::jsonb ?| :${key}`,
289
304
  params: { [key]: arr },
290
305
  };
291
306
  case 'contains_all':
292
307
  // Check if array contains ALL of the provided values
293
308
  // Using ?& operator: jsonb ?& array['value1','value2']
294
309
  return {
295
- query: `(e.${jsonColumn}->>'${attr}')::jsonb ?& :${key}`,
310
+ query: `(e.${jsonColumn}->'${attr}')::jsonb ?& :${key}`,
296
311
  params: { [key]: arr },
297
312
  };
298
313
  case 'empty':
299
314
  // Check if null, empty string, or empty array
300
315
  return {
301
- query: `(e.${jsonColumn}->>'${attr}' IS NULL OR e.${jsonColumn}->>'${attr}' = '' OR jsonb_array_length((e.${jsonColumn}->>'${attr}')::jsonb) = 0)`,
316
+ query: `(e.${jsonColumn}->>'${attr}' IS NULL OR e.${jsonColumn}->>'${attr}' = '' OR jsonb_array_length((e.${jsonColumn}->'${attr}')::jsonb) = 0)`,
302
317
  params: {},
303
318
  };
304
319
  case 'not_empty':
305
320
  // Check if not null and not empty array
306
321
  return {
307
- query: `(e.${jsonColumn}->>'${attr}' IS NOT NULL AND e.${jsonColumn}->>'${attr}' != '' AND jsonb_array_length((e.${jsonColumn}->>'${attr}')::jsonb) > 0)`,
322
+ query: `(e.${jsonColumn}->>'${attr}' IS NOT NULL AND e.${jsonColumn}->>'${attr}' != '' AND jsonb_array_length((e.${jsonColumn}->'${attr}')::jsonb) > 0)`,
308
323
  params: {},
309
324
  };
310
325
  default:
@@ -40,7 +40,7 @@ export class ResolverService {
40
40
  const resolvedEntityData = { ...entityData };
41
41
  for (const attr of attributeItems) {
42
42
  const field = attr.attribute_key;
43
- const codeValue = entityData[field];
43
+ const codeValue = entityData?.[field];
44
44
 
45
45
  if (!codeValue) continue;
46
46
 
@@ -15,6 +15,8 @@ export class ListingLayoutService {
15
15
  private readonly savedFilterRepoService: SavedFilterService,
16
16
  @Inject(forwardRef(() => 'LayoutPreferenceService'))
17
17
  private readonly layoutPreferenceService: LayoutPreferenceService,
18
+ @Inject('EntityMasterService')
19
+ private readonly entityMasterService: any,
18
20
  ) {}
19
21
 
20
22
  async getTableMetaDataForListing(
@@ -179,6 +181,15 @@ export class ListingLayoutService {
179
181
  );
180
182
  }
181
183
 
184
+ // Get entity master data to fetch is_flat_json flag
185
+ const entityMaster = await this.entityMasterService.getEntityMasterData(
186
+ entityType,
187
+ loggedInUser,
188
+ );
189
+
190
+ // Add is_flat_json flag to response
191
+ entityTableDto.is_flat_json = entityMaster?.is_flat_json || false;
192
+
182
193
  return entityTableDto;
183
194
  }
184
195
  }
@@ -1,26 +0,0 @@
1
- {
2
- "permissions": {
3
- "allow": [
4
- "Bash(npm run build:*)",
5
- "Bash(npm install)",
6
- "Bash(npm run lint)",
7
- "Bash(npm install:*)",
8
- "Bash(curl:*)",
9
- "Bash(npm run start:dev:*)",
10
- "Bash(mkdir:*)",
11
- "Bash(lsof:*)",
12
- "Bash(kill:*)",
13
- "Bash(npx eslint:*)",
14
- "Read(/Users/admin/yash/**)",
15
- "Bash(timeout 15 npm run start:dev)",
16
- "Read(/Users/admin/yash/**)",
17
- "Bash(find:*)",
18
- "Bash(sed:*)",
19
- "Bash(git checkout:*)",
20
- "Read(//Users/admin/yash/**)",
21
- "Bash(npx tsc:*)"
22
- ],
23
- "deny": [],
24
- "ask": []
25
- }
26
- }
@@ -1,9 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <module type="JAVA_MODULE" version="4">
3
- <component name="NewModuleRootManager" inherit-compiler-output="true">
4
- <exclude-output />
5
- <content url="file://$MODULE_DIR$" />
6
- <orderEntry type="inheritedJdk" />
7
- <orderEntry type="sourceFolder" forTests="false" />
8
- </component>
9
- </module>
@@ -1,59 +0,0 @@
1
- <component name="ProjectCodeStyleConfiguration">
2
- <code_scheme name="Project" version="173">
3
- <HTMLCodeStyleSettings>
4
- <option name="HTML_SPACE_INSIDE_EMPTY_TAG" value="true" />
5
- </HTMLCodeStyleSettings>
6
- <JSCodeStyleSettings version="0">
7
- <option name="FORCE_SEMICOLON_STYLE" value="true" />
8
- <option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
9
- <option name="USE_DOUBLE_QUOTES" value="false" />
10
- <option name="FORCE_QUOTE_STYlE" value="true" />
11
- <option name="ENFORCE_TRAILING_COMMA" value="WhenMultiline" />
12
- <option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
13
- <option name="SPACES_WITHIN_IMPORTS" value="true" />
14
- </JSCodeStyleSettings>
15
- <TypeScriptCodeStyleSettings version="0">
16
- <option name="FORCE_SEMICOLON_STYLE" value="true" />
17
- <option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
18
- <option name="USE_DOUBLE_QUOTES" value="false" />
19
- <option name="FORCE_QUOTE_STYlE" value="true" />
20
- <option name="ENFORCE_TRAILING_COMMA" value="WhenMultiline" />
21
- <option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
22
- <option name="SPACES_WITHIN_IMPORTS" value="true" />
23
- </TypeScriptCodeStyleSettings>
24
- <VueCodeStyleSettings>
25
- <option name="INTERPOLATION_NEW_LINE_AFTER_START_DELIMITER" value="false" />
26
- <option name="INTERPOLATION_NEW_LINE_BEFORE_END_DELIMITER" value="false" />
27
- </VueCodeStyleSettings>
28
- <codeStyleSettings language="HTML">
29
- <option name="SOFT_MARGINS" value="80" />
30
- <indentOptions>
31
- <option name="INDENT_SIZE" value="2" />
32
- <option name="CONTINUATION_INDENT_SIZE" value="2" />
33
- <option name="TAB_SIZE" value="2" />
34
- </indentOptions>
35
- </codeStyleSettings>
36
- <codeStyleSettings language="JavaScript">
37
- <option name="SOFT_MARGINS" value="80" />
38
- <indentOptions>
39
- <option name="INDENT_SIZE" value="2" />
40
- <option name="CONTINUATION_INDENT_SIZE" value="2" />
41
- <option name="TAB_SIZE" value="2" />
42
- </indentOptions>
43
- </codeStyleSettings>
44
- <codeStyleSettings language="TypeScript">
45
- <option name="SOFT_MARGINS" value="80" />
46
- <indentOptions>
47
- <option name="INDENT_SIZE" value="2" />
48
- <option name="CONTINUATION_INDENT_SIZE" value="2" />
49
- <option name="TAB_SIZE" value="2" />
50
- </indentOptions>
51
- </codeStyleSettings>
52
- <codeStyleSettings language="Vue">
53
- <option name="SOFT_MARGINS" value="80" />
54
- <indentOptions>
55
- <option name="CONTINUATION_INDENT_SIZE" value="2" />
56
- </indentOptions>
57
- </codeStyleSettings>
58
- </code_scheme>
59
- </component>
@@ -1,5 +0,0 @@
1
- <component name="ProjectCodeStyleConfiguration">
2
- <state>
3
- <option name="USE_PER_PROJECT_SETTINGS" value="true" />
4
- </state>
5
- </component>
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="AgentMigrationStateService">
4
- <option name="migrationStatus" value="COMPLETED" />
5
- </component>
6
- </project>
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="AskMigrationStateService">
4
- <option name="migrationStatus" value="COMPLETED" />
5
- </component>
6
- </project>
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="Ask2AgentMigrationStateService">
4
- <option name="migrationStatus" value="COMPLETED" />
5
- </component>
6
- </project>
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="EditMigrationStateService">
4
- <option name="migrationStatus" value="COMPLETED" />
5
- </component>
6
- </project>
@@ -1,6 +0,0 @@
1
- <component name="InspectionProjectProfileManager">
2
- <profile version="1.0">
3
- <option name="myName" value="Project Default" />
4
- <inspection_tool class="SqlNoDataSourceInspection" enabled="false" level="WARNING" enabled_by_default="false" />
5
- </profile>
6
- </component>
package/.idea/misc.xml DELETED
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectRootManager" version="2" languageLevel="JDK_21" default="true" project-jdk-name="21" project-jdk-type="JavaSDK">
4
- <output url="file://$PROJECT_DIR$/out" />
5
- </component>
6
- </project>
package/.idea/modules.xml DELETED
@@ -1,8 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="ProjectModuleManager">
4
- <modules>
5
- <module fileurl="file://$PROJECT_DIR$/.idea/250218_nodejs_core.iml" filepath="$PROJECT_DIR$/.idea/250218_nodejs_core.iml" />
6
- </modules>
7
- </component>
8
- </project>
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="PrettierConfiguration">
4
- <option name="myConfigurationMode" value="DISABLED" />
5
- </component>
6
- </project>
package/.idea/vcs.xml DELETED
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="VcsDirectoryMappings">
4
- <mapping directory="" vcs="Git" />
5
- </component>
6
- </project>