@peernova/cuneiform-sf 1.0.2 → 1.0.4-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +81 -30
- package/README.md +168 -134
- package/lib/adapters/connection-facade.d.ts +458 -0
- package/lib/adapters/connection-facade.js +379 -0
- package/lib/adapters/connection-facade.js.map +1 -0
- package/lib/adapters/errors.d.ts +547 -0
- package/lib/adapters/errors.js +937 -0
- package/lib/adapters/errors.js.map +1 -0
- package/lib/adapters/lifecycle.d.ts +112 -0
- package/lib/adapters/lifecycle.js +94 -0
- package/lib/adapters/lifecycle.js.map +1 -0
- package/lib/adapters/rest/cache.d.ts +69 -0
- package/lib/adapters/rest/cache.js +133 -0
- package/lib/adapters/rest/cache.js.map +1 -0
- package/lib/adapters/rest/index.d.ts +11 -0
- package/lib/adapters/rest/index.js +18 -0
- package/lib/adapters/rest/index.js.map +1 -0
- package/lib/adapters/rest/profiling-rest-client.d.ts +137 -0
- package/lib/adapters/rest/profiling-rest-client.js +115 -0
- package/lib/adapters/rest/profiling-rest-client.js.map +1 -0
- package/lib/adapters/rest/rest-api-adapter.d.ts +393 -0
- package/lib/adapters/rest/rest-api-adapter.js +764 -0
- package/lib/adapters/rest/rest-api-adapter.js.map +1 -0
- package/lib/adapters/rest/types.d.ts +34 -0
- package/lib/adapters/rest/types.js +9 -0
- package/lib/adapters/rest/types.js.map +1 -0
- package/lib/adapters/retry.d.ts +91 -0
- package/lib/adapters/retry.js +215 -0
- package/lib/adapters/retry.js.map +1 -0
- package/lib/adapters/soql/cuneiform-query-builder.d.ts +418 -0
- package/lib/adapters/soql/cuneiform-query-builder.js +606 -0
- package/lib/adapters/soql/cuneiform-query-builder.js.map +1 -0
- package/lib/adapters/soql/soql-query-adapter.d.ts +141 -0
- package/lib/adapters/soql/soql-query-adapter.js +259 -0
- package/lib/adapters/soql/soql-query-adapter.js.map +1 -0
- package/lib/adapters/soql/types.d.ts +37 -0
- package/lib/adapters/soql/types.js +19 -0
- package/lib/adapters/soql/types.js.map +1 -0
- package/lib/adapters/testing/index.d.ts +37 -0
- package/lib/adapters/testing/index.js +20 -0
- package/lib/adapters/testing/index.js.map +1 -0
- package/lib/adapters/testing/mock-connection.d.ts +77 -0
- package/lib/adapters/testing/mock-connection.js +207 -0
- package/lib/adapters/testing/mock-connection.js.map +1 -0
- package/lib/adapters/testing/mock-logger.d.ts +29 -0
- package/lib/adapters/testing/mock-logger.js +57 -0
- package/lib/adapters/testing/mock-logger.js.map +1 -0
- package/lib/adapters/testing/mock-mcp-adapters.d.ts +32 -0
- package/lib/adapters/testing/mock-mcp-adapters.js +52 -0
- package/lib/adapters/testing/mock-mcp-adapters.js.map +1 -0
- package/lib/adapters/testing/mock-oclif-config.d.ts +22 -0
- package/lib/adapters/testing/mock-oclif-config.js +90 -0
- package/lib/adapters/testing/mock-oclif-config.js.map +1 -0
- package/lib/adapters/testing/mock-rest-adapter.d.ts +26 -0
- package/lib/adapters/testing/mock-rest-adapter.js +243 -0
- package/lib/adapters/testing/mock-rest-adapter.js.map +1 -0
- package/lib/adapters/testing/mock-salesforce-connection.d.ts +40 -0
- package/lib/adapters/testing/mock-salesforce-connection.js +61 -0
- package/lib/adapters/testing/mock-salesforce-connection.js.map +1 -0
- package/lib/adapters/testing/mock-soql-adapter.d.ts +30 -0
- package/lib/adapters/testing/mock-soql-adapter.js +120 -0
- package/lib/adapters/testing/mock-soql-adapter.js.map +1 -0
- package/lib/adapters/testing/mock-tooling-adapter.d.ts +24 -0
- package/lib/adapters/testing/mock-tooling-adapter.js +163 -0
- package/lib/adapters/testing/mock-tooling-adapter.js.map +1 -0
- package/lib/adapters/testing/stub-connection.d.ts +93 -0
- package/lib/adapters/testing/stub-connection.js +97 -0
- package/lib/adapters/testing/stub-connection.js.map +1 -0
- package/lib/adapters/testing/stub-rest-adapter.d.ts +52 -0
- package/lib/adapters/testing/stub-rest-adapter.js +58 -0
- package/lib/adapters/testing/stub-rest-adapter.js.map +1 -0
- package/lib/adapters/testing/stub-soql-adapter.d.ts +56 -0
- package/lib/adapters/testing/stub-soql-adapter.js +50 -0
- package/lib/adapters/testing/stub-soql-adapter.js.map +1 -0
- package/lib/adapters/testing/types.d.ts +71 -0
- package/lib/adapters/testing/types.js +9 -0
- package/lib/adapters/testing/types.js.map +1 -0
- package/lib/adapters/tooling/index.d.ts +10 -0
- package/lib/adapters/tooling/index.js +17 -0
- package/lib/adapters/tooling/index.js.map +1 -0
- package/lib/adapters/tooling/tooling-api-adapter.d.ts +157 -0
- package/lib/adapters/tooling/tooling-api-adapter.js +339 -0
- package/lib/adapters/tooling/tooling-api-adapter.js.map +1 -0
- package/lib/adapters/tooling/types.d.ts +81 -0
- package/lib/adapters/tooling/types.js +9 -0
- package/lib/adapters/tooling/types.js.map +1 -0
- package/lib/adapters/types.d.ts +112 -0
- package/lib/adapters/types.js +169 -0
- package/lib/adapters/types.js.map +1 -0
- package/lib/base/cuneiform-command.d.ts +175 -0
- package/lib/base/cuneiform-command.js +326 -0
- package/lib/base/cuneiform-command.js.map +1 -0
- package/lib/commands/cuneiform/compatibility/check.d.ts +43 -0
- package/lib/commands/cuneiform/compatibility/check.js +114 -0
- package/lib/commands/cuneiform/compatibility/check.js.map +1 -0
- package/lib/commands/cuneiform/definition/create.d.ts +120 -0
- package/lib/commands/cuneiform/definition/create.js +737 -0
- package/lib/commands/cuneiform/definition/create.js.map +1 -0
- package/lib/commands/cuneiform/definition/export.d.ts +57 -0
- package/lib/commands/cuneiform/definition/export.js +133 -0
- package/lib/commands/cuneiform/definition/export.js.map +1 -0
- package/lib/commands/cuneiform/definition/get.d.ts +86 -0
- package/lib/commands/cuneiform/definition/get.js +277 -0
- package/lib/commands/cuneiform/definition/get.js.map +1 -0
- package/lib/commands/cuneiform/definition/import.d.ts +54 -0
- package/lib/commands/cuneiform/definition/import.js +118 -0
- package/lib/commands/cuneiform/definition/import.js.map +1 -0
- package/lib/commands/cuneiform/definition/list.d.ts +110 -0
- package/lib/commands/cuneiform/definition/list.js +351 -0
- package/lib/commands/cuneiform/definition/list.js.map +1 -0
- package/lib/commands/cuneiform/definition/purge.d.ts +109 -0
- package/lib/commands/cuneiform/definition/purge.js +578 -0
- package/lib/commands/cuneiform/definition/purge.js.map +1 -0
- package/lib/commands/cuneiform/definition/update.d.ts +58 -0
- package/lib/commands/cuneiform/definition/update.js +209 -0
- package/lib/commands/cuneiform/definition/update.js.map +1 -0
- package/lib/commands/cuneiform/mcp/serve.d.ts +56 -0
- package/lib/commands/cuneiform/mcp/serve.js +109 -0
- package/lib/commands/cuneiform/mcp/serve.js.map +1 -0
- package/lib/commands/cuneiform/object/describe.d.ts +61 -0
- package/lib/commands/cuneiform/object/describe.js +461 -0
- package/lib/commands/cuneiform/object/describe.js.map +1 -0
- package/lib/commands/cuneiform/object/list.d.ts +123 -0
- package/lib/commands/cuneiform/object/list.js +264 -0
- package/lib/commands/cuneiform/object/list.js.map +1 -0
- package/lib/commands/cuneiform/org/details.d.ts +99 -0
- package/lib/commands/cuneiform/org/details.js +521 -0
- package/lib/commands/cuneiform/org/details.js.map +1 -0
- package/lib/commands/cuneiform/org/reset.d.ts +46 -0
- package/lib/commands/cuneiform/org/reset.js +135 -0
- package/lib/commands/cuneiform/org/reset.js.map +1 -0
- package/lib/commands/cuneiform/profile/request/cancel.d.ts +59 -0
- package/lib/commands/cuneiform/profile/request/cancel.js +202 -0
- package/lib/commands/cuneiform/profile/request/cancel.js.map +1 -0
- package/lib/commands/cuneiform/profile/request/delete.d.ts +59 -0
- package/lib/commands/cuneiform/profile/request/delete.js +223 -0
- package/lib/commands/cuneiform/profile/request/delete.js.map +1 -0
- package/lib/commands/cuneiform/profile/request/list.d.ts +35 -0
- package/lib/commands/cuneiform/profile/request/list.js +102 -0
- package/lib/commands/cuneiform/profile/request/list.js.map +1 -0
- package/lib/commands/cuneiform/profile.d.ts +93 -0
- package/lib/commands/cuneiform/profile.js +353 -0
- package/lib/commands/cuneiform/profile.js.map +1 -0
- package/lib/commands/cuneiform/summary/purge.d.ts +80 -0
- package/lib/commands/cuneiform/summary/purge.js +467 -0
- package/lib/commands/cuneiform/summary/purge.js.map +1 -0
- package/lib/commands/cuneiform/summary/reprofile.d.ts +60 -0
- package/lib/commands/cuneiform/summary/reprofile.js +236 -0
- package/lib/commands/cuneiform/summary/reprofile.js.map +1 -0
- package/lib/commands/cuneiform/summary/stop.d.ts +59 -0
- package/lib/commands/cuneiform/summary/stop.js +234 -0
- package/lib/commands/cuneiform/summary/stop.js.map +1 -0
- package/lib/commands/cuneiform/user/details.d.ts +77 -0
- package/lib/commands/cuneiform/user/details.js +414 -0
- package/lib/commands/cuneiform/user/details.js.map +1 -0
- package/lib/constants/namespace-constants.d.ts +102 -0
- package/lib/constants/namespace-constants.js +225 -0
- package/lib/constants/namespace-constants.js.map +1 -0
- package/lib/debug/command-debug-proxy.d.ts +101 -0
- package/lib/debug/command-debug-proxy.js +171 -0
- package/lib/debug/command-debug-proxy.js.map +1 -0
- package/lib/debug/debug-logger.d.ts +85 -0
- package/lib/debug/debug-logger.js +133 -0
- package/lib/debug/debug-logger.js.map +1 -0
- package/lib/debug/service-debug-proxy.d.ts +30 -0
- package/lib/debug/service-debug-proxy.js +102 -0
- package/lib/debug/service-debug-proxy.js.map +1 -0
- package/lib/hooks/prerun.d.ts +25 -0
- package/lib/hooks/prerun.js +47 -0
- package/lib/hooks/prerun.js.map +1 -0
- package/lib/mcp/config/mcp-config.d.ts +55 -0
- package/lib/mcp/config/mcp-config.js +51 -0
- package/lib/mcp/config/mcp-config.js.map +1 -0
- package/lib/mcp/config/pagination.d.ts +96 -0
- package/lib/mcp/config/pagination.js +108 -0
- package/lib/mcp/config/pagination.js.map +1 -0
- package/lib/mcp/config/system-prompts.d.ts +18 -0
- package/lib/mcp/config/system-prompts.js +92 -0
- package/lib/mcp/config/system-prompts.js.map +1 -0
- package/lib/mcp/errors.d.ts +23 -0
- package/lib/mcp/errors.js +27 -0
- package/lib/mcp/errors.js.map +1 -0
- package/lib/mcp/schemas/input-schemas.d.ts +327 -0
- package/lib/mcp/schemas/input-schemas.js +310 -0
- package/lib/mcp/schemas/input-schemas.js.map +1 -0
- package/lib/mcp/server.d.ts +40 -0
- package/lib/mcp/server.js +316 -0
- package/lib/mcp/server.js.map +1 -0
- package/lib/mcp/tools/contactpoint-tools.d.ts +14 -0
- package/lib/mcp/tools/contactpoint-tools.js +34 -0
- package/lib/mcp/tools/contactpoint-tools.js.map +1 -0
- package/lib/mcp/tools/definition-io-tools.d.ts +19 -0
- package/lib/mcp/tools/definition-io-tools.js +152 -0
- package/lib/mcp/tools/definition-io-tools.js.map +1 -0
- package/lib/mcp/tools/definition-tools.d.ts +51 -0
- package/lib/mcp/tools/definition-tools.js +220 -0
- package/lib/mcp/tools/definition-tools.js.map +1 -0
- package/lib/mcp/tools/index.d.ts +37 -0
- package/lib/mcp/tools/index.js +88 -0
- package/lib/mcp/tools/index.js.map +1 -0
- package/lib/mcp/tools/object-tools.d.ts +22 -0
- package/lib/mcp/tools/object-tools.js +327 -0
- package/lib/mcp/tools/object-tools.js.map +1 -0
- package/lib/mcp/tools/org-tools.d.ts +14 -0
- package/lib/mcp/tools/org-tools.js +177 -0
- package/lib/mcp/tools/org-tools.js.map +1 -0
- package/lib/mcp/tools/profile-tools.d.ts +59 -0
- package/lib/mcp/tools/profile-tools.js +213 -0
- package/lib/mcp/tools/profile-tools.js.map +1 -0
- package/lib/mcp/tools/summary-tools.d.ts +14 -0
- package/lib/mcp/tools/summary-tools.js +38 -0
- package/lib/mcp/tools/summary-tools.js.map +1 -0
- package/lib/mcp/tools/tool-factory.d.ts +63 -0
- package/lib/mcp/tools/tool-factory.js +146 -0
- package/lib/mcp/tools/tool-factory.js.map +1 -0
- package/lib/mcp/tools/user-tools.d.ts +25 -0
- package/lib/mcp/tools/user-tools.js +167 -0
- package/lib/mcp/tools/user-tools.js.map +1 -0
- package/lib/models/cascade-skip-accumulator.d.ts +25 -0
- package/lib/models/cascade-skip-accumulator.js +9 -0
- package/lib/models/cascade-skip-accumulator.js.map +1 -0
- package/lib/models/date-literal.d.ts +280 -0
- package/lib/models/date-literal.js +1164 -0
- package/lib/models/date-literal.js.map +1 -0
- package/lib/models/object-describe-types.d.ts +173 -0
- package/lib/models/object-describe-types.js +9 -0
- package/lib/models/object-describe-types.js.map +1 -0
- package/lib/models/portability-recipe.d.ts +35 -0
- package/lib/models/portability-recipe.js +113 -0
- package/lib/models/portability-recipe.js.map +1 -0
- package/lib/models/profile-request-types.d.ts +118 -0
- package/lib/models/profile-request-types.js +23 -0
- package/lib/models/profile-request-types.js.map +1 -0
- package/lib/models/profiling-execution-types.d.ts +154 -0
- package/lib/models/profiling-execution-types.js +14 -0
- package/lib/models/profiling-execution-types.js.map +1 -0
- package/lib/models/service-result.d.ts +114 -0
- package/lib/models/service-result.js +81 -0
- package/lib/models/service-result.js.map +1 -0
- package/lib/models/sfdmu-types.d.ts +49 -0
- package/lib/models/sfdmu-types.js +23 -0
- package/lib/models/sfdmu-types.js.map +1 -0
- package/lib/models/status-types.d.ts +38 -0
- package/lib/models/status-types.js +12 -0
- package/lib/models/status-types.js.map +1 -0
- package/lib/models/summary-bulk-types.d.ts +61 -0
- package/lib/models/summary-bulk-types.js +23 -0
- package/lib/models/summary-bulk-types.js.map +1 -0
- package/lib/models/user-details-types.d.ts +188 -0
- package/lib/models/user-details-types.js +9 -0
- package/lib/models/user-details-types.js.map +1 -0
- package/lib/models/year-range.d.ts +78 -0
- package/lib/models/year-range.js +153 -0
- package/lib/models/year-range.js.map +1 -0
- package/lib/operations/CompatibilityCheckOperation.d.ts +62 -0
- package/lib/operations/CompatibilityCheckOperation.js +102 -0
- package/lib/operations/CompatibilityCheckOperation.js.map +1 -0
- package/lib/operations/DefinitionCreateOperation.d.ts +427 -0
- package/lib/operations/DefinitionCreateOperation.js +1270 -0
- package/lib/operations/DefinitionCreateOperation.js.map +1 -0
- package/lib/operations/DefinitionExportOperation.d.ts +155 -0
- package/lib/operations/DefinitionExportOperation.js +281 -0
- package/lib/operations/DefinitionExportOperation.js.map +1 -0
- package/lib/operations/DefinitionImportOperation.d.ts +144 -0
- package/lib/operations/DefinitionImportOperation.js +357 -0
- package/lib/operations/DefinitionImportOperation.js.map +1 -0
- package/lib/operations/DefinitionListOperation.d.ts +66 -0
- package/lib/operations/DefinitionListOperation.js +108 -0
- package/lib/operations/DefinitionListOperation.js.map +1 -0
- package/lib/operations/DefinitionPurgeOperation.d.ts +203 -0
- package/lib/operations/DefinitionPurgeOperation.js +465 -0
- package/lib/operations/DefinitionPurgeOperation.js.map +1 -0
- package/lib/operations/DefinitionUpdateOperation.d.ts +78 -0
- package/lib/operations/DefinitionUpdateOperation.js +142 -0
- package/lib/operations/DefinitionUpdateOperation.js.map +1 -0
- package/lib/operations/OrgDetailsOperation.d.ts +253 -0
- package/lib/operations/OrgDetailsOperation.js +456 -0
- package/lib/operations/OrgDetailsOperation.js.map +1 -0
- package/lib/operations/OrgResetOperation.d.ts +114 -0
- package/lib/operations/OrgResetOperation.js +209 -0
- package/lib/operations/OrgResetOperation.js.map +1 -0
- package/lib/operations/ProfileOperation.d.ts +192 -0
- package/lib/operations/ProfileOperation.js +371 -0
- package/lib/operations/ProfileOperation.js.map +1 -0
- package/lib/operations/ProfileRequestCancelOperation.d.ts +59 -0
- package/lib/operations/ProfileRequestCancelOperation.js +137 -0
- package/lib/operations/ProfileRequestCancelOperation.js.map +1 -0
- package/lib/operations/ProfileRequestDeleteOperation.d.ts +64 -0
- package/lib/operations/ProfileRequestDeleteOperation.js +134 -0
- package/lib/operations/ProfileRequestDeleteOperation.js.map +1 -0
- package/lib/operations/ProfileRequestListOperation.d.ts +39 -0
- package/lib/operations/ProfileRequestListOperation.js +61 -0
- package/lib/operations/ProfileRequestListOperation.js.map +1 -0
- package/lib/operations/SummaryPurgeOperation.d.ts +134 -0
- package/lib/operations/SummaryPurgeOperation.js +257 -0
- package/lib/operations/SummaryPurgeOperation.js.map +1 -0
- package/lib/operations/SummaryReprofileOperation.d.ts +88 -0
- package/lib/operations/SummaryReprofileOperation.js +174 -0
- package/lib/operations/SummaryReprofileOperation.js.map +1 -0
- package/lib/operations/SummaryStopOperation.d.ts +87 -0
- package/lib/operations/SummaryStopOperation.js +175 -0
- package/lib/operations/SummaryStopOperation.js.map +1 -0
- package/lib/services/BulkExecutionService.d.ts +120 -0
- package/lib/services/BulkExecutionService.js +535 -0
- package/lib/services/BulkExecutionService.js.map +1 -0
- package/lib/services/CompatibilityService.d.ts +81 -0
- package/lib/services/CompatibilityService.js +118 -0
- package/lib/services/CompatibilityService.js.map +1 -0
- package/lib/services/ConfigureMode.d.ts +98 -0
- package/lib/services/ConfigureMode.js +413 -0
- package/lib/services/ConfigureMode.js.map +1 -0
- package/lib/services/ContactPointService.d.ts +111 -0
- package/lib/services/ContactPointService.js +286 -0
- package/lib/services/ContactPointService.js.map +1 -0
- package/lib/services/DataAvailabilityService.d.ts +81 -0
- package/lib/services/DataAvailabilityService.js +128 -0
- package/lib/services/DataAvailabilityService.js.map +1 -0
- package/lib/services/DefinitionFieldGenerationService.d.ts +357 -0
- package/lib/services/DefinitionFieldGenerationService.js +899 -0
- package/lib/services/DefinitionFieldGenerationService.js.map +1 -0
- package/lib/services/DefinitionQueryBuilder.d.ts +92 -0
- package/lib/services/DefinitionQueryBuilder.js +328 -0
- package/lib/services/DefinitionQueryBuilder.js.map +1 -0
- package/lib/services/ObjectDescribeService.d.ts +436 -0
- package/lib/services/ObjectDescribeService.js +881 -0
- package/lib/services/ObjectDescribeService.js.map +1 -0
- package/lib/services/ObjectFilteringService.d.ts +484 -0
- package/lib/services/ObjectFilteringService.js +1080 -0
- package/lib/services/ObjectFilteringService.js.map +1 -0
- package/lib/services/ObjectListCommandService.d.ts +467 -0
- package/lib/services/ObjectListCommandService.js +904 -0
- package/lib/services/ObjectListCommandService.js.map +1 -0
- package/lib/services/ObjectListService.d.ts +201 -0
- package/lib/services/ObjectListService.js +350 -0
- package/lib/services/ObjectListService.js.map +1 -0
- package/lib/services/OrgInfoService.d.ts +493 -0
- package/lib/services/OrgInfoService.js +1142 -0
- package/lib/services/OrgInfoService.js.map +1 -0
- package/lib/services/PollingService.d.ts +105 -0
- package/lib/services/PollingService.js +117 -0
- package/lib/services/PollingService.js.map +1 -0
- package/lib/services/ProfileRequestService.d.ts +186 -0
- package/lib/services/ProfileRequestService.js +555 -0
- package/lib/services/ProfileRequestService.js.map +1 -0
- package/lib/services/ProfilingDefinitionService.d.ts +575 -0
- package/lib/services/ProfilingDefinitionService.js +1029 -0
- package/lib/services/ProfilingDefinitionService.js.map +1 -0
- package/lib/services/ProfilingExecutionService.d.ts +122 -0
- package/lib/services/ProfilingExecutionService.js +320 -0
- package/lib/services/ProfilingExecutionService.js.map +1 -0
- package/lib/services/ProfilingSummaryService.d.ts +292 -0
- package/lib/services/ProfilingSummaryService.js +688 -0
- package/lib/services/ProfilingSummaryService.js.map +1 -0
- package/lib/services/RecordTypeService.d.ts +129 -0
- package/lib/services/RecordTypeService.js +284 -0
- package/lib/services/RecordTypeService.js.map +1 -0
- package/lib/services/SFDMUService.d.ts +146 -0
- package/lib/services/SFDMUService.js +323 -0
- package/lib/services/SFDMUService.js.map +1 -0
- package/lib/services/TabDetectionService.d.ts +105 -0
- package/lib/services/TabDetectionService.js +206 -0
- package/lib/services/TabDetectionService.js.map +1 -0
- package/lib/services/UnconfigureMode.d.ts +74 -0
- package/lib/services/UnconfigureMode.js +378 -0
- package/lib/services/UnconfigureMode.js.map +1 -0
- package/lib/services/UserConfigurationService.d.ts +158 -0
- package/lib/services/UserConfigurationService.js +574 -0
- package/lib/services/UserConfigurationService.js.map +1 -0
- package/lib/services/UserConfigurationTypes.d.ts +181 -0
- package/lib/services/UserConfigurationTypes.js +14 -0
- package/lib/services/UserConfigurationTypes.js.map +1 -0
- package/lib/services/UserReadinessService.d.ts +347 -0
- package/lib/services/UserReadinessService.js +891 -0
- package/lib/services/UserReadinessService.js.map +1 -0
- package/lib/services/constants.d.ts +54 -0
- package/lib/services/constants.js +71 -0
- package/lib/services/constants.js.map +1 -0
- package/lib/services/namespace-constants.d.ts +1 -0
- package/lib/services/namespace-constants.js +11 -0
- package/lib/services/namespace-constants.js.map +1 -0
- package/lib/services/namespace-filter.d.ts +36 -0
- package/lib/services/namespace-filter.js +109 -0
- package/lib/services/namespace-filter.js.map +1 -0
- package/lib/services/validation.d.ts +47 -0
- package/lib/services/validation.js +119 -0
- package/lib/services/validation.js.map +1 -0
- package/lib/utils/batch-processor.d.ts +13 -0
- package/lib/utils/batch-processor.js +39 -0
- package/lib/utils/batch-processor.js.map +1 -0
- package/lib/utils/formatting/availability-grid.d.ts +81 -0
- package/lib/utils/formatting/availability-grid.js +94 -0
- package/lib/utils/formatting/availability-grid.js.map +1 -0
- package/lib/utils/formatting/business-process-grid.d.ts +51 -0
- package/lib/utils/formatting/business-process-grid.js +58 -0
- package/lib/utils/formatting/business-process-grid.js.map +1 -0
- package/lib/utils/formatting/command-display.d.ts +154 -0
- package/lib/utils/formatting/command-display.js +154 -0
- package/lib/utils/formatting/command-display.js.map +1 -0
- package/lib/utils/formatting/definition-create-display.d.ts +118 -0
- package/lib/utils/formatting/definition-create-display.js +230 -0
- package/lib/utils/formatting/definition-create-display.js.map +1 -0
- package/lib/utils/formatting/empty-states.d.ts +35 -0
- package/lib/utils/formatting/empty-states.js +70 -0
- package/lib/utils/formatting/empty-states.js.map +1 -0
- package/lib/utils/formatting/errors.d.ts +33 -0
- package/lib/utils/formatting/errors.js +72 -0
- package/lib/utils/formatting/errors.js.map +1 -0
- package/lib/utils/formatting/field-types.d.ts +32 -0
- package/lib/utils/formatting/field-types.js +88 -0
- package/lib/utils/formatting/field-types.js.map +1 -0
- package/lib/utils/formatting/index.d.ts +29 -0
- package/lib/utils/formatting/index.js +28 -0
- package/lib/utils/formatting/index.js.map +1 -0
- package/lib/utils/formatting/indicators.d.ts +113 -0
- package/lib/utils/formatting/indicators.js +161 -0
- package/lib/utils/formatting/indicators.js.map +1 -0
- package/lib/utils/formatting/loading-messages.d.ts +37 -0
- package/lib/utils/formatting/loading-messages.js +50 -0
- package/lib/utils/formatting/loading-messages.js.map +1 -0
- package/lib/utils/formatting/namespace-display.d.ts +31 -0
- package/lib/utils/formatting/namespace-display.js +64 -0
- package/lib/utils/formatting/namespace-display.js.map +1 -0
- package/lib/utils/formatting/numbers.d.ts +73 -0
- package/lib/utils/formatting/numbers.js +187 -0
- package/lib/utils/formatting/numbers.js.map +1 -0
- package/lib/utils/formatting/object-describe-display.d.ts +117 -0
- package/lib/utils/formatting/object-describe-display.js +447 -0
- package/lib/utils/formatting/object-describe-display.js.map +1 -0
- package/lib/utils/formatting/object-list-display.d.ts +225 -0
- package/lib/utils/formatting/object-list-display.js +718 -0
- package/lib/utils/formatting/object-list-display.js.map +1 -0
- package/lib/utils/formatting/org-identity.d.ts +15 -0
- package/lib/utils/formatting/org-identity.js +28 -0
- package/lib/utils/formatting/org-identity.js.map +1 -0
- package/lib/utils/formatting/record-age-grid.d.ts +41 -0
- package/lib/utils/formatting/record-age-grid.js +56 -0
- package/lib/utils/formatting/record-age-grid.js.map +1 -0
- package/lib/utils/formatting/sections.d.ts +108 -0
- package/lib/utils/formatting/sections.js +150 -0
- package/lib/utils/formatting/sections.js.map +1 -0
- package/lib/utils/formatting/tables.d.ts +90 -0
- package/lib/utils/formatting/tables.js +113 -0
- package/lib/utils/formatting/tables.js.map +1 -0
- package/lib/utils/formatting/user-details-display.d.ts +101 -0
- package/lib/utils/formatting/user-details-display.js +425 -0
- package/lib/utils/formatting/user-details-display.js.map +1 -0
- package/lib/utils/pagination/keypress-reader.d.ts +20 -0
- package/lib/utils/pagination/keypress-reader.js +63 -0
- package/lib/utils/pagination/keypress-reader.js.map +1 -0
- package/lib/utils/pagination/paginate-output.d.ts +48 -0
- package/lib/utils/pagination/paginate-output.js +136 -0
- package/lib/utils/pagination/paginate-output.js.map +1 -0
- package/messages/compatibility.check.md +71 -0
- package/messages/cuneiform.access.md +138 -0
- package/messages/definition.create.md +525 -0
- package/messages/definition.export.md +84 -0
- package/messages/definition.get.md +147 -0
- package/messages/definition.import.md +65 -0
- package/messages/definition.list.md +264 -0
- package/messages/definition.purge.md +330 -0
- package/messages/definition.update.md +118 -0
- package/messages/mcp.serve.md +66 -0
- package/messages/object.describe.md +205 -0
- package/messages/object.list.md +463 -0
- package/messages/org.details.md +386 -0
- package/messages/org.reset.md +71 -0
- package/messages/profile.md +243 -0
- package/messages/profile.request.cancel.md +143 -0
- package/messages/profile.request.delete.md +139 -0
- package/messages/profile.request.list.md +89 -0
- package/messages/summary.purge.md +218 -0
- package/messages/summary.reprofile.md +150 -0
- package/messages/summary.stop.md +157 -0
- package/messages/user.details.md +501 -0
- package/oclif.lock +3267 -2148
- package/oclif.manifest.json +2829 -31
- package/package.json +104 -18
- package/lib/commands/cuneiform/about.d.ts +0 -13
- package/lib/commands/cuneiform/about.js +0 -26
- package/lib/commands/cuneiform/about.js.map +0 -1
- package/lib/commands/hello/world.d.ts +0 -14
- package/lib/commands/hello/world.js +0 -27
- package/lib/commands/hello/world.js.map +0 -1
- package/lib/index.d.ts +0 -2
- package/lib/index.js +0 -2
- package/lib/index.js.map +0 -1
- package/messages/cuneiform.about.md +0 -19
- package/messages/hello.world.md +0 -29
|
@@ -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=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,IAAI,eAAe,EAAE,CACnE,CAAC;QACJ,CAAC;QAED,4DAA4D;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,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared accumulator for cascade-mode skip tracking in `DefinitionCreateOperation`.
|
|
3
|
+
*
|
|
4
|
+
* When `--method full` orchestrates multiple input builders (record-type, outcome),
|
|
5
|
+
* per-object "skipping" warnings would be false: the object survives the run with
|
|
6
|
+
* other variants. The cascade caller allocates this accumulator and passes it down
|
|
7
|
+
* to the empty-result branches of each builder. Builders push the skipped object's
|
|
8
|
+
* name into the relevant bucket instead of pushing a per-object warning. The cascade
|
|
9
|
+
* caller then emits at most one aggregated summary warning after both builders run.
|
|
10
|
+
*
|
|
11
|
+
* Standalone callers (`--method recordtype`, `--method outcome`) pass nothing — per-object
|
|
12
|
+
* warning behavior is unchanged at line 910 (RT) and line 1021 (outcome) of their
|
|
13
|
+
* respective files.
|
|
14
|
+
*
|
|
15
|
+
* Presence/absence of the accumulator IS the caller-context signal — no enum needed.
|
|
16
|
+
*
|
|
17
|
+
* CLI-3611: `noOutcomeField` bucket removed. In `--method full`, outcome support is
|
|
18
|
+
* limited to Opportunity/Case/Lead by Salesforce platform design. Silently skipping
|
|
19
|
+
* objects without outcome fields is expected behavior — emitting a warning implies
|
|
20
|
+
* something went wrong, which is misleading.
|
|
21
|
+
*/
|
|
22
|
+
export type CascadeSkipAccumulator = {
|
|
23
|
+
/** Object names where `RecordTypeService` returned zero record types (empty-result branch). */
|
|
24
|
+
noRecordTypes: string[];
|
|
25
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=cascade-skip-accumulator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cascade-skip-accumulator.js","sourceRoot":"","sources":["../../src/models/cascade-skip-accumulator.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|
|
@@ -0,0 +1,280 @@
|
|
|
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
|
+
import type { ExpressionLine } from '../services/DefinitionFieldGenerationService.js';
|
|
11
|
+
/**
|
|
12
|
+
* The 52 date literals supported by the ISV DateLiteral.cls (after CLI-3419).
|
|
13
|
+
* These are the ONLY literals the CLI should generate — they correspond 1:1
|
|
14
|
+
* to the constants in the ISV product's DateLiteral class.
|
|
15
|
+
*
|
|
16
|
+
* Pre-CLI-3419 vocabulary was 14 entries (year-tier cap of 4 + 4 base
|
|
17
|
+
* non-year-tier + 2 span). CLI-3419 raises the cap to 10 across all
|
|
18
|
+
* non-span tiers, extending the cascade vocabulary to N_X_AGO:2..9 for
|
|
19
|
+
* day/week/month/quarter and N_YEARS_AGO:4..9 for year.
|
|
20
|
+
*/
|
|
21
|
+
export declare const SUPPORTED_DATE_LITERALS: readonly ["TODAY", "YESTERDAY", "N_DAYS_AGO:2", "N_DAYS_AGO:3", "N_DAYS_AGO:4", "N_DAYS_AGO:5", "N_DAYS_AGO:6", "N_DAYS_AGO:7", "N_DAYS_AGO:8", "N_DAYS_AGO:9", "THIS_WEEK", "LAST_WEEK", "N_WEEKS_AGO:2", "N_WEEKS_AGO:3", "N_WEEKS_AGO:4", "N_WEEKS_AGO:5", "N_WEEKS_AGO:6", "N_WEEKS_AGO:7", "N_WEEKS_AGO:8", "N_WEEKS_AGO:9", "THIS_MONTH", "LAST_MONTH", "N_MONTHS_AGO:2", "N_MONTHS_AGO:3", "N_MONTHS_AGO:4", "N_MONTHS_AGO:5", "N_MONTHS_AGO:6", "N_MONTHS_AGO:7", "N_MONTHS_AGO:8", "N_MONTHS_AGO:9", "THIS_QUARTER", "LAST_QUARTER", "N_QUARTERS_AGO:2", "N_QUARTERS_AGO:3", "N_QUARTERS_AGO:4", "N_QUARTERS_AGO:5", "N_QUARTERS_AGO:6", "N_QUARTERS_AGO:7", "N_QUARTERS_AGO:8", "N_QUARTERS_AGO:9", "THIS_YEAR", "LAST_YEAR", "N_YEARS_AGO:2", "N_YEARS_AGO:3", "N_YEARS_AGO:4", "N_YEARS_AGO:5", "N_YEARS_AGO:6", "N_YEARS_AGO:7", "N_YEARS_AGO:8", "N_YEARS_AGO:9", "LAST_N_YEARS:2", "LAST_N_YEARS:3"];
|
|
22
|
+
/** Type representing any supported date literal value */
|
|
23
|
+
export type SupportedDateLiteral = (typeof SUPPORTED_DATE_LITERALS)[number];
|
|
24
|
+
/**
|
|
25
|
+
* Customer-facing labels for each date literal.
|
|
26
|
+
* Used in definition names, descriptions, and time category display.
|
|
27
|
+
*
|
|
28
|
+
* Word-form convention for N≥2 mirrors the existing year-tier labels
|
|
29
|
+
* ("Two Years Ago", "Three Years Ago") — see CLI-3419 Decision #3.
|
|
30
|
+
*/
|
|
31
|
+
export declare const DATE_LITERAL_LABELS: Record<SupportedDateLiteral, string>;
|
|
32
|
+
/**
|
|
33
|
+
* Date literal tier classification.
|
|
34
|
+
*
|
|
35
|
+
* Each tier determines the maximum allowed depth for cascading. After
|
|
36
|
+
* CLI-3419, non-span tiers cascade across offsets 0..9 using the native
|
|
37
|
+
* SOQL N_X_AGO:n literals — definitions stay rolling:
|
|
38
|
+
* - year: THIS_YEAR → LAST_YEAR → N_YEARS_AGO:2..9 (10 entries)
|
|
39
|
+
* - quarter: THIS_QUARTER → LAST_QUARTER → N_QUARTERS_AGO:2..9 (10 entries)
|
|
40
|
+
* - month: THIS_MONTH → LAST_MONTH → N_MONTHS_AGO:2..9 (10 entries)
|
|
41
|
+
* - week: THIS_WEEK → LAST_WEEK → N_WEEKS_AGO:2..9 (10 entries)
|
|
42
|
+
* - day: TODAY → YESTERDAY → N_DAYS_AGO:2..9 (10 entries)
|
|
43
|
+
* - span: depth 0 only (LAST_N_YEARS:2, LAST_N_YEARS:3 combine multiple years)
|
|
44
|
+
*/
|
|
45
|
+
export type DateLiteralTier = 'year' | 'quarter' | 'month' | 'week' | 'day' | 'span';
|
|
46
|
+
/** Maps each literal to its tier */
|
|
47
|
+
export declare const LITERAL_TIERS: Record<SupportedDateLiteral, DateLiteralTier>;
|
|
48
|
+
/**
|
|
49
|
+
* Maximum cascade depth per tier — interpreted as max absolute offset from
|
|
50
|
+
* the current period plus one (offsets 0..MAX-1 are valid).
|
|
51
|
+
*
|
|
52
|
+
* CLI-3419 raised the cap from 4 (year-tier only) to 10 across all non-span
|
|
53
|
+
* tiers. The cascade vocabulary now covers offsets 0..9 — labels "This X"
|
|
54
|
+
* through "Nine X Ago" — at every non-span tier. Span literals
|
|
55
|
+
* (LAST_N_YEARS:2/3) stay at depth 1 because they already aggregate multiple
|
|
56
|
+
* periods (AC4).
|
|
57
|
+
*/
|
|
58
|
+
export declare const TIER_MAX_DEPTH: Record<DateLiteralTier, number>;
|
|
59
|
+
/**
|
|
60
|
+
* Depth cascade arrays per literal.
|
|
61
|
+
*
|
|
62
|
+
* Starting from a given literal at depth 0, each subsequent depth level
|
|
63
|
+
* adds the next literal in the cascade. Cascades always move backward in time.
|
|
64
|
+
*
|
|
65
|
+
* Cap interpretation (CLI-3419): cap=10 means max absolute offset is 9.
|
|
66
|
+
* Each base's cascade contains the literals from its own offset down to the
|
|
67
|
+
* tier max. E.g., LAST_QUARTER (offset 1) cascade has 9 entries
|
|
68
|
+
* (offsets 1..9); N_QUARTERS_AGO:9 cascade has 1 entry.
|
|
69
|
+
*
|
|
70
|
+
* Examples:
|
|
71
|
+
* - THIS_YEAR with depth 3 → [THIS_YEAR, LAST_YEAR, N_YEARS_AGO:2]
|
|
72
|
+
* - THIS_QUARTER with depth 4 → [THIS_QUARTER, LAST_QUARTER, N_QUARTERS_AGO:2, N_QUARTERS_AGO:3]
|
|
73
|
+
*/
|
|
74
|
+
export declare const LITERAL_CASCADES: Record<SupportedDateLiteral, readonly SupportedDateLiteral[]>;
|
|
75
|
+
/**
|
|
76
|
+
* A single entry in a resolved date literal range.
|
|
77
|
+
* Analogous to ComparativeYearEntry in the year-range model.
|
|
78
|
+
*/
|
|
79
|
+
export type DateLiteralEntry = {
|
|
80
|
+
/** The date literal value (e.g., 'THIS_YEAR', 'LAST_QUARTER') */
|
|
81
|
+
readonly literal: SupportedDateLiteral;
|
|
82
|
+
/** Customer-facing label (e.g., 'This Year', 'Last Quarter') */
|
|
83
|
+
readonly label: string;
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* A resolved date literal range for profiling definitions.
|
|
87
|
+
* Analogous to YearRange in the year-range model.
|
|
88
|
+
*
|
|
89
|
+
* Contains the ordered list of date literal entries derived from user input
|
|
90
|
+
* (--date-literal flag + --depth flag).
|
|
91
|
+
*/
|
|
92
|
+
export type DateLiteralRange = {
|
|
93
|
+
/** Ordered list of date literal entries (most recent first) */
|
|
94
|
+
readonly entries: readonly DateLiteralEntry[];
|
|
95
|
+
/** The date field to filter on (default: CreatedDate) */
|
|
96
|
+
readonly dateField: string;
|
|
97
|
+
};
|
|
98
|
+
/**
|
|
99
|
+
* Raw flag inputs for date literal range resolution.
|
|
100
|
+
*/
|
|
101
|
+
export type DateLiteralInput = {
|
|
102
|
+
/** The base date literal (e.g., 'THIS_YEAR') */
|
|
103
|
+
dateLiteral: string;
|
|
104
|
+
/** Number of periods to cascade (counting back from base) */
|
|
105
|
+
depth?: number;
|
|
106
|
+
/** The date field to filter on (default: CreatedDate) */
|
|
107
|
+
dateField?: string;
|
|
108
|
+
};
|
|
109
|
+
/**
|
|
110
|
+
* Validates a date literal value against the ISV-supported set.
|
|
111
|
+
*
|
|
112
|
+
* @param value - The date literal string to validate
|
|
113
|
+
* @returns undefined if valid, error message string if invalid
|
|
114
|
+
*/
|
|
115
|
+
export declare function validateDateLiteral(value: string): string | undefined;
|
|
116
|
+
/**
|
|
117
|
+
* Resolves CLI flag inputs into a validated DateLiteralRange.
|
|
118
|
+
*
|
|
119
|
+
* @param input - Raw flag inputs
|
|
120
|
+
* @returns Resolved DateLiteralRange
|
|
121
|
+
* @throws Error if inputs are invalid
|
|
122
|
+
*/
|
|
123
|
+
export declare function resolveDateLiteralRange(input: DateLiteralInput): DateLiteralRange;
|
|
124
|
+
/**
|
|
125
|
+
* Returns the customer-facing label for a date literal.
|
|
126
|
+
*
|
|
127
|
+
* @param literal - A supported date literal value
|
|
128
|
+
* @returns The label string, or the raw literal if not found
|
|
129
|
+
*/
|
|
130
|
+
export declare function getDateLiteralLabel(literal: string): string;
|
|
131
|
+
/**
|
|
132
|
+
* Customer-facing labels for known date-field API names.
|
|
133
|
+
* Used by humanizeDateField() to render filter labels and description text.
|
|
134
|
+
*/
|
|
135
|
+
export declare const DATE_FIELD_LABELS: Readonly<Record<string, string>>;
|
|
136
|
+
/**
|
|
137
|
+
* Converts a date-field API name into a customer-facing label.
|
|
138
|
+
*
|
|
139
|
+
* Examples:
|
|
140
|
+
* - `humanizeDateField('CreatedDate')` returns `'Created Date'`
|
|
141
|
+
* - `humanizeDateField('LastModifiedDate')` returns `'Last Modified Date'`
|
|
142
|
+
* - `humanizeDateField('SomeCustomDate__c')` returns `'Some Custom Date'`
|
|
143
|
+
* - `humanizeDateField('')` returns `''`
|
|
144
|
+
*
|
|
145
|
+
* Known field names return their canonical label from DATE_FIELD_LABELS.
|
|
146
|
+
* Unknown PascalCase identifiers are split into space-separated words
|
|
147
|
+
* with custom-field `__c` suffix stripped. Falsy input is returned
|
|
148
|
+
* as-is so caller-side `label ? ... : dateField` truthy guards continue
|
|
149
|
+
* to work unchanged.
|
|
150
|
+
*
|
|
151
|
+
* @param dateField - The date-field API name (e.g., 'CreatedDate')
|
|
152
|
+
* @returns The customer-facing label
|
|
153
|
+
*/
|
|
154
|
+
export declare function humanizeDateField(dateField: string): string;
|
|
155
|
+
/**
|
|
156
|
+
* Maps each date literal to its `$Constant.*` display value for the expression builder.
|
|
157
|
+
* These are the values that `fsc_expressionBuilder3` renders in the Value field.
|
|
158
|
+
*
|
|
159
|
+
* Naming mirrors the existing year-tier convention ($Constant.TwoYearsAgo,
|
|
160
|
+
* $Constant.ThreeYearsAgo) — CLI-3419 extends to all non-span tiers.
|
|
161
|
+
*/
|
|
162
|
+
export declare const DATE_LITERAL_CONSTANTS: Record<SupportedDateLiteral, string>;
|
|
163
|
+
/**
|
|
164
|
+
* Builds an ISV-compatible filterJson string for date literal filtering.
|
|
165
|
+
*
|
|
166
|
+
* Produces the full expression builder JSON schema that `fsc_expressionBuilder3` expects,
|
|
167
|
+
* including all 12 required fields per expression line. The `parameter` field uses `$Constant.*`
|
|
168
|
+
* display values and `parameterValue` / `dateLiteral` use the SOQL literal.
|
|
169
|
+
*
|
|
170
|
+
* The outer envelope (hasFilters, setA) is required by ProfilingDefinitionApiService.resolveFilterClause()
|
|
171
|
+
* to enable WHERE clause filtering. setA.json must be an object (not a string) — the API
|
|
172
|
+
* does JSON.serialize() on it.
|
|
173
|
+
*
|
|
174
|
+
* @param dateField - The date/datetime field to filter on (e.g., 'CreatedDate')
|
|
175
|
+
* @param dateLiteral - The date literal value (e.g., 'THIS_YEAR', 'N_YEARS_AGO:2')
|
|
176
|
+
* @param objectName - The Salesforce object API name (e.g., 'Account', 'Lead'). Defaults to empty string for backward compatibility.
|
|
177
|
+
* @param objectLabel - The Salesforce object label (e.g., 'Account', 'Lead'). Defaults to objectName.
|
|
178
|
+
* @returns JSON string compatible with GlobalProfilingService.createProfilingDefinition()
|
|
179
|
+
*/
|
|
180
|
+
export declare function buildDateLiteralFilterJson(dateField: string, dateLiteral: string, objectName?: string, objectLabel?: string): string;
|
|
181
|
+
/**
|
|
182
|
+
* Builds an ISV-compatible filterJson string for date-literal comparative definitions.
|
|
183
|
+
* Creates SetA (primary period) and SetB (prior period), both using SOQL date literals.
|
|
184
|
+
*
|
|
185
|
+
* Used when method='comparative' with a date literal that has a prior period in its cascade.
|
|
186
|
+
* The prior literal is derived from LITERAL_CASCADES[setALiteral][1] by the caller.
|
|
187
|
+
*
|
|
188
|
+
* @param dateField - The date/datetime field to filter on (e.g., 'CreatedDate', 'LastModifiedDate')
|
|
189
|
+
* @param setALiteral - The primary (current) date literal for SetA
|
|
190
|
+
* @param setBLiteral - The prior period date literal for SetB
|
|
191
|
+
* @param objectName - The Salesforce object API name
|
|
192
|
+
* @param objectLabel - The Salesforce object label
|
|
193
|
+
* @returns JSON string with hasFilters, setA, and setB
|
|
194
|
+
*/
|
|
195
|
+
export declare function buildComparativeDateLiteralFilterJson(dateField: string, setALiteral: SupportedDateLiteral, setBLiteral: SupportedDateLiteral, objectName?: string, objectLabel?: string): string;
|
|
196
|
+
/**
|
|
197
|
+
* Formats a year boundary as an ISO 8601 UTC midnight string.
|
|
198
|
+
* Used for explicit date range expressions in year-based comparisons.
|
|
199
|
+
*/
|
|
200
|
+
export declare function yearBoundaryISO(year: number): string;
|
|
201
|
+
/**
|
|
202
|
+
* Formats a year boundary as a human-readable display string (M/d/yyyy, h:mm a).
|
|
203
|
+
* Used for the `parameter` display value in expression builder JSON.
|
|
204
|
+
*/
|
|
205
|
+
export declare function yearBoundaryDisplay(year: number): string;
|
|
206
|
+
/**
|
|
207
|
+
* Builds an ISV-compatible filterJson string for a single year (SetA only, no SetB).
|
|
208
|
+
* Used for historical definitions scoped to a specific year via --year flag.
|
|
209
|
+
*
|
|
210
|
+
* @param dateField - The date/datetime field to filter on (e.g., 'CreatedDate')
|
|
211
|
+
* @param year - The target year
|
|
212
|
+
* @param objectName - The Salesforce object API name
|
|
213
|
+
* @param objectLabel - The Salesforce object label
|
|
214
|
+
* @returns JSON string with hasFilters and setA (no setB)
|
|
215
|
+
*/
|
|
216
|
+
export declare function buildHistoricalYearFilterJson(dateField: string, year: number, objectName?: string, objectLabel?: string): string;
|
|
217
|
+
/**
|
|
218
|
+
* Builds an ISV-compatible filterJson string for year-based comparative definitions.
|
|
219
|
+
* Creates SetA (target year) and SetB (prior year or all prior years) using explicit
|
|
220
|
+
* date range expressions (>= start AND < end), not date literals.
|
|
221
|
+
*
|
|
222
|
+
* This approach supports arbitrary years with no lookback limitation.
|
|
223
|
+
*
|
|
224
|
+
* @param dateField - The date/datetime field to filter on (e.g., 'CreatedDate', 'LastModifiedDate')
|
|
225
|
+
* @param year - The target year for SetA
|
|
226
|
+
* @param usePrior - When true, SetB is all records before the target year. When false, SetB is the prior year.
|
|
227
|
+
* @param objectName - The Salesforce object API name
|
|
228
|
+
* @param objectLabel - The Salesforce object label
|
|
229
|
+
* @returns JSON string with hasFilters, setA, and setB
|
|
230
|
+
*/
|
|
231
|
+
export declare function buildComparativeYearFilterJson(dateField: string, year: number, usePrior: boolean, objectName?: string, objectLabel?: string): string;
|
|
232
|
+
/**
|
|
233
|
+
* Builds an ISV-compatible filterJson string for the lifetime-vs-X comparative variant.
|
|
234
|
+
*
|
|
235
|
+
* SetA is unfiltered (empty expressions array — represents "all records / lifetime"); SetB carries the supplied
|
|
236
|
+
* secondary filter. This is the inverse of `buildComparativeYearFilterJson`, where SetA is the year-scoped set and
|
|
237
|
+
* SetB is the prior-year (or unbounded) set.
|
|
238
|
+
*
|
|
239
|
+
* @param dateField - The date/datetime field to filter on (e.g., 'CreatedDate', 'LastModifiedDate')
|
|
240
|
+
* @param secondary - The secondary filter spec applied to SetB. Accepts `{ kind: 'year', year }` for a year-bounded SetB,
|
|
241
|
+
* or `{ kind: 'dateLiteral', literal }` for a SOQL date-literal SetB.
|
|
242
|
+
* @param objectName - The Salesforce object API name
|
|
243
|
+
* @param objectLabel - The Salesforce object label (defaults to objectName)
|
|
244
|
+
* @returns JSON string with hasFilters, setA (empty), and setB (filtered)
|
|
245
|
+
*/
|
|
246
|
+
export declare function buildLifetimeComparativeFilterJson(dateField: string, secondary: {
|
|
247
|
+
kind: 'year';
|
|
248
|
+
year: number;
|
|
249
|
+
} | {
|
|
250
|
+
kind: 'dateLiteral';
|
|
251
|
+
literal: SupportedDateLiteral;
|
|
252
|
+
}, objectName?: string, objectLabel?: string): string;
|
|
253
|
+
/**
|
|
254
|
+
* Single expression-builder JSON line representing a `RecordTypeId = <rtId>` condition.
|
|
255
|
+
* Matches the 11-field schema (12 with optional `id`) that `fsc_expressionBuilder3` expects,
|
|
256
|
+
* used when scoping a profiling definition to a specific record type.
|
|
257
|
+
*
|
|
258
|
+
* @param rtId - The RecordType Salesforce ID (15 or 18 chars)
|
|
259
|
+
* @param objectName - The Salesforce object API name (e.g., 'Case')
|
|
260
|
+
* @param objectLabel - The Salesforce object label (defaults to objectName)
|
|
261
|
+
* @returns Expression line ready to embed in `setA.json.expressions` / `setB.json.expressions`
|
|
262
|
+
*/
|
|
263
|
+
export declare function buildRecordTypeFilterExpression(rtId: string, objectName?: string, objectLabel?: string): ExpressionLine;
|
|
264
|
+
/**
|
|
265
|
+
* Composes a RecordTypeId scope filter into an existing ISV filterJson envelope so the server
|
|
266
|
+
* restricts profiling SOQL to a single record type. CLI-3834: `--method recordtype` was writing
|
|
267
|
+
* the RT name to `Prop_SegmentCategory__c` (label only) without populating the filter/RT-scope
|
|
268
|
+
* fields. This helper appends the RT condition to `setA` (and `setB` when present) preserving
|
|
269
|
+
* the source `logicType` (defaults to `'AND'` for the legacy canonical builders).
|
|
270
|
+
*
|
|
271
|
+
* When `filterJson` is `undefined`/`null` (Lifetime path), returns a fresh envelope with
|
|
272
|
+
* `setA.json.expressions = [rtExpression]` and `hasFilters: true`.
|
|
273
|
+
*
|
|
274
|
+
* @param filterJson - Existing filterJson string from a `buildXxxFilterJson` helper, or undefined
|
|
275
|
+
* @param rtId - The RecordType Salesforce ID
|
|
276
|
+
* @param objectName - The Salesforce object API name
|
|
277
|
+
* @param objectLabel - The Salesforce object label (defaults to objectName)
|
|
278
|
+
* @returns Updated filterJson string carrying the RT scope on every existing filter side
|
|
279
|
+
*/
|
|
280
|
+
export declare function composeRecordTypeFilter(filterJson: string | undefined, rtId: string, objectName?: string, objectLabel?: string): string;
|