@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,118 @@
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
+ import { readFileSync } from 'node:fs';
9
+ import { dirname, join } from 'node:path';
10
+ import { fileURLToPath } from 'node:url';
11
+ import { SfError } from '@salesforce/core';
12
+ /**
13
+ * Default manifest reader — loads `package.json` from the project root by
14
+ * resolving a path relative to this source file. Source layout:
15
+ * `src/services/CompatibilityService.ts` → `../../package.json`. The compiled
16
+ * layout (`lib/services/CompatibilityService.js`) resolves identically.
17
+ */
18
+ const defaultManifestReader = () => {
19
+ const here = dirname(fileURLToPath(import.meta.url));
20
+ const pkgPath = join(here, '..', '..', 'package.json');
21
+ return JSON.parse(readFileSync(pkgPath, 'utf-8'));
22
+ };
23
+ /**
24
+ * Service for evaluating compatibility between the running CLI version and the
25
+ * Cuneiform For Salesforce managed package installed in a target org.
26
+ *
27
+ * Stateless. The required version is sourced from `package.json`; the installed
28
+ * version is supplied by the caller (typically via
29
+ * `OrgInfoService.getCuneiformPackageInfo`).
30
+ *
31
+ * Comparison semantics: version strings are parsed as integer tuples padded to
32
+ * four parts (`Major.Minor.Patch.Build`). Equality on the padded tuple yields
33
+ * `installed-match`; lexicographic order on the padded tuple yields
34
+ * `installed-newer` / `installed-older`. A null/undefined installed version
35
+ * yields `not-installed`.
36
+ */
37
+ export class CompatibilityService {
38
+ manifestReader;
39
+ constructor(config) {
40
+ this.manifestReader = config?.manifestReader ?? defaultManifestReader;
41
+ }
42
+ /**
43
+ * Compare a required version to an installed version. Pure function — exposed
44
+ * as a static method since it does not depend on instance state.
45
+ *
46
+ * @param required - required version string (`Major.Minor` or `Major.Minor.Patch.Build`)
47
+ * @param installed - installed version string, or `null`/`undefined` if absent
48
+ * @returns one of `installed-match`, `installed-newer`, `installed-older`, `not-installed`
49
+ * @throws SfError (E4682) when either version string contains a non-numeric component
50
+ */
51
+ static compare(required, installed) {
52
+ if (installed === null || installed === undefined)
53
+ return 'not-installed';
54
+ const requiredParts = parseVersion(required, 'required');
55
+ const installedParts = parseVersion(installed, 'installed');
56
+ for (let i = 0; i < 4; i++) {
57
+ const r = requiredParts[i] ?? 0;
58
+ const v = installedParts[i] ?? 0;
59
+ if (v > r)
60
+ return 'installed-newer';
61
+ if (v < r)
62
+ return 'installed-older';
63
+ }
64
+ return 'installed-match';
65
+ }
66
+ /**
67
+ * Load the required Cuneiform For Salesforce app version from the manifest.
68
+ *
69
+ * @returns the parsed required version
70
+ * @throws SfError (E4681) when `cuneiform.requiredAppVersion` is missing or empty
71
+ */
72
+ loadRequired() {
73
+ const manifest = this.manifestReader();
74
+ const raw = manifest.cuneiform?.requiredAppVersion;
75
+ if (typeof raw !== 'string' || raw.trim() === '') {
76
+ throw new SfError('package.json is missing the required "cuneiform.requiredAppVersion" field. ' +
77
+ 'Add it as part of the CLI release procedure (see README → "Compatibility").', 'E4681');
78
+ }
79
+ return { version: stripLeadingV(raw.trim()) };
80
+ }
81
+ /**
82
+ * Load the CLI plugin's own version from the manifest (`package.json` `version` field).
83
+ *
84
+ * @returns the CLI version string verbatim (e.g., "1.0.4-beta.1")
85
+ * @throws SfError (E4684) when `version` is missing or empty (should never happen for npm-published packages)
86
+ */
87
+ loadCliVersion() {
88
+ const manifest = this.manifestReader();
89
+ const raw = manifest.version;
90
+ if (typeof raw !== 'string' || raw.trim() === '') {
91
+ throw new SfError('package.json is missing the "version" field.', 'E4684');
92
+ }
93
+ return raw.trim();
94
+ }
95
+ }
96
+ /**
97
+ * Parse a Salesforce package version string into a 4-tuple of integers, padding
98
+ * missing parts with 0.
99
+ */
100
+ function parseVersion(raw, label) {
101
+ const stripped = stripLeadingV(raw.trim());
102
+ const parts = stripped.split('.');
103
+ const tuple = [];
104
+ for (const part of parts) {
105
+ if (!/^\d+$/.test(part)) {
106
+ throw new SfError(`${label} version "${raw}" contains a non-numeric component "${part}". ` +
107
+ 'Expected Major.Minor or Major.Minor.Patch.Build.', 'E4682');
108
+ }
109
+ tuple.push(Number.parseInt(part, 10));
110
+ }
111
+ while (tuple.length < 4)
112
+ tuple.push(0);
113
+ return tuple;
114
+ }
115
+ function stripLeadingV(raw) {
116
+ return raw.startsWith('v') || raw.startsWith('V') ? raw.slice(1) : raw;
117
+ }
118
+ //# sourceMappingURL=CompatibilityService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CompatibilityService.js","sourceRoot":"","sources":["../../src/services/CompatibilityService.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,E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,CAAC;YACxB,MAAM,IAAI,OAAO,CACf,GAAG,KAAK,aAAa,GAAG,uCAAuC,IAAI,KAAK;gBACtE,kDAAkD,EACpD,OAAO,CACR,CAAC;QACJ,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;IACxC,CAAC;IACD,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC;QAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACvC,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,aAAa,CAAC,GAAW;IAChC,OAAO,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;AACzE,CAAC"}
@@ -0,0 +1,98 @@
1
+ import type { ServiceResult } from '../models/service-result.js';
2
+ import type { UserReadiness } from './UserReadinessService.js';
3
+ import { type UserConfigurationResult, type IConfigurationServiceDeps } from './UserConfigurationTypes.js';
4
+ /**
5
+ * Handles the configure workflow for UserConfigurationService.
6
+ *
7
+ * Checks the current user state, identifies required changes (permission sets,
8
+ * API-only profiling), and optionally applies them. Supports dry-run mode to
9
+ * preview changes without applying them.
10
+ *
11
+ * This class is instantiated by UserConfigurationService and should not be
12
+ * used directly by consumers.
13
+ */
14
+ export declare class ConfigureMode {
15
+ private readonly deps;
16
+ constructor(deps: IConfigurationServiceDeps);
17
+ /**
18
+ * Creates an empty UserConfigurationResult for error cases.
19
+ */
20
+ private static createEmptyConfigurationResult;
21
+ /**
22
+ * Builds the previous configuration state from readiness check.
23
+ */
24
+ private static buildConfigurationState;
25
+ /**
26
+ * Builds the list of required configuration actions.
27
+ */
28
+ private static buildConfigurationActions;
29
+ /**
30
+ * Creates the result when Cuneiform is not installed.
31
+ */
32
+ private static createCuneiformNotInstalledResult;
33
+ /**
34
+ * Handles permission set insert failures, mapping error codes appropriately.
35
+ */
36
+ private static handlePermissionSetInsertFailure;
37
+ /**
38
+ * Orchestrates user configuration for Cuneiform operations.
39
+ *
40
+ * Checks the current user state, identifies required changes (permission sets,
41
+ * API-only profiling), and optionally applies them. Supports dry-run mode to
42
+ * preview changes without applying them.
43
+ *
44
+ * **Idempotency**: Skips already-configured items. Re-running configure() on
45
+ * a fully configured user will report all actions as 'skipped'.
46
+ *
47
+ * @param userId - The Salesforce user ID to configure
48
+ * @param options - Configuration options
49
+ * @param options.dryRun - If true, reports planned changes without applying them (default: false)
50
+ * @param options.readiness - Pre-fetched readiness snapshot. When provided, reuses it instead of issuing a second checkReadiness call — guaranteeing agreement with the caller's display.
51
+ * @returns ServiceResult containing UserConfigurationResult with actions taken/skipped/failed
52
+ */
53
+ execute(userId: string, options?: {
54
+ dryRun?: boolean;
55
+ readiness?: UserReadiness;
56
+ }): Promise<ServiceResult<UserConfigurationResult>>;
57
+ /**
58
+ * Executes a single permission set assignment action.
59
+ */
60
+ private executePermissionSetAction;
61
+ /**
62
+ * Executes a single API-only profiling action.
63
+ */
64
+ private executeApiOnlyProfilingAction;
65
+ /**
66
+ * Executes all configuration actions sequentially.
67
+ *
68
+ * Actions are executed sequentially because permission set assignments
69
+ * may have dependencies and order matters for proper error reporting.
70
+ */
71
+ private executeConfigurationActions;
72
+ /**
73
+ * Builds user state from a pre-fetched readiness snapshot. Avoids a second
74
+ * `checkReadiness` call when the caller already has a fresh snapshot — the
75
+ * canonical agreement guarantee for `user details --configure`.
76
+ *
77
+ * Username is still fetched independently (different SOQL query than readiness).
78
+ * `getUserInfo` failures degrade to an empty username — matching the tolerance
79
+ * of `fetchUserReadinessState` so the caller path is no less defensive.
80
+ */
81
+ private fetchUserStateWithCachedReadiness;
82
+ /**
83
+ * Fetches user readiness state and user info in parallel.
84
+ */
85
+ private fetchUserReadinessState;
86
+ /**
87
+ * Fetches the updated configuration state after applying changes.
88
+ */
89
+ private fetchUpdatedState;
90
+ /**
91
+ * Builds the final configuration result based on execution outcomes.
92
+ */
93
+ private buildConfigurationResult;
94
+ /**
95
+ * Creates the result for dry-run mode or when no changes are needed.
96
+ */
97
+ private createDryRunOrNoChangesResult;
98
+ }
@@ -0,0 +1,413 @@
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
+ import { createSuccessResult, createFailureResult } from '../models/service-result.js';
9
+ import { AdapterErrorCodes, ServiceErrorCodes } from '../adapters/errors.js';
10
+ import { CUNEIFORM_NAMESPACE } from './namespace-constants.js';
11
+ import { validateRequiredString } from './validation.js';
12
+ import { REQUIRED_PERMISSION_SETS, REQUIRED_PERMISSION_SET_LABELS } from './UserReadinessService.js';
13
+ import { CONFIGURABLE_PERMISSION_SETS, } from './UserConfigurationTypes.js';
14
+ /**
15
+ * Handles the configure workflow for UserConfigurationService.
16
+ *
17
+ * Checks the current user state, identifies required changes (permission sets,
18
+ * API-only profiling), and optionally applies them. Supports dry-run mode to
19
+ * preview changes without applying them.
20
+ *
21
+ * This class is instantiated by UserConfigurationService and should not be
22
+ * used directly by consumers.
23
+ */
24
+ export class ConfigureMode {
25
+ deps;
26
+ constructor(deps) {
27
+ this.deps = deps;
28
+ }
29
+ // ============================================================================
30
+ // Static helpers
31
+ // ============================================================================
32
+ /**
33
+ * Creates an empty UserConfigurationResult for error cases.
34
+ */
35
+ static createEmptyConfigurationResult(userId, dryRun, username = '') {
36
+ return {
37
+ user: { id: userId, username },
38
+ dryRun,
39
+ previousState: {
40
+ userId,
41
+ username,
42
+ hasRequiredPermissionSets: false,
43
+ missingPermissionSets: [...REQUIRED_PERMISSION_SETS],
44
+ apiOnlyProfilingEnabled: false,
45
+ },
46
+ actions: [],
47
+ currentState: null,
48
+ summary: {
49
+ changesRequired: 0,
50
+ changesApplied: 0,
51
+ changesFailed: 0,
52
+ isReady: false,
53
+ },
54
+ };
55
+ }
56
+ /**
57
+ * Builds the previous configuration state from readiness check.
58
+ */
59
+ static buildConfigurationState(userId, username, readiness) {
60
+ return {
61
+ userId,
62
+ username,
63
+ hasRequiredPermissionSets: readiness.permissionSets.hasAllRequired,
64
+ missingPermissionSets: readiness.permissionSets.missingRequired,
65
+ apiOnlyProfilingEnabled: readiness.configProfile.apiOnlyProfilingEnabled ?? false,
66
+ profileDeveloperName: readiness.configProfile.profileDeveloperName,
67
+ };
68
+ }
69
+ /**
70
+ * Builds the list of required configuration actions.
71
+ */
72
+ static buildConfigurationActions(previousState, dryRun) {
73
+ const actions = [];
74
+ // Only create assignment actions for configurable permission sets.
75
+ // Admin User Pro is a prerequisite (read-only verification) — not assigned by CLI.
76
+ const configurableMissing = previousState.missingPermissionSets.filter((ps) => CONFIGURABLE_PERMISSION_SETS.includes(ps));
77
+ for (const missingPerm of configurableMissing) {
78
+ actions.push({
79
+ type: 'assignPermissionSet',
80
+ target: missingPerm,
81
+ targetLabel: REQUIRED_PERMISSION_SET_LABELS[missingPerm],
82
+ status: dryRun ? 'skipped' : 'applied',
83
+ message: dryRun ? 'Would assign permission set' : undefined,
84
+ });
85
+ }
86
+ if (!previousState.apiOnlyProfilingEnabled && previousState.profileDeveloperName) {
87
+ actions.push({
88
+ type: 'enableApiOnlyProfiling',
89
+ target: previousState.profileDeveloperName,
90
+ status: dryRun ? 'skipped' : 'applied',
91
+ message: dryRun ? 'Would enable API-only profiling' : undefined,
92
+ });
93
+ }
94
+ return actions;
95
+ }
96
+ /**
97
+ * Creates the result when Cuneiform is not installed.
98
+ */
99
+ static createCuneiformNotInstalledResult(userId, username, dryRun, previousState, startTime) {
100
+ return createFailureResult({
101
+ user: { id: userId, username },
102
+ dryRun,
103
+ previousState,
104
+ actions: [],
105
+ currentState: null,
106
+ summary: { changesRequired: 0, changesApplied: 0, changesFailed: 0, isReady: false },
107
+ }, ServiceErrorCodes.USER_CUNEIFORM_NAMESPACE_NOT_FOUND, 'Cuneiform for Salesforce is not installed in this org', { metadata: { duration: Date.now() - startTime } });
108
+ }
109
+ /**
110
+ * Handles permission set insert failures, mapping error codes appropriately.
111
+ */
112
+ static handlePermissionSetInsertFailure(insertResult) {
113
+ if (insertResult.errorCode === AdapterErrorCodes.INSERT_DUPLICATE_VALUE) {
114
+ return { status: 'skipped', message: 'Permission set already assigned', failed: false };
115
+ }
116
+ if (insertResult.errorCode === AdapterErrorCodes.INSERT_INSUFFICIENT_ACCESS) {
117
+ return { status: 'failed', message: 'Insufficient access to assign permission set', failed: true };
118
+ }
119
+ return {
120
+ status: 'failed',
121
+ message: insertResult.message ?? 'Permission set assignment failed',
122
+ failed: true,
123
+ };
124
+ }
125
+ /**
126
+ * Orchestrates user configuration for Cuneiform operations.
127
+ *
128
+ * Checks the current user state, identifies required changes (permission sets,
129
+ * API-only profiling), and optionally applies them. Supports dry-run mode to
130
+ * preview changes without applying them.
131
+ *
132
+ * **Idempotency**: Skips already-configured items. Re-running configure() on
133
+ * a fully configured user will report all actions as 'skipped'.
134
+ *
135
+ * @param userId - The Salesforce user ID to configure
136
+ * @param options - Configuration options
137
+ * @param options.dryRun - If true, reports planned changes without applying them (default: false)
138
+ * @param options.readiness - Pre-fetched readiness snapshot. When provided, reuses it instead of issuing a second checkReadiness call — guaranteeing agreement with the caller's display.
139
+ * @returns ServiceResult containing UserConfigurationResult with actions taken/skipped/failed
140
+ */
141
+ async execute(userId, options) {
142
+ const startTime = Date.now();
143
+ const dryRun = options?.dryRun ?? false;
144
+ // Validate userId
145
+ const validationError = validateRequiredString(userId, 'User ID');
146
+ if (validationError) {
147
+ return createFailureResult(ConfigureMode.createEmptyConfigurationResult(userId, dryRun), ServiceErrorCodes.USER_CONFIG_USER_ID_REQUIRED, validationError, { metadata: { duration: Date.now() - startTime } });
148
+ }
149
+ try {
150
+ this.deps.logger?.log(`Configuring user: ${userId}${dryRun ? ' (dry-run)' : ''}`);
151
+ // Step 1: Get current user readiness state.
152
+ // When the caller injects a readiness snapshot (canonical: from `user details` outer fetch),
153
+ // reuse it so the caller's displayed readiness and the configure `previousState` agree.
154
+ // Otherwise fall back to fetching ourselves (operational resilience for direct callers).
155
+ const { readiness: rawReadiness, username, errorResult, } = options?.readiness !== undefined
156
+ ? await this.fetchUserStateWithCachedReadiness(userId, options.readiness)
157
+ : await this.fetchUserReadinessState(userId, dryRun, startTime);
158
+ if (errorResult)
159
+ return errorResult;
160
+ // readiness is guaranteed non-undefined when errorResult is null
161
+ const readiness = rawReadiness;
162
+ const previousState = ConfigureMode.buildConfigurationState(userId, username, readiness);
163
+ // Check if Cuneiform is installed
164
+ if (!readiness.isCuneiformInstalled) {
165
+ return ConfigureMode.createCuneiformNotInstalledResult(userId, username, dryRun, previousState, startTime);
166
+ }
167
+ // Gate: Self-registration must be enabled for CLI self-provisioning
168
+ // This ensures the admin has explicitly authorized users to self-configure
169
+ // API profiling access via the CLI. Without this, the permission set
170
+ // assignment is blocked to preserve the admin's security posture.
171
+ // Only enforced when a config profile exists — if no profile is configured,
172
+ // the configure flow will create/enable it (handled by downstream actions).
173
+ if (readiness.configProfile.isConfigured && readiness.configProfile.selfRegistrationEnabled !== true) {
174
+ return createFailureResult(ConfigureMode.createEmptyConfigurationResult(userId, dryRun, username), ServiceErrorCodes.SELF_REGISTRATION_NOT_ENABLED, 'Cuneiform is installed and API-Only Profiling is enabled, but CLI self-provisioning is not available. ' +
175
+ 'Your administrator has not enabled CLI self-provisioning for API-based profiling. ' +
176
+ 'This setting ensures your admin controls which users can configure their own API profiling access. ' +
177
+ 'Ask your Salesforce administrator to enable "Enable API Profiling Self-Registration" ' +
178
+ 'in the Cuneiform Configuration Profile (Custom Metadata), ' +
179
+ 'or request they assign the API-Based Profiling permission set to you directly.', { metadata: { duration: Date.now() - startTime } });
180
+ }
181
+ // Step 2: Identify required actions
182
+ const actions = ConfigureMode.buildConfigurationActions(previousState, dryRun);
183
+ const changesRequired = actions.length;
184
+ // If dry-run or no changes needed, return early
185
+ if (dryRun || changesRequired === 0) {
186
+ return this.createDryRunOrNoChangesResult(userId, username, dryRun, previousState, actions, changesRequired, readiness.isReady, startTime);
187
+ }
188
+ // Step 3: Execute actions
189
+ const { changesApplied, changesFailed } = await this.executeConfigurationActions(actions, userId);
190
+ // Step 4: Get updated state (if changes were made)
191
+ const currentState = await this.fetchUpdatedState(userId, username, changesApplied);
192
+ return this.buildConfigurationResult(userId, username, dryRun, previousState, actions, currentState, changesRequired, changesApplied, changesFailed, Date.now() - startTime);
193
+ }
194
+ catch (error) {
195
+ const errorMessage = error instanceof Error ? error.message : String(error);
196
+ this.deps.logger?.log(`Configuration failed: ${errorMessage}`);
197
+ return createFailureResult(ConfigureMode.createEmptyConfigurationResult(userId, dryRun), ServiceErrorCodes.USER_CONFIG_QUERY_FAILED, errorMessage, { metadata: { duration: Date.now() - startTime } });
198
+ }
199
+ }
200
+ // ============================================================================
201
+ // Private instance helpers
202
+ // ============================================================================
203
+ /**
204
+ * Executes a single permission set assignment action.
205
+ */
206
+ async executePermissionSetAction(action, userId) {
207
+ const permSetIdResult = await this.deps.getPermissionSetId(action.target, CUNEIFORM_NAMESPACE);
208
+ if (!permSetIdResult.success || !permSetIdResult.data) {
209
+ return {
210
+ applied: false,
211
+ failed: true,
212
+ update: {
213
+ status: 'failed',
214
+ message: permSetIdResult.message ?? 'Permission set not found',
215
+ },
216
+ };
217
+ }
218
+ const insertResult = await this.deps.restApiAdapter.insertRecord('PermissionSetAssignment', {
219
+ AssigneeId: userId,
220
+ PermissionSetId: permSetIdResult.data,
221
+ });
222
+ if (!insertResult.success) {
223
+ const failureInfo = ConfigureMode.handlePermissionSetInsertFailure(insertResult);
224
+ return {
225
+ applied: false,
226
+ failed: failureInfo.failed,
227
+ update: { status: failureInfo.status, message: failureInfo.message },
228
+ };
229
+ }
230
+ return {
231
+ applied: true,
232
+ failed: false,
233
+ update: {
234
+ status: 'applied',
235
+ message: 'Permission set assigned',
236
+ details: { permissionSetAssignmentId: insertResult.data.id },
237
+ },
238
+ };
239
+ }
240
+ /**
241
+ * Executes a single API-only profiling action.
242
+ */
243
+ async executeApiOnlyProfilingAction(action) {
244
+ const deployResult = await this.deps.enableApiOnlyProfiling(action.target);
245
+ if (!deployResult.success) {
246
+ return {
247
+ applied: false,
248
+ failed: true,
249
+ update: {
250
+ status: 'failed',
251
+ message: deployResult.message ?? 'Failed to enable API-only profiling',
252
+ },
253
+ };
254
+ }
255
+ const update = {
256
+ status: 'applied',
257
+ message: 'API-only profiling deployment triggered',
258
+ };
259
+ if (deployResult.data.jobId) {
260
+ update.details = { deploymentJobId: deployResult.data.jobId };
261
+ // Wait for deployment to complete so state is consistent for subsequent operations
262
+ const completionResult = await this.deps.waitForDeploymentCompletion(deployResult.data.jobId);
263
+ if (completionResult.success && completionResult.data.status === 'Failed') {
264
+ return {
265
+ applied: false,
266
+ failed: true,
267
+ update: {
268
+ status: 'failed',
269
+ message: completionResult.data.errorMessage ?? 'CMT deployment failed',
270
+ details: { deploymentJobId: deployResult.data.jobId },
271
+ },
272
+ };
273
+ }
274
+ update.message = `API-only profiling deployment ${completionResult.data.status.toLowerCase()}`;
275
+ }
276
+ return { applied: true, failed: false, update };
277
+ }
278
+ /**
279
+ * Executes all configuration actions sequentially.
280
+ *
281
+ * Actions are executed sequentially because permission set assignments
282
+ * may have dependencies and order matters for proper error reporting.
283
+ */
284
+ async executeConfigurationActions(actions, userId) {
285
+ let changesApplied = 0;
286
+ let changesFailed = 0;
287
+ /* eslint-disable no-await-in-loop -- Sequential execution required: permission set dependencies */
288
+ for (const [i, action] of actions.entries()) {
289
+ const result = action.type === 'assignPermissionSet'
290
+ ? await this.executePermissionSetAction(action, userId)
291
+ : await this.executeApiOnlyProfilingAction(action);
292
+ // Apply the update to the action in the array
293
+ Object.assign(actions[i], result.update);
294
+ if (result.applied)
295
+ changesApplied++;
296
+ if (result.failed)
297
+ changesFailed++;
298
+ }
299
+ /* eslint-enable no-await-in-loop */
300
+ return { changesApplied, changesFailed };
301
+ }
302
+ /**
303
+ * Builds user state from a pre-fetched readiness snapshot. Avoids a second
304
+ * `checkReadiness` call when the caller already has a fresh snapshot — the
305
+ * canonical agreement guarantee for `user details --configure`.
306
+ *
307
+ * Username is still fetched independently (different SOQL query than readiness).
308
+ * `getUserInfo` failures degrade to an empty username — matching the tolerance
309
+ * of `fetchUserReadinessState` so the caller path is no less defensive.
310
+ */
311
+ async fetchUserStateWithCachedReadiness(userId, cachedReadiness) {
312
+ const userInfoResult = await this.deps.userReadinessService.getUserInfo(userId);
313
+ return {
314
+ readiness: cachedReadiness,
315
+ username: userInfoResult.success ? userInfoResult.data.username : '',
316
+ errorResult: null,
317
+ };
318
+ }
319
+ /**
320
+ * Fetches user readiness state and user info in parallel.
321
+ */
322
+ async fetchUserReadinessState(userId, dryRun, startTime) {
323
+ const [readinessResult, userInfoResult] = await Promise.all([
324
+ this.deps.userReadinessService.checkReadiness(userId),
325
+ this.deps.userReadinessService.getUserInfo(userId),
326
+ ]);
327
+ if (!readinessResult.success) {
328
+ return {
329
+ readiness: undefined,
330
+ username: '',
331
+ errorResult: createFailureResult(ConfigureMode.createEmptyConfigurationResult(userId, dryRun), readinessResult.errorCode ?? ServiceErrorCodes.USER_CONFIG_QUERY_FAILED, readinessResult.message ?? 'Failed to check user readiness', { metadata: { duration: Date.now() - startTime } }),
332
+ };
333
+ }
334
+ return {
335
+ readiness: readinessResult.data,
336
+ username: userInfoResult.success ? userInfoResult.data.username : '',
337
+ errorResult: null,
338
+ };
339
+ }
340
+ /**
341
+ * Fetches the updated configuration state after applying changes.
342
+ */
343
+ async fetchUpdatedState(userId, username, changesApplied) {
344
+ if (changesApplied === 0)
345
+ return null;
346
+ const updatedReadinessResult = await this.deps.userReadinessService.checkReadiness(userId);
347
+ if (!updatedReadinessResult.success)
348
+ return null;
349
+ return ConfigureMode.buildConfigurationState(userId, username, updatedReadinessResult.data);
350
+ }
351
+ /**
352
+ * Builds the final configuration result based on execution outcomes.
353
+ */
354
+ buildConfigurationResult(userId, username, dryRun, previousState, actions, currentState, changesRequired, changesApplied, changesFailed, duration) {
355
+ const isReady = currentState?.hasRequiredPermissionSets === true && currentState?.apiOnlyProfilingEnabled === true;
356
+ const result = {
357
+ user: { id: userId, username },
358
+ dryRun,
359
+ previousState,
360
+ actions,
361
+ currentState,
362
+ summary: { changesRequired, changesApplied, changesFailed, isReady },
363
+ };
364
+ // All changes failed
365
+ if (changesFailed > 0 && changesApplied === 0) {
366
+ this.deps.logger?.log(`Configuration failed: all ${changesFailed} change(s) failed`);
367
+ return createFailureResult(result, ServiceErrorCodes.USER_CONFIG_PERMISSION_SET_ASSIGN_FAILED, `Configuration failed: all ${changesFailed} change(s) failed`, { metadata: { duration } });
368
+ }
369
+ // Partial failure
370
+ if (changesFailed > 0) {
371
+ this.deps.logger?.log(`Configuration partially complete: ${changesApplied} applied, ${changesFailed} failed`);
372
+ return createSuccessResult(result, {
373
+ message: `Configuration partially complete: ${changesApplied} applied, ${changesFailed} failed`,
374
+ warnings: [`${changesFailed} configuration action(s) failed`],
375
+ metadata: { duration },
376
+ });
377
+ }
378
+ // All changes applied successfully
379
+ this.deps.logger?.log(`Configuration complete: ${changesApplied} change(s) applied`);
380
+ return createSuccessResult(result, {
381
+ message: `Configuration complete: ${changesApplied} change(s) applied`,
382
+ metadata: { duration },
383
+ });
384
+ }
385
+ /**
386
+ * Creates the result for dry-run mode or when no changes are needed.
387
+ */
388
+ createDryRunOrNoChangesResult(userId, username, dryRun, previousState, actions, changesRequired, isReadinessReady, startTime) {
389
+ const duration = Date.now() - startTime;
390
+ const isReady = changesRequired === 0 && isReadinessReady;
391
+ const message = dryRun
392
+ ? `Dry-run complete: ${changesRequired} change(s) would be applied`
393
+ : 'This user is already fully configured; no changes are necessary';
394
+ this.deps.logger?.log(message);
395
+ return createSuccessResult({
396
+ user: { id: userId, username },
397
+ dryRun,
398
+ previousState,
399
+ actions: actions.map((a) => ({ ...a, message: dryRun ? 'Would be applied' : 'Already configured' })),
400
+ currentState: dryRun ? null : previousState,
401
+ summary: {
402
+ changesRequired,
403
+ changesApplied: 0,
404
+ changesFailed: 0,
405
+ isReady,
406
+ },
407
+ }, {
408
+ message,
409
+ metadata: { duration },
410
+ });
411
+ }
412
+ }
413
+ //# sourceMappingURL=ConfigureMode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ConfigureMode.js","sourceRoot":"","sources":["../../src/services/ConfigureMode.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AACvF,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAEzD,OAAO,EAAE,wBAAwB,EAAE,8BAA8B,EAAE,MAAM,2BAA2B,CAAC;AACrG,OAAO,EACL,4BAA4B,GAK7B,MAAM,6BAA6B,CAAC;AAErC;;;;;;;;;GASG;AACH,MAAM,OAAO,aAAa;IACP,IAAI,CAA4B;IAEjD,YAAmB,IAA+B;QAChD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,+EAA+E;IAC/E,iBAAiB;IACjB,+EAA+E;IAE/E;;OAEG;IACK,MAAM,CAAC,8BAA8B,CAC3C,MAAc,EACd,MAAe,EACf,QAAQ,GAAG,EAAE;QAEb,OAAO;YACL,IAAI,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE;YAC9B,MAAM;YACN,aAAa,EAAE;gBACb,MAAM;gBACN,QAAQ;gBACR,yBAAyB,EAAE,KAAK;gBAChC,qBAAqB,EAAE,CAAC,GAAG,wBAAwB,CAAC;gBACpD,uBAAuB,EAAE,KAA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