@keshavsoft/kschema-api-gen-actions 1.15.4 → 1.16.3

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 (178) hide show
  1. package/README.md +4 -1
  2. package/bin/cli.js +1 -1
  3. package/bin/v16/config/actions.json +46 -0
  4. package/bin/v16/config/actionsV3.json +35 -0
  5. package/bin/{v13/tasks/actions/GetMethods/ShowAll → v16/tasks/actions/GetMethods/Distinct/V1}/template/controller.js +7 -2
  6. package/bin/v16/tasks/actions/GetMethods/Distinct/V1/template/service.js +12 -0
  7. package/bin/{v14/tasks/actions/GetMethods/ShowAll → v16/tasks/actions/GetMethods/Distinct/V2}/template/controller.js +8 -3
  8. package/bin/v16/tasks/actions/GetMethods/Distinct/V2/template/service.js +12 -0
  9. package/bin/{v14/tasks/actions/PostMethods/Insert → v16/tasks/actions/PostMethods/FilterColumns}/template/controller.js +8 -5
  10. package/bin/v16/tasks/actions/PostMethods/FilterColumns/template/rest.http +4 -0
  11. package/bin/v16/tasks/actions/PostMethods/FilterColumns/template/service.js +9 -0
  12. package/bin/{v13 → v16}/tasks/actions/distinct.js +11 -15
  13. package/bin/{v14/tasks/actions/insert.js → v16/tasks/actions/filterColumns.js} +12 -15
  14. package/bin/{v14 → v16}/tasks/actions/showAll.js +10 -3
  15. package/package.json +2 -2
  16. package/bin/v13/config/actions.json +0 -20
  17. package/bin/v13/core/showUsage.js +0 -50
  18. package/bin/v13/start.js +0 -22
  19. package/bin/v13/tasks/actions/GetMethods/Distinct/template/service.js +0 -9
  20. package/bin/v13/tasks/actions/showAll.js +0 -59
  21. package/bin/v14/commands/loadCommand.js +0 -11
  22. package/bin/v14/core/createFolder.js +0 -34
  23. package/bin/v14/core/parseInput.js +0 -8
  24. package/bin/v14/core/resolveCommand.js +0 -11
  25. package/bin/v14/tasks/actions/GetMethods/Distinct/template/controller.js +0 -21
  26. package/bin/v14/tasks/actions/GetMethods/Distinct/template/service.js +0 -9
  27. package/bin/v14/tasks/actions/GetMethods/ShowAll/steps/UpdateRoutesJs/updateImports/checkDuplicate.js +0 -8
  28. package/bin/v14/tasks/actions/GetMethods/ShowAll/steps/UpdateRoutesJs/updateImports/index.js +0 -45
  29. package/bin/v14/tasks/actions/GetMethods/ShowAll/steps/UpdateRoutesJs/updateUse/buildUseLine.js +0 -9
  30. package/bin/v14/tasks/actions/GetMethods/ShowAll/steps/UpdateRoutesJs/updateUse/checkDuplicate.js +0 -8
  31. package/bin/v14/tasks/actions/GetMethods/ShowAll/steps/UpdateRoutesJs/updateUse/index.js +0 -46
  32. package/bin/v14/tasks/actions/GetMethods/ShowAll/steps/resolveFolderName.js +0 -20
  33. package/bin/v14/tasks/actions/GetMethods/ShowAll/template/service.js +0 -9
  34. package/bin/v14/tasks/actions/PostMethods/Insert/steps/UpdateRoutesJs/common/readFile.js +0 -8
  35. package/bin/v14/tasks/actions/PostMethods/Insert/steps/UpdateRoutesJs/common/writeFile.js +0 -10
  36. package/bin/v14/tasks/actions/PostMethods/Insert/steps/UpdateRoutesJs/updateImports/buildImport.js +0 -9
  37. package/bin/v14/tasks/actions/PostMethods/Insert/steps/UpdateRoutesJs/updateImports/findInsertIndex.js +0 -10
  38. package/bin/v14/tasks/actions/PostMethods/Insert/steps/UpdateRoutesJs/updateUse/findInsertIndex.js +0 -10
  39. package/bin/v14/tasks/actions/PostMethods/Insert/steps/announce.js +0 -9
  40. package/bin/v14/tasks/actions/PostMethods/Insert/steps/createFolder.js +0 -7
  41. package/bin/v14/tasks/actions/PostMethods/Insert/steps/createHttpFile.js +0 -12
  42. package/bin/v14/tasks/actions/PostMethods/Insert/steps/decideTemplate.js +0 -3
  43. package/bin/v14/tasks/actions/PostMethods/Insert/steps/locateDestination.js +0 -7
  44. package/bin/v14/tasks/actions/PostMethods/Insert/steps/locateSource.js +0 -13
  45. package/bin/v14/tasks/actions/PostMethods/Insert/steps/updateAppJs.js +0 -7
  46. package/bin/v14/tasks/actions/PostMethods/Insert/steps/updateEndPointsFile.js +0 -30
  47. package/bin/v14/tasks/actions/PostMethods/Insert/steps/updateEndPointsJs.js +0 -16
  48. package/bin/v14/tasks/actions/PostMethods/Insert/template/errors.js +0 -11
  49. package/bin/v14/tasks/actions/PostMethods/Insert/template/service.js +0 -11
  50. package/bin/v14/tasks/actions/distinct.js +0 -59
  51. package/bin/v14/tasks/core/createFolder.js +0 -34
  52. package/bin/v14/tasks/core/parseInput.js +0 -12
  53. package/bin/v14/tasks/core/resolveCommand.js +0 -24
  54. package/bin/v14/tasks/core/showUsage.js +0 -43
  55. /package/bin/{v13 → v16}/commands/loadCommand.js +0 -0
  56. /package/bin/{v14 → v16}/config/actionsV1.json +0 -0
  57. /package/bin/{v14/config/actions.json → v16/config/actionsV2.json} +0 -0
  58. /package/bin/{v13 → v16}/core/createFolder.js +0 -0
  59. /package/bin/{v13 → v16}/core/parseInput.js +0 -0
  60. /package/bin/{v13 → v16}/core/resolveCommand.js +0 -0
  61. /package/bin/{v14 → v16}/core/showUsage.js +0 -0
  62. /package/bin/{v14 → v16}/start.js +0 -0
  63. /package/bin/{v13/tasks/actions/GetMethods/Distinct → v16/tasks/actions/GetMethods/Distinct/V1}/steps/UpdateRoutesJs/common/readFile.js +0 -0
  64. /package/bin/{v13/tasks/actions/GetMethods/Distinct → v16/tasks/actions/GetMethods/Distinct/V1}/steps/UpdateRoutesJs/common/writeFile.js +0 -0
  65. /package/bin/{v13/tasks/actions/GetMethods/Distinct → v16/tasks/actions/GetMethods/Distinct/V1}/steps/UpdateRoutesJs/updateImports/buildImport.js +0 -0
  66. /package/bin/{v13/tasks/actions/GetMethods/Distinct → v16/tasks/actions/GetMethods/Distinct/V1}/steps/UpdateRoutesJs/updateImports/checkDuplicate.js +0 -0
  67. /package/bin/{v13/tasks/actions/GetMethods/Distinct → v16/tasks/actions/GetMethods/Distinct/V1}/steps/UpdateRoutesJs/updateImports/findInsertIndex.js +0 -0
  68. /package/bin/{v13/tasks/actions/GetMethods/Distinct → v16/tasks/actions/GetMethods/Distinct/V1}/steps/UpdateRoutesJs/updateImports/index.js +0 -0
  69. /package/bin/{v13/tasks/actions/GetMethods/Distinct → v16/tasks/actions/GetMethods/Distinct/V1}/steps/UpdateRoutesJs/updateUse/buildUseLine.js +0 -0
  70. /package/bin/{v13/tasks/actions/GetMethods/Distinct → v16/tasks/actions/GetMethods/Distinct/V1}/steps/UpdateRoutesJs/updateUse/checkDuplicate.js +0 -0
  71. /package/bin/{v13/tasks/actions/GetMethods/Distinct → v16/tasks/actions/GetMethods/Distinct/V1}/steps/UpdateRoutesJs/updateUse/findInsertIndex.js +0 -0
  72. /package/bin/{v13/tasks/actions/GetMethods/Distinct → v16/tasks/actions/GetMethods/Distinct/V1}/steps/UpdateRoutesJs/updateUse/index.js +0 -0
  73. /package/bin/{v13/tasks/actions/GetMethods/Distinct → v16/tasks/actions/GetMethods/Distinct/V1}/steps/announce.js +0 -0
  74. /package/bin/{v13/tasks/actions/GetMethods/Distinct → v16/tasks/actions/GetMethods/Distinct/V1}/steps/createFolder.js +0 -0
  75. /package/bin/{v13/tasks/actions/GetMethods/Distinct → v16/tasks/actions/GetMethods/Distinct/V1}/steps/createHttpFile.js +0 -0
  76. /package/bin/{v13/tasks/actions/GetMethods/Distinct → v16/tasks/actions/GetMethods/Distinct/V1}/steps/decideTemplate.js +0 -0
  77. /package/bin/{v13/tasks/actions/GetMethods/Distinct → v16/tasks/actions/GetMethods/Distinct/V1}/steps/locateDestination.js +0 -0
  78. /package/bin/{v13/tasks/actions/GetMethods/Distinct → v16/tasks/actions/GetMethods/Distinct/V1}/steps/locateSource.js +0 -0
  79. /package/bin/{v13/tasks/actions/GetMethods/Distinct → v16/tasks/actions/GetMethods/Distinct/V1}/steps/resolveFolderName.js +0 -0
  80. /package/bin/{v13/tasks/actions/GetMethods/Distinct → v16/tasks/actions/GetMethods/Distinct/V1}/steps/updateAppJs.js +0 -0
  81. /package/bin/{v13/tasks/actions/GetMethods/Distinct → v16/tasks/actions/GetMethods/Distinct/V1}/steps/updateEndPointsFile.js +0 -0
  82. /package/bin/{v13/tasks/actions/GetMethods/Distinct → v16/tasks/actions/GetMethods/Distinct/V1}/steps/updateEndPointsJs.js +0 -0
  83. /package/bin/{v13/tasks/actions/GetMethods/Distinct → v16/tasks/actions/GetMethods/Distinct/V1}/template/errors.js +0 -0
  84. /package/bin/{v13/tasks/actions/GetMethods/ShowAll → v16/tasks/actions/GetMethods/Distinct/V2}/steps/UpdateRoutesJs/common/readFile.js +0 -0
  85. /package/bin/{v13/tasks/actions/GetMethods/ShowAll → v16/tasks/actions/GetMethods/Distinct/V2}/steps/UpdateRoutesJs/common/writeFile.js +0 -0
  86. /package/bin/{v13/tasks/actions/GetMethods/ShowAll → v16/tasks/actions/GetMethods/Distinct/V2}/steps/UpdateRoutesJs/updateImports/buildImport.js +0 -0
  87. /package/bin/{v13/tasks/actions/GetMethods/ShowAll → v16/tasks/actions/GetMethods/Distinct/V2}/steps/UpdateRoutesJs/updateImports/checkDuplicate.js +0 -0
  88. /package/bin/{v13/tasks/actions/GetMethods/ShowAll → v16/tasks/actions/GetMethods/Distinct/V2}/steps/UpdateRoutesJs/updateImports/findInsertIndex.js +0 -0
  89. /package/bin/{v13/tasks/actions/GetMethods/ShowAll → v16/tasks/actions/GetMethods/Distinct/V2}/steps/UpdateRoutesJs/updateImports/index.js +0 -0
  90. /package/bin/{v13/tasks/actions/GetMethods/ShowAll → v16/tasks/actions/GetMethods/Distinct/V2}/steps/UpdateRoutesJs/updateUse/buildUseLine.js +0 -0
  91. /package/bin/{v13/tasks/actions/GetMethods/ShowAll → v16/tasks/actions/GetMethods/Distinct/V2}/steps/UpdateRoutesJs/updateUse/checkDuplicate.js +0 -0
  92. /package/bin/{v13/tasks/actions/GetMethods/ShowAll → v16/tasks/actions/GetMethods/Distinct/V2}/steps/UpdateRoutesJs/updateUse/findInsertIndex.js +0 -0
  93. /package/bin/{v13/tasks/actions/GetMethods/ShowAll → v16/tasks/actions/GetMethods/Distinct/V2}/steps/UpdateRoutesJs/updateUse/index.js +0 -0
  94. /package/bin/{v13/tasks/actions/GetMethods/ShowAll → v16/tasks/actions/GetMethods/Distinct/V2}/steps/announce.js +0 -0
  95. /package/bin/{v13/tasks/actions/GetMethods/ShowAll → v16/tasks/actions/GetMethods/Distinct/V2}/steps/createFolder.js +0 -0
  96. /package/bin/{v13/tasks/actions/GetMethods/ShowAll → v16/tasks/actions/GetMethods/Distinct/V2}/steps/createHttpFile.js +0 -0
  97. /package/bin/{v13/tasks/actions/GetMethods/ShowAll → v16/tasks/actions/GetMethods/Distinct/V2}/steps/decideTemplate.js +0 -0
  98. /package/bin/{v13/tasks/actions/GetMethods/ShowAll → v16/tasks/actions/GetMethods/Distinct/V2}/steps/locateDestination.js +0 -0
  99. /package/bin/{v13/tasks/actions/GetMethods/ShowAll → v16/tasks/actions/GetMethods/Distinct/V2}/steps/locateSource.js +0 -0
  100. /package/bin/{v13/tasks/actions/GetMethods/ShowAll → v16/tasks/actions/GetMethods/Distinct/V2}/steps/resolveFolderName.js +0 -0
  101. /package/bin/{v13/tasks/actions/GetMethods/ShowAll → v16/tasks/actions/GetMethods/Distinct/V2}/steps/updateAppJs.js +0 -0
  102. /package/bin/{v13/tasks/actions/GetMethods/ShowAll → v16/tasks/actions/GetMethods/Distinct/V2}/steps/updateEndPointsFile.js +0 -0
  103. /package/bin/{v13/tasks/actions/GetMethods/ShowAll → v16/tasks/actions/GetMethods/Distinct/V2}/steps/updateEndPointsJs.js +0 -0
  104. /package/bin/{v13/tasks/actions/GetMethods/ShowAll → v16/tasks/actions/GetMethods/Distinct/V2}/template/errors.js +0 -0
  105. /package/bin/{v13/tasks/actions/PostMethods/Insert → v16/tasks/actions/GetMethods/ShowAll}/steps/UpdateRoutesJs/common/readFile.js +0 -0
  106. /package/bin/{v13/tasks/actions/PostMethods/Insert → v16/tasks/actions/GetMethods/ShowAll}/steps/UpdateRoutesJs/common/writeFile.js +0 -0
  107. /package/bin/{v13/tasks/actions/PostMethods/Insert → v16/tasks/actions/GetMethods/ShowAll}/steps/UpdateRoutesJs/updateImports/buildImport.js +0 -0
  108. /package/bin/{v14/tasks/actions/GetMethods/Distinct → v16/tasks/actions/GetMethods/ShowAll}/steps/UpdateRoutesJs/updateImports/checkDuplicate.js +0 -0
  109. /package/bin/{v13/tasks/actions/PostMethods/Insert → v16/tasks/actions/GetMethods/ShowAll}/steps/UpdateRoutesJs/updateImports/findInsertIndex.js +0 -0
  110. /package/bin/{v14/tasks/actions/GetMethods/Distinct → v16/tasks/actions/GetMethods/ShowAll}/steps/UpdateRoutesJs/updateImports/index.js +0 -0
  111. /package/bin/{v14/tasks/actions/GetMethods/Distinct → v16/tasks/actions/GetMethods/ShowAll}/steps/UpdateRoutesJs/updateUse/buildUseLine.js +0 -0
  112. /package/bin/{v14/tasks/actions/GetMethods/Distinct → v16/tasks/actions/GetMethods/ShowAll}/steps/UpdateRoutesJs/updateUse/checkDuplicate.js +0 -0
  113. /package/bin/{v13/tasks/actions/PostMethods/Insert → v16/tasks/actions/GetMethods/ShowAll}/steps/UpdateRoutesJs/updateUse/findInsertIndex.js +0 -0
  114. /package/bin/{v14/tasks/actions/GetMethods/Distinct → v16/tasks/actions/GetMethods/ShowAll}/steps/UpdateRoutesJs/updateUse/index.js +0 -0
  115. /package/bin/{v13/tasks/actions/PostMethods/Insert → v16/tasks/actions/GetMethods/ShowAll}/steps/announce.js +0 -0
  116. /package/bin/{v13/tasks/actions/PostMethods/Insert → v16/tasks/actions/GetMethods/ShowAll}/steps/createFolder.js +0 -0
  117. /package/bin/{v13/tasks/actions/PostMethods/Insert → v16/tasks/actions/GetMethods/ShowAll}/steps/createHttpFile.js +0 -0
  118. /package/bin/{v13/tasks/actions/PostMethods/Insert → v16/tasks/actions/GetMethods/ShowAll}/steps/decideTemplate.js +0 -0
  119. /package/bin/{v13/tasks/actions/PostMethods/Insert → v16/tasks/actions/GetMethods/ShowAll}/steps/locateDestination.js +0 -0
  120. /package/bin/{v13/tasks/actions/PostMethods/Insert → v16/tasks/actions/GetMethods/ShowAll}/steps/locateSource.js +0 -0
  121. /package/bin/{v14/tasks/actions/GetMethods/Distinct → v16/tasks/actions/GetMethods/ShowAll}/steps/resolveFolderName.js +0 -0
  122. /package/bin/{v13/tasks/actions/PostMethods/Insert → v16/tasks/actions/GetMethods/ShowAll}/steps/updateAppJs.js +0 -0
  123. /package/bin/{v13/tasks/actions/PostMethods/Insert → v16/tasks/actions/GetMethods/ShowAll}/steps/updateEndPointsFile.js +0 -0
  124. /package/bin/{v13/tasks/actions/PostMethods/Insert → v16/tasks/actions/GetMethods/ShowAll}/steps/updateEndPointsJs.js +0 -0
  125. /package/bin/{v13/tasks/actions/GetMethods/Distinct → v16/tasks/actions/GetMethods/ShowAll}/template/controller.js +0 -0
  126. /package/bin/{v13/tasks/actions/PostMethods/Insert → v16/tasks/actions/GetMethods/ShowAll}/template/errors.js +0 -0
  127. /package/bin/{v13 → v16}/tasks/actions/GetMethods/ShowAll/template/service.js +0 -0
  128. /package/bin/{v14/tasks/actions/GetMethods/Distinct → v16/tasks/actions/PostMethods/FilterColumns}/steps/UpdateRoutesJs/common/readFile.js +0 -0
  129. /package/bin/{v14/tasks/actions/GetMethods/Distinct → v16/tasks/actions/PostMethods/FilterColumns}/steps/UpdateRoutesJs/common/writeFile.js +0 -0
  130. /package/bin/{v14/tasks/actions/GetMethods/Distinct → v16/tasks/actions/PostMethods/FilterColumns}/steps/UpdateRoutesJs/updateImports/buildImport.js +0 -0
  131. /package/bin/{v13/tasks/actions/PostMethods/Insert → v16/tasks/actions/PostMethods/FilterColumns}/steps/UpdateRoutesJs/updateImports/checkDuplicate.js +0 -0
  132. /package/bin/{v14/tasks/actions/GetMethods/Distinct → v16/tasks/actions/PostMethods/FilterColumns}/steps/UpdateRoutesJs/updateImports/findInsertIndex.js +0 -0
  133. /package/bin/{v13/tasks/actions/PostMethods/Insert → v16/tasks/actions/PostMethods/FilterColumns}/steps/UpdateRoutesJs/updateImports/index.js +0 -0
  134. /package/bin/{v13/tasks/actions/PostMethods/Insert → v16/tasks/actions/PostMethods/FilterColumns}/steps/UpdateRoutesJs/updateUse/buildUseLine.js +0 -0
  135. /package/bin/{v13/tasks/actions/PostMethods/Insert → v16/tasks/actions/PostMethods/FilterColumns}/steps/UpdateRoutesJs/updateUse/checkDuplicate.js +0 -0
  136. /package/bin/{v14/tasks/actions/GetMethods/Distinct → v16/tasks/actions/PostMethods/FilterColumns}/steps/UpdateRoutesJs/updateUse/findInsertIndex.js +0 -0
  137. /package/bin/{v13/tasks/actions/PostMethods/Insert → v16/tasks/actions/PostMethods/FilterColumns}/steps/UpdateRoutesJs/updateUse/index.js +0 -0
  138. /package/bin/{v14/tasks/actions/GetMethods/Distinct → v16/tasks/actions/PostMethods/FilterColumns}/steps/announce.js +0 -0
  139. /package/bin/{v14/tasks/actions/GetMethods/Distinct → v16/tasks/actions/PostMethods/FilterColumns}/steps/createFolder.js +0 -0
  140. /package/bin/{v14/tasks/actions/GetMethods/Distinct → v16/tasks/actions/PostMethods/FilterColumns}/steps/createHttpFile.js +0 -0
  141. /package/bin/{v14/tasks/actions/GetMethods/Distinct → v16/tasks/actions/PostMethods/FilterColumns}/steps/decideTemplate.js +0 -0
  142. /package/bin/{v14/tasks/actions/GetMethods/Distinct → v16/tasks/actions/PostMethods/FilterColumns}/steps/locateDestination.js +0 -0
  143. /package/bin/{v14/tasks/actions/GetMethods/Distinct → v16/tasks/actions/PostMethods/FilterColumns}/steps/locateSource.js +0 -0
  144. /package/bin/{v13/tasks/actions/PostMethods/Insert → v16/tasks/actions/PostMethods/FilterColumns}/steps/resolveFolderName.js +0 -0
  145. /package/bin/{v14/tasks/actions/GetMethods/Distinct → v16/tasks/actions/PostMethods/FilterColumns}/steps/updateAppJs.js +0 -0
  146. /package/bin/{v14/tasks/actions/GetMethods/Distinct → v16/tasks/actions/PostMethods/FilterColumns}/steps/updateEndPointsFile.js +0 -0
  147. /package/bin/{v14/tasks/actions/GetMethods/Distinct → v16/tasks/actions/PostMethods/FilterColumns}/steps/updateEndPointsJs.js +0 -0
  148. /package/bin/{v14/tasks/actions/GetMethods/Distinct → v16/tasks/actions/PostMethods/FilterColumns}/template/errors.js +0 -0
  149. /package/bin/{v13/tasks/actions/PostMethods/Insert → v16/tasks/actions/PostMethods/FilterColumns}/template/middleware.js +0 -0
  150. /package/bin/{v14/tasks/actions/GetMethods/ShowAll → v16/tasks/actions/PostMethods/Insert}/steps/UpdateRoutesJs/common/readFile.js +0 -0
  151. /package/bin/{v14/tasks/actions/GetMethods/ShowAll → v16/tasks/actions/PostMethods/Insert}/steps/UpdateRoutesJs/common/writeFile.js +0 -0
  152. /package/bin/{v14/tasks/actions/GetMethods/ShowAll → v16/tasks/actions/PostMethods/Insert}/steps/UpdateRoutesJs/updateImports/buildImport.js +0 -0
  153. /package/bin/{v14 → v16}/tasks/actions/PostMethods/Insert/steps/UpdateRoutesJs/updateImports/checkDuplicate.js +0 -0
  154. /package/bin/{v14/tasks/actions/GetMethods/ShowAll → v16/tasks/actions/PostMethods/Insert}/steps/UpdateRoutesJs/updateImports/findInsertIndex.js +0 -0
  155. /package/bin/{v14 → v16}/tasks/actions/PostMethods/Insert/steps/UpdateRoutesJs/updateImports/index.js +0 -0
  156. /package/bin/{v14 → v16}/tasks/actions/PostMethods/Insert/steps/UpdateRoutesJs/updateUse/buildUseLine.js +0 -0
  157. /package/bin/{v14 → v16}/tasks/actions/PostMethods/Insert/steps/UpdateRoutesJs/updateUse/checkDuplicate.js +0 -0
  158. /package/bin/{v14/tasks/actions/GetMethods/ShowAll → v16/tasks/actions/PostMethods/Insert}/steps/UpdateRoutesJs/updateUse/findInsertIndex.js +0 -0
  159. /package/bin/{v14 → v16}/tasks/actions/PostMethods/Insert/steps/UpdateRoutesJs/updateUse/index.js +0 -0
  160. /package/bin/{v14/tasks/actions/GetMethods/ShowAll → v16/tasks/actions/PostMethods/Insert}/steps/announce.js +0 -0
  161. /package/bin/{v14/tasks/actions/GetMethods/ShowAll → v16/tasks/actions/PostMethods/Insert}/steps/createFolder.js +0 -0
  162. /package/bin/{v14/tasks/actions/GetMethods/ShowAll → v16/tasks/actions/PostMethods/Insert}/steps/createHttpFile.js +0 -0
  163. /package/bin/{v14/tasks/actions/GetMethods/ShowAll → v16/tasks/actions/PostMethods/Insert}/steps/decideTemplate.js +0 -0
  164. /package/bin/{v14/tasks/actions/GetMethods/ShowAll → v16/tasks/actions/PostMethods/Insert}/steps/locateDestination.js +0 -0
  165. /package/bin/{v14/tasks/actions/GetMethods/ShowAll → v16/tasks/actions/PostMethods/Insert}/steps/locateSource.js +0 -0
  166. /package/bin/{v14 → v16}/tasks/actions/PostMethods/Insert/steps/resolveFolderName.js +0 -0
  167. /package/bin/{v14/tasks/actions/GetMethods/ShowAll → v16/tasks/actions/PostMethods/Insert}/steps/updateAppJs.js +0 -0
  168. /package/bin/{v14/tasks/actions/GetMethods/ShowAll → v16/tasks/actions/PostMethods/Insert}/steps/updateEndPointsFile.js +0 -0
  169. /package/bin/{v14/tasks/actions/GetMethods/ShowAll → v16/tasks/actions/PostMethods/Insert}/steps/updateEndPointsJs.js +0 -0
  170. /package/bin/{v13 → v16}/tasks/actions/PostMethods/Insert/template/controller.js +0 -0
  171. /package/bin/{v14/tasks/actions/GetMethods/ShowAll → v16/tasks/actions/PostMethods/Insert}/template/errors.js +0 -0
  172. /package/bin/{v14 → v16}/tasks/actions/PostMethods/Insert/template/middleware.js +0 -0
  173. /package/bin/{v13 → v16}/tasks/actions/PostMethods/Insert/template/service.js +0 -0
  174. /package/bin/{v13 → v16}/tasks/actions/insert.js +0 -0
  175. /package/bin/{v13 → v16}/tasks/core/createFolder.js +0 -0
  176. /package/bin/{v13 → v16}/tasks/core/parseInput.js +0 -0
  177. /package/bin/{v13 → v16}/tasks/core/resolveCommand.js +0 -0
  178. /package/bin/{v13 → v16}/tasks/core/showUsage.js +0 -0
package/README.md CHANGED
@@ -301,6 +301,8 @@ bin/
301
301
 
302
302
  ---
303
303
 
304
+ this is config driven
305
+
304
306
  # Contributing
305
307
 
306
308
  Pull requests are welcome.
@@ -317,4 +319,5 @@ MIT
317
319
 
318
320
  # Author
319
321
 
320
- Created by KeshavSoft.
322
+ Created by KeshavSoft.
323
+
package/bin/cli.js CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env node
1
+ #!/usr/bin/env node
2
2
 
3
3
  import getLatestVersion from "./core/getLatestVersion.js";
4
4
  import loadRunner from "./core/loadRunner.js";
@@ -0,0 +1,46 @@
1
+ [
2
+ {
3
+ "cmd": "ShowAll",
4
+ "file": "showAll",
5
+ "exportFile": "ShowAll",
6
+ "group": "GetMethods",
7
+ "description": "Generate ShowAll GET action",
8
+ "endPointsJs": {
9
+ "importLine": "import { getFunc } from './ShowAll/controller.js';",
10
+ "usageLine": "router.get('/ShowAll', (req, res) => getFunc({ res, inTableName : tableName}));"
11
+ }
12
+ },
13
+ {
14
+ "cmd": "Insert",
15
+ "file": "insert",
16
+ "exportFile": "Insert",
17
+ "group": "PostMethods",
18
+ "description": "Generate Insert POST action",
19
+ "endPointsJs": {
20
+ "importLine": "import { postFunc } from './Insert/controller.js';",
21
+ "usageLine": "router.post('/Insert', express.json(), (req, res) => postFunc({ req, res, inTableName : tableName}));"
22
+ }
23
+ },
24
+ {
25
+ "cmd": "Distinct",
26
+ "file": "distinct",
27
+ "exportFile": "Distinct",
28
+ "group": "GetMethods",
29
+ "description": "Generate Distinct GET action",
30
+ "endPointsJs": {
31
+ "importLine": "import distinctFunc from './Distinct/controller.js';",
32
+ "usageLine": "router.get('/Distinct/:columnName', (req, res) => distinctFunc({ req, res, inTableName : tableName}));"
33
+ }
34
+ },
35
+ {
36
+ "cmd": "FilterColumns",
37
+ "file": "filterColumns",
38
+ "exportFile": "FilterColumns",
39
+ "group": "PostMethods",
40
+ "description": "Generate FilterColumns POST action",
41
+ "endPointsJs": {
42
+ "importLine": "import filterColumnsFunc from './FilterColumns/controller.js';",
43
+ "usageLine": "router.post('/FilterColumns', express.json(), (req, res) => filterColumnsFunc({ req, res, inTableName : tableName}));"
44
+ }
45
+ }
46
+ ]
@@ -0,0 +1,35 @@
1
+ [
2
+ {
3
+ "cmd": "ShowAll",
4
+ "file": "showAll",
5
+ "exportFile": "ShowAll",
6
+ "group": "GetMethods",
7
+ "description": "Generate ShowAll GET action",
8
+ "endPointsJs": {
9
+ "importLine": "import { getFunc } from './ShowAll/controller.js';",
10
+ "usageLine": "router.get('/ShowAll', (req, res) => getFunc({ res, inTableName : tableName}));"
11
+ }
12
+ },
13
+ {
14
+ "cmd": "Insert",
15
+ "file": "insert",
16
+ "exportFile": "Insert",
17
+ "group": "PostMethods",
18
+ "description": "Generate Insert POST action",
19
+ "endPointsJs": {
20
+ "importLine": "import { postFunc } from './Insert/controller.js';",
21
+ "usageLine": "router.post('/Insert', express.json(), (req, res) => postFunc({ req, res, inTableName : tableName}));"
22
+ }
23
+ },
24
+ {
25
+ "cmd": "Distinct",
26
+ "file": "distinct",
27
+ "exportFile": "Distinct",
28
+ "group": "GetMethods",
29
+ "description": "Generate Distinct GET action",
30
+ "endPointsJs": {
31
+ "importLine": "import distinctFunc from './Distinct/controller.js';",
32
+ "usageLine": "router.get('/Distinct/:columnName', (req, res) => distinctFunc({ req, res, inTableName : tableName}));"
33
+ }
34
+ }
35
+ ]
@@ -1,9 +1,14 @@
1
1
  import { fromJsonPath } from './service.js';
2
2
  import { ConflictError, StorageError } from './errors.js';
3
3
 
4
- const getFunc = ({ res, inTableName }) => {
4
+ const getFunc = ({ req, res, inTableName }) => {
5
5
  try {
6
- const message = fromJsonPath({ inTableName });
6
+ const columnName = req.params.columnName;
7
+
8
+ const message = fromJsonPath({
9
+ inTableName,
10
+ inColumnName: columnName
11
+ });
7
12
 
8
13
  res.type("application/json").send(message);
9
14
  } catch (err) {
@@ -0,0 +1,12 @@
1
+ import { kschema } from "@keshavsoft/kschema";
2
+
3
+ const fromJsonPath = ({ inTableName, inColumnName }) => {
4
+ const tableName = inTableName;
5
+
6
+ const array = kschema.table(tableName).query.aggregate.distinct(inColumnName);
7
+ const collection = array.map(str => ({ [inColumnName]: str }));
8
+
9
+ return collection;
10
+ };
11
+
12
+ export { fromJsonPath };
@@ -1,9 +1,14 @@
1
1
  import { fromJsonPath } from './service.js';
2
2
  import { ConflictError, StorageError } from './errors.js';
3
3
 
4
- const getFunc = ({ res, inTableName }) => {
4
+ const distinctFunc = ({ req, res, inTableName }) => {
5
5
  try {
6
- const message = fromJsonPath({ inTableName });
6
+ const columnName = req.params.columnName;
7
+
8
+ const message = fromJsonPath({
9
+ inTableName,
10
+ inColumnName: columnName
11
+ });
7
12
 
8
13
  res.type("application/json").send(message);
9
14
  } catch (err) {
@@ -18,4 +23,4 @@ const getFunc = ({ res, inTableName }) => {
18
23
  }
19
24
  };
20
25
 
21
- export { getFunc };
26
+ export default distinctFunc;
@@ -0,0 +1,12 @@
1
+ import { kschema } from "@keshavsoft/kschema";
2
+
3
+ const fromJsonPath = ({ inTableName, inColumnName }) => {
4
+ const tableName = inTableName;
5
+
6
+ const array = kschema.table(tableName).query.aggregate.distinct(inColumnName);
7
+ const collection = array.map(str => ({ [inColumnName]: str }));
8
+
9
+ return collection;
10
+ };
11
+
12
+ export { fromJsonPath };
@@ -1,13 +1,16 @@
1
- import { startFunc as Service } from "./service.js";
1
+ import { filterItems } from "./service.js";
2
2
  import { ConflictError, StorageError } from "./errors.js";
3
3
 
4
- const postFunc = async ({ req, res, inTableName }) => {
4
+ const filterColumnsFunc = ({ req, res, inTableName }) => {
5
5
  try {
6
6
  const inRequestBody = req.body;
7
7
 
8
- const fromService = await Service({ inRequestBody, inTableName });
8
+ const message = filterItems({
9
+ inRequestBody,
10
+ inTableName
11
+ });
9
12
 
10
- res.type("application/json").send(fromService);
13
+ res.type("application/json").send(message);
11
14
  } catch (err) {
12
15
 
13
16
  if (err instanceof ConflictError)
@@ -21,4 +24,4 @@ const postFunc = async ({ req, res, inTableName }) => {
21
24
  }
22
25
  };
23
26
 
24
- export { postFunc };
27
+ export default filterColumnsFunc;
@@ -0,0 +1,4 @@
1
+ POST http://localhost:3000/Api/V1/journals/FilterColumns
2
+ Content-Type: application/json
3
+
4
+ { "AccountName": "VEETI KRISHNA" }
@@ -0,0 +1,9 @@
1
+ import { kschema } from "@keshavsoft/kschema";
2
+
3
+ const filterItems = ({ inRequestBody, inTableName }) => {
4
+ const tableName = inTableName;
5
+
6
+ return kschema.table(tableName).query.filterByColumns(inRequestBody);
7
+ };
8
+
9
+ export { filterItems };
@@ -1,18 +1,17 @@
1
1
  import path from "path";
2
- import { endPointsJs } from "@keshavsoft/kschema-api-check";
2
+ import endPointsJs from "@keshavsoft/kschema-api-check";
3
3
 
4
- import { locateSource } from "./GetMethods/ShowAll/steps/locateSource.js";
5
- import { locateDestination } from "./GetMethods/ShowAll/steps/locateDestination.js";
4
+ import { locateSource } from "./GetMethods/Distinct/V2/steps/locateSource.js";
5
+ import { locateDestination } from "./GetMethods/Distinct/V2/steps/locateDestination.js";
6
6
  import { createFolder } from "../core/createFolder.js";
7
7
 
8
- // import updateEndPointsJs from "./ShowAll/steps/updateEndPointsJs.js";
9
- import createHttpFile from "./GetMethods/ShowAll/steps/createHttpFile.js";
8
+ import createHttpFile from "./GetMethods/Distinct/V2/steps/createHttpFile.js";
10
9
 
11
- import { announce } from "./GetMethods/ShowAll/steps/announce.js";
10
+ import { announce } from "./GetMethods/Distinct/V2/steps/announce.js";
12
11
 
13
- import resolveFolderName from "./GetMethods/ShowAll/steps/resolveFolderName.js";
12
+ import resolveFolderName from "./GetMethods/Distinct/V2/steps/resolveFolderName.js";
14
13
 
15
- export default ({ cmd = "", toPath, isAnnounce = true, checkBeforeCreate = true }) => {
14
+ const startFunc = async ({ cmd = "", toPath, isAnnounce = true, checkBeforeCreate = true }) => {
16
15
  const localToPath = toPath;
17
16
 
18
17
  const resolvedFolderName = resolveFolderName({
@@ -37,16 +36,11 @@ export default ({ cmd = "", toPath, isAnnounce = true, checkBeforeCreate = true
37
36
  });
38
37
 
39
38
  if (createFolderResponse.KTF) {
40
- endPointsJs({
39
+ await endPointsJs({
41
40
  toPath: localToPath,
42
41
  action: resolvedFolderName
43
42
  });
44
43
 
45
- // updateEndPointsJs({
46
- // appJsPath: `${localToPath}/end-points.js`,
47
- // endpoint: resolvedFolderName
48
- // });
49
-
50
44
  createHttpFile({
51
45
  inTargetPath: path.join(localToPath, resolvedFolderName),
52
46
  toPath: process.cwd()
@@ -56,4 +50,6 @@ export default ({ cmd = "", toPath, isAnnounce = true, checkBeforeCreate = true
56
50
  if (isAnnounce) announce({ inResolvedFolderName: resolvedFolderName });
57
51
 
58
52
  return resolveFolderName;
59
- };
53
+ };
54
+
55
+ export default startFunc
@@ -1,18 +1,18 @@
1
1
  import path from "path";
2
- import { endPointsJs } from "@keshavsoft/kschema-api-check";
2
+ import apiCheck from "@keshavsoft/kschema-api-check";
3
3
 
4
- import { locateSource } from "./PostMethods/Insert/steps/locateSource.js";
5
- import { locateDestination } from "./PostMethods/Insert/steps/locateDestination.js";
4
+ import { locateSource } from "./PostMethods/FilterColumns/steps/locateSource.js";
5
+ import { locateDestination } from "./PostMethods/FilterColumns/steps/locateDestination.js";
6
6
  import { createFolder } from "../../core/createFolder.js";
7
7
 
8
- import updateEndPointsJs from "./PostMethods/Insert/steps/updateEndPointsJs.js";
9
- import createHttpFile from "./PostMethods/Insert/steps/createHttpFile.js";
8
+ import updateEndPointsJs from "./PostMethods/FilterColumns/steps/updateEndPointsJs.js";
9
+ import createHttpFile from "./PostMethods/FilterColumns/steps/createHttpFile.js";
10
10
 
11
- import { announce } from "./PostMethods/Insert/steps/announce.js";
11
+ import { announce } from "./PostMethods/FilterColumns/steps/announce.js";
12
12
 
13
- import resolveFolderName from "./PostMethods/Insert/steps/resolveFolderName.js";
13
+ import resolveFolderName from "./PostMethods/FilterColumns/steps/resolveFolderName.js";
14
14
 
15
- export default ({ cmd = "", toPath, isAnnounce = true, checkBeforeCreate = true }) => {
15
+ const startFunc = async ({ cmd = "", toPath, isAnnounce = true, checkBeforeCreate = true }) => {
16
16
  const localToPath = toPath;
17
17
 
18
18
  const resolvedFolderName = resolveFolderName({
@@ -37,16 +37,11 @@ export default ({ cmd = "", toPath, isAnnounce = true, checkBeforeCreate = true
37
37
  });
38
38
 
39
39
  if (createFolderResponse.KTF) {
40
- endPointsJs({
40
+ await apiCheck({
41
41
  toPath: localToPath,
42
42
  action: resolvedFolderName
43
43
  });
44
44
 
45
- // updateEndPointsJs({
46
- // appJsPath: `${localToPath}/end-points.js`,
47
- // endpoint: resolvedFolderName
48
- // });
49
-
50
45
  createHttpFile({
51
46
  inTargetPath: path.join(localToPath, resolvedFolderName),
52
47
  toPath: process.cwd()
@@ -56,4 +51,6 @@ export default ({ cmd = "", toPath, isAnnounce = true, checkBeforeCreate = true
56
51
  if (isAnnounce) announce({ inResolvedFolderName: resolvedFolderName });
57
52
 
58
53
  return resolvedFolderName;
59
- };
54
+ };
55
+
56
+ export default startFunc;
@@ -1,5 +1,5 @@
1
1
  import path from "path";
2
- import { endPointsJs } from "@keshavsoft/kschema-api-check";
2
+ import endPointsJs from "@keshavsoft/kschema-api-check";
3
3
 
4
4
  import { locateSource } from "./GetMethods/ShowAll/steps/locateSource.js";
5
5
  import { locateDestination } from "./GetMethods/ShowAll/steps/locateDestination.js";
@@ -12,7 +12,7 @@ import { announce } from "./GetMethods/ShowAll/steps/announce.js";
12
12
 
13
13
  import resolveFolderName from "./GetMethods/ShowAll/steps/resolveFolderName.js";
14
14
 
15
- export default ({ cmd = "", toPath, isAnnounce = true, checkBeforeCreate = true }) => {
15
+ export default async ({ cmd = "", toPath, isAnnounce = true, checkBeforeCreate = true }) => {
16
16
  const localToPath = toPath;
17
17
 
18
18
  const resolvedFolderName = resolveFolderName({
@@ -37,11 +37,18 @@ export default ({ cmd = "", toPath, isAnnounce = true, checkBeforeCreate = true
37
37
  });
38
38
 
39
39
  if (createFolderResponse.KTF) {
40
- endPointsJs({
40
+ const loadEndPointsJs = await endPointsJs();
41
+
42
+ await loadEndPointsJs({
41
43
  toPath: localToPath,
42
44
  action: resolvedFolderName
43
45
  });
44
46
 
47
+ // await endPointsJs({
48
+ // toPath: localToPath,
49
+ // action: resolvedFolderName
50
+ // });
51
+
45
52
  // updateEndPointsJs({
46
53
  // appJsPath: `${localToPath}/end-points.js`,
47
54
  // endpoint: resolvedFolderName
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@keshavsoft/kschema-api-gen-actions",
3
- "version": "1.15.4",
3
+ "version": "1.16.3",
4
4
  "description": "CLI to scaffold projects using templates",
5
5
  "keywords": [
6
6
  "cli",
@@ -11,7 +11,7 @@
11
11
  ],
12
12
  "dependencies": {
13
13
  "@keshavsoft/kschema": "^1.17.8",
14
- "@keshavsoft/kschema-api-check": "^1.11.4"
14
+ "@keshavsoft/kschema-api-check": "^1.12.3"
15
15
  },
16
16
  "type": "module",
17
17
  "exports": {
@@ -1,20 +0,0 @@
1
- [
2
- {
3
- "cmd": "showAll",
4
- "file": "showAll",
5
- "exportFile": "ShowAll",
6
- "group": "GetMethods"
7
- },
8
- {
9
- "cmd": "insert",
10
- "file": "insert",
11
- "exportFile": "Insert",
12
- "group": "PostMethods"
13
- },
14
- {
15
- "cmd": "distinct",
16
- "file": "distinct",
17
- "exportFile": "Distinct",
18
- "group": "GetMethods"
19
- }
20
- ]
@@ -1,50 +0,0 @@
1
- /*
2
- KSchema CLI – Entry Flow
3
-
4
- 1. Read user input from terminal (parseInput)
5
- 2. If no command → show usage (first-time user safety)
6
- 3. If help flags → show usage (quick guidance)
7
- 4. Resolve command dynamically (no hardcoding logic)
8
- 5. If command not found → inform + guide back to usage
9
- 6. Execute command with parsed input
10
-
11
- Goal:
12
- - Zero confusion for user
13
- - Single source of truth (showUsage)
14
- - Easy to extend (just add commands, no core changes)
15
- */
16
-
17
- export default function showUsage(version) {
18
- const g = "\x1b[32m";
19
- const y = "\x1b[33m";
20
- const c = "\x1b[36m";
21
- const gray = "\x1b[90m";
22
- const r = "\x1b[0m";
23
-
24
- console.log(`
25
- ${c}🚀 KSchema Api Generator v${version}${r}
26
-
27
- ${y}Usage:${r}
28
- ${g}npx @keshavsoft/kschema-api-gen${r} <command> [options]
29
-
30
- ${y}Commands:${r}
31
- ${g}StartEndPoint${r} Initialize a new folder and files
32
- ${g}AddSubRoute${r} Initialize a new folder and files
33
- ${g}AddTableName${r} Initialize a new folder and files for TableName
34
- ${g}ShowAll${r} Initialize a new folder and files for action
35
-
36
- ${g}CreateApi${r} Creates new end point and hooks to app.js
37
- ${g}InsertApi${r} Creates new InsertApi end point and hooks to app.js
38
-
39
- ${y}Examples:${r}
40
- ${gray}npx @keshavsoft/kschema-api-gen StartEndPoint${r}
41
- ${gray}npx @keshavsoft/kschema-api-gen AddSubRoute${r}
42
- ${gray}npx @keshavsoft/kschema-api-gen AddTableName${r}
43
- ${gray}npx @keshavsoft/kschema-api-gen ShowAll${r}
44
- ${gray}npx @keshavsoft/kschema-api-gen CreateApi Api/V1/journals/ShowAll${r}
45
- ${gray}npx @keshavsoft/kschema-api-gen InsertApi Api/V1/journals/Insert${r}
46
-
47
- ${y}Tip:${r}
48
- ${gray}npm i -g @keshavsoft/kschema-api-gen${r}
49
- `);
50
- }
package/bin/v13/start.js DELETED
@@ -1,22 +0,0 @@
1
- import parseInput from "./core/parseInput.js";
2
- import resolveCommand from "./core/resolveCommand.js";
3
- import showUsage from './core/showUsage.js';
4
- import pkg from '../../package.json' with { type: 'json' };
5
-
6
- const version = pkg.version;
7
-
8
- const run = async () => {
9
- const input = parseInput();
10
-
11
- if (!input.cmd) return showUsage(version);
12
-
13
- if (input.cmd === "--help" || input.cmd === "-h" || input.cmd === "help") return showUsage(version);
14
-
15
- const command = resolveCommand(input.cmd);
16
-
17
- if (!command) return (console.log(`Unknown command: ${input.cmd}\n`), showUsage(version));
18
-
19
- await command(input);
20
- };
21
-
22
- export default run;
@@ -1,9 +0,0 @@
1
- import { kschema } from "@keshavsoft/kschema";
2
-
3
- const fromJsonPath = ({ inTableName }) => {
4
- const tableName = inTableName;
5
-
6
- return kschema.table(tableName).query.aggregate.distinct("AccountName");
7
- };
8
-
9
- export { fromJsonPath };
@@ -1,59 +0,0 @@
1
- import path from "path";
2
- import { endPointsJs } from "@keshavsoft/kschema-api-check";
3
-
4
- import { locateSource } from "./GetMethods/ShowAll/steps/locateSource.js";
5
- import { locateDestination } from "./GetMethods/ShowAll/steps/locateDestination.js";
6
- import { createFolder } from "../core/createFolder.js";
7
-
8
- // import updateEndPointsJs from "./ShowAll/steps/updateEndPointsJs.js";
9
- import createHttpFile from "./GetMethods/ShowAll/steps/createHttpFile.js";
10
-
11
- import { announce } from "./GetMethods/ShowAll/steps/announce.js";
12
-
13
- import resolveFolderName from "./GetMethods/ShowAll/steps/resolveFolderName.js";
14
-
15
- export default ({ cmd = "", toPath, isAnnounce = true, checkBeforeCreate = true }) => {
16
- const localToPath = toPath;
17
-
18
- const resolvedFolderName = resolveFolderName({
19
- name: cmd
20
- });
21
-
22
- if (resolvedFolderName.KTF === false) {
23
- console.log(resolvedFolderName.KReason);
24
-
25
- return;
26
- };
27
-
28
- const source = locateSource();
29
- const destination = locateDestination({
30
- inResolvedFolderName: resolvedFolderName,
31
- toPath: localToPath
32
- });
33
-
34
- const createFolderResponse = createFolder({
35
- source, destination,
36
- isAnnounce, checkBeforeCreate
37
- });
38
-
39
- if (createFolderResponse.KTF) {
40
- endPointsJs({
41
- toPath: localToPath,
42
- action: resolvedFolderName
43
- });
44
-
45
- // updateEndPointsJs({
46
- // appJsPath: `${localToPath}/end-points.js`,
47
- // endpoint: resolvedFolderName
48
- // });
49
-
50
- createHttpFile({
51
- inTargetPath: path.join(localToPath, resolvedFolderName),
52
- toPath: process.cwd()
53
- });
54
- };
55
-
56
- if (isAnnounce) announce({ inResolvedFolderName: resolvedFolderName });
57
-
58
- return resolveFolderName;
59
- };
@@ -1,11 +0,0 @@
1
- import actions from "../config/actions.json" with { type: "json" };
2
-
3
- export default async function loadCommand(name) {
4
- const matched = actions.find(x => x.exportFile === name);
5
-
6
- if (!matched) return null;
7
-
8
- const module = await import(`../tasks/actions/${matched.file}.js`);
9
-
10
- return module.default;
11
- };
@@ -1,34 +0,0 @@
1
- import fs from "fs";
2
-
3
- export const createFolder = ({ source, destination, checkBeforeCreate = false, isAnnounce = true }) => {
4
- if (checkBeforeCreate) {
5
- return createFolderWithCheck({ source, destination, isAnnounce });
6
- } else {
7
- return createOnly({ source, destination });
8
- };
9
- };
10
-
11
- const createOnly = ({ source, destination }) => {
12
- fs.mkdirSync(destination, { recursive: true });
13
-
14
- fs.cpSync(source, destination, { recursive: true });
15
-
16
- return {
17
- KTF: true
18
- };
19
- };
20
-
21
- const createFolderWithCheck = ({ source, destination, isAnnounce }) => {
22
- if (fs.existsSync(destination)) {
23
- if (isAnnounce) console.log("Folder already exists :", destination);
24
-
25
- return {
26
- KTF: false,
27
- KReason: "Folder already exists"
28
- };
29
- };
30
-
31
- if (isAnnounce) console.log("Folder created :", destination);
32
-
33
- return createOnly({ source, destination });
34
- };
@@ -1,8 +0,0 @@
1
- export default function parseInput() {
2
- const [cmd] = process.argv.slice(2);
3
-
4
- return {
5
- cmd: cmd || null,
6
- toPath: process.cwd()
7
- };
8
- };
@@ -1,11 +0,0 @@
1
- import actions from "../config/actions.json" with { type: "json" };
2
-
3
- export default async function resolveCommand(cmd) {
4
- const matched = actions.find(x => x.cmd === cmd);
5
-
6
- if (!matched) return null;
7
-
8
- const module = await import(`../tasks/actions/${matched.file}.js`);
9
-
10
- return module.default;
11
- };
@@ -1,21 +0,0 @@
1
- import { fromJsonPath } from './service.js';
2
- import { ConflictError, StorageError } from './errors.js';
3
-
4
- const getFunc = ({ res, inTableName }) => {
5
- try {
6
- const message = fromJsonPath({ inTableName });
7
-
8
- res.type("application/json").send(message);
9
- } catch (err) {
10
- if (err instanceof ConflictError)
11
- return res.status(409).send(err.message);
12
-
13
- if (err instanceof StorageError)
14
- return res.status(500).send("Failed to persist data");
15
-
16
- console.error(err);
17
- res.status(500).send("Unexpected error");
18
- }
19
- };
20
-
21
- export { getFunc };
@@ -1,9 +0,0 @@
1
- import { kschema } from "@keshavsoft/kschema";
2
-
3
- const fromJsonPath = ({ inTableName }) => {
4
- const tableName = inTableName;
5
-
6
- return kschema.table(tableName).query.aggregate.distinct("AccountName");
7
- };
8
-
9
- export { fromJsonPath };
@@ -1,8 +0,0 @@
1
- const checkUseDuplicate = (inContent, inEndpoint) => {
2
- const localContent = inContent;
3
- const localEndpoint = inEndpoint;
4
-
5
- return localContent.includes(`app.use("/${localEndpoint}"`);
6
- };
7
-
8
- export default checkUseDuplicate;