@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,137 @@
1
+ import type { ServiceResult } from '../../models/service-result.js';
2
+ import type { DateLiteralRange } from '../../models/date-literal.js';
3
+ import type { IRestApiAdapter } from './rest-api-adapter.js';
4
+ /**
5
+ * Standard response envelope from the ISV REST API.
6
+ */
7
+ export type ProfilingRestResponse<T = unknown> = {
8
+ success: boolean;
9
+ results?: T;
10
+ result?: T;
11
+ summary?: Record<string, number>;
12
+ errors: string[];
13
+ };
14
+ /**
15
+ * Smart definition creation request payload.
16
+ */
17
+ export type SmartCreateRequest = {
18
+ objects: Array<{
19
+ name: string;
20
+ label: string;
21
+ }>;
22
+ method: string;
23
+ options: {
24
+ category?: string;
25
+ timeCategory?: string;
26
+ segmentCategory?: string;
27
+ year?: number;
28
+ usePrior?: boolean;
29
+ noValueFrequency?: boolean;
30
+ namePrefix?: string;
31
+ nameSuffix?: string;
32
+ origin?: string;
33
+ recordType?: string;
34
+ description?: string;
35
+ dryRun?: boolean;
36
+ dateLiteralRange?: DateLiteralRange;
37
+ yearEntries?: Array<{
38
+ year: number;
39
+ unbounded: boolean;
40
+ }>;
41
+ };
42
+ };
43
+ /**
44
+ * Per-definition result from the smart creation endpoint.
45
+ */
46
+ export type SmartCreateDefinitionResult = {
47
+ objectName: string;
48
+ definitionName: string;
49
+ definitionId?: string;
50
+ definitionKey?: string;
51
+ status: 'created' | 'skipped' | 'failed' | 'preview';
52
+ errorMessage?: string;
53
+ fieldCount?: number;
54
+ type?: string;
55
+ category?: string;
56
+ timeCategory?: string;
57
+ segmentCategory?: string;
58
+ };
59
+ /**
60
+ * Object filter request payload.
61
+ */
62
+ export type FilterObjectsRequest = {
63
+ type?: string;
64
+ namespace?: string;
65
+ excludeSystemObjects?: boolean;
66
+ namePattern?: string;
67
+ nameOperator?: string;
68
+ classification?: string;
69
+ hasRecordTypes?: boolean;
70
+ withOwner?: boolean;
71
+ limit?: number;
72
+ };
73
+ /**
74
+ * Thin REST client for calling Cuneiform ISV profiling endpoints.
75
+ * Wraps the existing IRestApiAdapter.request<T>() method with typed payloads.
76
+ *
77
+ * @example
78
+ * ```typescript
79
+ * const client = new ProfilingRestClient(restAdapter);
80
+ * const result = await client.createSmart({
81
+ * objects: [{ name: 'Account', label: 'Account' }],
82
+ * method: 'metadata',
83
+ * options: { dryRun: true }
84
+ * });
85
+ * ```
86
+ */
87
+ export declare class ProfilingRestClient {
88
+ private readonly restAdapter;
89
+ constructor(restAdapter: IRestApiAdapter);
90
+ /**
91
+ * Calls the smart definition creation endpoint.
92
+ * Server handles naming, categorization, deduplication, and creation.
93
+ */
94
+ createSmart(request: SmartCreateRequest): Promise<ServiceResult<ProfilingRestResponse<SmartCreateDefinitionResult[]>>>;
95
+ /**
96
+ * Calls the object filtering endpoint.
97
+ * Server applies cost-optimized multi-criteria filter chain.
98
+ */
99
+ filterObjects(request: FilterObjectsRequest): Promise<ServiceResult<ProfilingRestResponse>>;
100
+ /**
101
+ * Calls the object describe endpoint.
102
+ */
103
+ describeObject(objectName: string, options?: {
104
+ includeRecordAge?: boolean;
105
+ includeFieldDistribution?: boolean;
106
+ withFields?: boolean;
107
+ withRelationships?: boolean;
108
+ withProfilingStatus?: boolean;
109
+ }): Promise<ServiceResult<ProfilingRestResponse>>;
110
+ /**
111
+ * Calls the data availability grid endpoint.
112
+ */
113
+ getDataAvailability(objects: string[], years: number[]): Promise<ServiceResult<ProfilingRestResponse>>;
114
+ /**
115
+ * Calls the user readiness endpoint.
116
+ */
117
+ checkUserReadiness(userId?: string): Promise<ServiceResult<ProfilingRestResponse>>;
118
+ /**
119
+ * Calls the org info endpoint.
120
+ */
121
+ getOrgInfo(): Promise<ServiceResult<ProfilingRestResponse>>;
122
+ /**
123
+ * Calls the user-configure endpoint (ConfigurationProfileResource).
124
+ * Separate REST resource at /v1/profiling/configuration/.
125
+ */
126
+ configureUser(options: {
127
+ userId?: string;
128
+ enableApiOnlyProfiling?: boolean;
129
+ enableRegistration?: boolean;
130
+ profileDeveloperName?: string;
131
+ dryRun?: boolean;
132
+ }): Promise<ServiceResult<ProfilingRestResponse>>;
133
+ /**
134
+ * Generic POST to a profiling REST action.
135
+ */
136
+ private post;
137
+ }
@@ -0,0 +1,115 @@
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
+ /**
10
+ * REST API base URL for Cuneiform profiling endpoints.
11
+ * All actions are routed via POST to this URL with the action as the last path segment.
12
+ */
13
+ // Apex urlMapping is '/v1/profiling/*' — Salesforce auto-prepends namespace (pnova)
14
+ const PROFILING_REST_BASE = '/services/apexrest/pnova/v1/profiling';
15
+ /**
16
+ * Thin REST client for calling Cuneiform ISV profiling endpoints.
17
+ * Wraps the existing IRestApiAdapter.request<T>() method with typed payloads.
18
+ *
19
+ * @example
20
+ * ```typescript
21
+ * const client = new ProfilingRestClient(restAdapter);
22
+ * const result = await client.createSmart({
23
+ * objects: [{ name: 'Account', label: 'Account' }],
24
+ * method: 'metadata',
25
+ * options: { dryRun: true }
26
+ * });
27
+ * ```
28
+ */
29
+ export class ProfilingRestClient {
30
+ restAdapter;
31
+ constructor(restAdapter) {
32
+ this.restAdapter = restAdapter;
33
+ }
34
+ /**
35
+ * Calls the smart definition creation endpoint.
36
+ * Server handles naming, categorization, deduplication, and creation.
37
+ */
38
+ async createSmart(request) {
39
+ return this.post('create-smart', request);
40
+ }
41
+ /**
42
+ * Calls the object filtering endpoint.
43
+ * Server applies cost-optimized multi-criteria filter chain.
44
+ */
45
+ async filterObjects(request) {
46
+ return this.post('filter-objects', request);
47
+ }
48
+ /**
49
+ * Calls the object describe endpoint.
50
+ */
51
+ async describeObject(objectName, options) {
52
+ return this.post('describe-object', {
53
+ objectName,
54
+ ...options,
55
+ });
56
+ }
57
+ /**
58
+ * Calls the data availability grid endpoint.
59
+ */
60
+ async getDataAvailability(objects, years) {
61
+ return this.post('data-availability', { objects, years });
62
+ }
63
+ /**
64
+ * Calls the user readiness endpoint.
65
+ */
66
+ async checkUserReadiness(userId) {
67
+ return this.post('user-readiness', { userId });
68
+ }
69
+ /**
70
+ * Calls the org info endpoint.
71
+ */
72
+ async getOrgInfo() {
73
+ return this.post('org-info', {});
74
+ }
75
+ /**
76
+ * Calls the user-configure endpoint (ConfigurationProfileResource).
77
+ * Separate REST resource at /v1/profiling/configuration/.
78
+ */
79
+ async configureUser(options) {
80
+ const startTime = Date.now();
81
+ const result = await this.restAdapter.request({
82
+ url: '/services/apexrest/pnova/v1/profiling/configuration',
83
+ method: 'POST',
84
+ body: JSON.stringify(options),
85
+ headers: { 'content-type': 'application/json' },
86
+ });
87
+ if (!result.success) {
88
+ return createFailureResult(result.data, result.errorCode ?? 'REST_API_ERROR', result.message ?? 'REST API call to user-configure failed', { metadata: { duration: Date.now() - startTime } });
89
+ }
90
+ return createSuccessResult(result.data, {
91
+ message: 'User configuration completed via REST API',
92
+ metadata: { duration: Date.now() - startTime },
93
+ });
94
+ }
95
+ /**
96
+ * Generic POST to a profiling REST action.
97
+ */
98
+ async post(action, body) {
99
+ const startTime = Date.now();
100
+ const result = await this.restAdapter.request({
101
+ url: `${PROFILING_REST_BASE}/${action}`,
102
+ method: 'POST',
103
+ body: JSON.stringify(body),
104
+ headers: { 'content-type': 'application/json' },
105
+ });
106
+ if (!result.success) {
107
+ return createFailureResult(result.data, result.errorCode ?? 'REST_API_ERROR', result.message ?? `REST API call to ${action} failed`, { metadata: { duration: Date.now() - startTime } });
108
+ }
109
+ return createSuccessResult(result.data, {
110
+ message: `REST API call to ${action} succeeded`,
111
+ metadata: { duration: Date.now() - startTime },
112
+ });
113
+ }
114
+ }
115
+ //# sourceMappingURL=profiling-rest-client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profiling-rest-client.js","sourceRoot":"","sources":["../../../src/adapters/rest/profiling-rest-client.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,389 @@
1
+ import type { IConnectionFacade, DescribeSObjectResult, DescribeGlobalResult, HttpRequest } from '../connection-facade.js';
2
+ import type { ServiceResult } from '../../models/service-result.js';
3
+ import type { RestApiAdapterConfig } from './types.js';
4
+ /**
5
+ * Result type for successful record insert operations.
6
+ */
7
+ export type InsertRecordResult = {
8
+ /** The ID of the newly created record */
9
+ id: string;
10
+ };
11
+ /**
12
+ * Result type for successful record update operations.
13
+ */
14
+ export type UpdateRecordResult = {
15
+ /** The ID of the updated record */
16
+ id: string;
17
+ /** Whether the update succeeded */
18
+ success: boolean;
19
+ };
20
+ /**
21
+ * Result type for successful record delete operations.
22
+ */
23
+ export type DeleteRecordResult = {
24
+ /** The ID of the deleted record */
25
+ id: string;
26
+ /** Whether the delete succeeded */
27
+ success: boolean;
28
+ };
29
+ /**
30
+ * Interface for REST API operations.
31
+ *
32
+ * Provides methods for describing Salesforce objects with caching support,
33
+ * and writing sObject records.
34
+ */
35
+ export type IRestApiAdapter = {
36
+ /**
37
+ * Describes a single Salesforce object.
38
+ *
39
+ * @param objectName - The API name of the object
40
+ * @returns ServiceResult containing the describe result
41
+ */
42
+ describeObject(objectName: string): Promise<ServiceResult<DescribeSObjectResult>>;
43
+ /**
44
+ * Retrieves global describe information for all accessible objects.
45
+ *
46
+ * @returns ServiceResult containing the global describe result
47
+ */
48
+ describeGlobal(): Promise<ServiceResult<DescribeGlobalResult>>;
49
+ /**
50
+ * Gets the record count for a Salesforce object.
51
+ *
52
+ * @param objectName - The API name of the object
53
+ * @returns ServiceResult containing the record count
54
+ */
55
+ getRecordCount(objectName: string): Promise<ServiceResult<number>>;
56
+ /**
57
+ * Gets record counts for multiple Salesforce objects using the bulk REST endpoint.
58
+ *
59
+ * Uses `GET /limits/recordCount?sObjects=...` for a single API call instead of
60
+ * N individual SOQL COUNT() queries. Falls back to per-object SOQL queries if
61
+ * the REST endpoint fails. Cached counts are resolved first; only uncached
62
+ * objects are included in the REST call.
63
+ *
64
+ * @param objectNames - Array of object API names
65
+ * @returns ServiceResult containing Map of object name to count
66
+ *
67
+ * @example
68
+ * ```typescript
69
+ * const result = await adapter.getRecordCounts(['Account', 'Contact', 'Lead']);
70
+ * if (result.success) {
71
+ * for (const [name, count] of result.data) {
72
+ * console.log(`${name}: ${count} records`);
73
+ * }
74
+ * }
75
+ * ```
76
+ */
77
+ getRecordCounts(objectNames: string[]): Promise<ServiceResult<Map<string, number>>>;
78
+ /**
79
+ * Describes multiple Salesforce objects.
80
+ *
81
+ * @param objectNames - Array of object API names
82
+ * @returns ServiceResult containing a map of object names to describe results
83
+ */
84
+ describeObjects(objectNames: string[]): Promise<ServiceResult<Map<string, DescribeSObjectResult>>>;
85
+ /**
86
+ * Inserts a new record into a Salesforce object.
87
+ *
88
+ * Uses the REST API POST /sobjects/{objectName} endpoint.
89
+ *
90
+ * @param objectName - The API name of the object (e.g., 'Account', 'PermissionSetAssignment')
91
+ * @param record - The field values for the new record
92
+ * @returns ServiceResult containing the created record's ID
93
+ *
94
+ * @example
95
+ * ```typescript
96
+ * // Insert a PermissionSetAssignment record
97
+ * const result = await adapter.insertRecord('PermissionSetAssignment', {
98
+ * AssigneeId: '005xx000001234567',
99
+ * PermissionSetId: '0PS000000000001'
100
+ * });
101
+ * if (result.success) {
102
+ * console.log(`Created record: ${result.data.id}`);
103
+ * }
104
+ * ```
105
+ */
106
+ insertRecord(objectName: string, record: Record<string, unknown>): Promise<ServiceResult<InsertRecordResult>>;
107
+ /**
108
+ * Updates an existing record in a Salesforce object.
109
+ *
110
+ * Uses the REST API PATCH /sobjects/{objectName}/{recordId} endpoint.
111
+ *
112
+ * @param objectName - The API name of the object (must use pnova__ namespace, e.g., 'pnova__Profiling_Definition__c')
113
+ * @param recordId - The ID of the record to update
114
+ * @param record - The field values to update
115
+ * @returns ServiceResult containing the update result with record ID and success status
116
+ *
117
+ * @example
118
+ * ```typescript
119
+ * // Update a Cuneiform record
120
+ * const result = await adapter.updateRecord('pnova__Profiling_Definition__c', '001xx000003DKMPAA4', {
121
+ * pnova__Prop_Name__c: 'Updated Definition',
122
+ * });
123
+ * if (result.success) {
124
+ * console.log(`Updated record: ${result.data.id}`);
125
+ * }
126
+ * ```
127
+ */
128
+ updateRecord(objectName: string, recordId: string, record: Record<string, unknown>): Promise<ServiceResult<UpdateRecordResult>>;
129
+ /**
130
+ * Deletes a record from a Salesforce object.
131
+ *
132
+ * Uses the REST API DELETE /sobjects/{objectName}/{recordId} endpoint.
133
+ *
134
+ * @param objectName - The API name of the object (must use pnova__ namespace, e.g., 'pnova__Profiling_Summary__c')
135
+ * @param recordId - The ID of the record to delete
136
+ * @returns ServiceResult containing the delete result with record ID and success status
137
+ *
138
+ * @example
139
+ * ```typescript
140
+ * // Delete a Cuneiform record
141
+ * const result = await adapter.deleteRecord('pnova__Profiling_Summary__c', '003xx000004TMJQAA4');
142
+ * if (result.success) {
143
+ * console.log(`Deleted record: ${result.data.id}`);
144
+ * }
145
+ * ```
146
+ */
147
+ deleteRecord(objectName: string, recordId: string): Promise<ServiceResult<DeleteRecordResult>>;
148
+ /**
149
+ * Makes a generic HTTP request to a custom Salesforce REST endpoint.
150
+ *
151
+ * Supports custom Apex REST endpoints (e.g., `/services/apexrest/pnova/v1/...`)
152
+ * and any other Salesforce REST API path. Unlike the typed methods above,
153
+ * this provides a pass-through for arbitrary request/response shapes.
154
+ *
155
+ * @param request - The HTTP request configuration (url, method, body, headers)
156
+ * @returns ServiceResult containing the deserialized response of type T
157
+ *
158
+ * @example
159
+ * ```typescript
160
+ * // Call a custom Apex REST endpoint
161
+ * const result = await adapter.request<{ success: boolean; results: Array<{ id: string }> }>({
162
+ * url: '/services/apexrest/pnova/v1/profiling/requests',
163
+ * method: 'POST',
164
+ * body: JSON.stringify({ id: definitionId }),
165
+ * headers: { 'content-type': 'application/json' },
166
+ * });
167
+ * ```
168
+ */
169
+ request<T>(request: HttpRequest): Promise<ServiceResult<T>>;
170
+ /**
171
+ * Invalidates cached entries.
172
+ *
173
+ * @param pattern - Optional pattern to match keys (supports * wildcard). If not provided, clears all entries.
174
+ */
175
+ invalidateCache(pattern?: string): void;
176
+ };
177
+ /**
178
+ * Adapter for REST API operations against Salesforce.
179
+ *
180
+ * Provides caching for describe operations to reduce API calls.
181
+ *
182
+ * @example
183
+ * ```typescript
184
+ * const adapter = new RestApiAdapter(connectionFacade);
185
+ *
186
+ * // Describe an object (cached)
187
+ * const result = await adapter.describeObject('Account');
188
+ *
189
+ * // Get global describe (cached)
190
+ * const global = await adapter.describeGlobal();
191
+ *
192
+ * // Describe multiple objects
193
+ * const describes = await adapter.describeObjects(['Account', 'Contact', 'Opportunity']);
194
+ *
195
+ * // Invalidate cache
196
+ * adapter.invalidateCache('describe:Account'); // Single object
197
+ * adapter.invalidateCache('describe:*'); // All describes
198
+ * adapter.invalidateCache(); // Everything
199
+ * ```
200
+ */
201
+ export declare class RestApiAdapter implements IRestApiAdapter {
202
+ private readonly connection;
203
+ private readonly logger?;
204
+ private readonly cache;
205
+ private readonly cacheEnabled;
206
+ private readonly lifecycle;
207
+ private readonly retryConfig?;
208
+ private readonly recordCountBatchSize;
209
+ /**
210
+ * Creates a new RestApiAdapter.
211
+ *
212
+ * @param connection - The connection facade to use for API calls
213
+ * @param config - Optional configuration
214
+ */
215
+ constructor(connection: IConnectionFacade, config?: RestApiAdapterConfig);
216
+ /**
217
+ * Validates that a write operation targets a permitted object.
218
+ *
219
+ * Only objects with the pnova__ namespace prefix are allowed for all write operations.
220
+ * A small set of standard objects (WRITE_ALLOWLIST) are allowed for specific operations.
221
+ *
222
+ * @param objectName - The API name of the target object
223
+ * @param operation - The write operation type
224
+ * @returns undefined if allowed, or an error code and message if blocked
225
+ */
226
+ private static validateWriteNamespace;
227
+ /**
228
+ * Describes a single Salesforce object.
229
+ *
230
+ * @param objectName - The API name of the object
231
+ * @returns ServiceResult containing the describe result
232
+ */
233
+ describeObject(objectName: string): Promise<ServiceResult<DescribeSObjectResult>>;
234
+ /**
235
+ * Retrieves global describe information for all accessible objects.
236
+ *
237
+ * @returns ServiceResult containing the global describe result
238
+ */
239
+ describeGlobal(): Promise<ServiceResult<DescribeGlobalResult>>;
240
+ /**
241
+ * Gets the record count for a Salesforce object.
242
+ *
243
+ * @param objectName - The API name of the object
244
+ * @returns ServiceResult containing the record count
245
+ */
246
+ getRecordCount(objectName: string): Promise<ServiceResult<number>>;
247
+ /**
248
+ * Describes multiple Salesforce objects.
249
+ *
250
+ * @param objectNames - Array of object API names
251
+ * @returns ServiceResult containing a map of object names to describe results
252
+ */
253
+ describeObjects(objectNames: string[]): Promise<ServiceResult<Map<string, DescribeSObjectResult>>>;
254
+ /**
255
+ * Gets record counts for multiple Salesforce objects using the bulk REST endpoint.
256
+ *
257
+ * Uses `GET /limits/recordCount?sObjects=A,B,C` for a single API call instead of
258
+ * N individual SOQL `SELECT COUNT()` queries. Falls back to per-object SOQL queries
259
+ * if the REST endpoint is unavailable or fails.
260
+ *
261
+ * Counts from the bulk response are cached individually so subsequent
262
+ * `getRecordCount()` calls benefit from the same cache.
263
+ *
264
+ * @param objectNames - Array of object API names
265
+ * @returns ServiceResult containing Map of object name to count
266
+ */
267
+ getRecordCounts(objectNames: string[]): Promise<ServiceResult<Map<string, number>>>;
268
+ /**
269
+ * Inserts a new record into a Salesforce object.
270
+ *
271
+ * Uses the REST API POST /sobjects/{objectName} endpoint to create a record.
272
+ * Does not use caching since write operations should always execute.
273
+ *
274
+ * @param objectName - The API name of the object (e.g., 'Account', 'PermissionSetAssignment')
275
+ * @param record - The field values for the new record
276
+ * @returns ServiceResult containing the created record's ID
277
+ *
278
+ * @example
279
+ * ```typescript
280
+ * const result = await adapter.insertRecord('PermissionSetAssignment', {
281
+ * AssigneeId: '005xx000001234567',
282
+ * PermissionSetId: '0PS000000000001'
283
+ * });
284
+ * ```
285
+ */
286
+ insertRecord(objectName: string, record: Record<string, unknown>): Promise<ServiceResult<InsertRecordResult>>;
287
+ /**
288
+ * Updates an existing record in a Salesforce object.
289
+ *
290
+ * Uses the REST API PATCH /sobjects/{objectName}/{recordId} endpoint to update a record.
291
+ * Does not use caching since write operations should always execute.
292
+ *
293
+ * @param objectName - The API name of the object (e.g., 'Account', 'Contact')
294
+ * @param recordId - The ID of the record to update
295
+ * @param record - The field values to update
296
+ * @returns ServiceResult containing the update result with record ID and success status
297
+ */
298
+ updateRecord(objectName: string, recordId: string, record: Record<string, unknown>): Promise<ServiceResult<UpdateRecordResult>>;
299
+ /**
300
+ * Deletes a record from a Salesforce object.
301
+ *
302
+ * Uses the REST API DELETE /sobjects/{objectName}/{recordId} endpoint to delete a record.
303
+ * Does not use caching since write operations should always execute.
304
+ *
305
+ * @param objectName - The API name of the object (e.g., 'Account', 'Contact')
306
+ * @param recordId - The ID of the record to delete
307
+ * @returns ServiceResult containing the delete result with record ID and success status
308
+ */
309
+ deleteRecord(objectName: string, recordId: string): Promise<ServiceResult<DeleteRecordResult>>;
310
+ /**
311
+ * Makes a generic HTTP request to a custom Salesforce REST endpoint.
312
+ *
313
+ * Supports custom Apex REST endpoints and any other Salesforce REST API path.
314
+ * Does not use caching since custom endpoints have unpredictable response shapes.
315
+ *
316
+ * The namespace guard is enforced for write operations (POST, PATCH, PUT, DELETE) that
317
+ * target sObject endpoints (`/sobjects/{objectName}`). Custom Apex REST endpoints
318
+ * (e.g., `/services/apexrest/pnova/v1/...`) and GET requests are not affected.
319
+ *
320
+ * @param httpRequest - The HTTP request configuration
321
+ * @returns ServiceResult containing the deserialized response of type T
322
+ */
323
+ request<T>(httpRequest: HttpRequest): Promise<ServiceResult<T>>;
324
+ /**
325
+ * Invalidates cached entries.
326
+ *
327
+ * @param pattern - Optional pattern to match keys (supports * wildcard). If not provided, clears all entries.
328
+ */
329
+ invalidateCache(pattern?: string): void;
330
+ /**
331
+ * Fetches record counts via the bulk REST endpoint `/limits/recordCount`.
332
+ *
333
+ * @param objectNames - Object API names to fetch counts for
334
+ * @param results - Map to populate with counts
335
+ * @returns true if the REST endpoint succeeded, false if it failed
336
+ */
337
+ private fetchRecordCountsViaRest;
338
+ /**
339
+ * Fallback: fetches record counts via individual SOQL COUNT() queries.
340
+ *
341
+ * @param objectNames - Object API names to fetch counts for
342
+ * @param results - Map to populate with counts
343
+ */
344
+ private fetchRecordCountsViaSoql;
345
+ /**
346
+ * Handles DML insert errors and maps them to appropriate error codes.
347
+ *
348
+ * @param error - The caught error
349
+ * @param startTime - The operation start time for duration calculation
350
+ * @param emptyResult - The empty result to return on failure
351
+ * @param context - Context for logging (object name)
352
+ * @returns ServiceResult with success=false and mapped error code
353
+ */
354
+ private handleInsertError;
355
+ /**
356
+ * Handles DML update errors and maps them to appropriate error codes.
357
+ *
358
+ * @param error - The caught error
359
+ * @param startTime - The operation start time for duration calculation
360
+ * @param emptyResult - The empty result to return on failure
361
+ * @param context - Context for logging (object name/record ID)
362
+ * @returns ServiceResult with success=false and mapped error code
363
+ */
364
+ private handleUpdateError;
365
+ /**
366
+ * Handles DML delete errors and maps them to appropriate error codes.
367
+ *
368
+ * @param error - The caught error
369
+ * @param startTime - The operation start time for duration calculation
370
+ * @param emptyResult - The empty result to return on failure
371
+ * @param context - Context for logging (object name/record ID)
372
+ * @returns ServiceResult with success=false and mapped error code
373
+ */
374
+ private handleDeleteError;
375
+ /**
376
+ * Handles errors and maps them to appropriate error codes.
377
+ *
378
+ * Accepts SfError, jsforce errors, or unknown error types. Extracts Salesforce
379
+ * error codes when available and maps them to adapter-specific error codes.
380
+ *
381
+ * @param error - The caught error (SfError, jsforce error, or unknown)
382
+ * @param startTime - The operation start time for duration calculation
383
+ * @param emptyResult - The empty result to return on failure
384
+ * @param context - Context for logging (e.g., "Account", "global describe")
385
+ * @param defaultErrorCode - The default error code if no SF error code is found
386
+ * @returns ServiceResult with success=false and mapped error code
387
+ */
388
+ private handleError;
389
+ }