@peernova/cuneiform-sf 1.0.2 → 1.0.4-beta.10

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 (488) hide show
  1. package/LICENSE +81 -30
  2. package/README.md +168 -134
  3. package/lib/adapters/connection-facade.d.ts +458 -0
  4. package/lib/adapters/connection-facade.js +379 -0
  5. package/lib/adapters/connection-facade.js.map +1 -0
  6. package/lib/adapters/errors.d.ts +547 -0
  7. package/lib/adapters/errors.js +937 -0
  8. package/lib/adapters/errors.js.map +1 -0
  9. package/lib/adapters/lifecycle.d.ts +112 -0
  10. package/lib/adapters/lifecycle.js +94 -0
  11. package/lib/adapters/lifecycle.js.map +1 -0
  12. package/lib/adapters/rest/cache.d.ts +69 -0
  13. package/lib/adapters/rest/cache.js +133 -0
  14. package/lib/adapters/rest/cache.js.map +1 -0
  15. package/lib/adapters/rest/index.d.ts +11 -0
  16. package/lib/adapters/rest/index.js +18 -0
  17. package/lib/adapters/rest/index.js.map +1 -0
  18. package/lib/adapters/rest/profiling-rest-client.d.ts +137 -0
  19. package/lib/adapters/rest/profiling-rest-client.js +115 -0
  20. package/lib/adapters/rest/profiling-rest-client.js.map +1 -0
  21. package/lib/adapters/rest/rest-api-adapter.d.ts +393 -0
  22. package/lib/adapters/rest/rest-api-adapter.js +764 -0
  23. package/lib/adapters/rest/rest-api-adapter.js.map +1 -0
  24. package/lib/adapters/rest/types.d.ts +34 -0
  25. package/lib/adapters/rest/types.js +9 -0
  26. package/lib/adapters/rest/types.js.map +1 -0
  27. package/lib/adapters/retry.d.ts +91 -0
  28. package/lib/adapters/retry.js +215 -0
  29. package/lib/adapters/retry.js.map +1 -0
  30. package/lib/adapters/soql/cuneiform-query-builder.d.ts +418 -0
  31. package/lib/adapters/soql/cuneiform-query-builder.js +606 -0
  32. package/lib/adapters/soql/cuneiform-query-builder.js.map +1 -0
  33. package/lib/adapters/soql/soql-query-adapter.d.ts +141 -0
  34. package/lib/adapters/soql/soql-query-adapter.js +259 -0
  35. package/lib/adapters/soql/soql-query-adapter.js.map +1 -0
  36. package/lib/adapters/soql/types.d.ts +37 -0
  37. package/lib/adapters/soql/types.js +19 -0
  38. package/lib/adapters/soql/types.js.map +1 -0
  39. package/lib/adapters/testing/index.d.ts +37 -0
  40. package/lib/adapters/testing/index.js +20 -0
  41. package/lib/adapters/testing/index.js.map +1 -0
  42. package/lib/adapters/testing/mock-connection.d.ts +77 -0
  43. package/lib/adapters/testing/mock-connection.js +207 -0
  44. package/lib/adapters/testing/mock-connection.js.map +1 -0
  45. package/lib/adapters/testing/mock-logger.d.ts +29 -0
  46. package/lib/adapters/testing/mock-logger.js +57 -0
  47. package/lib/adapters/testing/mock-logger.js.map +1 -0
  48. package/lib/adapters/testing/mock-mcp-adapters.d.ts +32 -0
  49. package/lib/adapters/testing/mock-mcp-adapters.js +52 -0
  50. package/lib/adapters/testing/mock-mcp-adapters.js.map +1 -0
  51. package/lib/adapters/testing/mock-oclif-config.d.ts +22 -0
  52. package/lib/adapters/testing/mock-oclif-config.js +90 -0
  53. package/lib/adapters/testing/mock-oclif-config.js.map +1 -0
  54. package/lib/adapters/testing/mock-rest-adapter.d.ts +26 -0
  55. package/lib/adapters/testing/mock-rest-adapter.js +243 -0
  56. package/lib/adapters/testing/mock-rest-adapter.js.map +1 -0
  57. package/lib/adapters/testing/mock-salesforce-connection.d.ts +40 -0
  58. package/lib/adapters/testing/mock-salesforce-connection.js +61 -0
  59. package/lib/adapters/testing/mock-salesforce-connection.js.map +1 -0
  60. package/lib/adapters/testing/mock-soql-adapter.d.ts +30 -0
  61. package/lib/adapters/testing/mock-soql-adapter.js +120 -0
  62. package/lib/adapters/testing/mock-soql-adapter.js.map +1 -0
  63. package/lib/adapters/testing/mock-tooling-adapter.d.ts +24 -0
  64. package/lib/adapters/testing/mock-tooling-adapter.js +163 -0
  65. package/lib/adapters/testing/mock-tooling-adapter.js.map +1 -0
  66. package/lib/adapters/testing/stub-connection.d.ts +93 -0
  67. package/lib/adapters/testing/stub-connection.js +97 -0
  68. package/lib/adapters/testing/stub-connection.js.map +1 -0
  69. package/lib/adapters/testing/stub-rest-adapter.d.ts +52 -0
  70. package/lib/adapters/testing/stub-rest-adapter.js +58 -0
  71. package/lib/adapters/testing/stub-rest-adapter.js.map +1 -0
  72. package/lib/adapters/testing/stub-soql-adapter.d.ts +56 -0
  73. package/lib/adapters/testing/stub-soql-adapter.js +50 -0
  74. package/lib/adapters/testing/stub-soql-adapter.js.map +1 -0
  75. package/lib/adapters/testing/types.d.ts +71 -0
  76. package/lib/adapters/testing/types.js +9 -0
  77. package/lib/adapters/testing/types.js.map +1 -0
  78. package/lib/adapters/tooling/index.d.ts +10 -0
  79. package/lib/adapters/tooling/index.js +17 -0
  80. package/lib/adapters/tooling/index.js.map +1 -0
  81. package/lib/adapters/tooling/tooling-api-adapter.d.ts +157 -0
  82. package/lib/adapters/tooling/tooling-api-adapter.js +339 -0
  83. package/lib/adapters/tooling/tooling-api-adapter.js.map +1 -0
  84. package/lib/adapters/tooling/types.d.ts +81 -0
  85. package/lib/adapters/tooling/types.js +9 -0
  86. package/lib/adapters/tooling/types.js.map +1 -0
  87. package/lib/adapters/types.d.ts +112 -0
  88. package/lib/adapters/types.js +169 -0
  89. package/lib/adapters/types.js.map +1 -0
  90. package/lib/base/cuneiform-command.d.ts +175 -0
  91. package/lib/base/cuneiform-command.js +326 -0
  92. package/lib/base/cuneiform-command.js.map +1 -0
  93. package/lib/commands/cuneiform/compatibility/check.d.ts +43 -0
  94. package/lib/commands/cuneiform/compatibility/check.js +114 -0
  95. package/lib/commands/cuneiform/compatibility/check.js.map +1 -0
  96. package/lib/commands/cuneiform/definition/create.d.ts +120 -0
  97. package/lib/commands/cuneiform/definition/create.js +737 -0
  98. package/lib/commands/cuneiform/definition/create.js.map +1 -0
  99. package/lib/commands/cuneiform/definition/export.d.ts +57 -0
  100. package/lib/commands/cuneiform/definition/export.js +133 -0
  101. package/lib/commands/cuneiform/definition/export.js.map +1 -0
  102. package/lib/commands/cuneiform/definition/get.d.ts +86 -0
  103. package/lib/commands/cuneiform/definition/get.js +277 -0
  104. package/lib/commands/cuneiform/definition/get.js.map +1 -0
  105. package/lib/commands/cuneiform/definition/import.d.ts +54 -0
  106. package/lib/commands/cuneiform/definition/import.js +118 -0
  107. package/lib/commands/cuneiform/definition/import.js.map +1 -0
  108. package/lib/commands/cuneiform/definition/list.d.ts +110 -0
  109. package/lib/commands/cuneiform/definition/list.js +351 -0
  110. package/lib/commands/cuneiform/definition/list.js.map +1 -0
  111. package/lib/commands/cuneiform/definition/purge.d.ts +109 -0
  112. package/lib/commands/cuneiform/definition/purge.js +578 -0
  113. package/lib/commands/cuneiform/definition/purge.js.map +1 -0
  114. package/lib/commands/cuneiform/definition/update.d.ts +58 -0
  115. package/lib/commands/cuneiform/definition/update.js +209 -0
  116. package/lib/commands/cuneiform/definition/update.js.map +1 -0
  117. package/lib/commands/cuneiform/mcp/serve.d.ts +56 -0
  118. package/lib/commands/cuneiform/mcp/serve.js +109 -0
  119. package/lib/commands/cuneiform/mcp/serve.js.map +1 -0
  120. package/lib/commands/cuneiform/object/describe.d.ts +61 -0
  121. package/lib/commands/cuneiform/object/describe.js +461 -0
  122. package/lib/commands/cuneiform/object/describe.js.map +1 -0
  123. package/lib/commands/cuneiform/object/list.d.ts +123 -0
  124. package/lib/commands/cuneiform/object/list.js +264 -0
  125. package/lib/commands/cuneiform/object/list.js.map +1 -0
  126. package/lib/commands/cuneiform/org/details.d.ts +99 -0
  127. package/lib/commands/cuneiform/org/details.js +521 -0
  128. package/lib/commands/cuneiform/org/details.js.map +1 -0
  129. package/lib/commands/cuneiform/org/reset.d.ts +46 -0
  130. package/lib/commands/cuneiform/org/reset.js +135 -0
  131. package/lib/commands/cuneiform/org/reset.js.map +1 -0
  132. package/lib/commands/cuneiform/profile/request/cancel.d.ts +59 -0
  133. package/lib/commands/cuneiform/profile/request/cancel.js +202 -0
  134. package/lib/commands/cuneiform/profile/request/cancel.js.map +1 -0
  135. package/lib/commands/cuneiform/profile/request/delete.d.ts +59 -0
  136. package/lib/commands/cuneiform/profile/request/delete.js +223 -0
  137. package/lib/commands/cuneiform/profile/request/delete.js.map +1 -0
  138. package/lib/commands/cuneiform/profile/request/list.d.ts +35 -0
  139. package/lib/commands/cuneiform/profile/request/list.js +102 -0
  140. package/lib/commands/cuneiform/profile/request/list.js.map +1 -0
  141. package/lib/commands/cuneiform/profile.d.ts +93 -0
  142. package/lib/commands/cuneiform/profile.js +353 -0
  143. package/lib/commands/cuneiform/profile.js.map +1 -0
  144. package/lib/commands/cuneiform/summary/purge.d.ts +80 -0
  145. package/lib/commands/cuneiform/summary/purge.js +467 -0
  146. package/lib/commands/cuneiform/summary/purge.js.map +1 -0
  147. package/lib/commands/cuneiform/summary/reprofile.d.ts +60 -0
  148. package/lib/commands/cuneiform/summary/reprofile.js +236 -0
  149. package/lib/commands/cuneiform/summary/reprofile.js.map +1 -0
  150. package/lib/commands/cuneiform/summary/stop.d.ts +59 -0
  151. package/lib/commands/cuneiform/summary/stop.js +234 -0
  152. package/lib/commands/cuneiform/summary/stop.js.map +1 -0
  153. package/lib/commands/cuneiform/user/details.d.ts +77 -0
  154. package/lib/commands/cuneiform/user/details.js +414 -0
  155. package/lib/commands/cuneiform/user/details.js.map +1 -0
  156. package/lib/constants/namespace-constants.d.ts +102 -0
  157. package/lib/constants/namespace-constants.js +225 -0
  158. package/lib/constants/namespace-constants.js.map +1 -0
  159. package/lib/debug/command-debug-proxy.d.ts +101 -0
  160. package/lib/debug/command-debug-proxy.js +171 -0
  161. package/lib/debug/command-debug-proxy.js.map +1 -0
  162. package/lib/debug/debug-logger.d.ts +85 -0
  163. package/lib/debug/debug-logger.js +133 -0
  164. package/lib/debug/debug-logger.js.map +1 -0
  165. package/lib/debug/service-debug-proxy.d.ts +30 -0
  166. package/lib/debug/service-debug-proxy.js +102 -0
  167. package/lib/debug/service-debug-proxy.js.map +1 -0
  168. package/lib/hooks/prerun.d.ts +25 -0
  169. package/lib/hooks/prerun.js +47 -0
  170. package/lib/hooks/prerun.js.map +1 -0
  171. package/lib/mcp/config/mcp-config.d.ts +55 -0
  172. package/lib/mcp/config/mcp-config.js +51 -0
  173. package/lib/mcp/config/mcp-config.js.map +1 -0
  174. package/lib/mcp/config/pagination.d.ts +96 -0
  175. package/lib/mcp/config/pagination.js +108 -0
  176. package/lib/mcp/config/pagination.js.map +1 -0
  177. package/lib/mcp/config/system-prompts.d.ts +18 -0
  178. package/lib/mcp/config/system-prompts.js +92 -0
  179. package/lib/mcp/config/system-prompts.js.map +1 -0
  180. package/lib/mcp/errors.d.ts +23 -0
  181. package/lib/mcp/errors.js +27 -0
  182. package/lib/mcp/errors.js.map +1 -0
  183. package/lib/mcp/schemas/input-schemas.d.ts +327 -0
  184. package/lib/mcp/schemas/input-schemas.js +310 -0
  185. package/lib/mcp/schemas/input-schemas.js.map +1 -0
  186. package/lib/mcp/server.d.ts +40 -0
  187. package/lib/mcp/server.js +316 -0
  188. package/lib/mcp/server.js.map +1 -0
  189. package/lib/mcp/tools/contactpoint-tools.d.ts +14 -0
  190. package/lib/mcp/tools/contactpoint-tools.js +34 -0
  191. package/lib/mcp/tools/contactpoint-tools.js.map +1 -0
  192. package/lib/mcp/tools/definition-io-tools.d.ts +19 -0
  193. package/lib/mcp/tools/definition-io-tools.js +152 -0
  194. package/lib/mcp/tools/definition-io-tools.js.map +1 -0
  195. package/lib/mcp/tools/definition-tools.d.ts +51 -0
  196. package/lib/mcp/tools/definition-tools.js +220 -0
  197. package/lib/mcp/tools/definition-tools.js.map +1 -0
  198. package/lib/mcp/tools/index.d.ts +37 -0
  199. package/lib/mcp/tools/index.js +88 -0
  200. package/lib/mcp/tools/index.js.map +1 -0
  201. package/lib/mcp/tools/object-tools.d.ts +22 -0
  202. package/lib/mcp/tools/object-tools.js +327 -0
  203. package/lib/mcp/tools/object-tools.js.map +1 -0
  204. package/lib/mcp/tools/org-tools.d.ts +14 -0
  205. package/lib/mcp/tools/org-tools.js +177 -0
  206. package/lib/mcp/tools/org-tools.js.map +1 -0
  207. package/lib/mcp/tools/profile-tools.d.ts +59 -0
  208. package/lib/mcp/tools/profile-tools.js +213 -0
  209. package/lib/mcp/tools/profile-tools.js.map +1 -0
  210. package/lib/mcp/tools/summary-tools.d.ts +14 -0
  211. package/lib/mcp/tools/summary-tools.js +38 -0
  212. package/lib/mcp/tools/summary-tools.js.map +1 -0
  213. package/lib/mcp/tools/tool-factory.d.ts +63 -0
  214. package/lib/mcp/tools/tool-factory.js +146 -0
  215. package/lib/mcp/tools/tool-factory.js.map +1 -0
  216. package/lib/mcp/tools/user-tools.d.ts +25 -0
  217. package/lib/mcp/tools/user-tools.js +167 -0
  218. package/lib/mcp/tools/user-tools.js.map +1 -0
  219. package/lib/models/cascade-skip-accumulator.d.ts +25 -0
  220. package/lib/models/cascade-skip-accumulator.js +9 -0
  221. package/lib/models/cascade-skip-accumulator.js.map +1 -0
  222. package/lib/models/date-literal.d.ts +280 -0
  223. package/lib/models/date-literal.js +1164 -0
  224. package/lib/models/date-literal.js.map +1 -0
  225. package/lib/models/object-describe-types.d.ts +173 -0
  226. package/lib/models/object-describe-types.js +9 -0
  227. package/lib/models/object-describe-types.js.map +1 -0
  228. package/lib/models/portability-recipe.d.ts +35 -0
  229. package/lib/models/portability-recipe.js +113 -0
  230. package/lib/models/portability-recipe.js.map +1 -0
  231. package/lib/models/profile-request-types.d.ts +118 -0
  232. package/lib/models/profile-request-types.js +23 -0
  233. package/lib/models/profile-request-types.js.map +1 -0
  234. package/lib/models/profiling-execution-types.d.ts +154 -0
  235. package/lib/models/profiling-execution-types.js +14 -0
  236. package/lib/models/profiling-execution-types.js.map +1 -0
  237. package/lib/models/service-result.d.ts +114 -0
  238. package/lib/models/service-result.js +81 -0
  239. package/lib/models/service-result.js.map +1 -0
  240. package/lib/models/sfdmu-types.d.ts +49 -0
  241. package/lib/models/sfdmu-types.js +23 -0
  242. package/lib/models/sfdmu-types.js.map +1 -0
  243. package/lib/models/status-types.d.ts +38 -0
  244. package/lib/models/status-types.js +12 -0
  245. package/lib/models/status-types.js.map +1 -0
  246. package/lib/models/summary-bulk-types.d.ts +61 -0
  247. package/lib/models/summary-bulk-types.js +23 -0
  248. package/lib/models/summary-bulk-types.js.map +1 -0
  249. package/lib/models/user-details-types.d.ts +188 -0
  250. package/lib/models/user-details-types.js +9 -0
  251. package/lib/models/user-details-types.js.map +1 -0
  252. package/lib/models/year-range.d.ts +78 -0
  253. package/lib/models/year-range.js +153 -0
  254. package/lib/models/year-range.js.map +1 -0
  255. package/lib/operations/CompatibilityCheckOperation.d.ts +62 -0
  256. package/lib/operations/CompatibilityCheckOperation.js +102 -0
  257. package/lib/operations/CompatibilityCheckOperation.js.map +1 -0
  258. package/lib/operations/DefinitionCreateOperation.d.ts +427 -0
  259. package/lib/operations/DefinitionCreateOperation.js +1270 -0
  260. package/lib/operations/DefinitionCreateOperation.js.map +1 -0
  261. package/lib/operations/DefinitionExportOperation.d.ts +155 -0
  262. package/lib/operations/DefinitionExportOperation.js +281 -0
  263. package/lib/operations/DefinitionExportOperation.js.map +1 -0
  264. package/lib/operations/DefinitionImportOperation.d.ts +144 -0
  265. package/lib/operations/DefinitionImportOperation.js +357 -0
  266. package/lib/operations/DefinitionImportOperation.js.map +1 -0
  267. package/lib/operations/DefinitionListOperation.d.ts +66 -0
  268. package/lib/operations/DefinitionListOperation.js +108 -0
  269. package/lib/operations/DefinitionListOperation.js.map +1 -0
  270. package/lib/operations/DefinitionPurgeOperation.d.ts +203 -0
  271. package/lib/operations/DefinitionPurgeOperation.js +465 -0
  272. package/lib/operations/DefinitionPurgeOperation.js.map +1 -0
  273. package/lib/operations/DefinitionUpdateOperation.d.ts +78 -0
  274. package/lib/operations/DefinitionUpdateOperation.js +142 -0
  275. package/lib/operations/DefinitionUpdateOperation.js.map +1 -0
  276. package/lib/operations/OrgDetailsOperation.d.ts +253 -0
  277. package/lib/operations/OrgDetailsOperation.js +456 -0
  278. package/lib/operations/OrgDetailsOperation.js.map +1 -0
  279. package/lib/operations/OrgResetOperation.d.ts +114 -0
  280. package/lib/operations/OrgResetOperation.js +209 -0
  281. package/lib/operations/OrgResetOperation.js.map +1 -0
  282. package/lib/operations/ProfileOperation.d.ts +192 -0
  283. package/lib/operations/ProfileOperation.js +371 -0
  284. package/lib/operations/ProfileOperation.js.map +1 -0
  285. package/lib/operations/ProfileRequestCancelOperation.d.ts +59 -0
  286. package/lib/operations/ProfileRequestCancelOperation.js +137 -0
  287. package/lib/operations/ProfileRequestCancelOperation.js.map +1 -0
  288. package/lib/operations/ProfileRequestDeleteOperation.d.ts +64 -0
  289. package/lib/operations/ProfileRequestDeleteOperation.js +134 -0
  290. package/lib/operations/ProfileRequestDeleteOperation.js.map +1 -0
  291. package/lib/operations/ProfileRequestListOperation.d.ts +39 -0
  292. package/lib/operations/ProfileRequestListOperation.js +61 -0
  293. package/lib/operations/ProfileRequestListOperation.js.map +1 -0
  294. package/lib/operations/SummaryPurgeOperation.d.ts +134 -0
  295. package/lib/operations/SummaryPurgeOperation.js +257 -0
  296. package/lib/operations/SummaryPurgeOperation.js.map +1 -0
  297. package/lib/operations/SummaryReprofileOperation.d.ts +88 -0
  298. package/lib/operations/SummaryReprofileOperation.js +174 -0
  299. package/lib/operations/SummaryReprofileOperation.js.map +1 -0
  300. package/lib/operations/SummaryStopOperation.d.ts +87 -0
  301. package/lib/operations/SummaryStopOperation.js +175 -0
  302. package/lib/operations/SummaryStopOperation.js.map +1 -0
  303. package/lib/services/BulkExecutionService.d.ts +120 -0
  304. package/lib/services/BulkExecutionService.js +535 -0
  305. package/lib/services/BulkExecutionService.js.map +1 -0
  306. package/lib/services/CompatibilityService.d.ts +81 -0
  307. package/lib/services/CompatibilityService.js +118 -0
  308. package/lib/services/CompatibilityService.js.map +1 -0
  309. package/lib/services/ConfigureMode.d.ts +98 -0
  310. package/lib/services/ConfigureMode.js +413 -0
  311. package/lib/services/ConfigureMode.js.map +1 -0
  312. package/lib/services/ContactPointService.d.ts +111 -0
  313. package/lib/services/ContactPointService.js +286 -0
  314. package/lib/services/ContactPointService.js.map +1 -0
  315. package/lib/services/DataAvailabilityService.d.ts +81 -0
  316. package/lib/services/DataAvailabilityService.js +128 -0
  317. package/lib/services/DataAvailabilityService.js.map +1 -0
  318. package/lib/services/DefinitionFieldGenerationService.d.ts +357 -0
  319. package/lib/services/DefinitionFieldGenerationService.js +899 -0
  320. package/lib/services/DefinitionFieldGenerationService.js.map +1 -0
  321. package/lib/services/DefinitionQueryBuilder.d.ts +92 -0
  322. package/lib/services/DefinitionQueryBuilder.js +328 -0
  323. package/lib/services/DefinitionQueryBuilder.js.map +1 -0
  324. package/lib/services/ObjectDescribeService.d.ts +436 -0
  325. package/lib/services/ObjectDescribeService.js +881 -0
  326. package/lib/services/ObjectDescribeService.js.map +1 -0
  327. package/lib/services/ObjectFilteringService.d.ts +484 -0
  328. package/lib/services/ObjectFilteringService.js +1080 -0
  329. package/lib/services/ObjectFilteringService.js.map +1 -0
  330. package/lib/services/ObjectListCommandService.d.ts +467 -0
  331. package/lib/services/ObjectListCommandService.js +904 -0
  332. package/lib/services/ObjectListCommandService.js.map +1 -0
  333. package/lib/services/ObjectListService.d.ts +201 -0
  334. package/lib/services/ObjectListService.js +350 -0
  335. package/lib/services/ObjectListService.js.map +1 -0
  336. package/lib/services/OrgInfoService.d.ts +493 -0
  337. package/lib/services/OrgInfoService.js +1142 -0
  338. package/lib/services/OrgInfoService.js.map +1 -0
  339. package/lib/services/PollingService.d.ts +105 -0
  340. package/lib/services/PollingService.js +117 -0
  341. package/lib/services/PollingService.js.map +1 -0
  342. package/lib/services/ProfileRequestService.d.ts +186 -0
  343. package/lib/services/ProfileRequestService.js +555 -0
  344. package/lib/services/ProfileRequestService.js.map +1 -0
  345. package/lib/services/ProfilingDefinitionService.d.ts +575 -0
  346. package/lib/services/ProfilingDefinitionService.js +1029 -0
  347. package/lib/services/ProfilingDefinitionService.js.map +1 -0
  348. package/lib/services/ProfilingExecutionService.d.ts +122 -0
  349. package/lib/services/ProfilingExecutionService.js +320 -0
  350. package/lib/services/ProfilingExecutionService.js.map +1 -0
  351. package/lib/services/ProfilingSummaryService.d.ts +292 -0
  352. package/lib/services/ProfilingSummaryService.js +688 -0
  353. package/lib/services/ProfilingSummaryService.js.map +1 -0
  354. package/lib/services/RecordTypeService.d.ts +129 -0
  355. package/lib/services/RecordTypeService.js +284 -0
  356. package/lib/services/RecordTypeService.js.map +1 -0
  357. package/lib/services/SFDMUService.d.ts +146 -0
  358. package/lib/services/SFDMUService.js +323 -0
  359. package/lib/services/SFDMUService.js.map +1 -0
  360. package/lib/services/TabDetectionService.d.ts +105 -0
  361. package/lib/services/TabDetectionService.js +206 -0
  362. package/lib/services/TabDetectionService.js.map +1 -0
  363. package/lib/services/UnconfigureMode.d.ts +74 -0
  364. package/lib/services/UnconfigureMode.js +378 -0
  365. package/lib/services/UnconfigureMode.js.map +1 -0
  366. package/lib/services/UserConfigurationService.d.ts +158 -0
  367. package/lib/services/UserConfigurationService.js +574 -0
  368. package/lib/services/UserConfigurationService.js.map +1 -0
  369. package/lib/services/UserConfigurationTypes.d.ts +181 -0
  370. package/lib/services/UserConfigurationTypes.js +14 -0
  371. package/lib/services/UserConfigurationTypes.js.map +1 -0
  372. package/lib/services/UserReadinessService.d.ts +347 -0
  373. package/lib/services/UserReadinessService.js +891 -0
  374. package/lib/services/UserReadinessService.js.map +1 -0
  375. package/lib/services/constants.d.ts +54 -0
  376. package/lib/services/constants.js +71 -0
  377. package/lib/services/constants.js.map +1 -0
  378. package/lib/services/namespace-constants.d.ts +1 -0
  379. package/lib/services/namespace-constants.js +11 -0
  380. package/lib/services/namespace-constants.js.map +1 -0
  381. package/lib/services/namespace-filter.d.ts +36 -0
  382. package/lib/services/namespace-filter.js +109 -0
  383. package/lib/services/namespace-filter.js.map +1 -0
  384. package/lib/services/validation.d.ts +47 -0
  385. package/lib/services/validation.js +119 -0
  386. package/lib/services/validation.js.map +1 -0
  387. package/lib/utils/batch-processor.d.ts +13 -0
  388. package/lib/utils/batch-processor.js +39 -0
  389. package/lib/utils/batch-processor.js.map +1 -0
  390. package/lib/utils/formatting/availability-grid.d.ts +81 -0
  391. package/lib/utils/formatting/availability-grid.js +94 -0
  392. package/lib/utils/formatting/availability-grid.js.map +1 -0
  393. package/lib/utils/formatting/business-process-grid.d.ts +51 -0
  394. package/lib/utils/formatting/business-process-grid.js +58 -0
  395. package/lib/utils/formatting/business-process-grid.js.map +1 -0
  396. package/lib/utils/formatting/command-display.d.ts +154 -0
  397. package/lib/utils/formatting/command-display.js +154 -0
  398. package/lib/utils/formatting/command-display.js.map +1 -0
  399. package/lib/utils/formatting/definition-create-display.d.ts +118 -0
  400. package/lib/utils/formatting/definition-create-display.js +230 -0
  401. package/lib/utils/formatting/definition-create-display.js.map +1 -0
  402. package/lib/utils/formatting/empty-states.d.ts +35 -0
  403. package/lib/utils/formatting/empty-states.js +70 -0
  404. package/lib/utils/formatting/empty-states.js.map +1 -0
  405. package/lib/utils/formatting/errors.d.ts +33 -0
  406. package/lib/utils/formatting/errors.js +72 -0
  407. package/lib/utils/formatting/errors.js.map +1 -0
  408. package/lib/utils/formatting/field-types.d.ts +32 -0
  409. package/lib/utils/formatting/field-types.js +88 -0
  410. package/lib/utils/formatting/field-types.js.map +1 -0
  411. package/lib/utils/formatting/index.d.ts +29 -0
  412. package/lib/utils/formatting/index.js +28 -0
  413. package/lib/utils/formatting/index.js.map +1 -0
  414. package/lib/utils/formatting/indicators.d.ts +113 -0
  415. package/lib/utils/formatting/indicators.js +161 -0
  416. package/lib/utils/formatting/indicators.js.map +1 -0
  417. package/lib/utils/formatting/loading-messages.d.ts +37 -0
  418. package/lib/utils/formatting/loading-messages.js +50 -0
  419. package/lib/utils/formatting/loading-messages.js.map +1 -0
  420. package/lib/utils/formatting/namespace-display.d.ts +31 -0
  421. package/lib/utils/formatting/namespace-display.js +64 -0
  422. package/lib/utils/formatting/namespace-display.js.map +1 -0
  423. package/lib/utils/formatting/numbers.d.ts +73 -0
  424. package/lib/utils/formatting/numbers.js +187 -0
  425. package/lib/utils/formatting/numbers.js.map +1 -0
  426. package/lib/utils/formatting/object-describe-display.d.ts +117 -0
  427. package/lib/utils/formatting/object-describe-display.js +447 -0
  428. package/lib/utils/formatting/object-describe-display.js.map +1 -0
  429. package/lib/utils/formatting/object-list-display.d.ts +225 -0
  430. package/lib/utils/formatting/object-list-display.js +718 -0
  431. package/lib/utils/formatting/object-list-display.js.map +1 -0
  432. package/lib/utils/formatting/org-identity.d.ts +15 -0
  433. package/lib/utils/formatting/org-identity.js +28 -0
  434. package/lib/utils/formatting/org-identity.js.map +1 -0
  435. package/lib/utils/formatting/record-age-grid.d.ts +41 -0
  436. package/lib/utils/formatting/record-age-grid.js +56 -0
  437. package/lib/utils/formatting/record-age-grid.js.map +1 -0
  438. package/lib/utils/formatting/sections.d.ts +108 -0
  439. package/lib/utils/formatting/sections.js +150 -0
  440. package/lib/utils/formatting/sections.js.map +1 -0
  441. package/lib/utils/formatting/tables.d.ts +90 -0
  442. package/lib/utils/formatting/tables.js +113 -0
  443. package/lib/utils/formatting/tables.js.map +1 -0
  444. package/lib/utils/formatting/user-details-display.d.ts +101 -0
  445. package/lib/utils/formatting/user-details-display.js +425 -0
  446. package/lib/utils/formatting/user-details-display.js.map +1 -0
  447. package/lib/utils/pagination/keypress-reader.d.ts +20 -0
  448. package/lib/utils/pagination/keypress-reader.js +63 -0
  449. package/lib/utils/pagination/keypress-reader.js.map +1 -0
  450. package/lib/utils/pagination/paginate-output.d.ts +48 -0
  451. package/lib/utils/pagination/paginate-output.js +136 -0
  452. package/lib/utils/pagination/paginate-output.js.map +1 -0
  453. package/messages/compatibility.check.md +71 -0
  454. package/messages/cuneiform.access.md +138 -0
  455. package/messages/definition.create.md +525 -0
  456. package/messages/definition.export.md +84 -0
  457. package/messages/definition.get.md +147 -0
  458. package/messages/definition.import.md +65 -0
  459. package/messages/definition.list.md +264 -0
  460. package/messages/definition.purge.md +330 -0
  461. package/messages/definition.update.md +118 -0
  462. package/messages/mcp.serve.md +66 -0
  463. package/messages/object.describe.md +205 -0
  464. package/messages/object.list.md +463 -0
  465. package/messages/org.details.md +386 -0
  466. package/messages/org.reset.md +71 -0
  467. package/messages/profile.md +243 -0
  468. package/messages/profile.request.cancel.md +143 -0
  469. package/messages/profile.request.delete.md +139 -0
  470. package/messages/profile.request.list.md +89 -0
  471. package/messages/summary.purge.md +218 -0
  472. package/messages/summary.reprofile.md +150 -0
  473. package/messages/summary.stop.md +157 -0
  474. package/messages/user.details.md +501 -0
  475. package/oclif.lock +3267 -2148
  476. package/oclif.manifest.json +2829 -31
  477. package/package.json +104 -18
  478. package/lib/commands/cuneiform/about.d.ts +0 -13
  479. package/lib/commands/cuneiform/about.js +0 -26
  480. package/lib/commands/cuneiform/about.js.map +0 -1
  481. package/lib/commands/hello/world.d.ts +0 -14
  482. package/lib/commands/hello/world.js +0 -27
  483. package/lib/commands/hello/world.js.map +0 -1
  484. package/lib/index.d.ts +0 -2
  485. package/lib/index.js +0 -2
  486. package/lib/index.js.map +0 -1
  487. package/messages/cuneiform.about.md +0 -19
  488. package/messages/hello.world.md +0 -29
@@ -0,0 +1,718 @@
1
+ /*
2
+ * Copyright (c) 2026, PeerNova, Inc. All Rights Reserved.
3
+ * PROPRIETARY AND CONFIDENTIAL. Unauthorized copying, modification,
4
+ * or distribution is strictly prohibited. Use is governed by the
5
+ * Master Subscription Agreement (MSA) between PeerNova, Inc. and the
6
+ * licensee. See LICENSE file in the repo root.
7
+ */
8
+ /**
9
+ * Display formatting functions for the `sf cuneiform object list` command.
10
+ *
11
+ * Extracted from the command class to keep the command as a thin orchestration
12
+ * shell. All functions are pure (no `this` references) and accept a `log`
13
+ * callback for output. Functions compose primitives from the shared formatting
14
+ * barrel (`utils/formatting/index.ts`).
15
+ *
16
+ * @module utils/formatting/object-list-display
17
+ */
18
+ import { makeTable } from '@oclif/table';
19
+ import { Messages } from '@salesforce/core';
20
+ import { ObjectListCommandService } from '../../services/ObjectListCommandService.js';
21
+ import { OrgInfoService } from '../../services/OrgInfoService.js';
22
+ import { formatNumber, formatNamespace, formatEmptyState, renderSummaryBox, sectionHeader, sectionHeaderWithCount, logSectionGap, } from './index.js';
23
+ /**
24
+ * Default border style for all tables rendered by this module.
25
+ */
26
+ const TABLE_BORDER_STYLE = 'headers-only';
27
+ /**
28
+ * Lazily loads messages for the object.list command.
29
+ * Using a getter to avoid module-level side effects.
30
+ */
31
+ function getMessages() {
32
+ return Messages.loadMessages('@peernova/cuneiform-sf', 'object.list');
33
+ }
34
+ /**
35
+ * Renders the record-count cell for an object, disclosing count provenance (CLI-4214).
36
+ *
37
+ * - `undefined` recordCount → the unknown-count placeholder (em dash). NEVER 0.
38
+ * - `recordCountProvenance === 'limits'` → APPROXIMATE: prefixed with `~`.
39
+ * - otherwise (authoritative `'queried'` or a count with no provenance) → plain number.
40
+ *
41
+ * @param obj - The object list item
42
+ * @returns The display string for the record count (unpadded)
43
+ */
44
+ export function formatRecordCount(obj) {
45
+ const msgs = getMessages();
46
+ if (obj.recordCount === undefined) {
47
+ return msgs.getMessage('output.objects.unknownRecordCount');
48
+ }
49
+ const rendered = formatNumber(obj.recordCount);
50
+ return obj.recordCountProvenance === 'limits' ? `~${rendered}` : rendered;
51
+ }
52
+ /**
53
+ * Computes per-category contact point totals across all objects.
54
+ *
55
+ * @param objects - The object list items to aggregate
56
+ * @returns Totals for email, phone, and URL contact point fields
57
+ */
58
+ export function computeCpCategoryTotals(objects) {
59
+ let email = 0;
60
+ let phone = 0;
61
+ let url = 0;
62
+ for (const obj of objects) {
63
+ const cp = obj.contactPoints?.summary;
64
+ if (cp) {
65
+ email += cp.emailCount ?? 0;
66
+ phone += cp.phoneCount ?? 0;
67
+ url += cp.urlCount ?? 0;
68
+ }
69
+ }
70
+ return { email, phone, url };
71
+ }
72
+ /**
73
+ * Displays the complete object list results in table format.
74
+ *
75
+ * Orchestrates all display sub-sections: org identity, active filters,
76
+ * summary box, namespace distribution, object table, and next steps.
77
+ *
78
+ * @param log - The logging function (typically `this.log.bind(this)`)
79
+ * @param data - The ObjectListResult from the service
80
+ * @param orgIdentity - The org identity data (optional)
81
+ * @param instanceUrl - The org instance URL (optional)
82
+ * @param username - The target org username for Next Steps commands
83
+ */
84
+ export function displayResults(log, data, orgIdentity, instanceUrl, username) {
85
+ const msgs = getMessages();
86
+ const { summary } = data;
87
+ // Sort objects at render time (presentation concern, not service concern)
88
+ const sortField = data.filters.sort ?? 'recordCount';
89
+ const objects = ObjectListCommandService.sortObjects(data.objects, sortField);
90
+ // Display contextual title and Org Identity section (non-fatal if absent)
91
+ if (orgIdentity?.organizationId) {
92
+ const orgName = orgIdentity.organizationName ?? '(unknown)';
93
+ const orgType = OrgInfoService.classifyOrgType(orgIdentity.isSandbox ?? false, orgIdentity.organizationType);
94
+ log('');
95
+ log(msgs.getMessage('output.title', [orgName, orgType]));
96
+ logSectionGap(log);
97
+ log(renderSummaryBox({
98
+ title: msgs.getMessage('output.identity.header'),
99
+ entries: [
100
+ { key: msgs.getMessage('output.identity.orgName'), value: orgName },
101
+ { key: msgs.getMessage('output.identity.orgId'), value: orgIdentity.organizationId },
102
+ { key: msgs.getMessage('output.identity.instanceUrl'), value: instanceUrl ?? '' },
103
+ { key: msgs.getMessage('output.identity.orgType'), value: orgType },
104
+ { key: msgs.getMessage('output.identity.edition'), value: orgIdentity.organizationType ?? 'Unknown' },
105
+ { key: msgs.getMessage('output.identity.namespace'), value: orgIdentity.namespacePrefix ?? 'None' },
106
+ { key: msgs.getMessage('output.identity.username'), value: username ?? orgIdentity.username },
107
+ ],
108
+ }));
109
+ }
110
+ // Display Pattern block (active filters) between Org Identity and Summary
111
+ const activeFilters = getActiveFilters(data.filters);
112
+ if (activeFilters.length > 0) {
113
+ logSectionGap(log);
114
+ log(sectionHeader(msgs.getMessage('output.patternHeader')));
115
+ for (const filter of activeFilters) {
116
+ log(` • ${filter}`);
117
+ }
118
+ }
119
+ // Display summary section
120
+ const summaryEntries = [
121
+ { key: msgs.getMessage('output.summary.totalObjects'), value: formatNumber(summary.totalObjects) },
122
+ { key: msgs.getMessage('output.summary.withRecords'), value: formatNumber(summary.withRecords) },
123
+ { key: msgs.getMessage('output.summary.withoutRecords'), value: formatNumber(summary.withoutRecords) },
124
+ { key: msgs.getMessage('output.summary.standard'), value: formatNumber(summary.standardObjects) },
125
+ { key: msgs.getMessage('output.summary.custom'), value: formatNumber(summary.customObjects) },
126
+ ];
127
+ if (summary.withRecordTypes !== undefined) {
128
+ summaryEntries.push({
129
+ key: msgs.getMessage('output.summary.withRecordTypes'),
130
+ value: formatNumber(summary.withRecordTypes),
131
+ });
132
+ }
133
+ if (summary.withOwner !== undefined) {
134
+ summaryEntries.push({
135
+ key: msgs.getMessage('output.summary.withOwner'),
136
+ value: formatNumber(summary.withOwner),
137
+ });
138
+ }
139
+ if (summary.externalObjects > 0) {
140
+ summaryEntries.push({
141
+ key: msgs.getMessage('output.summary.external'),
142
+ value: formatNumber(summary.externalObjects),
143
+ });
144
+ }
145
+ summaryEntries.push({
146
+ key: msgs.getMessage('output.summary.withNamespace'),
147
+ value: formatNumber(summary.withNamespace),
148
+ });
149
+ summaryEntries.push({
150
+ key: msgs.getMessage('output.summary.withoutNamespace'),
151
+ value: formatNumber(summary.withoutNamespace),
152
+ });
153
+ logSectionGap(log);
154
+ log(renderSummaryBox({ title: msgs.getMessage('output.summary.header'), entries: summaryEntries }));
155
+ // Display namespace distribution if any namespaced objects exist
156
+ const hasNamespacedObjects = summary.namespaceCounts.some((ns) => ns.namespace !== null);
157
+ if (hasNamespacedObjects) {
158
+ logSectionGap(log);
159
+ displayNamespaceDistribution(log, summary.namespaceCounts);
160
+ }
161
+ // Display object table with count in header
162
+ logSectionGap(log);
163
+ const displayedCount = formatNumber(objects.length);
164
+ const totalCount = formatNumber(summary.totalObjects);
165
+ const countLabel = objects.length < summary.totalObjects ? `${displayedCount} of ${totalCount}` : `${displayedCount}`;
166
+ log(sectionHeader(`${msgs.getMessage('output.objects.header')} (${countLabel})`));
167
+ displayObjectsTable(log, data, objects);
168
+ // Display Next Steps
169
+ logSectionGap(log);
170
+ displayNextSteps(log, objects, username);
171
+ }
172
+ /**
173
+ * Displays the namespace distribution table.
174
+ *
175
+ * @param log - The logging function
176
+ * @param namespaceCounts - The namespace counts from the summary
177
+ */
178
+ export function displayNamespaceDistribution(log, namespaceCounts) {
179
+ const msgs = getMessages();
180
+ const nsHeader = msgs.getMessage('output.namespaceDistribution.header');
181
+ log(sectionHeaderWithCount(nsHeader, namespaceCounts.length));
182
+ const noNamespaceLabel = msgs.getMessage('output.namespaceDistribution.noNamespace');
183
+ const totalLabel = msgs.getMessage('output.objects.totalLabel');
184
+ const nsTotal = namespaceCounts.reduce((sum, ns) => sum + ns.count, 0);
185
+ const nsTotalWidth = Math.max(msgs.getMessage('output.namespaceDistribution.columns.count').length, formatNumber(nsTotal).length, ...namespaceCounts.map((ns) => formatNumber(ns.count).length));
186
+ const nsData = namespaceCounts.map((ns) => ({
187
+ prefix: ns.namespace ?? '—',
188
+ label: formatNamespace(ns.namespace, { standardLabel: noNamespaceLabel }),
189
+ count: formatNumber(ns.count).padStart(nsTotalWidth),
190
+ }));
191
+ nsData.push({ prefix: '', label: '', count: '─'.repeat(nsTotalWidth) });
192
+ nsData.push({ prefix: '', label: totalLabel, count: formatNumber(nsTotal).padStart(nsTotalWidth) });
193
+ log(makeTable({
194
+ data: nsData,
195
+ columns: [
196
+ { key: 'prefix', name: msgs.getMessage('output.namespaceDistribution.columns.prefix') },
197
+ { key: 'label', name: msgs.getMessage('output.namespaceDistribution.columns.label') },
198
+ {
199
+ key: 'count',
200
+ name: msgs.getMessage('output.namespaceDistribution.columns.count'),
201
+ horizontalAlignment: 'right',
202
+ },
203
+ ],
204
+ borderStyle: TABLE_BORDER_STYLE,
205
+ }).trimEnd());
206
+ }
207
+ /**
208
+ * Displays the objects table with enrichment columns, or empty state if no objects match.
209
+ *
210
+ * @param log - The logging function
211
+ * @param data - The full ObjectListResult (for filters and summary)
212
+ * @param objects - The sorted objects to display
213
+ */
214
+ export function displayObjectsTable(log, data, objects) {
215
+ const msgs = getMessages();
216
+ if (objects.length === 0) {
217
+ // Order active filters by selectivity (most restrictive first)
218
+ const selectiveFilters = getSelectiveFilters(data.filters);
219
+ const suggestions = selectiveFilters.length > 0 ? [msgs.getMessage('output.noResults.suggestion')] : [];
220
+ const emptyLines = formatEmptyState({
221
+ entityType: msgs.getMessage('output.entityType'),
222
+ appliedFilters: selectiveFilters,
223
+ suggestions,
224
+ });
225
+ for (const line of emptyLines) {
226
+ log(` ${line}`);
227
+ }
228
+ return;
229
+ }
230
+ // Determine active enrichment flags for conditional columns
231
+ const enrichmentFlags = {
232
+ withFields: data.filters.includeFieldCounts ?? false,
233
+ withRecordTypes: data.filters.withRecordTypes ?? false,
234
+ withBusinessProcess: data.filters.withBusinessProcess ?? false,
235
+ withReferences: data.filters.includeReferences ?? false,
236
+ withContactPoints: data.filters.withContactPoints ?? false,
237
+ };
238
+ const { summary } = data;
239
+ // Pre-compute CP category totals (needed for both width calculation and total row rendering)
240
+ const cpTotals = enrichmentFlags.withContactPoints
241
+ ? computeCpCategoryTotals(objects)
242
+ : { email: 0, phone: 0, url: 0 };
243
+ // Pre-compute numeric column widths for right-alignment (includes total values to prevent alignment drift)
244
+ const colWidths = computeColWidths(objects, enrichmentFlags, summary, cpTotals);
245
+ // Build table data with consistent structure
246
+ const tableData = objects.map((obj) => formatObjectRow(obj, colWidths, enrichmentFlags));
247
+ // Append separator + total rows (injected as data rows for guaranteed alignment)
248
+ const { separatorRow, totalRow } = buildTotalRows(summary, colWidths, enrichmentFlags, cpTotals);
249
+ tableData.push(separatorRow);
250
+ tableData.push(totalRow);
251
+ log(makeTable({
252
+ data: tableData,
253
+ columns: getTableColumns(enrichmentFlags),
254
+ borderStyle: TABLE_BORDER_STYLE,
255
+ }).trimEnd());
256
+ // CLI-4214: when any row carries an approximate (limits-derived) count, print a legend
257
+ // explaining the `~` indicator so the approximation is never silently presented as exact.
258
+ if (objects.some((obj) => obj.recordCountProvenance === 'limits')) {
259
+ log('');
260
+ log(` ${msgs.getMessage('output.objects.approximateLegend')}`);
261
+ }
262
+ // Display limit notice when results are truncated
263
+ if (data.filters.limit && objects.length >= data.filters.limit) {
264
+ log('');
265
+ log(` • ${msgs.getMessage('output.objects.limitNotice', [formatNumber(objects.length)])}`);
266
+ }
267
+ // Display contact point field details below the main table
268
+ if (enrichmentFlags.withContactPoints) {
269
+ displayContactPointDetails(log, objects);
270
+ }
271
+ }
272
+ /**
273
+ * Displays contact point field details (email, phone, URL field names) for each object
274
+ * that has at least one contact point field, rendered as a sub-section after the main table.
275
+ *
276
+ * @param log - The logging function
277
+ * @param objects - The objects to display contact points for
278
+ */
279
+ export function displayContactPointDetails(log, objects) {
280
+ const msgs = getMessages();
281
+ const objectsWithCPs = objects.filter((obj) => obj.contactPoints && obj.contactPoints.summary.totalContactPoints > 0);
282
+ if (objectsWithCPs.length === 0) {
283
+ return;
284
+ }
285
+ log('');
286
+ const cpHeader = msgs.getMessage('output.contactPoints.header');
287
+ log(sectionHeaderWithCount(cpHeader, objectsWithCPs.length));
288
+ for (const obj of objectsWithCPs) {
289
+ const cp = obj.contactPoints;
290
+ log('');
291
+ log(` ${obj.label}`);
292
+ if (cp.emailFields.length > 0) {
293
+ log(` ${msgs.getMessage('output.contactPoints.email')} ${cp.emailFields.map((f) => f.label).join(', ')}`);
294
+ }
295
+ if (cp.phoneFields.length > 0) {
296
+ log(` ${msgs.getMessage('output.contactPoints.phone')} ${cp.phoneFields.map((f) => f.label).join(', ')}`);
297
+ }
298
+ if (cp.urlFields.length > 0) {
299
+ log(` ${msgs.getMessage('output.contactPoints.url')} ${cp.urlFields.map((f) => f.label).join(', ')}`);
300
+ }
301
+ }
302
+ }
303
+ /**
304
+ * Builds separator and total rows for the objects table.
305
+ *
306
+ * @param summary - The object list summary with aggregate counts
307
+ * @param colWidths - Pre-computed column widths
308
+ * @param enrichmentFlags - Active enrichment flags
309
+ * @param cpTotals - Contact point category totals
310
+ * @returns Separator and total row data
311
+ */
312
+ export function buildTotalRows(summary, colWidths, enrichmentFlags, cpTotals) {
313
+ const msgs = getMessages();
314
+ const totalLabel = msgs.getMessage('output.objects.totalLabel');
315
+ const separatorRow = {
316
+ prefix: '',
317
+ objectLabel: '',
318
+ type: '',
319
+ records: '─'.repeat(colWidths.records),
320
+ };
321
+ const totalRow = {
322
+ prefix: '',
323
+ objectLabel: totalLabel,
324
+ type: '',
325
+ records: formatNumber(summary.totalRecordCount).padStart(colWidths.records),
326
+ };
327
+ if (enrichmentFlags.withRecordTypes) {
328
+ separatorRow.recordTypes = '─'.repeat(colWidths.recordTypes);
329
+ totalRow.recordTypes = formatNumber(summary.totalRecordTypeCount ?? 0).padStart(colWidths.recordTypes);
330
+ }
331
+ if (enrichmentFlags.withBusinessProcess) {
332
+ separatorRow.businessProcess = '─'.repeat(colWidths.businessProcess);
333
+ totalRow.businessProcess = formatNumber(summary.totalBusinessProcessCount ?? 0).padStart(colWidths.businessProcess);
334
+ }
335
+ if (enrichmentFlags.withFields) {
336
+ separatorRow.totalFields = '─'.repeat(colWidths.totalFields);
337
+ separatorRow.custom = '─'.repeat(colWidths.custom);
338
+ totalRow.totalFields = formatNumber(summary.totalFieldCount ?? 0).padStart(colWidths.totalFields);
339
+ totalRow.custom = formatNumber(summary.totalCustomFieldCount ?? 0).padStart(colWidths.custom);
340
+ }
341
+ if (enrichmentFlags.withReferences) {
342
+ separatorRow.reference = '─'.repeat(colWidths.reference);
343
+ totalRow.reference = formatNumber(summary.totalReferenceCount ?? 0).padStart(colWidths.reference);
344
+ }
345
+ if (enrichmentFlags.withContactPoints) {
346
+ separatorRow.cpTotal = '─'.repeat(colWidths.cpTotal);
347
+ separatorRow.cpEmail = '─'.repeat(colWidths.cpEmail);
348
+ separatorRow.cpPhone = '─'.repeat(colWidths.cpPhone);
349
+ separatorRow.cpUrl = '─'.repeat(colWidths.cpUrl);
350
+ totalRow.cpTotal = String(summary.totalContactPoints ?? 0).padStart(colWidths.cpTotal);
351
+ totalRow.cpEmail = String(cpTotals.email).padStart(colWidths.cpEmail);
352
+ totalRow.cpPhone = String(cpTotals.phone).padStart(colWidths.cpPhone);
353
+ totalRow.cpUrl = String(cpTotals.url).padStart(colWidths.cpUrl);
354
+ }
355
+ return { separatorRow, totalRow };
356
+ }
357
+ /**
358
+ * Pre-computes column widths for right-alignment of numeric columns.
359
+ * Includes summary totals in the max width calculation to prevent
360
+ * alignment drift when a total value is wider than any data value.
361
+ *
362
+ * @param objects - The objects to compute widths for
363
+ * @param enrichmentFlags - Active enrichment flags
364
+ * @param summary - The summary with aggregate totals
365
+ * @param cpTotals - Contact point category totals
366
+ * @returns Pre-computed column widths
367
+ */
368
+ export function computeColWidths(objects, enrichmentFlags, summary, cpTotals) {
369
+ const msgs = getMessages();
370
+ // Include summary totals in max width calculation to prevent alignment drift
371
+ // when the total value is wider than any individual data value
372
+ return {
373
+ records: Math.max(msgs.getMessage('output.objects.columns.records').length, formatNumber(summary.totalRecordCount).length,
374
+ // CLI-4214: width must account for the `~` prefix on approximate counts and the
375
+ // em-dash placeholder on unknown counts — both produced by formatRecordCount.
376
+ ...objects.map((obj) => formatRecordCount(obj).length)),
377
+ recordTypes: enrichmentFlags.withRecordTypes
378
+ ? Math.max(msgs.getMessage('output.objects.columns.recordTypes').length, formatNumber(summary.totalRecordTypeCount ?? 0).length, ...objects.map((obj) => (obj.recordTypeCount !== undefined ? formatNumber(obj.recordTypeCount).length : 1)))
379
+ : 0,
380
+ businessProcess: enrichmentFlags.withBusinessProcess
381
+ ? Math.max(msgs.getMessage('output.objects.columns.businessProcess').length, formatNumber(summary.totalBusinessProcessCount ?? 0).length, ...objects.map((obj) => obj.businessProcessCount !== undefined ? formatNumber(obj.businessProcessCount).length : 1))
382
+ : 0,
383
+ totalFields: enrichmentFlags.withFields
384
+ ? Math.max(msgs.getMessage('output.objects.columns.totalFields').length, formatNumber(summary.totalFieldCount ?? 0).length, ...objects.map((obj) => (obj.totalFields !== undefined ? formatNumber(obj.totalFields).length : 1)))
385
+ : 0,
386
+ custom: enrichmentFlags.withFields
387
+ ? Math.max(msgs.getMessage('output.objects.columns.custom').length, formatNumber(summary.totalCustomFieldCount ?? 0).length, ...objects.map((obj) => (obj.customFields !== undefined ? formatNumber(obj.customFields).length : 1)))
388
+ : 0,
389
+ reference: enrichmentFlags.withReferences
390
+ ? Math.max(msgs.getMessage('output.objects.columns.reference').length, formatNumber(summary.totalReferenceCount ?? 0).length, ...objects.map((obj) => (obj.lookupFieldCount !== undefined ? formatNumber(obj.lookupFieldCount).length : 1)))
391
+ : 0,
392
+ cpTotal: enrichmentFlags.withContactPoints
393
+ ? Math.max(msgs.getMessage('output.objects.columns.totalCPs').length, String(summary.totalContactPoints ?? 0).length, ...objects.map((obj) => String(obj.contactPoints?.summary.totalContactPoints ?? 0).length))
394
+ : 0,
395
+ cpEmail: enrichmentFlags.withContactPoints
396
+ ? Math.max(msgs.getMessage('output.objects.columns.email').length, String(cpTotals.email).length, ...objects.map((obj) => String(obj.contactPoints?.summary.emailCount ?? 0).length))
397
+ : 0,
398
+ cpPhone: enrichmentFlags.withContactPoints
399
+ ? Math.max(msgs.getMessage('output.objects.columns.phone').length, String(cpTotals.phone).length, ...objects.map((obj) => String(obj.contactPoints?.summary.phoneCount ?? 0).length))
400
+ : 0,
401
+ cpUrl: enrichmentFlags.withContactPoints
402
+ ? Math.max(msgs.getMessage('output.objects.columns.url').length, String(cpTotals.url).length, ...objects.map((obj) => String(obj.contactPoints?.summary.urlCount ?? 0).length))
403
+ : 0,
404
+ };
405
+ }
406
+ /**
407
+ * Formats a single object row for the table display, including optional enrichment columns.
408
+ *
409
+ * @param obj - The object list item to format
410
+ * @param colWidths - Pre-computed column widths for right-alignment
411
+ * @param enrichmentFlags - Active enrichment flags for conditional columns
412
+ * @returns A record of column key to formatted string value
413
+ */
414
+ export function formatObjectRow(obj, colWidths, enrichmentFlags) {
415
+ const msgs = getMessages();
416
+ const row = {
417
+ prefix: obj.namespace ?? msgs.getMessage('output.objects.noNamespace'),
418
+ objectLabel: obj.label,
419
+ type: obj.isCustom ? msgs.getMessage('output.objects.typeCustom') : msgs.getMessage('output.objects.typeStandard'),
420
+ // CLI-4214: disclose count provenance — approximate counts carry a leading `~`,
421
+ // unknown counts render as an em dash (never 0).
422
+ records: formatRecordCount(obj).padStart(colWidths.records),
423
+ };
424
+ // Enrichment columns — right-aligned via padStart, ordered per spec
425
+ if (enrichmentFlags?.withRecordTypes) {
426
+ row.recordTypes = (obj.recordTypeCount !== undefined ? formatNumber(obj.recordTypeCount) : '—').padStart(colWidths.recordTypes);
427
+ }
428
+ if (enrichmentFlags?.withBusinessProcess) {
429
+ row.businessProcess = (obj.businessProcessCount !== undefined ? formatNumber(obj.businessProcessCount) : '—').padStart(colWidths.businessProcess);
430
+ }
431
+ if (enrichmentFlags?.withFields) {
432
+ row.totalFields = (obj.totalFields !== undefined ? formatNumber(obj.totalFields) : '—').padStart(colWidths.totalFields);
433
+ row.custom = (obj.customFields !== undefined ? formatNumber(obj.customFields) : '—').padStart(colWidths.custom);
434
+ }
435
+ if (enrichmentFlags?.withReferences) {
436
+ row.reference = (obj.lookupFieldCount !== undefined ? formatNumber(obj.lookupFieldCount) : '—').padStart(colWidths.reference);
437
+ }
438
+ if (enrichmentFlags?.withContactPoints) {
439
+ const cp = obj.contactPoints?.summary;
440
+ row.cpTotal = String(cp?.totalContactPoints ?? 0).padStart(colWidths.cpTotal);
441
+ row.cpEmail = String(cp?.emailCount ?? 0).padStart(colWidths.cpEmail);
442
+ row.cpPhone = String(cp?.phoneCount ?? 0).padStart(colWidths.cpPhone);
443
+ row.cpUrl = String(cp?.urlCount ?? 0).padStart(colWidths.cpUrl);
444
+ }
445
+ return row;
446
+ }
447
+ /**
448
+ * Gets table column definitions, including optional enrichment columns.
449
+ * Numeric columns use horizontalAlignment: 'right' for consistent rendering.
450
+ *
451
+ * @param enrichmentFlags - Active enrichment flags for conditional columns
452
+ * @returns Array of column definitions for makeTable
453
+ */
454
+ export function getTableColumns(enrichmentFlags) {
455
+ const msgs = getMessages();
456
+ const columns = [
457
+ { key: 'prefix', name: msgs.getMessage('output.objects.columns.prefix') },
458
+ { key: 'objectLabel', name: msgs.getMessage('output.objects.columns.objectLabel') },
459
+ { key: 'records', name: msgs.getMessage('output.objects.columns.records'), horizontalAlignment: 'right' },
460
+ ];
461
+ // Enrichment columns: Record Types, Business Processes, Total Fields, Custom, Reference, Total CPs, Email, Phone, Url
462
+ if (enrichmentFlags?.withRecordTypes) {
463
+ columns.push({
464
+ key: 'recordTypes',
465
+ name: msgs.getMessage('output.objects.columns.recordTypes'),
466
+ horizontalAlignment: 'right',
467
+ });
468
+ }
469
+ if (enrichmentFlags?.withBusinessProcess) {
470
+ columns.push({
471
+ key: 'businessProcess',
472
+ name: msgs.getMessage('output.objects.columns.businessProcess'),
473
+ horizontalAlignment: 'right',
474
+ });
475
+ }
476
+ if (enrichmentFlags?.withFields) {
477
+ columns.push({
478
+ key: 'totalFields',
479
+ name: msgs.getMessage('output.objects.columns.totalFields'),
480
+ horizontalAlignment: 'right',
481
+ });
482
+ columns.push({
483
+ key: 'custom',
484
+ name: msgs.getMessage('output.objects.columns.custom'),
485
+ horizontalAlignment: 'right',
486
+ });
487
+ }
488
+ if (enrichmentFlags?.withReferences) {
489
+ columns.push({
490
+ key: 'reference',
491
+ name: msgs.getMessage('output.objects.columns.reference'),
492
+ horizontalAlignment: 'right',
493
+ });
494
+ }
495
+ if (enrichmentFlags?.withContactPoints) {
496
+ columns.push({
497
+ key: 'cpTotal',
498
+ name: msgs.getMessage('output.objects.columns.totalCPs'),
499
+ horizontalAlignment: 'right',
500
+ });
501
+ columns.push({
502
+ key: 'cpEmail',
503
+ name: msgs.getMessage('output.objects.columns.email'),
504
+ horizontalAlignment: 'right',
505
+ });
506
+ columns.push({
507
+ key: 'cpPhone',
508
+ name: msgs.getMessage('output.objects.columns.phone'),
509
+ horizontalAlignment: 'right',
510
+ });
511
+ columns.push({
512
+ key: 'cpUrl',
513
+ name: msgs.getMessage('output.objects.columns.url'),
514
+ horizontalAlignment: 'right',
515
+ });
516
+ }
517
+ return columns;
518
+ }
519
+ /**
520
+ * Renders a NamespaceFilter as a human-readable string for display.
521
+ *
522
+ * @param filter - The typed NamespaceFilter value
523
+ * @returns Display label (e.g. "all", "(unmanaged)", "FinServ", "FinServ, SBQQ")
524
+ */
525
+ function formatNamespaceFilter(filter) {
526
+ if (filter.kind === 'all')
527
+ return 'all';
528
+ if (filter.kind === 'unmanaged')
529
+ return '(unmanaged)';
530
+ return filter.namespaces.join(', ');
531
+ }
532
+ /**
533
+ * Builds a list of human-readable descriptions for active filters.
534
+ *
535
+ * @param filters - The applied filter options from the service result
536
+ * @returns Array of filter description strings (empty if no filters active)
537
+ */
538
+ export function getActiveFilters(filters) {
539
+ const msgs = getMessages();
540
+ const active = [];
541
+ if (filters.filter && filters.filter !== 'all') {
542
+ active.push(msgs.getMessage('output.filters.type', [`${filters.filter.charAt(0).toUpperCase()}${filters.filter.slice(1)}`]));
543
+ }
544
+ if (filters.namespace) {
545
+ active.push(msgs.getMessage('output.filters.namespace', [formatNamespaceFilter(filters.namespace)]));
546
+ }
547
+ if (filters.pattern) {
548
+ active.push(msgs.getMessage('output.filters.pattern', [filters.pattern]));
549
+ }
550
+ if (filters.withRecords) {
551
+ active.push(msgs.getMessage('output.filters.withRecords'));
552
+ }
553
+ if (filters.withoutRecords) {
554
+ active.push(msgs.getMessage('output.filters.withoutRecords'));
555
+ }
556
+ if (filters.withOwner) {
557
+ active.push(msgs.getMessage('output.filters.withOwner'));
558
+ }
559
+ if (filters.withRecordTypes) {
560
+ active.push(msgs.getMessage('output.filters.withRecordTypes'));
561
+ }
562
+ if (filters.withBusinessProcess) {
563
+ active.push(msgs.getMessage('output.filters.withBusinessProcess'));
564
+ }
565
+ if (filters.includeFieldCounts) {
566
+ active.push(msgs.getMessage('output.filters.withFields'));
567
+ }
568
+ if (filters.includeReferences) {
569
+ active.push(msgs.getMessage('output.filters.withReferences'));
570
+ }
571
+ if (filters.withContactPoints) {
572
+ active.push(msgs.getMessage('output.filters.withContactPoints'));
573
+ }
574
+ if (filters.classification && filters.classification !== 'all') {
575
+ active.push(msgs.getMessage('output.filters.classification', [
576
+ `${filters.classification.charAt(0).toUpperCase()}${filters.classification.slice(1)}`,
577
+ ]));
578
+ }
579
+ if (filters.minRecords && filters.minRecords > 0) {
580
+ active.push(msgs.getMessage('output.filters.minRecords', [formatNumber(filters.minRecords)]));
581
+ }
582
+ return active;
583
+ }
584
+ /**
585
+ * Returns active filters ordered by selectivity (most restrictive first).
586
+ * Used in empty state display to help users identify which filter to relax.
587
+ *
588
+ * @param filters - The applied filter options from the service result
589
+ * @returns Array of filter flag strings ordered by selectivity
590
+ */
591
+ export function getSelectiveFilters(filters) {
592
+ const selective = [];
593
+ // Most restrictive first
594
+ if (filters.pattern)
595
+ selective.push(`--pattern ${filters.pattern}`);
596
+ if (filters.namespace)
597
+ selective.push(`--namespace ${formatNamespaceFilter(filters.namespace)}`);
598
+ if (filters.withRecordTypes)
599
+ selective.push('--with-record-types');
600
+ if (filters.withOwner)
601
+ selective.push('--with-owner');
602
+ if (filters.includeFieldCounts)
603
+ selective.push('--with-fields');
604
+ if (filters.includeReferences)
605
+ selective.push('--with-references');
606
+ if (filters.withContactPoints)
607
+ selective.push('--with-contact-points');
608
+ if (filters.classification && filters.classification !== 'all')
609
+ selective.push(`--classification ${filters.classification}`);
610
+ if (filters.minRecords && filters.minRecords > 0)
611
+ selective.push(`--min-records ${formatNumber(filters.minRecords)}`);
612
+ if (filters.withRecords)
613
+ selective.push('--with-records');
614
+ if (filters.withoutRecords)
615
+ selective.push('--without-records');
616
+ if (filters.filter && filters.filter !== 'all')
617
+ selective.push(`--filter ${filters.filter}`);
618
+ return selective;
619
+ }
620
+ /**
621
+ * Builds the command result for JSON output.
622
+ *
623
+ * @param data - The ObjectListResult from the service
624
+ * @param flags - The parsed command flags
625
+ * @param orgIdentity - The org identity data (optional)
626
+ * @param instanceUrl - The org instance URL (optional)
627
+ * @param metadata - Service metadata with duration
628
+ * @returns ObjectListCommandResult for JSON output
629
+ */
630
+ export function buildCommandResult(data, flags, orgIdentity, instanceUrl, metadata) {
631
+ return {
632
+ success: true,
633
+ orgIdentity: orgIdentity
634
+ ? {
635
+ orgId: orgIdentity.organizationId,
636
+ orgName: orgIdentity.organizationName ?? '(unknown)',
637
+ orgType: orgIdentity.organizationType ?? '(unknown)',
638
+ isSandbox: orgIdentity.isSandbox ?? false,
639
+ instanceUrl: instanceUrl ?? '',
640
+ username: orgIdentity.username,
641
+ namespacePrefix: orgIdentity.namespacePrefix,
642
+ }
643
+ : undefined,
644
+ summary: data.summary,
645
+ filters: {
646
+ object: flags.object,
647
+ filter: flags.filter,
648
+ namespace: flags.namespace,
649
+ pattern: flags.pattern,
650
+ withRecords: flags['with-records'] || undefined,
651
+ withoutRecords: flags['without-records'] || undefined,
652
+ withOwner: flags['with-owner'] || undefined,
653
+ withRecordTypes: flags['with-record-types'] || undefined,
654
+ withBusinessProcess: flags['with-business-process'] || undefined,
655
+ includeFieldCounts: flags['with-fields'] || undefined,
656
+ includeReferences: flags['with-references'] || undefined,
657
+ withContactPoints: flags['with-contact-points'] || undefined,
658
+ classification: flags.classification,
659
+ minRecords: flags['min-records'],
660
+ sort: flags.sort,
661
+ limit: flags.limit,
662
+ },
663
+ objects: data.objects,
664
+ // CLI-4214: relay the record-count reconciliation truncation disclosure in JSON output.
665
+ warnings: data.warnings && data.warnings.length > 0 ? data.warnings : undefined,
666
+ metadata: metadata?.duration !== undefined ? { duration: metadata.duration } : undefined,
667
+ };
668
+ }
669
+ /**
670
+ * Displays contextual next steps based on the objects in the result.
671
+ * Suggests object describe commands for meaningful objects and
672
+ * always ends with the definition create command.
673
+ *
674
+ * @param log - The logging function
675
+ * @param objects - The object list items
676
+ * @param username - The target org username for command examples
677
+ */
678
+ export function displayNextSteps(log, objects, username) {
679
+ const msgs = getMessages();
680
+ log(msgs.getMessage('output.nextSteps.header'));
681
+ log('');
682
+ // Pick meaningful objects for describe suggestions:
683
+ // 1. Highest record count object (most populated = most interesting)
684
+ // 2. First custom namespaced object (shows namespace-aware usage)
685
+ const suggestions = [];
686
+ // Find highest record count object
687
+ const sorted = [...objects]
688
+ .filter((o) => (o.recordCount ?? 0) > 0)
689
+ .sort((a, b) => (b.recordCount ?? 0) - (a.recordCount ?? 0));
690
+ if (sorted.length > 0) {
691
+ suggestions.push({ label: sorted[0].label, apiName: sorted[0].apiName });
692
+ }
693
+ // Find first custom namespaced object (different from the first suggestion)
694
+ const namespacedCustom = objects.find((o) => o.namespace && o.isCustom && (!suggestions[0] || o.apiName !== suggestions[0].apiName));
695
+ if (namespacedCustom) {
696
+ suggestions.push({ label: namespacedCustom.label, apiName: namespacedCustom.apiName });
697
+ }
698
+ // If we still have no second suggestion, pick a different standard object
699
+ if (suggestions.length < 2 && sorted.length > 1) {
700
+ suggestions.push({ label: sorted[1].label, apiName: sorted[1].apiName });
701
+ }
702
+ // Render object describe suggestions (2-space label, 4-space command)
703
+ for (const suggestion of suggestions) {
704
+ log(` ${msgs.getMessage('output.nextSteps.describeLabel', [suggestion.label])}`);
705
+ if (username) {
706
+ log(` ${msgs.getMessage('output.nextSteps.describeCommand', [suggestion.apiName, username])}`);
707
+ }
708
+ else {
709
+ log(` ${msgs.getMessage('output.nextSteps.describeCommandNoOrg', [suggestion.apiName])}`);
710
+ }
711
+ log('');
712
+ }
713
+ // Static: definition create (always present, matches user-details/org-details)
714
+ log(` ${msgs.getMessage('output.nextSteps.definitionCreateLabel')}`);
715
+ log(` ${msgs.getMessage('output.nextSteps.definitionCreateCommand')}`);
716
+ log('');
717
+ }
718
+ //# sourceMappingURL=object-list-display.js.map