@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,209 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2026, PeerNova, Inc. All Rights Reserved.
|
|
3
|
+
* PROPRIETARY AND CONFIDENTIAL. Unauthorized copying, modification,
|
|
4
|
+
* or distribution is strictly prohibited. Use is governed by the
|
|
5
|
+
* Master Subscription Agreement (MSA) between PeerNova, Inc. and the
|
|
6
|
+
* licensee. See LICENSE file in the repo root.
|
|
7
|
+
*/
|
|
8
|
+
import { createSuccessResult, createFailureResult } from '../models/service-result.js';
|
|
9
|
+
/**
|
|
10
|
+
* Default name pattern for NUT-created definitions.
|
|
11
|
+
* Matches definitions created by NUT tests with the `[NUT-` prefix.
|
|
12
|
+
*/
|
|
13
|
+
export const DEFAULT_NUT_PATTERN = '[NUT-%';
|
|
14
|
+
/**
|
|
15
|
+
* Error codes specific to org reset operations.
|
|
16
|
+
* Range: E4950-E4959.
|
|
17
|
+
*/
|
|
18
|
+
export const ResetErrorCodes = {
|
|
19
|
+
/** Query for definitions failed */
|
|
20
|
+
DEFINITION_QUERY_FAILED: 'E4950',
|
|
21
|
+
/** Definition deletion failed */
|
|
22
|
+
DEFINITION_DELETE_FAILED: 'E4951',
|
|
23
|
+
/** Request cancellation failed */
|
|
24
|
+
REQUEST_CANCEL_FAILED: 'E4952',
|
|
25
|
+
/** Request deletion failed */
|
|
26
|
+
REQUEST_DELETE_FAILED: 'E4953',
|
|
27
|
+
/** Operation failed unexpectedly */
|
|
28
|
+
OPERATION_FAILED: 'E4954',
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Orchestrates a full org reset by purging NUT-created test data.
|
|
32
|
+
*
|
|
33
|
+
* The reset sequence is:
|
|
34
|
+
* 1. Query definitions matching the name pattern (default: `[NUT-%`)
|
|
35
|
+
* 2. Cancel any active profiling requests linked to those definitions
|
|
36
|
+
* 3. Delete cancelled/rejected profiling requests
|
|
37
|
+
* 4. Delete definitions that have no related summaries
|
|
38
|
+
*
|
|
39
|
+
* Follows the 4-layer architecture: Command → Operation → Service → API
|
|
40
|
+
*/
|
|
41
|
+
export class OrgResetOperation {
|
|
42
|
+
definitionService;
|
|
43
|
+
requestService;
|
|
44
|
+
logger;
|
|
45
|
+
constructor(definitionService, requestService, logger) {
|
|
46
|
+
this.definitionService = definitionService;
|
|
47
|
+
this.requestService = requestService;
|
|
48
|
+
this.logger = logger;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Creates an empty result structure.
|
|
52
|
+
*/
|
|
53
|
+
static emptyResult(pattern, dryRun) {
|
|
54
|
+
return {
|
|
55
|
+
definitions: { deleted: 0, skipped: 0, failed: 0, total: 0 },
|
|
56
|
+
requests: { cancelled: 0, deleted: 0, failed: 0, total: 0 },
|
|
57
|
+
dryRun,
|
|
58
|
+
pattern,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Executes the org reset operation.
|
|
63
|
+
*/
|
|
64
|
+
async execute(options) {
|
|
65
|
+
const startTime = Date.now();
|
|
66
|
+
const pattern = options.pattern ?? DEFAULT_NUT_PATTERN;
|
|
67
|
+
const dryRun = options.dryRun ?? false;
|
|
68
|
+
const emptyResult = OrgResetOperation.emptyResult(pattern, dryRun);
|
|
69
|
+
try {
|
|
70
|
+
this.logger?.log(`Starting org reset with pattern: ${pattern}`);
|
|
71
|
+
// Step 1: Query definitions matching pattern
|
|
72
|
+
options.onProgress?.({ step: 'query-definitions', message: `Querying definitions matching "${pattern}"...` });
|
|
73
|
+
const queryResult = await this.definitionService.getAllDefinitions({ namePattern: pattern });
|
|
74
|
+
if (!queryResult.success) {
|
|
75
|
+
this.logger?.log(`Definition query failed: ${queryResult.message}`);
|
|
76
|
+
return createFailureResult(emptyResult, ResetErrorCodes.DEFINITION_QUERY_FAILED, queryResult.message, {
|
|
77
|
+
metadata: { duration: Date.now() - startTime },
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
const definitions = queryResult.data;
|
|
81
|
+
if (definitions.length === 0) {
|
|
82
|
+
this.logger?.log('No definitions found matching pattern — org is already clean');
|
|
83
|
+
return createSuccessResult(emptyResult, {
|
|
84
|
+
message: 'Org is already clean — no test data found.',
|
|
85
|
+
metadata: { duration: Date.now() - startTime },
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
options.onProgress?.({
|
|
89
|
+
step: 'query-definitions',
|
|
90
|
+
message: `Found ${definitions.length} definitions matching "${pattern}"`,
|
|
91
|
+
count: definitions.length,
|
|
92
|
+
});
|
|
93
|
+
// Categorize definitions
|
|
94
|
+
const deletable = definitions.filter((d) => !d.hasRelatedSummaries);
|
|
95
|
+
const blocked = definitions.filter((d) => d.hasRelatedSummaries);
|
|
96
|
+
// Step 2: Cancel active profiling requests for matched definitions
|
|
97
|
+
const requestResult = await this.handleRequests(definitions, dryRun, options);
|
|
98
|
+
// Step 3: Delete definitions (unless dry-run)
|
|
99
|
+
const definitionResult = await this.handleDefinitions(deletable, blocked, dryRun, options);
|
|
100
|
+
// Build final result
|
|
101
|
+
const result = {
|
|
102
|
+
definitions: definitionResult,
|
|
103
|
+
requests: requestResult,
|
|
104
|
+
dryRun,
|
|
105
|
+
pattern,
|
|
106
|
+
};
|
|
107
|
+
const summary = dryRun
|
|
108
|
+
? `Dry-run: would delete ${deletable.length} definitions, skip ${blocked.length} (has summaries), ` +
|
|
109
|
+
`cancel ${requestResult.cancelled} requests`
|
|
110
|
+
: `Reset complete: deleted ${definitionResult.deleted} definitions, ` +
|
|
111
|
+
`cancelled ${requestResult.cancelled} requests, deleted ${requestResult.deleted} requests`;
|
|
112
|
+
this.logger?.log(summary);
|
|
113
|
+
return createSuccessResult(result, {
|
|
114
|
+
message: summary,
|
|
115
|
+
metadata: { duration: Date.now() - startTime },
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
catch (error) {
|
|
119
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
120
|
+
this.logger?.log(`Org reset failed: ${errorMessage}`);
|
|
121
|
+
return createFailureResult(emptyResult, ResetErrorCodes.OPERATION_FAILED, errorMessage, {
|
|
122
|
+
metadata: { duration: Date.now() - startTime },
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Handles profiling request cancellation and deletion for matched definitions.
|
|
128
|
+
*/
|
|
129
|
+
async handleRequests(_definitions, dryRun, options) {
|
|
130
|
+
const result = { cancelled: 0, deleted: 0, failed: 0, total: 0 };
|
|
131
|
+
// Cancel active requests
|
|
132
|
+
options.onProgress?.({ step: 'cancel-requests', message: 'Cancelling active profiling requests...' });
|
|
133
|
+
const cancelResult = await this.requestService.cancelRequests({ all: true, dryRun });
|
|
134
|
+
if (cancelResult.success) {
|
|
135
|
+
result.cancelled = cancelResult.data.cancelled.length;
|
|
136
|
+
result.total += cancelResult.data.totalCancellable;
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
// Not a fatal error — continue even if cancel finds nothing
|
|
140
|
+
this.logger?.log(`Request cancellation: ${cancelResult.message ?? 'no cancellable requests'}`);
|
|
141
|
+
}
|
|
142
|
+
// Delete cancelled/rejected requests
|
|
143
|
+
options.onProgress?.({ step: 'delete-requests', message: 'Deleting terminal profiling requests...' });
|
|
144
|
+
const deleteResult = await this.requestService.deleteRequests({ all: true, dryRun });
|
|
145
|
+
if (deleteResult.success) {
|
|
146
|
+
result.deleted = deleteResult.data.deleted.length;
|
|
147
|
+
result.total += deleteResult.data.totalDeletable;
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
this.logger?.log(`Request deletion: ${deleteResult.message ?? 'no deletable requests'}`);
|
|
151
|
+
}
|
|
152
|
+
options.onProgress?.({
|
|
153
|
+
step: 'delete-requests',
|
|
154
|
+
message: `Requests: ${result.cancelled} cancelled, ${result.deleted} deleted`,
|
|
155
|
+
count: result.cancelled + result.deleted,
|
|
156
|
+
});
|
|
157
|
+
return result;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Handles definition deletion for deletable definitions.
|
|
161
|
+
*/
|
|
162
|
+
async handleDefinitions(deletable, blocked, dryRun, options) {
|
|
163
|
+
const result = {
|
|
164
|
+
deleted: 0,
|
|
165
|
+
skipped: blocked.length,
|
|
166
|
+
failed: 0,
|
|
167
|
+
total: deletable.length + blocked.length,
|
|
168
|
+
};
|
|
169
|
+
if (deletable.length === 0) {
|
|
170
|
+
options.onProgress?.({
|
|
171
|
+
step: 'delete-definitions',
|
|
172
|
+
message: 'No deletable definitions (all blocked by summaries)',
|
|
173
|
+
count: 0,
|
|
174
|
+
});
|
|
175
|
+
return result;
|
|
176
|
+
}
|
|
177
|
+
if (dryRun) {
|
|
178
|
+
result.deleted = deletable.length;
|
|
179
|
+
options.onProgress?.({
|
|
180
|
+
step: 'delete-definitions',
|
|
181
|
+
message: `Dry-run: would delete ${deletable.length} definitions, skip ${blocked.length}`,
|
|
182
|
+
count: deletable.length,
|
|
183
|
+
});
|
|
184
|
+
return result;
|
|
185
|
+
}
|
|
186
|
+
options.onProgress?.({
|
|
187
|
+
step: 'delete-definitions',
|
|
188
|
+
message: `Deleting ${deletable.length} definitions...`,
|
|
189
|
+
count: deletable.length,
|
|
190
|
+
});
|
|
191
|
+
const idsToDelete = deletable.map((d) => d.id);
|
|
192
|
+
const deleteResult = await this.definitionService.deleteDefinitions(idsToDelete);
|
|
193
|
+
if (!deleteResult.success) {
|
|
194
|
+
this.logger?.log(`Definition deletion failed: ${deleteResult.message}`);
|
|
195
|
+
result.failed = deletable.length;
|
|
196
|
+
return result;
|
|
197
|
+
}
|
|
198
|
+
result.deleted = deleteResult.data.deleted;
|
|
199
|
+
result.failed = deleteResult.data.failed;
|
|
200
|
+
result.skipped += deleteResult.data.skipped;
|
|
201
|
+
options.onProgress?.({
|
|
202
|
+
step: 'delete-definitions',
|
|
203
|
+
message: `Definitions: ${result.deleted} deleted, ${result.skipped} skipped, ${result.failed} failed`,
|
|
204
|
+
count: result.deleted,
|
|
205
|
+
});
|
|
206
|
+
return result;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
//# sourceMappingURL=OrgResetOperation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OrgResetOperation.js","sourceRoot":"","sources":["../../src/operations/OrgResetOperation.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAsB,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAI3G;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,QAAQ,CAAC;AAmE5C;;;G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AAC;CACF"}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { type ServiceResult } from '../models/service-result.js';
|
|
2
|
+
import { ProfilingDefinitionService, type DefinitionType, type ProfilingStatus } from '../services/ProfilingDefinitionService.js';
|
|
3
|
+
import { ProfilingExecutionService } from '../services/ProfilingExecutionService.js';
|
|
4
|
+
/**
|
|
5
|
+
* Execution mode: single definition or bulk.
|
|
6
|
+
*/
|
|
7
|
+
export type ProfileMode = 'single' | 'bulk';
|
|
8
|
+
/**
|
|
9
|
+
* Options for the profile execution operation.
|
|
10
|
+
*/
|
|
11
|
+
export type ProfileOptions = {
|
|
12
|
+
/** Target org username or alias */
|
|
13
|
+
targetOrg: string;
|
|
14
|
+
/** Profile by definition key(s) (e.g., PD-0001). Accepts multiple keys. */
|
|
15
|
+
keys?: string[];
|
|
16
|
+
/** Profile by Salesforce definition ID */
|
|
17
|
+
definitionId?: string;
|
|
18
|
+
/** Bulk profile by type */
|
|
19
|
+
type?: DefinitionType;
|
|
20
|
+
/** Filter by current status (e.g., "NOT PROFILED", "ERROR") */
|
|
21
|
+
status?: ProfilingStatus;
|
|
22
|
+
/** Object namespace filter */
|
|
23
|
+
namespace?: string;
|
|
24
|
+
/** Filter by definition category (e.g., "Baseline", "Record Types") */
|
|
25
|
+
category?: string;
|
|
26
|
+
/** Filter by time category (e.g., "Lifetime", "2026 vs 2025") */
|
|
27
|
+
timeCategory?: string;
|
|
28
|
+
/** Filter by segment category (e.g., "Historical", "Enterprise Sales") */
|
|
29
|
+
segmentCategory?: string;
|
|
30
|
+
/** Limit number of definitions processed */
|
|
31
|
+
limit?: number;
|
|
32
|
+
/** Skip definitions with zero records (default: true) */
|
|
33
|
+
skipEmpty?: boolean;
|
|
34
|
+
/** Parallel execution threads 1-10 (default: 5) */
|
|
35
|
+
parallel?: number;
|
|
36
|
+
/** Progress callback for bulk execution */
|
|
37
|
+
onProgress?: (message: string) => void;
|
|
38
|
+
logger?: Console;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Result of a single profiling execution.
|
|
42
|
+
*/
|
|
43
|
+
export type ProfileExecutionResult = {
|
|
44
|
+
/** Definition key (e.g., PD-0001) */
|
|
45
|
+
definitionKey: string;
|
|
46
|
+
/** Definition ID */
|
|
47
|
+
definitionId: string;
|
|
48
|
+
/** Object API name */
|
|
49
|
+
objectName: string;
|
|
50
|
+
/** Execution status */
|
|
51
|
+
status: 'success' | 'failed' | 'skipped';
|
|
52
|
+
/** Request ID (if execution started) */
|
|
53
|
+
requestId?: string;
|
|
54
|
+
/** Error message (if failed) */
|
|
55
|
+
errorMessage?: string;
|
|
56
|
+
/** Error code (if failed) */
|
|
57
|
+
errorCode?: string;
|
|
58
|
+
/** Skip reason (if skipped) */
|
|
59
|
+
skipReason?: string;
|
|
60
|
+
/** Resolution guidance (if failed) */
|
|
61
|
+
resolution?: string;
|
|
62
|
+
/** Duration in ms */
|
|
63
|
+
durationMs: number;
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Result of profile execution operation.
|
|
67
|
+
*/
|
|
68
|
+
export type ProfileResult = {
|
|
69
|
+
/** Execution mode */
|
|
70
|
+
mode: ProfileMode;
|
|
71
|
+
/** Individual execution results */
|
|
72
|
+
executions: ProfileExecutionResult[];
|
|
73
|
+
/** Summary statistics */
|
|
74
|
+
summary: {
|
|
75
|
+
total: number;
|
|
76
|
+
successful: number;
|
|
77
|
+
failed: number;
|
|
78
|
+
skipped: number;
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* Error codes specific to profile operations.
|
|
83
|
+
*/
|
|
84
|
+
export declare const ProfileErrorCodes: {
|
|
85
|
+
/** No selection provided (key/id/type) */
|
|
86
|
+
readonly NO_SELECTION: "PROFILE_NO_SELECTION";
|
|
87
|
+
/** Multiple selection flags provided */
|
|
88
|
+
readonly INVALID_SELECTION: "PROFILE_INVALID_SELECTION";
|
|
89
|
+
/** Definition not found */
|
|
90
|
+
readonly DEFINITION_NOT_FOUND: "PROFILE_DEFINITION_NOT_FOUND";
|
|
91
|
+
/** Definition ID has invalid Salesforce ID format */
|
|
92
|
+
readonly INVALID_ID: "PROFILE_INVALID_ID";
|
|
93
|
+
/** Parallel out of range (1-10) */
|
|
94
|
+
readonly INVALID_PARALLEL: "PROFILE_INVALID_PARALLEL";
|
|
95
|
+
/** Query for definitions failed */
|
|
96
|
+
readonly QUERY_FAILED: "PROFILE_QUERY_FAILED";
|
|
97
|
+
/** No definitions found matching filters */
|
|
98
|
+
readonly NO_DEFINITIONS_FOUND: "PROFILE_NO_DEFINITIONS_FOUND";
|
|
99
|
+
/** Execution failed */
|
|
100
|
+
readonly EXECUTION_FAILED: "PROFILE_EXECUTION_FAILED";
|
|
101
|
+
/** Operation failed unexpectedly */
|
|
102
|
+
readonly OPERATION_FAILED: "PROFILE_OPERATION_FAILED";
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* Orchestrates profiling execution for single and bulk modes.
|
|
106
|
+
*
|
|
107
|
+
* Follows the 4-layer architecture: Command → Operation → Service → API
|
|
108
|
+
* This operation layer handles business logic orchestration:
|
|
109
|
+
* 1. Validates options (must have exactly one of key/id/type)
|
|
110
|
+
* 2. Routes to single or bulk execution
|
|
111
|
+
* 3. Transforms service results to spec-compliant ProfileResult format
|
|
112
|
+
* 4. Handles partial failures (return success if any succeeded)
|
|
113
|
+
*
|
|
114
|
+
* @example
|
|
115
|
+
* ```typescript
|
|
116
|
+
* const operation = new ProfileOperation(executionService, definitionService);
|
|
117
|
+
*
|
|
118
|
+
* // Single mode
|
|
119
|
+
* const result = await operation.execute({
|
|
120
|
+
* targetOrg: 'myOrg',
|
|
121
|
+
* key: 'PD-0001',
|
|
122
|
+
* });
|
|
123
|
+
*
|
|
124
|
+
* // Bulk mode
|
|
125
|
+
* const result = await operation.execute({
|
|
126
|
+
* targetOrg: 'myOrg',
|
|
127
|
+
* type: 'metadata',
|
|
128
|
+
* parallel: 5,
|
|
129
|
+
* onProgress: (msg) => console.log(msg),
|
|
130
|
+
* });
|
|
131
|
+
* ```
|
|
132
|
+
*/
|
|
133
|
+
export declare class ProfileOperation {
|
|
134
|
+
private readonly executionService;
|
|
135
|
+
private readonly definitionService;
|
|
136
|
+
private readonly logger?;
|
|
137
|
+
/**
|
|
138
|
+
* Creates a new ProfileOperation instance.
|
|
139
|
+
*
|
|
140
|
+
* @param executionService - Service for executing and monitoring profiling operations
|
|
141
|
+
* @param definitionService - Service for querying profiling definitions
|
|
142
|
+
* @param logger - Optional logger for debug output
|
|
143
|
+
*/
|
|
144
|
+
constructor(executionService: ProfilingExecutionService, definitionService: ProfilingDefinitionService, logger?: Console | undefined);
|
|
145
|
+
/**
|
|
146
|
+
* Validates profile operation options.
|
|
147
|
+
*
|
|
148
|
+
* @param options - The profile options to validate
|
|
149
|
+
* @returns Error code if invalid, undefined if valid
|
|
150
|
+
*/
|
|
151
|
+
private static validateOptions;
|
|
152
|
+
/**
|
|
153
|
+
* Creates an empty ProfileResult for failure cases.
|
|
154
|
+
*
|
|
155
|
+
* @param mode - The execution mode
|
|
156
|
+
* @returns Empty ProfileResult
|
|
157
|
+
*/
|
|
158
|
+
private static createEmptyResult;
|
|
159
|
+
/**
|
|
160
|
+
* Executes the profile operation.
|
|
161
|
+
*
|
|
162
|
+
* @param options - Profile operation options
|
|
163
|
+
* @returns ServiceResult containing ProfileResult
|
|
164
|
+
*/
|
|
165
|
+
execute(options: ProfileOptions): Promise<ServiceResult<ProfileResult>>;
|
|
166
|
+
/**
|
|
167
|
+
* Executes profiling for a single definition by key or ID.
|
|
168
|
+
*
|
|
169
|
+
* @param options - Profile operation options (key or definitionId must be set)
|
|
170
|
+
* @returns ServiceResult containing ProfileResult
|
|
171
|
+
*/
|
|
172
|
+
private executeSingle;
|
|
173
|
+
/**
|
|
174
|
+
* Executes profiling for multiple keys by iterating and aggregating results.
|
|
175
|
+
*
|
|
176
|
+
* @param options - Profile operation options (keys must have 2+ entries)
|
|
177
|
+
* @returns ServiceResult containing aggregated ProfileResult
|
|
178
|
+
*/
|
|
179
|
+
private executeMultipleKeys;
|
|
180
|
+
/**
|
|
181
|
+
* Executes profiling for multiple definitions matching type and filters.
|
|
182
|
+
*
|
|
183
|
+
* @param options - Profile operation options (type must be set)
|
|
184
|
+
* @returns ServiceResult containing ProfileResult
|
|
185
|
+
*/
|
|
186
|
+
private executeBulk;
|
|
187
|
+
}
|