@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,146 @@
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 { McpErrorCodes } from '../errors.js';
9
+ /**
10
+ * Creates a typed MCP tool handler that narrows `unknown` input to type `T`.
11
+ *
12
+ * The McpServer SDK validates input via Zod schemas before calling handlers,
13
+ * so the cast from `unknown` to `T` is runtime-safe. This wrapper centralizes
14
+ * the single cast point instead of scattering `input as T` across 18 handlers.
15
+ *
16
+ * @template T The validated input type (inferred from the handler parameter)
17
+ * @param handler - Typed handler function accepting validated input
18
+ * @returns Untyped handler matching the ToolHandler signature
19
+ */
20
+ export function typedHandler(handler) {
21
+ return (adapters, input) => handler(adapters, input);
22
+ }
23
+ /**
24
+ * Converts a ServiceResult to MCP CallToolResult format.
25
+ *
26
+ * Maps success/failure to MCP's content/isError structure.
27
+ * Preserves warnings and metadata in the response.
28
+ *
29
+ * @template T The type of the service result data
30
+ * @param result - ServiceResult from a service call
31
+ * @returns MCP-formatted CallToolResult
32
+ *
33
+ * @example
34
+ * ```typescript
35
+ * const serviceResult = await orgInfoService.getOrgIdentity();
36
+ * return serviceResultToMcp(serviceResult);
37
+ * ```
38
+ */
39
+ export function serviceResultToMcp(result) {
40
+ if (result.success) {
41
+ const content = {
42
+ type: 'text',
43
+ text: JSON.stringify({
44
+ success: true,
45
+ data: result.data,
46
+ message: result.message,
47
+ warnings: result.warnings,
48
+ metadata: result.metadata,
49
+ }, null, 2),
50
+ };
51
+ return {
52
+ content: [content],
53
+ isError: false,
54
+ };
55
+ }
56
+ // Failure case
57
+ const errorContent = {
58
+ type: 'text',
59
+ text: JSON.stringify({
60
+ success: false,
61
+ errorCode: result.errorCode ?? McpErrorCodes.SERVICE_CALL_FAILED,
62
+ message: result.message ?? 'Service call failed',
63
+ data: result.data,
64
+ metadata: result.metadata,
65
+ }, null, 2),
66
+ };
67
+ return {
68
+ content: [errorContent],
69
+ isError: true,
70
+ };
71
+ }
72
+ /**
73
+ * Converts a ServiceResult to a paginated MCP CallToolResult.
74
+ *
75
+ * Includes `_pagination` metadata in the response envelope for
76
+ * cursor-based pagination through large result sets.
77
+ *
78
+ * @template T The type of the service result data
79
+ * @param result - ServiceResult from a service call
80
+ * @param pagination - Pagination metadata for the response
81
+ * @returns MCP-formatted CallToolResult with pagination envelope
82
+ */
83
+ export function serviceResultToMcpPaginated(result, pagination) {
84
+ if (result.success) {
85
+ const content = {
86
+ type: 'text',
87
+ text: JSON.stringify({
88
+ success: true,
89
+ data: result.data,
90
+ _pagination: pagination,
91
+ message: result.message,
92
+ warnings: result.warnings,
93
+ metadata: result.metadata,
94
+ }, null, 2),
95
+ };
96
+ return {
97
+ content: [content],
98
+ isError: false,
99
+ };
100
+ }
101
+ // Failure case — no pagination on errors
102
+ return serviceResultToMcp(result);
103
+ }
104
+ /**
105
+ * Extracts a user-facing error message from a caught error and logs the
106
+ * full stack trace to stderr for post-mortem debugging.
107
+ *
108
+ * @param error - The caught error (may be Error or non-Error value)
109
+ * @param context - Tool/handler name for the log prefix
110
+ * @returns The error message string
111
+ */
112
+ /* eslint-disable no-console -- MCP uses stderr for logging */
113
+ export function extractErrorMessage(error, context) {
114
+ if (error instanceof Error) {
115
+ if (error.stack) {
116
+ console.error(`[MCP] ${context} error:\n${error.stack}`);
117
+ }
118
+ return error.message;
119
+ }
120
+ const message = String(error);
121
+ console.error(`[MCP] ${context} non-Error thrown: ${message}`);
122
+ return message;
123
+ }
124
+ /* eslint-enable no-console */
125
+ /**
126
+ * Creates an MCP error response.
127
+ *
128
+ * @param errorCode - MCP error code
129
+ * @param message - Error message
130
+ * @returns MCP-formatted error CallToolResult
131
+ */
132
+ export function createMcpError(errorCode, message) {
133
+ const errorContent = {
134
+ type: 'text',
135
+ text: JSON.stringify({
136
+ success: false,
137
+ errorCode,
138
+ message,
139
+ }, null, 2),
140
+ };
141
+ return {
142
+ content: [errorContent],
143
+ isError: true,
144
+ };
145
+ }
146
+ //# sourceMappingURL=tool-factory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-factory.js","sourceRoot":"","sources":["../../../src/mcp/tools/tool-factory.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,OAAO,EAAE,aAAa,EAAqB,MAAM,cAAc,CAAC;AAEhE;;;;;;;;;;GAUG;AACH,MAAM,UAAU,YAAY,CAC1B,OAAqE;IAErE,OA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C,YAAY,CAAC;QACvB,OAAO,EAAE,IAAI;KACd,CAAC;AACJ,CAAC"}
@@ -0,0 +1,25 @@
1
+ import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
2
+ import type { McpAdapters } from '../config/mcp-config.js';
3
+ import type { UserDetailsInput, UserConfigureInput } from '../schemas/input-schemas.js';
4
+ /**
5
+ * Handler for cuneiform_user_details tool invocation.
6
+ *
7
+ * Returns user identity, readiness, and org context directly from service data.
8
+ * Builds the MCP response inline rather than delegating to the command layer.
9
+ *
10
+ * @param adapters - Session-scoped MCP adapters
11
+ * @param params - Validated input from MCP SDK
12
+ * @returns MCP CallToolResult
13
+ */
14
+ export declare function handleUserDetails(adapters: McpAdapters, params: UserDetailsInput): Promise<CallToolResult>;
15
+ /**
16
+ * Handler for cuneiform_user_configure tool invocation.
17
+ *
18
+ * Includes a prerequisite guard that checks Cuneiform installation
19
+ * before attempting configuration.
20
+ *
21
+ * @param adapters - Session-scoped MCP adapters
22
+ * @param params - Validated input from MCP SDK
23
+ * @returns MCP CallToolResult
24
+ */
25
+ export declare function handleUserConfigure(adapters: McpAdapters, params: UserConfigureInput): Promise<CallToolResult>;
@@ -0,0 +1,167 @@
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 { UserConfigurationService } from '../../services/UserConfigurationService.js';
9
+ import { OrgInfoService } from '../../services/OrgInfoService.js';
10
+ import { UserReadinessService } from '../../services/UserReadinessService.js';
11
+ import { McpErrorCodes } from '../errors.js';
12
+ import { createMcpError, serviceResultToMcp, extractErrorMessage } from './tool-factory.js';
13
+ /**
14
+ * Handler for cuneiform_user_details tool invocation.
15
+ *
16
+ * Returns user identity, readiness, and org context directly from service data.
17
+ * Builds the MCP response inline rather than delegating to the command layer.
18
+ *
19
+ * @param adapters - Session-scoped MCP adapters
20
+ * @param params - Validated input from MCP SDK
21
+ * @returns MCP CallToolResult
22
+ */
23
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars -- SDK requires params arg; UserDetailsInput is empty
24
+ export async function handleUserDetails(adapters, params) {
25
+ try {
26
+ const { facade, soql: soqlAdapter } = adapters;
27
+ const userReadinessService = new UserReadinessService({ soqlAdapter });
28
+ const orgInfoService = new OrgInfoService({ connectionFacade: facade, soqlAdapter });
29
+ // Get current user ID from connection identity with validation
30
+ const identity = await facade.identity();
31
+ const userId = identity.user_id;
32
+ if (!userId) {
33
+ return createMcpError(McpErrorCodes.TOOL_INVOCATION_FAILED, 'Session expired or identity unavailable. Re-authenticate with the target org.');
34
+ }
35
+ // Fetch org identity, user info, and readiness in parallel
36
+ const [orgIdentityResult, userInfoResult, readinessResult] = await Promise.all([
37
+ orgInfoService.getOrgIdentity(),
38
+ userReadinessService.getUserInfo(userId),
39
+ userReadinessService.checkReadiness(userId),
40
+ ]);
41
+ // Handle user info failure
42
+ if (!userInfoResult.success) {
43
+ return createMcpError(McpErrorCodes.TOOL_INVOCATION_FAILED, `Failed to get user info: ${userInfoResult.message ?? 'Unknown error'}`);
44
+ }
45
+ // Handle readiness check failure
46
+ if (!readinessResult.success) {
47
+ return createMcpError(McpErrorCodes.TOOL_INVOCATION_FAILED, `Failed to check readiness: ${readinessResult.message ?? 'Unknown error'}`);
48
+ }
49
+ // Build warnings for partial failures
50
+ const warnings = [];
51
+ if (!orgIdentityResult.success) {
52
+ warnings.push(`Org identity unavailable: ${orgIdentityResult.message ?? 'Unknown error'}`);
53
+ }
54
+ const orgIdentity = orgIdentityResult.success ? orgIdentityResult.data : undefined;
55
+ const userInfo = userInfoResult.data;
56
+ const readiness = readinessResult.data;
57
+ // Build MCP response directly from service data (no command-layer dependency)
58
+ const result = {
59
+ orgContext: {
60
+ orgName: orgIdentity?.organizationName ?? null,
61
+ orgId: orgIdentity?.organizationId ?? null,
62
+ instanceUrl: facade.instanceUrl ?? null,
63
+ isSandbox: orgIdentity?.isSandbox ?? null,
64
+ },
65
+ user: {
66
+ id: userInfo.id,
67
+ username: userInfo.username,
68
+ email: userInfo.email,
69
+ profileName: userInfo.profileName,
70
+ roleName: userInfo.roleName,
71
+ },
72
+ readiness: {
73
+ isReady: readiness.isReady,
74
+ isCuneiformInstalled: readiness.isCuneiformInstalled,
75
+ permissionSets: {
76
+ hasAllRequired: readiness.permissionSets.hasAllRequired,
77
+ missingRequired: readiness.permissionSets.missingRequired,
78
+ assignments: readiness.permissionSets.assignments,
79
+ },
80
+ configProfile: {
81
+ isConfigured: readiness.configProfile.isConfigured,
82
+ profileLabel: readiness.configProfile.profileLabel ?? null,
83
+ apiOnlyProfilingEnabled: readiness.configProfile.isConfigured
84
+ ? readiness.configProfile.apiOnlyProfilingEnabled ?? null
85
+ : null,
86
+ },
87
+ },
88
+ warnings: warnings.length > 0 ? warnings : undefined,
89
+ };
90
+ return serviceResultToMcp({
91
+ success: true,
92
+ data: result,
93
+ warnings: warnings.length > 0 ? warnings : undefined,
94
+ });
95
+ }
96
+ catch (error) {
97
+ return createMcpError(McpErrorCodes.TOOL_INVOCATION_FAILED, `Failed to get user details: ${extractErrorMessage(error, 'handleUserDetails')}`);
98
+ }
99
+ }
100
+ /**
101
+ * Handler for cuneiform_user_configure tool invocation.
102
+ *
103
+ * Includes a prerequisite guard that checks Cuneiform installation
104
+ * before attempting configuration.
105
+ *
106
+ * @param adapters - Session-scoped MCP adapters
107
+ * @param params - Validated input from MCP SDK
108
+ * @returns MCP CallToolResult
109
+ */
110
+ export async function handleUserConfigure(adapters, params) {
111
+ try {
112
+ const { facade, soql: soqlAdapter, rest: restAdapter } = adapters;
113
+ const userReadinessService = new UserReadinessService({ soqlAdapter });
114
+ // Get current user ID from connection identity with validation
115
+ const identity = await facade.identity();
116
+ const userId = identity.user_id;
117
+ if (!userId) {
118
+ return createMcpError(McpErrorCodes.TOOL_INVOCATION_FAILED, 'Session expired or identity unavailable. Re-authenticate with the target org.');
119
+ }
120
+ // Prerequisite guard: check Cuneiform is installed before configuring
121
+ const readinessResult = await userReadinessService.checkReadiness(userId);
122
+ if (!readinessResult.success) {
123
+ return createMcpError(McpErrorCodes.TOOL_INVOCATION_FAILED, `Failed to check prerequisites: ${readinessResult.message ?? 'Unknown error'}`);
124
+ }
125
+ if (!readinessResult.data.isCuneiformInstalled) {
126
+ return createMcpError(McpErrorCodes.TOOL_INVOCATION_FAILED, 'Cuneiform for Salesforce is not installed in this org. ' +
127
+ 'Install the package from AppExchange before configuring user access. ' +
128
+ 'See: https://peernova.link/cli/configure');
129
+ }
130
+ const userConfigService = new UserConfigurationService({
131
+ soqlAdapter,
132
+ restApiAdapter: restAdapter,
133
+ userReadinessService,
134
+ });
135
+ // Execute configuration (with dry-run by default)
136
+ const configResult = await userConfigService.configure(userId, {
137
+ dryRun: params.dryRun,
138
+ });
139
+ if (!configResult.success) {
140
+ return createMcpError(McpErrorCodes.TOOL_INVOCATION_FAILED, `Configuration failed: ${configResult.message ?? 'Unknown error'}`);
141
+ }
142
+ // Map to command-level result for consistent response shape
143
+ const result = {
144
+ dryRun: params.dryRun,
145
+ actions: configResult.data.actions.map((action) => ({
146
+ type: action.type,
147
+ target: action.target,
148
+ targetLabel: action.targetLabel ?? action.target,
149
+ status: params.dryRun ? 'planned' : action.status,
150
+ message: action.message,
151
+ })),
152
+ summary: {
153
+ changesRequired: configResult.data.summary.changesRequired,
154
+ changesApplied: configResult.data.summary.changesApplied,
155
+ changesFailed: configResult.data.summary.changesFailed,
156
+ },
157
+ };
158
+ return serviceResultToMcp({
159
+ success: true,
160
+ data: result,
161
+ });
162
+ }
163
+ catch (error) {
164
+ return createMcpError(McpErrorCodes.TOOL_INVOCATION_FAILED, `Failed to configure user: ${extractErrorMessage(error, 'handleUserConfigure')}`);
165
+ }
166
+ }
167
+ //# sourceMappingURL=user-tools.js.map
@@ -0,0 +1 @@
1
+ {"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DAA4D;QAC5D,MAAM,MAAM,GAAG;YACb,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,OAAO,EAAE,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;gBAClD,IAAI,EAAE,MAAM,CAAC,IAAI;gBACjB,MAAM,EAAE,MAAM,CAAC,MAAM;gBACrB,WAAW,EAAE,MAAM,CAAC,WAAW,IAAI,MAAM,CAAC,MAAM;gBAChD,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM;gBACjD,OAAO,EAAE,MAAM,CAAC,OAAO;aACxB,CAAC,CAAC;YACH,OAAO,EAAE;gBACP,eAAe,EAAE,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe;gBAC1D,cAAc,EAAE,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc;gBACxD,aAAa,EAAE,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa;aACvD;SACF,CAAC;QAEF,OAAO,kBAAkB,CAAC;YACxB,OAAO,EAAE,IAAI;YACb,IAAI,EAAE,MAAM;SACb,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,cAAc,CACnB,aAAa,CAAC,sBAAsB,EACpC,6BAA6B,mBAAmB,CAAC,KAAK,EAAE,qBAAqB,CAAC,EAAE,CACjF,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -0,0 +1,211 @@
1
+ /**
2
+ * Date literal support for profiling definition creation.
3
+ *
4
+ * Replaces the year-range model with ISV-compatible date literal segmentation.
5
+ * Definitions become rolling windows that stay relevant without recreation.
6
+ *
7
+ * The 14 supported literals match the ISV DateLiteral.cls constants exactly.
8
+ * See docs/knowledge/salesforce/date-literals.md for full reference.
9
+ */
10
+ /**
11
+ * The 14 date literals supported by the ISV DateLiteral.cls.
12
+ * These are the ONLY literals the CLI should generate — they correspond 1:1
13
+ * to the constants in the ISV product's DateLiteral class.
14
+ */
15
+ export declare const SUPPORTED_DATE_LITERALS: readonly ["TODAY", "YESTERDAY", "THIS_WEEK", "LAST_WEEK", "THIS_MONTH", "LAST_MONTH", "THIS_QUARTER", "LAST_QUARTER", "THIS_YEAR", "LAST_YEAR", "N_YEARS_AGO:2", "N_YEARS_AGO:3", "LAST_N_YEARS:2", "LAST_N_YEARS:3"];
16
+ /** Type representing any supported date literal value */
17
+ export type SupportedDateLiteral = (typeof SUPPORTED_DATE_LITERALS)[number];
18
+ /**
19
+ * Customer-facing labels for each date literal.
20
+ * Used in definition names, descriptions, and time category display.
21
+ */
22
+ export declare const DATE_LITERAL_LABELS: Record<SupportedDateLiteral, string>;
23
+ /**
24
+ * Date literal tier classification.
25
+ *
26
+ * Each tier determines the maximum allowed depth for cascading:
27
+ * - year: depth 0-3 (THIS_YEAR → LAST_YEAR → N_YEARS_AGO:2 → N_YEARS_AGO:3)
28
+ * - quarter: depth 0-1 (THIS_QUARTER → LAST_QUARTER)
29
+ * - month: depth 0-1 (THIS_MONTH → LAST_MONTH)
30
+ * - week: depth 0-1 (THIS_WEEK → LAST_WEEK)
31
+ * - day: depth 0-1 (TODAY → YESTERDAY)
32
+ * - span: depth 0 only (LAST_N_YEARS:2, LAST_N_YEARS:3 combine multiple years)
33
+ */
34
+ export type DateLiteralTier = 'year' | 'quarter' | 'month' | 'week' | 'day' | 'span';
35
+ /** Maps each literal to its tier */
36
+ export declare const LITERAL_TIERS: Record<SupportedDateLiteral, DateLiteralTier>;
37
+ /**
38
+ * Maximum cascade depth per tier.
39
+ *
40
+ * Only year-tier literals support depth > 1. Quarter, month, week, and day tiers
41
+ * each represent a single atomic period with no comparable prior available via
42
+ * ISV-supported literals, so depth is capped at 1 for those tiers.
43
+ */
44
+ export declare const TIER_MAX_DEPTH: Record<DateLiteralTier, number>;
45
+ /**
46
+ * Depth cascade arrays per literal.
47
+ *
48
+ * Starting from a given literal at depth 0, each subsequent depth level
49
+ * adds the next literal in the cascade. Cascades always move backward in time.
50
+ *
51
+ * Example: THIS_YEAR with depth 3 → [THIS_YEAR, LAST_YEAR, N_YEARS_AGO:2]
52
+ */
53
+ export declare const LITERAL_CASCADES: Record<SupportedDateLiteral, readonly SupportedDateLiteral[]>;
54
+ /**
55
+ * A single entry in a resolved date literal range.
56
+ * Analogous to ComparativeYearEntry in the year-range model.
57
+ */
58
+ export type DateLiteralEntry = {
59
+ /** The date literal value (e.g., 'THIS_YEAR', 'LAST_QUARTER') */
60
+ readonly literal: SupportedDateLiteral;
61
+ /** Customer-facing label (e.g., 'This Year', 'Last Quarter') */
62
+ readonly label: string;
63
+ };
64
+ /**
65
+ * A resolved date literal range for profiling definitions.
66
+ * Analogous to YearRange in the year-range model.
67
+ *
68
+ * Contains the ordered list of date literal entries derived from user input
69
+ * (--date-literal flag + --depth flag).
70
+ */
71
+ export type DateLiteralRange = {
72
+ /** Ordered list of date literal entries (most recent first) */
73
+ readonly entries: readonly DateLiteralEntry[];
74
+ /** The date field to filter on (default: CreatedDate) */
75
+ readonly dateField: string;
76
+ };
77
+ /**
78
+ * Raw flag inputs for date literal range resolution.
79
+ */
80
+ export type DateLiteralInput = {
81
+ /** The base date literal (e.g., 'THIS_YEAR') */
82
+ dateLiteral: string;
83
+ /** Number of periods to cascade (counting back from base) */
84
+ depth?: number;
85
+ /** The date field to filter on (default: CreatedDate) */
86
+ dateField?: string;
87
+ };
88
+ /**
89
+ * Validates a date literal value against the ISV-supported set.
90
+ *
91
+ * @param value - The date literal string to validate
92
+ * @returns undefined if valid, error message string if invalid
93
+ */
94
+ export declare function validateDateLiteral(value: string): string | undefined;
95
+ /**
96
+ * Resolves CLI flag inputs into a validated DateLiteralRange.
97
+ *
98
+ * @param input - Raw flag inputs
99
+ * @returns Resolved DateLiteralRange
100
+ * @throws Error if inputs are invalid
101
+ */
102
+ export declare function resolveDateLiteralRange(input: DateLiteralInput): DateLiteralRange;
103
+ /**
104
+ * Returns the customer-facing label for a date literal.
105
+ *
106
+ * @param literal - A supported date literal value
107
+ * @returns The label string, or the raw literal if not found
108
+ */
109
+ export declare function getDateLiteralLabel(literal: string): string;
110
+ /**
111
+ * Maps each date literal to its `$Constant.*` display value for the expression builder.
112
+ * These are the values that `fsc_expressionBuilder3` renders in the Value field.
113
+ */
114
+ export declare const DATE_LITERAL_CONSTANTS: Record<SupportedDateLiteral, string>;
115
+ /**
116
+ * Builds an ISV-compatible filterJson string for date literal filtering.
117
+ *
118
+ * Produces the full expression builder JSON schema that `fsc_expressionBuilder3` expects,
119
+ * including all 12 required fields per expression line. The `parameter` field uses `$Constant.*`
120
+ * display values and `parameterValue` / `dateLiteral` use the SOQL literal.
121
+ *
122
+ * The outer envelope (hasFilters, setA) is required by ProfilingDefinitionApiService.resolveFilterClause()
123
+ * to enable WHERE clause filtering. setA.json must be an object (not a string) — the API
124
+ * does JSON.serialize() on it.
125
+ *
126
+ * @param dateField - The date/datetime field to filter on (e.g., 'CreatedDate')
127
+ * @param dateLiteral - The date literal value (e.g., 'THIS_YEAR', 'N_YEARS_AGO:2')
128
+ * @param objectName - The Salesforce object API name (e.g., 'Account', 'Lead'). Defaults to empty string for backward compatibility.
129
+ * @param objectLabel - The Salesforce object label (e.g., 'Account', 'Lead'). Defaults to objectName.
130
+ * @returns JSON string compatible with GlobalProfilingService.createProfilingDefinition()
131
+ */
132
+ export declare function buildDateLiteralFilterJson(dateField: string, dateLiteral: string, objectName?: string, objectLabel?: string): string;
133
+ /**
134
+ * Builds an ISV-compatible filterJson string for date-literal comparative definitions.
135
+ * Creates SetA (primary period) and SetB (prior period), both using SOQL date literals.
136
+ *
137
+ * Used when method='comparative' with a date literal that has a prior period in its cascade.
138
+ * The prior literal is derived from LITERAL_CASCADES[setALiteral][1] by the caller.
139
+ *
140
+ * @param dateField - The date/datetime field to filter on (e.g., 'CreatedDate')
141
+ * @param setALiteral - The primary (current) date literal for SetA
142
+ * @param setBLiteral - The prior period date literal for SetB
143
+ * @param objectName - The Salesforce object API name
144
+ * @param objectLabel - The Salesforce object label
145
+ * @returns JSON string with hasFilters, setA, and setB
146
+ */
147
+ export declare function buildComparativeDateLiteralFilterJson(dateField: string, setALiteral: SupportedDateLiteral, setBLiteral: SupportedDateLiteral, objectName?: string, objectLabel?: string): string;
148
+ /**
149
+ * Maps a calendar year to the appropriate SOQL date literal based on distance from current year.
150
+ *
151
+ * @param year - The target calendar year
152
+ * @returns The date literal key (THIS_YEAR, LAST_YEAR, N_YEARS_AGO:2, N_YEARS_AGO:3) or undefined if out of range
153
+ */
154
+ export declare function yearToDateLiteral(year: number): SupportedDateLiteral | undefined;
155
+ /**
156
+ * Formats a year boundary as an ISO 8601 UTC midnight string.
157
+ * Used for explicit date range expressions in year-based comparisons.
158
+ */
159
+ export declare function yearBoundaryISO(year: number): string;
160
+ /**
161
+ * Formats a year boundary as a human-readable display string (M/d/yyyy, h:mm a).
162
+ * Used for the `parameter` display value in expression builder JSON.
163
+ */
164
+ export declare function yearBoundaryDisplay(year: number): string;
165
+ /**
166
+ * Builds an ISV-compatible filterJson string for a single year (SetA only, no SetB).
167
+ * Used for historical definitions scoped to a specific year via --year flag.
168
+ *
169
+ * @param dateField - The date/datetime field to filter on (e.g., 'CreatedDate')
170
+ * @param year - The target year
171
+ * @param objectName - The Salesforce object API name
172
+ * @param objectLabel - The Salesforce object label
173
+ * @returns JSON string with hasFilters and setA (no setB)
174
+ */
175
+ export declare function buildHistoricalYearFilterJson(dateField: string, year: number, objectName?: string, objectLabel?: string): string;
176
+ /**
177
+ * Builds an ISV-compatible filterJson string for year-based comparative definitions.
178
+ * Creates SetA (target year) and SetB (prior year or all prior years) using explicit
179
+ * date range expressions (>= start AND < end), not date literals.
180
+ *
181
+ * This approach supports arbitrary years with no lookback limitation.
182
+ *
183
+ * @param dateField - The date/datetime field to filter on (e.g., 'CreatedDate', 'LastModifiedDate')
184
+ * @param year - The target year for SetA
185
+ * @param usePrior - When true, SetB is all records before the target year. When false, SetB is the prior year.
186
+ * @param objectName - The Salesforce object API name
187
+ * @param objectLabel - The Salesforce object label
188
+ * @returns JSON string with hasFilters, setA, and setB
189
+ */
190
+ export declare function buildComparativeYearFilterJson(dateField: string, year: number, usePrior: boolean, objectName?: string, objectLabel?: string): string;
191
+ /**
192
+ * Builds an ISV-compatible filterJson string for the lifetime-vs-X comparative variant.
193
+ *
194
+ * SetA is unfiltered (empty expressions array — represents "all records / lifetime"); SetB carries the supplied
195
+ * secondary filter. This is the inverse of `buildComparativeYearFilterJson`, where SetA is the year-scoped set and
196
+ * SetB is the prior-year (or unbounded) set.
197
+ *
198
+ * @param dateField - The date/datetime field to filter on (e.g., 'CreatedDate', 'LastModifiedDate')
199
+ * @param secondary - The secondary filter spec applied to SetB. Accepts `{ kind: 'year', year }` for a year-bounded SetB,
200
+ * or `{ kind: 'dateLiteral', literal }` for a SOQL date-literal SetB.
201
+ * @param objectName - The Salesforce object API name
202
+ * @param objectLabel - The Salesforce object label (defaults to objectName)
203
+ * @returns JSON string with hasFilters, setA (empty), and setB (filtered)
204
+ */
205
+ export declare function buildLifetimeComparativeFilterJson(dateField: string, secondary: {
206
+ kind: 'year';
207
+ year: number;
208
+ } | {
209
+ kind: 'dateLiteral';
210
+ literal: SupportedDateLiteral;
211
+ }, objectName?: string, objectLabel?: string): string;