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

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