@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.
- package/LICENSE +81 -30
- package/README.md +59 -95
- 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/index.d.ts +33 -0
- package/lib/adapters/index.js +50 -0
- package/lib/adapters/index.js.map +1 -0
- package/lib/adapters/lifecycle.d.ts +119 -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 +389 -0
- package/lib/adapters/rest/rest-api-adapter.js +747 -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 +391 -0
- package/lib/adapters/soql/cuneiform-query-builder.js +559 -0
- package/lib/adapters/soql/cuneiform-query-builder.js.map +1 -0
- package/lib/adapters/soql/index.d.ts +13 -0
- package/lib/adapters/soql/index.js +21 -0
- package/lib/adapters/soql/index.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 +152 -0
- package/lib/base/cuneiform-command.js +243 -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 +119 -0
- package/lib/commands/cuneiform/definition/create.js +693 -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 +270 -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 +344 -0
- package/lib/commands/cuneiform/definition/list.js.map +1 -0
- package/lib/commands/cuneiform/definition/purge.d.ts +105 -0
- package/lib/commands/cuneiform/definition/purge.js +533 -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 +206 -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 +111 -0
- package/lib/commands/cuneiform/object/list.js +239 -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 +90 -0
- package/lib/commands/cuneiform/profile.js +322 -0
- package/lib/commands/cuneiform/profile.js.map +1 -0
- package/lib/commands/cuneiform/summary/purge.d.ts +77 -0
- package/lib/commands/cuneiform/summary/purge.js +429 -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 +73 -0
- package/lib/commands/cuneiform/user/details.js +391 -0
- package/lib/commands/cuneiform/user/details.js.map +1 -0
- package/lib/constants/index.d.ts +8 -0
- package/lib/constants/index.js +16 -0
- package/lib/constants/index.js.map +1 -0
- package/lib/constants/namespace-constants.d.ts +91 -0
- package/lib/constants/namespace-constants.js +211 -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/index.d.ts +12 -0
- package/lib/debug/index.js +20 -0
- package/lib/debug/index.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 +302 -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 +199 -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 +306 -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/date-literal.d.ts +211 -0
- package/lib/models/date-literal.js +615 -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/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 +53 -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 +163 -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 +411 -0
- package/lib/operations/DefinitionCreateOperation.js +1121 -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 +199 -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 +187 -0
- package/lib/operations/ProfileOperation.js +373 -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 +85 -0
- package/lib/services/ConfigureMode.js +390 -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 +309 -0
- package/lib/services/DefinitionFieldGenerationService.js +795 -0
- package/lib/services/DefinitionFieldGenerationService.js.map +1 -0
- package/lib/services/DefinitionQueryBuilder.d.ts +59 -0
- package/lib/services/DefinitionQueryBuilder.js +234 -0
- package/lib/services/DefinitionQueryBuilder.js.map +1 -0
- package/lib/services/ObjectDescribeService.d.ts +436 -0
- package/lib/services/ObjectDescribeService.js +869 -0
- package/lib/services/ObjectDescribeService.js.map +1 -0
- package/lib/services/ObjectFilteringService.d.ts +400 -0
- package/lib/services/ObjectFilteringService.js +878 -0
- package/lib/services/ObjectFilteringService.js.map +1 -0
- package/lib/services/ObjectListCommandService.d.ts +429 -0
- package/lib/services/ObjectListCommandService.js +873 -0
- package/lib/services/ObjectListCommandService.js.map +1 -0
- package/lib/services/ObjectListService.d.ts +201 -0
- package/lib/services/ObjectListService.js +345 -0
- package/lib/services/ObjectListService.js.map +1 -0
- package/lib/services/OrgInfoService.d.ts +485 -0
- package/lib/services/OrgInfoService.js +1122 -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 +535 -0
- package/lib/services/ProfilingDefinitionService.js +981 -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 +685 -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 +133 -0
- package/lib/services/SFDMUService.js +295 -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 +155 -0
- package/lib/services/UserConfigurationService.js +573 -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 +330 -0
- package/lib/services/UserReadinessService.js +831 -0
- package/lib/services/UserReadinessService.js.map +1 -0
- package/lib/services/constants.d.ts +53 -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/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 +231 -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 +114 -0
- package/lib/utils/formatting/object-describe-display.js +440 -0
- package/lib/utils/formatting/object-describe-display.js.map +1 -0
- package/lib/utils/formatting/object-list-display.d.ts +213 -0
- package/lib/utils/formatting/object-list-display.js +672 -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/index.d.ts +11 -0
- package/lib/utils/pagination/index.js +18 -0
- package/lib/utils/pagination/index.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 +511 -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 +318 -0
- package/messages/definition.update.md +118 -0
- package/messages/mcp.serve.md +66 -0
- package/messages/object.describe.md +201 -0
- package/messages/object.list.md +443 -0
- package/messages/org.details.md +386 -0
- package/messages/org.reset.md +71 -0
- package/messages/profile.md +231 -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 +2887 -2149
- package/oclif.manifest.json +2813 -31
- package/package.json +94 -19
- 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,181 @@
|
|
|
1
|
+
import type { ISoqlQueryAdapter } from '../adapters/soql/soql-query-adapter.js';
|
|
2
|
+
import type { IRestApiAdapter } from '../adapters/rest/rest-api-adapter.js';
|
|
3
|
+
import type { DeploymentStatus as DeploymentStatusValue, ConfigurationActionStatus } from '../models/status-types.js';
|
|
4
|
+
import type { UserReadinessService } from './UserReadinessService.js';
|
|
5
|
+
/**
|
|
6
|
+
* Permission sets that the configure command can assign (writable actions).
|
|
7
|
+
* The Pro Administrative User permission set is a prerequisite verified via
|
|
8
|
+
* UserReadinessService but NOT assigned by the CLI — admin intervention required.
|
|
9
|
+
*/
|
|
10
|
+
export declare const CONFIGURABLE_PERMISSION_SETS: readonly string[];
|
|
11
|
+
/**
|
|
12
|
+
* User configuration profile information from Cuneiform CMT.
|
|
13
|
+
*/
|
|
14
|
+
export type UserConfig = {
|
|
15
|
+
/** User ID being checked */
|
|
16
|
+
userId: string;
|
|
17
|
+
/** Active configuration profile developer name */
|
|
18
|
+
profileDeveloperName?: string;
|
|
19
|
+
/** Active configuration profile label */
|
|
20
|
+
profileLabel?: string;
|
|
21
|
+
/** Whether API-only profiling is enabled */
|
|
22
|
+
apiOnlyProfilingEnabled: boolean;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Result of a CMT deployment trigger.
|
|
26
|
+
*/
|
|
27
|
+
export type DeploymentResult = {
|
|
28
|
+
/** Whether the deployment was successfully triggered */
|
|
29
|
+
triggered: boolean;
|
|
30
|
+
/** The deployment job ID (for status tracking) */
|
|
31
|
+
jobId?: string;
|
|
32
|
+
/** Message describing the result */
|
|
33
|
+
message: string;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Status of a CMT deployment job.
|
|
37
|
+
*/
|
|
38
|
+
export type DeploymentStatus = {
|
|
39
|
+
/** The deployment job ID */
|
|
40
|
+
jobId: string;
|
|
41
|
+
/** Current status (Pending, InProgress, Succeeded, Failed, Canceled) */
|
|
42
|
+
status: DeploymentStatusValue;
|
|
43
|
+
/** Whether the deployment is complete */
|
|
44
|
+
isComplete: boolean;
|
|
45
|
+
/** Error message if failed */
|
|
46
|
+
errorMessage?: string;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Represents the current configuration state for a user.
|
|
50
|
+
*/
|
|
51
|
+
export type ConfigurationState = {
|
|
52
|
+
/** User ID that was checked */
|
|
53
|
+
userId: string;
|
|
54
|
+
/** User's login username */
|
|
55
|
+
username: string;
|
|
56
|
+
/** Whether all required permission sets are assigned */
|
|
57
|
+
hasRequiredPermissionSets: boolean;
|
|
58
|
+
/** Names of missing permission sets (empty if all assigned) */
|
|
59
|
+
missingPermissionSets: string[];
|
|
60
|
+
/** Whether API-only profiling is enabled */
|
|
61
|
+
apiOnlyProfilingEnabled: boolean;
|
|
62
|
+
/** Active profile developer name (if configured) */
|
|
63
|
+
profileDeveloperName?: string;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* A single configuration action with its result.
|
|
67
|
+
*/
|
|
68
|
+
export type ConfigurationAction = {
|
|
69
|
+
/** Type of action (e.g., 'assignPermissionSet', 'enableApiOnlyProfiling') */
|
|
70
|
+
type: 'assignPermissionSet' | 'enableApiOnlyProfiling' | 'unassignPermissionSet' | 'disableApiOnlyProfiling';
|
|
71
|
+
/** Target identifier (permission set name or profile name) */
|
|
72
|
+
target: string;
|
|
73
|
+
/** Human-readable label for the target (e.g., 'Cuneiform for CRM Global Profiling Support') */
|
|
74
|
+
targetLabel?: string;
|
|
75
|
+
/** Action status */
|
|
76
|
+
status: ConfigurationActionStatus;
|
|
77
|
+
/** Reason for skipping or failure message */
|
|
78
|
+
message?: string;
|
|
79
|
+
/** Additional details (e.g., PermissionSetAssignment ID, deployment job ID) */
|
|
80
|
+
details?: Record<string, string>;
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* Result of the configure orchestration method.
|
|
84
|
+
*/
|
|
85
|
+
export type UserConfigurationResult = {
|
|
86
|
+
/** User information */
|
|
87
|
+
user: {
|
|
88
|
+
id: string;
|
|
89
|
+
username: string;
|
|
90
|
+
};
|
|
91
|
+
/** Whether this was a dry-run (no changes applied) */
|
|
92
|
+
dryRun: boolean;
|
|
93
|
+
/** Configuration state before changes */
|
|
94
|
+
previousState: ConfigurationState;
|
|
95
|
+
/** Actions taken or planned */
|
|
96
|
+
actions: ConfigurationAction[];
|
|
97
|
+
/** Configuration state after changes (null for dry-run) */
|
|
98
|
+
currentState: ConfigurationState | null;
|
|
99
|
+
/** Summary statistics */
|
|
100
|
+
summary: {
|
|
101
|
+
/** Number of changes required */
|
|
102
|
+
changesRequired: number;
|
|
103
|
+
/** Number of changes successfully applied */
|
|
104
|
+
changesApplied: number;
|
|
105
|
+
/** Number of changes that failed */
|
|
106
|
+
changesFailed: number;
|
|
107
|
+
/**
|
|
108
|
+
* Whether the user has all required configuration (permission sets assigned + API-only enabled).
|
|
109
|
+
* For configure(): true when all permissions are in place after changes.
|
|
110
|
+
* For unconfigure(): reflects the post-unconfigure state (typically false after successful unconfigure).
|
|
111
|
+
*/
|
|
112
|
+
isReady: boolean;
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* Raw Active Configuration CMT query record with relationship.
|
|
117
|
+
*/
|
|
118
|
+
export type ActiveConfigurationRecord = {
|
|
119
|
+
Id: string;
|
|
120
|
+
DeveloperName: string;
|
|
121
|
+
pnova__Active_Configuration_Profile__r?: {
|
|
122
|
+
Id: string;
|
|
123
|
+
DeveloperName: string;
|
|
124
|
+
Label: string;
|
|
125
|
+
pnova__Enable_API_Only_Profiling__c: boolean;
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
/**
|
|
129
|
+
* Raw DeployRequest query record for status tracking.
|
|
130
|
+
*/
|
|
131
|
+
export type DeployRequestRecord = {
|
|
132
|
+
Id: string;
|
|
133
|
+
Status: string;
|
|
134
|
+
ErrorMessage?: string;
|
|
135
|
+
};
|
|
136
|
+
/**
|
|
137
|
+
* Raw PermissionSet query record.
|
|
138
|
+
*/
|
|
139
|
+
export type PermissionSetRecord = {
|
|
140
|
+
Id: string;
|
|
141
|
+
Name: string;
|
|
142
|
+
NamespacePrefix: string | null;
|
|
143
|
+
};
|
|
144
|
+
/**
|
|
145
|
+
* Configuration for UserConfigurationService.
|
|
146
|
+
*/
|
|
147
|
+
export type IUserConfigurationServiceConfig = {
|
|
148
|
+
/** SOQL query adapter for CMT queries */
|
|
149
|
+
soqlAdapter: ISoqlQueryAdapter;
|
|
150
|
+
/** REST API adapter for CMT deployments and record inserts */
|
|
151
|
+
restApiAdapter: IRestApiAdapter;
|
|
152
|
+
/** User readiness service for checking user state (required for configure()) */
|
|
153
|
+
userReadinessService?: UserReadinessService;
|
|
154
|
+
/** Optional logger for debug output */
|
|
155
|
+
logger?: Console;
|
|
156
|
+
};
|
|
157
|
+
/**
|
|
158
|
+
* Shared service dependencies passed to configure/unconfigure mode classes.
|
|
159
|
+
*
|
|
160
|
+
* These are the subset of UserConfigurationService methods that modes need
|
|
161
|
+
* to perform their work. Using an interface decouples modes from the
|
|
162
|
+
* full service class.
|
|
163
|
+
*/
|
|
164
|
+
export type IConfigurationServiceDeps = {
|
|
165
|
+
/** SOQL adapter for queries */
|
|
166
|
+
soqlAdapter: ISoqlQueryAdapter;
|
|
167
|
+
/** REST API adapter for record operations */
|
|
168
|
+
restApiAdapter: IRestApiAdapter;
|
|
169
|
+
/** User readiness service (always available within modes) */
|
|
170
|
+
userReadinessService: UserReadinessService;
|
|
171
|
+
/** Optional logger */
|
|
172
|
+
logger?: Console;
|
|
173
|
+
/** Get the ID of a permission set by name and namespace */
|
|
174
|
+
getPermissionSetId: (name: string, namespace: string) => Promise<import('../models/service-result.js').ServiceResult<string | null>>;
|
|
175
|
+
/** Enable API-only profiling for a profile */
|
|
176
|
+
enableApiOnlyProfiling: (profileDeveloperName: string) => Promise<import('../models/service-result.js').ServiceResult<DeploymentResult>>;
|
|
177
|
+
/** Disable API-only profiling for a profile */
|
|
178
|
+
disableApiOnlyProfiling: (profileDeveloperName: string) => Promise<import('../models/service-result.js').ServiceResult<DeploymentResult>>;
|
|
179
|
+
/** Wait for a deployment to complete */
|
|
180
|
+
waitForDeploymentCompletion: (jobId: string) => Promise<import('../models/service-result.js').ServiceResult<DeploymentStatus>>;
|
|
181
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2026, PeerNova, Inc. All Rights Reserved.
|
|
3
|
+
* PROPRIETARY AND CONFIDENTIAL. Unauthorized copying, modification,
|
|
4
|
+
* or distribution is strictly prohibited. Use is governed by the
|
|
5
|
+
* Master Subscription Agreement (MSA) between PeerNova, Inc. and the
|
|
6
|
+
* licensee. See LICENSE file in the repo root.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Permission sets that the configure command can assign (writable actions).
|
|
10
|
+
* The Pro Administrative User permission set is a prerequisite verified via
|
|
11
|
+
* UserReadinessService but NOT assigned by the CLI — admin intervention required.
|
|
12
|
+
*/
|
|
13
|
+
export const CONFIGURABLE_PERMISSION_SETS = ['Cuneiform_for_CRM_Global_Profiling_Support'];
|
|
14
|
+
//# sourceMappingURL=UserConfigurationTypes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserConfigurationTypes.js","sourceRoot":"","sources":["../../src/services/UserConfigurationTypes.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAOH;;;;GAIG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAsB,CAAC,4CAA4C,CAAU,CAAC"}
|
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
import type { ISoqlQueryAdapter } from '../adapters/soql/soql-query-adapter.js';
|
|
2
|
+
import type { IRestApiAdapter } from '../adapters/rest/rest-api-adapter.js';
|
|
3
|
+
import type { ServiceResult } from '../models/service-result.js';
|
|
4
|
+
import type { OrgType } from './OrgInfoService.js';
|
|
5
|
+
/**
|
|
6
|
+
* Response shape from the ISV profiling status endpoint.
|
|
7
|
+
*
|
|
8
|
+
* @see GET /services/apexrest/pnova/v1/profiling/status
|
|
9
|
+
*/
|
|
10
|
+
export type FeatureStatus = {
|
|
11
|
+
/** Whether the overall feature is enabled for this organization */
|
|
12
|
+
featureEnabled: boolean;
|
|
13
|
+
/** Whether API-Based Profiling is enabled */
|
|
14
|
+
apiBasedProfilingEnabled: boolean;
|
|
15
|
+
/** Whether self-registration is enabled */
|
|
16
|
+
selfRegistrationEnabled: boolean;
|
|
17
|
+
/** Installed package version string */
|
|
18
|
+
packageVersion: string;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Permission set names required for Cuneiform operations.
|
|
22
|
+
*/
|
|
23
|
+
export declare const REQUIRED_PERMISSION_SETS: readonly ["Cuneiform_for_CRM_PRO_Administrative_User", "Cuneiform_for_CRM_Global_Profiling_Support"];
|
|
24
|
+
/**
|
|
25
|
+
* Maps required permission set API names to their human-readable labels.
|
|
26
|
+
* Used for user-facing display across both details and configure commands.
|
|
27
|
+
*/
|
|
28
|
+
export declare const REQUIRED_PERMISSION_SET_LABELS: Record<string, string>;
|
|
29
|
+
/**
|
|
30
|
+
* Org types that allow configure operations.
|
|
31
|
+
* Production is the only blocked type.
|
|
32
|
+
*/
|
|
33
|
+
export declare const CONFIGURE_ALLOWED_ORG_TYPES: readonly OrgType[];
|
|
34
|
+
/**
|
|
35
|
+
* Status of a single permission set assignment.
|
|
36
|
+
*/
|
|
37
|
+
export type PermissionSetAssignmentStatus = {
|
|
38
|
+
/** Permission set API name */
|
|
39
|
+
name: string;
|
|
40
|
+
/** Permission set label (human-readable display name) */
|
|
41
|
+
label?: string;
|
|
42
|
+
/** Whether the permission set is assigned to the user */
|
|
43
|
+
isAssigned: boolean;
|
|
44
|
+
/** Whether this permission set is required */
|
|
45
|
+
isRequired: boolean;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Result of permission set check.
|
|
49
|
+
*/
|
|
50
|
+
export type PermissionSetStatus = {
|
|
51
|
+
/** Whether all required permission sets are assigned */
|
|
52
|
+
hasAllRequired: boolean;
|
|
53
|
+
/** Status of each checked permission set */
|
|
54
|
+
assignments: PermissionSetAssignmentStatus[];
|
|
55
|
+
/** Names of missing required permission sets */
|
|
56
|
+
missingRequired: string[];
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Configuration profile information from Cuneiform CMT.
|
|
60
|
+
*/
|
|
61
|
+
export type ConfigProfileStatus = {
|
|
62
|
+
/** Whether a config profile is configured */
|
|
63
|
+
isConfigured: boolean;
|
|
64
|
+
/** Developer name of the active profile */
|
|
65
|
+
profileDeveloperName?: string;
|
|
66
|
+
/** Label of the active profile */
|
|
67
|
+
profileLabel?: string;
|
|
68
|
+
/** Whether API-only profiling is enabled */
|
|
69
|
+
apiOnlyProfilingEnabled?: boolean;
|
|
70
|
+
/** Whether CLI self-provisioning (self-registration) is enabled */
|
|
71
|
+
selfRegistrationEnabled?: boolean;
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Complete user readiness status.
|
|
75
|
+
*/
|
|
76
|
+
export type UserReadiness = {
|
|
77
|
+
/** User ID that was checked */
|
|
78
|
+
userId: string;
|
|
79
|
+
/** Whether the user is ready to use Cuneiform */
|
|
80
|
+
isReady: boolean;
|
|
81
|
+
/** Whether Cuneiform is installed in the org */
|
|
82
|
+
isCuneiformInstalled: boolean;
|
|
83
|
+
/** Permission set status */
|
|
84
|
+
permissionSets: PermissionSetStatus;
|
|
85
|
+
/** Configuration profile status */
|
|
86
|
+
configProfile: ConfigProfileStatus;
|
|
87
|
+
/** Human-readable readiness messages */
|
|
88
|
+
messages: string[];
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* Authenticated user identity information.
|
|
92
|
+
*
|
|
93
|
+
* Contains user profile details retrieved from the Salesforce User object
|
|
94
|
+
* with Profile and UserRole relationship data.
|
|
95
|
+
*/
|
|
96
|
+
export type UserInfo = {
|
|
97
|
+
/** Salesforce User ID (18-character) */
|
|
98
|
+
id: string;
|
|
99
|
+
/** User's login username */
|
|
100
|
+
username: string;
|
|
101
|
+
/** User's full name (Name field) */
|
|
102
|
+
fullName: string;
|
|
103
|
+
/** User's email address */
|
|
104
|
+
email: string;
|
|
105
|
+
/** Name of the user's assigned Profile */
|
|
106
|
+
profileName: string;
|
|
107
|
+
/** Name of the user's assigned Role (null if no role assigned) */
|
|
108
|
+
roleName: string | null;
|
|
109
|
+
/** Whether the user account is active */
|
|
110
|
+
isActive: boolean;
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* Configuration for UserReadinessService.
|
|
114
|
+
*/
|
|
115
|
+
export type IUserReadinessServiceConfig = {
|
|
116
|
+
/** SOQL query adapter for permission and CMT queries */
|
|
117
|
+
soqlAdapter: ISoqlQueryAdapter;
|
|
118
|
+
/** Optional logger for debug output */
|
|
119
|
+
logger?: Console;
|
|
120
|
+
/** Optional REST client for server-side readiness checks via ISV REST API */
|
|
121
|
+
restClient?: import('../adapters/rest/profiling-rest-client.js').ProfilingRestClient;
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* Service for validating user readiness to use Cuneiform.
|
|
125
|
+
*
|
|
126
|
+
* Checks whether a user has the required permission sets and configuration
|
|
127
|
+
* profile to execute Cuneiform operations. Also detects if Cuneiform is
|
|
128
|
+
* installed in the org.
|
|
129
|
+
*
|
|
130
|
+
* @example
|
|
131
|
+
* ```typescript
|
|
132
|
+
* const service = new UserReadinessService({ soqlAdapter });
|
|
133
|
+
*
|
|
134
|
+
* const result = await service.checkReadiness(userId);
|
|
135
|
+
* if (result.success) {
|
|
136
|
+
* if (result.data.isReady) {
|
|
137
|
+
* console.log('User is ready to use Cuneiform');
|
|
138
|
+
* } else {
|
|
139
|
+
* console.log('Issues:', result.data.messages.join(', '));
|
|
140
|
+
* }
|
|
141
|
+
* }
|
|
142
|
+
* ```
|
|
143
|
+
*/
|
|
144
|
+
export declare class UserReadinessService {
|
|
145
|
+
private readonly soqlAdapter;
|
|
146
|
+
private readonly logger?;
|
|
147
|
+
private readonly restClient?;
|
|
148
|
+
constructor(config: IUserReadinessServiceConfig);
|
|
149
|
+
/**
|
|
150
|
+
* Checks whether configure operations are allowed in the given org type.
|
|
151
|
+
*
|
|
152
|
+
* Only Production orgs are blocked. Developer, Sandbox, Scratch, and Trial
|
|
153
|
+
* orgs are all allowed to run configure operations.
|
|
154
|
+
*
|
|
155
|
+
* @param orgType - The classified org type
|
|
156
|
+
* @returns true if configure is allowed, false for Production
|
|
157
|
+
*/
|
|
158
|
+
static isConfigureAllowed(orgType: OrgType): boolean;
|
|
159
|
+
/**
|
|
160
|
+
* Creates an empty UserReadiness result for error cases.
|
|
161
|
+
*/
|
|
162
|
+
private static createEmptyReadiness;
|
|
163
|
+
/**
|
|
164
|
+
* Creates an empty UserInfo result for error cases.
|
|
165
|
+
*/
|
|
166
|
+
private static createEmptyUserInfo;
|
|
167
|
+
/**
|
|
168
|
+
* Checks if an error message indicates Cuneiform namespace is not found.
|
|
169
|
+
*
|
|
170
|
+
* This typically means the Cuneiform for Salesforce package is not installed in the org.
|
|
171
|
+
* The Salesforce API returns "sObject type not supported" or similar when
|
|
172
|
+
* querying namespaced objects that don't exist.
|
|
173
|
+
*/
|
|
174
|
+
private static isCuneiformNamespaceNotFoundError;
|
|
175
|
+
/**
|
|
176
|
+
* Maps the ISV REST API payload to the canonical UserReadiness shape.
|
|
177
|
+
*
|
|
178
|
+
* The Apex endpoint returns flat booleans and differently-named fields
|
|
179
|
+
* (e.g. `assigned` instead of `isAssigned`, `cuneiformInstalled` instead
|
|
180
|
+
* of `isCuneiformInstalled`). This mapper bridges the wire format to
|
|
181
|
+
* the TypeScript domain type so downstream code (buildResult, display)
|
|
182
|
+
* works unchanged.
|
|
183
|
+
*/
|
|
184
|
+
private static mapRestPayloadToUserReadiness;
|
|
185
|
+
/**
|
|
186
|
+
* Retrieves user identity information.
|
|
187
|
+
*
|
|
188
|
+
* Queries the User object with Profile and UserRole relationships to build
|
|
189
|
+
* a complete user identity record. Handles null UserRole gracefully since
|
|
190
|
+
* users may not have a role assigned.
|
|
191
|
+
*
|
|
192
|
+
* @param userId - The Salesforce user ID to query
|
|
193
|
+
* @returns ServiceResult containing UserInfo
|
|
194
|
+
*
|
|
195
|
+
* @example
|
|
196
|
+
* ```typescript
|
|
197
|
+
* const result = await service.getUserInfo(userId);
|
|
198
|
+
* if (result.success) {
|
|
199
|
+
* console.log(`User: ${result.data.fullName} (${result.data.profileName})`);
|
|
200
|
+
* if (result.data.roleName) {
|
|
201
|
+
* console.log(`Role: ${result.data.roleName}`);
|
|
202
|
+
* }
|
|
203
|
+
* }
|
|
204
|
+
* ```
|
|
205
|
+
*/
|
|
206
|
+
getUserInfo(userId: string): Promise<ServiceResult<UserInfo>>;
|
|
207
|
+
/**
|
|
208
|
+
* Checks complete user readiness for Cuneiform operations.
|
|
209
|
+
*
|
|
210
|
+
* Validates:
|
|
211
|
+
* 1. Cuneiform is installed (by querying CMT)
|
|
212
|
+
* 2. User has required permission sets
|
|
213
|
+
* 3. Configuration profile is set up
|
|
214
|
+
*
|
|
215
|
+
* @param userId - The Salesforce user ID to check
|
|
216
|
+
* @returns ServiceResult containing UserReadiness
|
|
217
|
+
*/
|
|
218
|
+
checkReadiness(userId: string): Promise<ServiceResult<UserReadiness>>;
|
|
219
|
+
/**
|
|
220
|
+
* Checks if the user has required Cuneiform permission sets.
|
|
221
|
+
*
|
|
222
|
+
* @param userId - The Salesforce user ID to check
|
|
223
|
+
* @returns ServiceResult containing PermissionSetStatus
|
|
224
|
+
*/
|
|
225
|
+
hasRequiredPermissionSets(userId: string): Promise<ServiceResult<PermissionSetStatus>>;
|
|
226
|
+
/**
|
|
227
|
+
* Retrieves the ID of a permission set by name and namespace.
|
|
228
|
+
*
|
|
229
|
+
* Queries the PermissionSet object directly to find a permission set by
|
|
230
|
+
* its Name and NamespacePrefix. This method returns the permission set ID
|
|
231
|
+
* for use in permission set assignment operations.
|
|
232
|
+
*
|
|
233
|
+
* @param permissionSetName - The permission set API name (e.g., 'Cuneiform_for_CRM_Global_Profiling_Support')
|
|
234
|
+
* @param namespacePrefix - The namespace prefix (e.g., 'pnova')
|
|
235
|
+
* @returns ServiceResult containing the permission set ID or null if not found
|
|
236
|
+
*
|
|
237
|
+
* @example
|
|
238
|
+
* ```typescript
|
|
239
|
+
* const result = await service.getPermissionSetId(
|
|
240
|
+
* 'Cuneiform_for_CRM_Global_Profiling_Support',
|
|
241
|
+
* 'pnova'
|
|
242
|
+
* );
|
|
243
|
+
* if (result.success && result.data) {
|
|
244
|
+
* console.log(`Permission Set ID: ${result.data}`);
|
|
245
|
+
* } else if (result.success && result.data === null) {
|
|
246
|
+
* console.log('Permission set not found in org');
|
|
247
|
+
* }
|
|
248
|
+
* ```
|
|
249
|
+
*/
|
|
250
|
+
getPermissionSetId(permissionSetName: string, namespacePrefix: string): Promise<ServiceResult<string | null>>;
|
|
251
|
+
/**
|
|
252
|
+
* Checks if a configuration profile is configured.
|
|
253
|
+
*
|
|
254
|
+
* Queries the Cuneiform Active Configuration CMT to determine if a profile
|
|
255
|
+
* is set up. If the CMT doesn't exist, returns E4654 indicating Cuneiform
|
|
256
|
+
* is not installed.
|
|
257
|
+
*
|
|
258
|
+
* @returns ServiceResult containing ConfigProfileStatus
|
|
259
|
+
*/
|
|
260
|
+
hasConfigProfile(): Promise<ServiceResult<ConfigProfileStatus>>;
|
|
261
|
+
/**
|
|
262
|
+
* Validates that the user has profiling access to use Cuneiform commands.
|
|
263
|
+
*
|
|
264
|
+
* Checks in order:
|
|
265
|
+
* 1. Cuneiform is installed in the org
|
|
266
|
+
* 2. Required permission sets are assigned
|
|
267
|
+
* 3. Global Profiling is enabled
|
|
268
|
+
*
|
|
269
|
+
* Returns success if all checks pass. Returns a specific error code for the
|
|
270
|
+
* first failing check, with a user-friendly message including remediation steps.
|
|
271
|
+
*
|
|
272
|
+
* @param userId - The Salesforce user ID to validate
|
|
273
|
+
* @returns ServiceResult<void> — success or failure with specific error code
|
|
274
|
+
*/
|
|
275
|
+
validateProfilingAccess(userId: string): Promise<ServiceResult<void>>;
|
|
276
|
+
/**
|
|
277
|
+
* Checks the feature status via the ISV profiling status REST endpoint.
|
|
278
|
+
*
|
|
279
|
+
* Calls `GET /services/apexrest/pnova/v1/profiling/status` to determine whether
|
|
280
|
+
* API-Based Profiling is enabled for this organization. This is Gate 0 — if the
|
|
281
|
+
* feature is not enabled, all other gates are moot.
|
|
282
|
+
*
|
|
283
|
+
* Graceful degradation:
|
|
284
|
+
* - On 404 (endpoint not found): returns success with `featureEnabled: true`.
|
|
285
|
+
* Older ISV packages may not expose this endpoint; we don't block them.
|
|
286
|
+
* - On other errors: returns failure with `FEATURE_STATUS_CHECK_FAILED`.
|
|
287
|
+
*
|
|
288
|
+
* @param restAdapter - The REST API adapter for making the HTTP request
|
|
289
|
+
* @returns ServiceResult containing FeatureStatus
|
|
290
|
+
*
|
|
291
|
+
* @example
|
|
292
|
+
* ```typescript
|
|
293
|
+
* const result = await service.checkFeatureStatus(restAdapter);
|
|
294
|
+
* if (result.success && !result.data.featureEnabled) {
|
|
295
|
+
* // Block command execution — feature is disabled
|
|
296
|
+
* }
|
|
297
|
+
* ```
|
|
298
|
+
*/
|
|
299
|
+
checkFeatureStatus(restAdapter: IRestApiAdapter): Promise<ServiceResult<FeatureStatus>>;
|
|
300
|
+
/**
|
|
301
|
+
* Attempts REST delegation for user readiness.
|
|
302
|
+
* Returns the successful result, or null to signal fallback to the local SOQL path.
|
|
303
|
+
* Falls back when REST returns cuneiformInstalled=false (Apex endpoint bug on some orgs).
|
|
304
|
+
*/
|
|
305
|
+
private tryRestReadiness;
|
|
306
|
+
/**
|
|
307
|
+
* Delegates user readiness check to the ISV REST API.
|
|
308
|
+
*
|
|
309
|
+
* @param userId - The Salesforce user ID to check
|
|
310
|
+
* @param startTime - Timestamp for duration tracking
|
|
311
|
+
* @returns ServiceResult containing UserReadiness from REST endpoint
|
|
312
|
+
*/
|
|
313
|
+
private checkReadinessViaRest;
|
|
314
|
+
/**
|
|
315
|
+
* Checks for required permission sets accessible through PermissionSetGroup membership.
|
|
316
|
+
*
|
|
317
|
+
* Two-step query approach for precision:
|
|
318
|
+
* 1. Get the specific PermissionSetGroup IDs assigned to this user
|
|
319
|
+
* 2. Check if those specific groups contain any of the missing required permission sets
|
|
320
|
+
*
|
|
321
|
+
* Both queries are tightly filtered to avoid pulling excess records:
|
|
322
|
+
* - Group query: filtered by AssigneeId AND PermissionSetGroupId != null
|
|
323
|
+
* - Component query: filtered by specific group IDs, permission set names, AND namespace
|
|
324
|
+
*
|
|
325
|
+
* @param userId - The Salesforce user ID
|
|
326
|
+
* @param missingNames - Permission set names not found via direct assignment
|
|
327
|
+
* @returns Map of permission set names to labels found through group membership
|
|
328
|
+
*/
|
|
329
|
+
private getGroupAssignedPermissionSets;
|
|
330
|
+
}
|