@liminalfunctions/framework 1.0.67 → 1.0.69

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 (45) hide show
  1. package/dist/F_Collection.d.ts +2 -0
  2. package/dist/F_Collection.js +5 -0
  3. package/dist/F_Collection.js.map +1 -1
  4. package/dist/F_Compile.js +19 -0
  5. package/dist/F_Compile.js.map +1 -1
  6. package/dist/code_generation/templates/utils.ts.mustache +1 -0
  7. package/dist/utils/complex_query_validator_from_zod.d.ts +20 -0
  8. package/dist/utils/complex_query_validator_from_zod.js +223 -0
  9. package/dist/utils/complex_query_validator_from_zod.js.map +1 -0
  10. package/dist/utils/query_object_to_mongodb_query.d.ts +8 -1
  11. package/dist/utils/query_object_to_mongodb_query.js +12 -2
  12. package/dist/utils/query_object_to_mongodb_query.js.map +1 -1
  13. package/dist/utils/query_validator_from_zod.js +7 -1
  14. package/dist/utils/query_validator_from_zod.js.map +1 -1
  15. package/dist/utils/zod_loop_seperator.js +4 -0
  16. package/dist/utils/zod_loop_seperator.js.map +1 -1
  17. package/package.json +4 -3
  18. package/src/F_Collection.ts +5 -0
  19. package/src/F_Compile.ts +18 -0
  20. package/src/code_generation/templates/utils.ts.mustache +1 -0
  21. package/src/utils/complex_query_validator_from_zod.ts +252 -0
  22. package/src/utils/query_object_to_mongodb_query.ts +11 -3
  23. package/src/utils/query_validator_from_zod.ts +8 -1
  24. package/src/utils/zod_loop_seperator.ts +5 -0
  25. package/test/0_3_query_validator_to_mongodb_query.test.ts +18 -0
  26. package/test/0_4_query_validator_to_advanced_query.test.ts +402 -0
  27. package/test/1_0_basic_server.test.ts +30 -0
  28. package/test/1_4_advanced_queries.test.ts +400 -0
  29. package/test/2_0_client_library_basic_type_generation.test.ts +2 -2
  30. package/test/2_0_client_library_query_type_generation.test.ts +12 -0
  31. package/test/tmp/dist/types/brief_news_category_query.d.ts +3 -0
  32. package/test/tmp/dist/types/client_query.d.ts +2 -0
  33. package/test/tmp/dist/types/institution_query.d.ts +2 -0
  34. package/test/tmp/dist/types/project_query.d.ts +2 -0
  35. package/test/tmp/dist/utils/utils.js +4 -0
  36. package/test/tmp/dist/utils/utils.js.map +1 -1
  37. package/test/tmp/package-lock.json +3 -3
  38. package/test/tmp/src/types/brief_news_category_query.ts +3 -0
  39. package/test/tmp/src/types/client_query.ts +2 -0
  40. package/test/tmp/src/types/institution_query.ts +2 -0
  41. package/test/tmp/src/types/project_query.ts +2 -0
  42. package/test/tmp/src/utils/utils.ts +1 -0
  43. /package/test/{0_4_cache.test.ts → 0_5_cache.test.ts} +0 -0
  44. /package/test/{0_5_malicious_keys.test.ts → 0_6_malicious_keys.test.ts} +0 -0
  45. /package/test/{0_6_array_children.test.ts → 0_7_array_children.test.ts} +0 -0
@@ -2,6 +2,7 @@ export type project_query = {
2
2
  "limit"?: number
3
3
  "cursor"?: string
4
4
  "sort_order"?: ("ascending" | "descending")
5
+ "advanced_query"?: string
5
6
  "_id"?: string
6
7
  "_id_gt"?: string
7
8
  "_id_lt"?: string
@@ -9,6 +10,7 @@ export type project_query = {
9
10
  "name"?: string
10
11
  "name_gt"?: string
11
12
  "name_lt"?: string
13
+ "name_search"?: string
12
14
  "name_in"?: (string)[]
13
15
  "institution_id"?: string
14
16
  "institution_id_gt"?: string
@@ -3,6 +3,7 @@
3
3
  export function encode_search_params(params: {[key: string]: string | number | boolean | string[] | Date}): {[key: string]: string | number | boolean }{
4
4
  let retval: {[key: string]: string | number | boolean } = {}
5
5
  for(let [key, value] of Object.entries(params)){
6
+ if(key === 'advanced_query') { retval[key] = JSON.stringify(value); continue; }
6
7
  if(Array.isArray(value)){
7
8
  retval[key] = value.join(',')
8
9
  } else if(value instanceof Date){
File without changes