@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,465 @@
|
|
|
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
|
+
* Options for the definition purge operation.
|
|
11
|
+
*
|
|
12
|
+
* Selection modes:
|
|
13
|
+
* - `keys` — delete specific definitions by key (exclusive, all other flags ignored)
|
|
14
|
+
* - `all` — fetch all definitions (optionally narrowed by filters)
|
|
15
|
+
* - Filters alone — fetch matching definitions via inclusive AND logic
|
|
16
|
+
*
|
|
17
|
+
* Filters that map to SOQL (server-side): objectNames, pattern, category, status, isActive, method (as type)
|
|
18
|
+
* Filters applied client-side after fetch: filter (standard/custom — derived from __c suffix), namespace (string-prefix on objectName)
|
|
19
|
+
*/
|
|
20
|
+
/** Canonical message returned when the user declines the purge confirmation prompt. */
|
|
21
|
+
export const PURGE_CANCELLED_MESSAGE = 'Purge cancelled by user.';
|
|
22
|
+
/**
|
|
23
|
+
* Error codes specific to purge operations.
|
|
24
|
+
*/
|
|
25
|
+
export const PurgeErrorCodes = {
|
|
26
|
+
/** No selection criteria provided (no --all, --keys, or filters) */
|
|
27
|
+
NO_SELECTION_CRITERIA: 'PURGE_NO_SELECTION_CRITERIA',
|
|
28
|
+
/** Query for definitions failed */
|
|
29
|
+
QUERY_FAILED: 'PURGE_QUERY_FAILED',
|
|
30
|
+
/** No eligible definitions found */
|
|
31
|
+
NO_ELIGIBLE_DEFINITIONS: 'PURGE_NO_ELIGIBLE_DEFINITIONS',
|
|
32
|
+
/** Delete operation failed */
|
|
33
|
+
DELETE_FAILED: 'PURGE_DELETE_FAILED',
|
|
34
|
+
/** User cancelled the operation */
|
|
35
|
+
USER_CANCELLED: 'PURGE_USER_CANCELLED',
|
|
36
|
+
/** Operation failed unexpectedly */
|
|
37
|
+
OPERATION_FAILED: 'PURGE_OPERATION_FAILED',
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Orchestrates purging of profiling definitions.
|
|
41
|
+
*
|
|
42
|
+
* Follows the 4-layer architecture: Command → Operation → Service → API
|
|
43
|
+
* This operation layer handles:
|
|
44
|
+
* 1. Validates selection mode (IDs, --all, or filters)
|
|
45
|
+
* 2. Fetches definitions using getAllDefinitions() with inclusive AND filters
|
|
46
|
+
* 3. Pre-categorizes into deletable vs blocked (by summaries)
|
|
47
|
+
* 4. Applies client-side filters (object type, method)
|
|
48
|
+
* 5. Optionally previews (dry-run) or executes deletion
|
|
49
|
+
* 6. Reports per-definition progress and statistics
|
|
50
|
+
*/
|
|
51
|
+
export class DefinitionPurgeOperation {
|
|
52
|
+
definitionService;
|
|
53
|
+
logger;
|
|
54
|
+
constructor(definitionService, logger) {
|
|
55
|
+
this.definitionService = definitionService;
|
|
56
|
+
this.logger = logger;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Checks if any filter flags are specified.
|
|
60
|
+
*/
|
|
61
|
+
static hasFilterFlags(options) {
|
|
62
|
+
return (options.objectNames !== undefined ||
|
|
63
|
+
options.filter !== undefined ||
|
|
64
|
+
options.pattern !== undefined ||
|
|
65
|
+
options.method !== undefined ||
|
|
66
|
+
options.category !== undefined ||
|
|
67
|
+
options.status !== undefined ||
|
|
68
|
+
options.namespace !== undefined ||
|
|
69
|
+
options.isActive !== undefined);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Builds GetDefinitionsOptions from purge options (server-side filters only).
|
|
73
|
+
*/
|
|
74
|
+
static buildQueryOptions(options) {
|
|
75
|
+
const queryOptions = {};
|
|
76
|
+
if (options.objectNames !== undefined) {
|
|
77
|
+
queryOptions.objectNames = options.objectNames;
|
|
78
|
+
}
|
|
79
|
+
if (options.pattern !== undefined) {
|
|
80
|
+
queryOptions.namePattern = options.pattern;
|
|
81
|
+
}
|
|
82
|
+
if (options.category !== undefined) {
|
|
83
|
+
queryOptions.category = options.category;
|
|
84
|
+
}
|
|
85
|
+
if (options.status !== undefined) {
|
|
86
|
+
queryOptions.status = options.status;
|
|
87
|
+
}
|
|
88
|
+
if (options.isActive !== undefined) {
|
|
89
|
+
queryOptions.isActive = options.isActive;
|
|
90
|
+
}
|
|
91
|
+
if (options.method !== undefined) {
|
|
92
|
+
queryOptions.type = options.method;
|
|
93
|
+
}
|
|
94
|
+
return queryOptions;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Applies client-side filters that can't be expressed in SOQL.
|
|
98
|
+
*/
|
|
99
|
+
static applyClientFilters(definitions, options) {
|
|
100
|
+
let filtered = definitions;
|
|
101
|
+
// Filter by object type (standard vs custom)
|
|
102
|
+
if (options.filter !== undefined) {
|
|
103
|
+
filtered = filtered.filter((def) => {
|
|
104
|
+
const isCustom = def.objectName.endsWith('__c');
|
|
105
|
+
return options.filter === 'custom' ? isCustom : !isCustom;
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
// Filter by object namespace prefix
|
|
109
|
+
if (options.namespace !== undefined) {
|
|
110
|
+
const nsPrefix = options.namespace.endsWith('__') ? options.namespace : `${options.namespace}__`;
|
|
111
|
+
filtered = filtered.filter((def) => def.objectName.startsWith(nsPrefix));
|
|
112
|
+
}
|
|
113
|
+
// Apply limit (bypassed when --all is specified)
|
|
114
|
+
if (options.limit !== undefined && options.limit > 0 && !options.all) {
|
|
115
|
+
filtered = filtered.slice(0, options.limit);
|
|
116
|
+
}
|
|
117
|
+
return filtered;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Categorizes definitions into deletable and blocked-by-summaries.
|
|
121
|
+
*
|
|
122
|
+
* Definitions can be deleted regardless of profiling status as long as
|
|
123
|
+
* they have no associated summaries.
|
|
124
|
+
*/
|
|
125
|
+
static categorize(definitions) {
|
|
126
|
+
const deletable = [];
|
|
127
|
+
const blockedBySummaries = [];
|
|
128
|
+
for (const def of definitions) {
|
|
129
|
+
if (def.hasRelatedSummaries) {
|
|
130
|
+
blockedBySummaries.push(def);
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
deletable.push(def);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
return { deletable, blockedBySummaries };
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Maps a definition to a BlockedDefinition for display.
|
|
140
|
+
*/
|
|
141
|
+
static toBlockedDefinition(def) {
|
|
142
|
+
return {
|
|
143
|
+
id: def.id,
|
|
144
|
+
key: def.key,
|
|
145
|
+
name: def.name,
|
|
146
|
+
objectName: def.objectName,
|
|
147
|
+
objectLabel: def.objectLabel,
|
|
148
|
+
category: def.category,
|
|
149
|
+
timeCategory: def.timeCategory,
|
|
150
|
+
segmentCategory: def.segmentCategory,
|
|
151
|
+
status: def.status,
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Creates the empty result structure.
|
|
156
|
+
*/
|
|
157
|
+
static emptyResult() {
|
|
158
|
+
return {
|
|
159
|
+
deleted: 0,
|
|
160
|
+
skipped: 0,
|
|
161
|
+
failed: 0,
|
|
162
|
+
total: 0,
|
|
163
|
+
skipReasons: [],
|
|
164
|
+
failures: [],
|
|
165
|
+
blockedBySummaries: [],
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Executes the definition purge operation.
|
|
170
|
+
*/
|
|
171
|
+
async execute(options) {
|
|
172
|
+
const startTime = Date.now();
|
|
173
|
+
const emptyResult = DefinitionPurgeOperation.emptyResult();
|
|
174
|
+
try {
|
|
175
|
+
this.logger?.log('Starting definition purge operation');
|
|
176
|
+
const hasKeys = options.keys !== undefined && options.keys.length > 0;
|
|
177
|
+
const hasAll = options.all === true;
|
|
178
|
+
const hasFilters = DefinitionPurgeOperation.hasFilterFlags(options);
|
|
179
|
+
// Key-list mode: exclusive — fetch all, match by key, delete matched
|
|
180
|
+
if (hasKeys) {
|
|
181
|
+
return await this.executeKeyMode(options, startTime);
|
|
182
|
+
}
|
|
183
|
+
// Validation: Must have at least one selection criterion
|
|
184
|
+
if (!hasAll && !hasFilters) {
|
|
185
|
+
return createFailureResult(emptyResult, PurgeErrorCodes.NO_SELECTION_CRITERIA, 'No selection criteria specified. Provide --all, --keys, or filter flags.', { metadata: { duration: Date.now() - startTime } });
|
|
186
|
+
}
|
|
187
|
+
// Filter mode (--all or filter flags)
|
|
188
|
+
return await this.executeFilterMode(options, startTime);
|
|
189
|
+
}
|
|
190
|
+
catch (error) {
|
|
191
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
192
|
+
this.logger?.log(`Definition purge operation failed: ${errorMessage}`);
|
|
193
|
+
return createFailureResult(emptyResult, PurgeErrorCodes.OPERATION_FAILED, errorMessage, {
|
|
194
|
+
metadata: { duration: Date.now() - startTime },
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Executes purge in key-list mode.
|
|
200
|
+
* Fetches all definitions, matches by key, ignores all other flags.
|
|
201
|
+
*/
|
|
202
|
+
async executeKeyMode(options, startTime) {
|
|
203
|
+
const keys = options.keys;
|
|
204
|
+
const keySet = new Set(keys);
|
|
205
|
+
this.logger?.log(`Fetching definitions to match keys: ${keys.join(', ')}`);
|
|
206
|
+
const queryResult = await this.definitionService.getAllDefinitions({});
|
|
207
|
+
if (!queryResult.success) {
|
|
208
|
+
return createFailureResult(DefinitionPurgeOperation.emptyResult(), PurgeErrorCodes.QUERY_FAILED, queryResult.message, { metadata: { duration: Date.now() - startTime } });
|
|
209
|
+
}
|
|
210
|
+
const matched = queryResult.data.filter((def) => keySet.has(def.key));
|
|
211
|
+
const matchedKeys = new Set(matched.map((def) => def.key));
|
|
212
|
+
const unmatchedKeys = keys.filter((k) => !matchedKeys.has(k));
|
|
213
|
+
const maxMatchedLabel = matched.reduce((max, def) => Math.max(max, def.name.length), 0);
|
|
214
|
+
options.onDefinitionsFound?.(matched.length, maxMatchedLabel);
|
|
215
|
+
if (matched.length === 0) {
|
|
216
|
+
return createFailureResult(DefinitionPurgeOperation.emptyResult(), PurgeErrorCodes.NO_ELIGIBLE_DEFINITIONS, `No definitions found matching keys: ${keys.join(', ')}`, { metadata: { duration: Date.now() - startTime } });
|
|
217
|
+
}
|
|
218
|
+
const warnings = unmatchedKeys.length > 0 ? [`Keys not found: ${unmatchedKeys.join(', ')}`] : undefined;
|
|
219
|
+
// Pre-categorize matched definitions
|
|
220
|
+
const { deletable, blockedBySummaries } = DefinitionPurgeOperation.categorize(matched);
|
|
221
|
+
const deletableInfo = deletable.map((def) => DefinitionPurgeOperation.toBlockedDefinition(def));
|
|
222
|
+
const blockedBySummariesInfo = blockedBySummaries.map((def) => DefinitionPurgeOperation.toBlockedDefinition(def));
|
|
223
|
+
// Invoke preview callback for user confirmation (unless dry-run or no-prompt)
|
|
224
|
+
if (options.onPreviewReady && !options.dryRun && !options.noPrompt) {
|
|
225
|
+
const proceed = await options.onPreviewReady({
|
|
226
|
+
deletable: deletableInfo,
|
|
227
|
+
blockedBySummaries: blockedBySummariesInfo,
|
|
228
|
+
total: matched.length,
|
|
229
|
+
});
|
|
230
|
+
if (!proceed) {
|
|
231
|
+
return createSuccessResult({
|
|
232
|
+
...DefinitionPurgeOperation.emptyResult(),
|
|
233
|
+
total: matched.length,
|
|
234
|
+
blockedBySummaries: blockedBySummariesInfo,
|
|
235
|
+
}, {
|
|
236
|
+
message: PURGE_CANCELLED_MESSAGE,
|
|
237
|
+
warnings,
|
|
238
|
+
metadata: { duration: Date.now() - startTime },
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
// Dry-run mode
|
|
243
|
+
if (options.dryRun) {
|
|
244
|
+
const preview = {
|
|
245
|
+
deletable: deletable.length,
|
|
246
|
+
blockedBySummaries: blockedBySummaries.length,
|
|
247
|
+
definitions: [
|
|
248
|
+
...deletable.map((def) => ({
|
|
249
|
+
id: def.id,
|
|
250
|
+
key: def.key,
|
|
251
|
+
name: def.name,
|
|
252
|
+
objectName: def.objectName,
|
|
253
|
+
status: def.status,
|
|
254
|
+
action: 'delete',
|
|
255
|
+
})),
|
|
256
|
+
...blockedBySummaries.map((def) => ({
|
|
257
|
+
id: def.id,
|
|
258
|
+
key: def.key,
|
|
259
|
+
name: def.name,
|
|
260
|
+
objectName: def.objectName,
|
|
261
|
+
status: def.status,
|
|
262
|
+
action: 'skip',
|
|
263
|
+
reason: 'has_summaries',
|
|
264
|
+
})),
|
|
265
|
+
],
|
|
266
|
+
};
|
|
267
|
+
return createSuccessResult({
|
|
268
|
+
...DefinitionPurgeOperation.emptyResult(),
|
|
269
|
+
deleted: deletable.length,
|
|
270
|
+
total: matched.length,
|
|
271
|
+
dryRun: true,
|
|
272
|
+
preview,
|
|
273
|
+
blockedBySummaries: blockedBySummariesInfo,
|
|
274
|
+
}, {
|
|
275
|
+
message: `Dry-run: ${deletable.length} deletable, ${blockedBySummaries.length} blocked by summaries`,
|
|
276
|
+
warnings,
|
|
277
|
+
metadata: { duration: Date.now() - startTime },
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
// No deletable definitions
|
|
281
|
+
if (deletable.length === 0) {
|
|
282
|
+
return createSuccessResult({
|
|
283
|
+
...DefinitionPurgeOperation.emptyResult(),
|
|
284
|
+
total: matched.length,
|
|
285
|
+
skipped: matched.length,
|
|
286
|
+
blockedBySummaries: blockedBySummariesInfo,
|
|
287
|
+
}, {
|
|
288
|
+
message: 'Purged 0 profiling definitions',
|
|
289
|
+
warnings,
|
|
290
|
+
metadata: { duration: Date.now() - startTime },
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
// Execute deletion
|
|
294
|
+
const idsToDelete = deletable.map((def) => def.id);
|
|
295
|
+
const deleteResult = await this.definitionService.deleteDefinitions(idsToDelete, {
|
|
296
|
+
onProgress: options.onProgress,
|
|
297
|
+
});
|
|
298
|
+
if (!deleteResult.success) {
|
|
299
|
+
return createFailureResult(DefinitionPurgeOperation.emptyResult(), PurgeErrorCodes.DELETE_FAILED, deleteResult.message, { metadata: { duration: Date.now() - startTime } });
|
|
300
|
+
}
|
|
301
|
+
const { deleted, skipped, failed, skipReasons, failures } = deleteResult.data;
|
|
302
|
+
return createSuccessResult({
|
|
303
|
+
deleted,
|
|
304
|
+
skipped: skipped + blockedBySummaries.length,
|
|
305
|
+
failed,
|
|
306
|
+
total: matched.length,
|
|
307
|
+
skipReasons,
|
|
308
|
+
failures,
|
|
309
|
+
blockedBySummaries: blockedBySummariesInfo,
|
|
310
|
+
}, {
|
|
311
|
+
message: `Purged ${deleted} profiling definitions`,
|
|
312
|
+
warnings,
|
|
313
|
+
metadata: { duration: Date.now() - startTime },
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* Executes purge in filter mode (--all or filter flags).
|
|
318
|
+
*/
|
|
319
|
+
async executeFilterMode(options, startTime) {
|
|
320
|
+
// Build server-side query options
|
|
321
|
+
const queryOptions = DefinitionPurgeOperation.buildQueryOptions(options);
|
|
322
|
+
this.logger?.log('Fetching definitions with filters...');
|
|
323
|
+
const queryResult = await this.definitionService.getAllDefinitions(queryOptions);
|
|
324
|
+
if (!queryResult.success) {
|
|
325
|
+
this.logger?.log(`Definition query failed: ${queryResult.message}`);
|
|
326
|
+
return createFailureResult(DefinitionPurgeOperation.emptyResult(), PurgeErrorCodes.QUERY_FAILED, queryResult.message, { metadata: { duration: Date.now() - startTime } });
|
|
327
|
+
}
|
|
328
|
+
// Apply client-side filters
|
|
329
|
+
const filtered = DefinitionPurgeOperation.applyClientFilters(queryResult.data, options);
|
|
330
|
+
const maxFilteredLabel = filtered.reduce((max, def) => Math.max(max, def.name.length), 0);
|
|
331
|
+
options.onDefinitionsFound?.(filtered.length, maxFilteredLabel);
|
|
332
|
+
if (filtered.length === 0) {
|
|
333
|
+
return createFailureResult(DefinitionPurgeOperation.emptyResult(), PurgeErrorCodes.NO_ELIGIBLE_DEFINITIONS, 'No definitions found matching the specified criteria.', { metadata: { duration: Date.now() - startTime } });
|
|
334
|
+
}
|
|
335
|
+
// Pre-categorize
|
|
336
|
+
const { deletable, blockedBySummaries } = DefinitionPurgeOperation.categorize(filtered);
|
|
337
|
+
const deletableInfo = deletable.map((def) => DefinitionPurgeOperation.toBlockedDefinition(def));
|
|
338
|
+
const blockedBySummariesInfo = blockedBySummaries.map((def) => DefinitionPurgeOperation.toBlockedDefinition(def));
|
|
339
|
+
// Invoke preview callback for user confirmation (unless dry-run or no-prompt)
|
|
340
|
+
if (options.onPreviewReady && !options.dryRun && !options.noPrompt) {
|
|
341
|
+
const proceed = await options.onPreviewReady({
|
|
342
|
+
deletable: deletableInfo,
|
|
343
|
+
blockedBySummaries: blockedBySummariesInfo,
|
|
344
|
+
total: filtered.length,
|
|
345
|
+
});
|
|
346
|
+
if (!proceed) {
|
|
347
|
+
return createSuccessResult({
|
|
348
|
+
...DefinitionPurgeOperation.emptyResult(),
|
|
349
|
+
total: filtered.length,
|
|
350
|
+
blockedBySummaries: blockedBySummariesInfo,
|
|
351
|
+
}, {
|
|
352
|
+
message: PURGE_CANCELLED_MESSAGE,
|
|
353
|
+
metadata: { duration: Date.now() - startTime },
|
|
354
|
+
});
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
// Dry-run mode: return preview without deleting
|
|
358
|
+
if (options.dryRun) {
|
|
359
|
+
const preview = {
|
|
360
|
+
deletable: deletable.length,
|
|
361
|
+
blockedBySummaries: blockedBySummaries.length,
|
|
362
|
+
definitions: [
|
|
363
|
+
...deletable.map((def) => ({
|
|
364
|
+
id: def.id,
|
|
365
|
+
key: def.key,
|
|
366
|
+
name: def.name,
|
|
367
|
+
objectName: def.objectName,
|
|
368
|
+
status: def.status,
|
|
369
|
+
action: 'delete',
|
|
370
|
+
})),
|
|
371
|
+
...blockedBySummaries.map((def) => ({
|
|
372
|
+
id: def.id,
|
|
373
|
+
key: def.key,
|
|
374
|
+
name: def.name,
|
|
375
|
+
objectName: def.objectName,
|
|
376
|
+
status: def.status,
|
|
377
|
+
action: 'skip',
|
|
378
|
+
reason: 'has_summaries',
|
|
379
|
+
})),
|
|
380
|
+
],
|
|
381
|
+
};
|
|
382
|
+
const result = {
|
|
383
|
+
...DefinitionPurgeOperation.emptyResult(),
|
|
384
|
+
deleted: deletable.length,
|
|
385
|
+
total: filtered.length,
|
|
386
|
+
dryRun: true,
|
|
387
|
+
preview,
|
|
388
|
+
blockedBySummaries: blockedBySummariesInfo,
|
|
389
|
+
};
|
|
390
|
+
return createSuccessResult(result, {
|
|
391
|
+
message: `Dry-run: ${deletable.length} deletable, ${blockedBySummaries.length} blocked by summaries`,
|
|
392
|
+
metadata: { duration: Date.now() - startTime },
|
|
393
|
+
});
|
|
394
|
+
}
|
|
395
|
+
// Emit progress events for pre-categorized blocked definitions
|
|
396
|
+
const totalForProgress = filtered.length;
|
|
397
|
+
let progressIndex = 0;
|
|
398
|
+
for (const def of blockedBySummaries) {
|
|
399
|
+
progressIndex++;
|
|
400
|
+
options.onProgress?.({
|
|
401
|
+
id: def.id,
|
|
402
|
+
key: def.key,
|
|
403
|
+
name: def.name,
|
|
404
|
+
objectName: def.objectName,
|
|
405
|
+
category: def.category,
|
|
406
|
+
timeCategory: def.timeCategory,
|
|
407
|
+
segmentCategory: def.segmentCategory,
|
|
408
|
+
profilingStatus: def.status,
|
|
409
|
+
status: 'skipped',
|
|
410
|
+
reason: 'has_summaries',
|
|
411
|
+
current: progressIndex,
|
|
412
|
+
total: totalForProgress,
|
|
413
|
+
});
|
|
414
|
+
}
|
|
415
|
+
// If no deletable definitions, return early
|
|
416
|
+
if (deletable.length === 0) {
|
|
417
|
+
const result = {
|
|
418
|
+
deleted: 0,
|
|
419
|
+
skipped: blockedBySummaries.length,
|
|
420
|
+
failed: 0,
|
|
421
|
+
total: filtered.length,
|
|
422
|
+
skipReasons: [],
|
|
423
|
+
failures: [],
|
|
424
|
+
blockedBySummaries: blockedBySummariesInfo,
|
|
425
|
+
};
|
|
426
|
+
return createSuccessResult(result, {
|
|
427
|
+
message: 'Purged 0 profiling definitions',
|
|
428
|
+
metadata: { duration: Date.now() - startTime },
|
|
429
|
+
});
|
|
430
|
+
}
|
|
431
|
+
// Execute deletion for eligible definitions
|
|
432
|
+
const idsToDelete = deletable.map((def) => def.id);
|
|
433
|
+
const deleteResult = await this.definitionService.deleteDefinitions(idsToDelete, {
|
|
434
|
+
onProgress: options.onProgress
|
|
435
|
+
? (event) => {
|
|
436
|
+
// Adjust progress index to account for pre-categorized skips
|
|
437
|
+
options.onProgress({
|
|
438
|
+
...event,
|
|
439
|
+
current: progressIndex + event.current,
|
|
440
|
+
total: totalForProgress,
|
|
441
|
+
});
|
|
442
|
+
}
|
|
443
|
+
: undefined,
|
|
444
|
+
});
|
|
445
|
+
if (!deleteResult.success) {
|
|
446
|
+
this.logger?.log(`Delete operation failed: ${deleteResult.message}`);
|
|
447
|
+
return createFailureResult(DefinitionPurgeOperation.emptyResult(), PurgeErrorCodes.DELETE_FAILED, deleteResult.message, { metadata: { duration: Date.now() - startTime } });
|
|
448
|
+
}
|
|
449
|
+
const { deleted, skipped, failed, skipReasons, failures } = deleteResult.data;
|
|
450
|
+
const result = {
|
|
451
|
+
deleted,
|
|
452
|
+
skipped: skipped + blockedBySummaries.length,
|
|
453
|
+
failed,
|
|
454
|
+
total: filtered.length,
|
|
455
|
+
skipReasons,
|
|
456
|
+
failures,
|
|
457
|
+
blockedBySummaries: blockedBySummariesInfo,
|
|
458
|
+
};
|
|
459
|
+
return createSuccessResult(result, {
|
|
460
|
+
message: `Purged ${result.deleted} profiling definitions`,
|
|
461
|
+
metadata: { duration: Date.now() - startTime },
|
|
462
|
+
});
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
//# sourceMappingURL=DefinitionPurgeOperation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefinitionPurgeOperation.js","sourceRoot":"","sources":["../../src/operations/DefinitionPurgeOperation.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAsB,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAY3G;;;;;;;;;;GAUG;AACH,uFAAuF;AACvF,MAAM,CAAC,MAAM,uBAAuB,GAAG,0BAA0B,CAAC;AA+IlE;;GAEG;AACH,MAAM,CAAC,MAAM,e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AAC,OAAO,EAAE,CAAC;YAC1B,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,4BAA4B,YAAY,CAAC,OAAQ,EAAE,CAAC,CAAC;YACtE,OAAO,mBAAmB,CACxB,wBAAwB,CAAC,WAAW,EAAE,EACtC,eAAe,CAAC,aAAa,EAC7B,YAAY,CAAC,OAAO,EACpB,EAAE,QAAQ,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,EAAE,EAAE,CACnD,CAAC;QACJ,CAAC;QAED,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,GAAG,YAAY,CAAC,IAAI,CAAC;QAE9E,MAAM,MAAM,GAAgB;YAC1B,OAAO;YACP,OAAO,EAAE,OAAO,GAAG,kBAAkB,CAAC,MAAM;YAC5C,MAAM;YACN,KAAK,EAAE,QAAQ,CAAC,MAAM;YACtB,WAAW;YACX,QAAQ;YACR,kBAAkB,EAAE,sBAAsB;SAC3C,CAAC;QAEF,OAAO,mBAAmB,CAAC,MAAM,EAAE;YACjC,OAAO,EAAE,UAAU,MAAM,CAAC,OAAO,wBAAwB;YACzD,QAAQ,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,EAAE;SAC/C,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { ServiceResult } from '../models/service-result.js';
|
|
2
|
+
import type { ProfilingDefinitionService, UpdateAttributesInput } from '../services/ProfilingDefinitionService.js';
|
|
3
|
+
/**
|
|
4
|
+
* Options for the definition update operation.
|
|
5
|
+
*/
|
|
6
|
+
export type UpdateOptions = {
|
|
7
|
+
/** Salesforce record ID of the definition to update */
|
|
8
|
+
definitionId: string;
|
|
9
|
+
/** Partial attribute set to write — at least one must be supplied */
|
|
10
|
+
attributes: UpdateAttributesInput;
|
|
11
|
+
/** Optional logger for debug output */
|
|
12
|
+
logger?: Console;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Result of a definition update operation.
|
|
16
|
+
*/
|
|
17
|
+
export type UpdateResult = {
|
|
18
|
+
/** The Salesforce record ID of the updated definition */
|
|
19
|
+
definitionId: string;
|
|
20
|
+
/** Whether any attributes were written */
|
|
21
|
+
updated: boolean;
|
|
22
|
+
/** Names of the attributes that were written */
|
|
23
|
+
updatedAttributes: string[];
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Error codes specific to update operations.
|
|
27
|
+
*/
|
|
28
|
+
export declare const UpdateErrorCodes: {
|
|
29
|
+
/** Invalid options provided (missing ID or fields) */
|
|
30
|
+
readonly INVALID_OPTIONS: "UPDATE_INVALID_OPTIONS";
|
|
31
|
+
/** Update operation failed */
|
|
32
|
+
readonly UPDATE_FAILED: "UPDATE_FAILED";
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Orchestrates the update of profiling definition metadata attributes.
|
|
36
|
+
*
|
|
37
|
+
* Follows the 4-layer architecture: Command → Operation → Service → API
|
|
38
|
+
* This operation layer handles business logic orchestration while delegating
|
|
39
|
+
* the actual update to ProfilingDefinitionService.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```typescript
|
|
43
|
+
* const operation = new DefinitionUpdateOperation(definitionService);
|
|
44
|
+
* const result = await operation.execute({
|
|
45
|
+
* definitionId: 'a00000000000001AAA',
|
|
46
|
+
* attributes: { name: 'New Name', category: 'Revenue' }
|
|
47
|
+
* });
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
export declare class DefinitionUpdateOperation {
|
|
51
|
+
private readonly definitionService;
|
|
52
|
+
private readonly logger?;
|
|
53
|
+
/**
|
|
54
|
+
* Creates a new DefinitionUpdateOperation.
|
|
55
|
+
*
|
|
56
|
+
* @param definitionService - The ProfilingDefinitionService instance for executing updates
|
|
57
|
+
* @param logger - Optional logger for debug output
|
|
58
|
+
*/
|
|
59
|
+
constructor(definitionService: ProfilingDefinitionService, logger?: Console);
|
|
60
|
+
/**
|
|
61
|
+
* Validates the update options.
|
|
62
|
+
*
|
|
63
|
+
* @param options - The update options to validate
|
|
64
|
+
* @returns Error message if invalid, undefined if valid
|
|
65
|
+
*/
|
|
66
|
+
private static validateOptions;
|
|
67
|
+
/**
|
|
68
|
+
* Executes the update operation.
|
|
69
|
+
*
|
|
70
|
+
* Returns a ServiceResult with success=false and one of the following error codes on failure:
|
|
71
|
+
* - INVALID_OPTIONS: Missing ID or no attributes supplied
|
|
72
|
+
* - UPDATE_FAILED: When the underlying service update fails
|
|
73
|
+
*
|
|
74
|
+
* @param options - Update options
|
|
75
|
+
* @returns ServiceResult containing update results or error details
|
|
76
|
+
*/
|
|
77
|
+
execute(options: UpdateOptions): Promise<ServiceResult<UpdateResult>>;
|
|
78
|
+
}
|