@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,693 @@
|
|
|
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 { execFile } from 'node:child_process';
|
|
9
|
+
import { mkdir, writeFile } from 'node:fs/promises';
|
|
10
|
+
import { join } from 'node:path';
|
|
11
|
+
import { Flags } from '@salesforce/sf-plugins-core';
|
|
12
|
+
import { Messages } from '@salesforce/core';
|
|
13
|
+
import { CuneiformCommand } from '../../../base/cuneiform-command.js';
|
|
14
|
+
import { ProfilingDefinitionService } from '../../../services/ProfilingDefinitionService.js';
|
|
15
|
+
import { ProfilingExecutionService } from '../../../services/ProfilingExecutionService.js';
|
|
16
|
+
import { ProfilingSummaryService } from '../../../services/ProfilingSummaryService.js';
|
|
17
|
+
import { RecordTypeService } from '../../../services/RecordTypeService.js';
|
|
18
|
+
import { ObjectFilteringService } from '../../../services/ObjectFilteringService.js';
|
|
19
|
+
import { OrgInfoService } from '../../../services/OrgInfoService.js';
|
|
20
|
+
import { DefinitionCreateOperation, } from '../../../operations/DefinitionCreateOperation.js';
|
|
21
|
+
import { DataAvailabilityService } from '../../../services/DataAvailabilityService.js';
|
|
22
|
+
import { ProfilingRestClient } from '../../../adapters/rest/profiling-rest-client.js';
|
|
23
|
+
import { renderSummaryBox } from '../../../utils/formatting/command-display.js';
|
|
24
|
+
import { resolveYearRange } from '../../../models/year-range.js';
|
|
25
|
+
import { validateDateLiteral, resolveDateLiteralRange } from '../../../models/date-literal.js';
|
|
26
|
+
import { displayOrgContext, displayResultsTables, resolveOperationFailure, buildPreConfirmSummary, } from '../../../utils/formatting/definition-create-display.js';
|
|
27
|
+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
28
|
+
const messages = Messages.loadMessages('@peernova/cuneiform-sf', 'definition.create');
|
|
29
|
+
/**
|
|
30
|
+
* Creates profiling definitions for Salesforce objects.
|
|
31
|
+
*/
|
|
32
|
+
// eslint-disable-next-line sf-plugin/only-extend-SfCommand -- CuneiformCommand extends SfCommand with shared access gate logic
|
|
33
|
+
export default class DefinitionCreate extends CuneiformCommand {
|
|
34
|
+
static summary = messages.getMessage('summary');
|
|
35
|
+
static description = messages.getMessage('description');
|
|
36
|
+
static examples = messages.getMessages('examples');
|
|
37
|
+
// eslint-disable-next-line sf-plugin/spread-base-flags -- CuneiformCommand has no additional flags to spread
|
|
38
|
+
static flags = {
|
|
39
|
+
'target-org': Flags.requiredOrg({
|
|
40
|
+
summary: messages.getMessage('flags.target-org.summary'),
|
|
41
|
+
char: 'o',
|
|
42
|
+
required: true,
|
|
43
|
+
}),
|
|
44
|
+
'api-version': Flags.orgApiVersion(),
|
|
45
|
+
objects: Flags.string({
|
|
46
|
+
summary: messages.getMessage('flags.objects.summary'),
|
|
47
|
+
char: 'b',
|
|
48
|
+
multiple: true,
|
|
49
|
+
}),
|
|
50
|
+
filter: Flags.option({
|
|
51
|
+
summary: messages.getMessage('flags.filter.summary'),
|
|
52
|
+
char: 'f',
|
|
53
|
+
options: ['all', 'standard', 'custom'],
|
|
54
|
+
default: 'all',
|
|
55
|
+
})(),
|
|
56
|
+
pattern: Flags.string({
|
|
57
|
+
summary: messages.getMessage('flags.pattern.summary'),
|
|
58
|
+
char: 'p',
|
|
59
|
+
}),
|
|
60
|
+
namespace: Flags.string({
|
|
61
|
+
summary: messages.getMessage('flags.namespace.summary'),
|
|
62
|
+
char: 'n',
|
|
63
|
+
}),
|
|
64
|
+
classification: Flags.option({
|
|
65
|
+
summary: messages.getMessage('flags.classification.summary'),
|
|
66
|
+
options: ['customer', 'internal', 'all'],
|
|
67
|
+
default: 'customer',
|
|
68
|
+
})(),
|
|
69
|
+
'with-records': Flags.boolean({
|
|
70
|
+
summary: messages.getMessage('flags.with-records.summary'),
|
|
71
|
+
}),
|
|
72
|
+
'without-records': Flags.boolean({
|
|
73
|
+
summary: messages.getMessage('flags.without-records.summary'),
|
|
74
|
+
}),
|
|
75
|
+
'with-record-types': Flags.boolean({
|
|
76
|
+
summary: messages.getMessage('flags.with-record-types.summary'),
|
|
77
|
+
}),
|
|
78
|
+
category: Flags.string({
|
|
79
|
+
summary: messages.getMessage('flags.category.summary'),
|
|
80
|
+
char: 'c',
|
|
81
|
+
}),
|
|
82
|
+
'min-records': Flags.integer({
|
|
83
|
+
summary: messages.getMessage('flags.min-records.summary'),
|
|
84
|
+
min: 0,
|
|
85
|
+
default: 0,
|
|
86
|
+
}),
|
|
87
|
+
limit: Flags.integer({
|
|
88
|
+
summary: messages.getMessage('flags.limit.summary'),
|
|
89
|
+
char: 'l',
|
|
90
|
+
min: 1,
|
|
91
|
+
default: 100,
|
|
92
|
+
}),
|
|
93
|
+
method: Flags.option({
|
|
94
|
+
summary: messages.getMessage('flags.method.summary'),
|
|
95
|
+
char: 't',
|
|
96
|
+
options: ['metadata', 'historical', 'comparative', 'recordtype', 'outcome', 'full'],
|
|
97
|
+
default: 'full',
|
|
98
|
+
})(),
|
|
99
|
+
recordtype: Flags.string({
|
|
100
|
+
summary: messages.getMessage('flags.recordtype.summary'),
|
|
101
|
+
}),
|
|
102
|
+
'record-type-status': Flags.option({
|
|
103
|
+
summary: messages.getMessage('flags.record-type-status.summary'),
|
|
104
|
+
options: ['active', 'all', 'inactive'],
|
|
105
|
+
default: 'active',
|
|
106
|
+
})(),
|
|
107
|
+
// eslint-disable-next-line sf-plugin/flag-min-max-default -- year defaults to current year at runtime when method requires it
|
|
108
|
+
year: Flags.integer({
|
|
109
|
+
summary: messages.getMessage('flags.year.summary'),
|
|
110
|
+
min: 2000,
|
|
111
|
+
max: 2050,
|
|
112
|
+
}),
|
|
113
|
+
// eslint-disable-next-line sf-plugin/flag-min-max-default -- depth defaults vary by method at runtime
|
|
114
|
+
depth: Flags.integer({
|
|
115
|
+
summary: messages.getMessage('flags.depth.summary'),
|
|
116
|
+
min: 1,
|
|
117
|
+
max: 10,
|
|
118
|
+
}),
|
|
119
|
+
// eslint-disable-next-line sf-plugin/flag-min-max-default -- from defaults to MIN_YEAR at runtime when to is specified
|
|
120
|
+
from: Flags.integer({
|
|
121
|
+
summary: messages.getMessage('flags.from.summary'),
|
|
122
|
+
min: 2000,
|
|
123
|
+
max: 2050,
|
|
124
|
+
}),
|
|
125
|
+
// eslint-disable-next-line sf-plugin/flag-min-max-default -- to defaults to current year at runtime when from is specified
|
|
126
|
+
to: Flags.integer({
|
|
127
|
+
summary: messages.getMessage('flags.to.summary'),
|
|
128
|
+
min: 2000,
|
|
129
|
+
max: 2050,
|
|
130
|
+
}),
|
|
131
|
+
'no-value-frequency': Flags.boolean({
|
|
132
|
+
summary: messages.getMessage('flags.no-value-frequency.summary'),
|
|
133
|
+
}),
|
|
134
|
+
'use-prior': Flags.boolean({
|
|
135
|
+
summary: messages.getMessage('flags.use-prior.summary'),
|
|
136
|
+
}),
|
|
137
|
+
'lifetime-primary': Flags.boolean({
|
|
138
|
+
summary: messages.getMessage('flags.lifetime-primary.summary'),
|
|
139
|
+
}),
|
|
140
|
+
'date-literal': Flags.string({
|
|
141
|
+
summary: messages.getMessage('flags.date-literal.summary'),
|
|
142
|
+
}),
|
|
143
|
+
'date-field': Flags.string({
|
|
144
|
+
summary: messages.getMessage('flags.date-field.summary'),
|
|
145
|
+
default: 'CreatedDate',
|
|
146
|
+
}),
|
|
147
|
+
profiled: Flags.boolean({
|
|
148
|
+
summary: messages.getMessage('flags.profiled.summary'),
|
|
149
|
+
}),
|
|
150
|
+
'dry-run': Flags.boolean({
|
|
151
|
+
summary: messages.getMessage('flags.dry-run.summary'),
|
|
152
|
+
char: 'd',
|
|
153
|
+
default: false,
|
|
154
|
+
}),
|
|
155
|
+
'no-prompt': Flags.boolean({
|
|
156
|
+
summary: messages.getMessage('flags.no-prompt.summary'),
|
|
157
|
+
default: false,
|
|
158
|
+
}),
|
|
159
|
+
profile: Flags.boolean({
|
|
160
|
+
summary: messages.getMessage('flags.profile.summary'),
|
|
161
|
+
}),
|
|
162
|
+
open: Flags.boolean({
|
|
163
|
+
summary: messages.getMessage('flags.open.summary'),
|
|
164
|
+
}),
|
|
165
|
+
logs: Flags.boolean({
|
|
166
|
+
summary: messages.getMessage('flags.logs.summary'),
|
|
167
|
+
}),
|
|
168
|
+
'name-prefix': Flags.string({
|
|
169
|
+
summary: messages.getMessage('flags.name-prefix.summary'),
|
|
170
|
+
}),
|
|
171
|
+
'name-suffix': Flags.string({
|
|
172
|
+
summary: messages.getMessage('flags.name-suffix.summary'),
|
|
173
|
+
}),
|
|
174
|
+
'time-category': Flags.string({
|
|
175
|
+
summary: messages.getMessage('flags.time-category.summary'),
|
|
176
|
+
}),
|
|
177
|
+
'segment-category': Flags.string({
|
|
178
|
+
summary: messages.getMessage('flags.segment-category.summary'),
|
|
179
|
+
}),
|
|
180
|
+
origin: Flags.string({
|
|
181
|
+
summary: messages.getMessage('flags.origin.summary'),
|
|
182
|
+
default: 'Created via the Cuneiform for Salesforce CLI.',
|
|
183
|
+
}),
|
|
184
|
+
};
|
|
185
|
+
/**
|
|
186
|
+
* Determines the effective --with-records value.
|
|
187
|
+
*
|
|
188
|
+
* When --method full is used and no explicit scope/filter flags are supplied by the user,
|
|
189
|
+
* defaults withRecords to true so the default scope is "customer objects with records."
|
|
190
|
+
* This prevents full profiling from targeting empty or system-only objects.
|
|
191
|
+
*
|
|
192
|
+
* Scope flags that suppress the default: --with-records, --without-records, --filter (non-default),
|
|
193
|
+
* --objects, --pattern.
|
|
194
|
+
*/
|
|
195
|
+
static resolveWithRecords(method, withRecordsFlag, withoutRecordsFlag, objects, pattern, filter) {
|
|
196
|
+
if (method !== 'full')
|
|
197
|
+
return withRecordsFlag;
|
|
198
|
+
// If user explicitly supplied any scope-narrowing flags, respect their intent.
|
|
199
|
+
if (withRecordsFlag !== undefined || withoutRecordsFlag !== undefined)
|
|
200
|
+
return withRecordsFlag;
|
|
201
|
+
if (objects !== undefined && objects.length > 0)
|
|
202
|
+
return withRecordsFlag;
|
|
203
|
+
if (pattern !== undefined)
|
|
204
|
+
return withRecordsFlag;
|
|
205
|
+
if (filter !== 'all')
|
|
206
|
+
return withRecordsFlag;
|
|
207
|
+
// No explicit scope flags for --method full: default to withRecords=true
|
|
208
|
+
return true;
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Executes the create command.
|
|
212
|
+
*
|
|
213
|
+
* @returns DefinitionCreateResult with success status and creation statistics
|
|
214
|
+
*/
|
|
215
|
+
// eslint-disable-next-line complexity -- multi-flag validation, service wiring, and result mapping are inherently sequential
|
|
216
|
+
async run() {
|
|
217
|
+
const { flags } = await this.parse(DefinitionCreate);
|
|
218
|
+
const targetOrg = flags['target-org'].getUsername();
|
|
219
|
+
if (!targetOrg) {
|
|
220
|
+
this.error(messages.getMessage('errors.noTargetOrg'));
|
|
221
|
+
}
|
|
222
|
+
const dryRun = flags['dry-run'];
|
|
223
|
+
const method = flags.method;
|
|
224
|
+
const parsedObjects = DefinitionCreate.parseMultiValueFlag(flags.objects, { caseInsensitive: true });
|
|
225
|
+
// Validate --with-records and --without-records mutual exclusion
|
|
226
|
+
if (flags['with-records'] && flags['without-records']) {
|
|
227
|
+
this.error(messages.getMessage('errors.mutuallyExclusiveRecordFlags'));
|
|
228
|
+
}
|
|
229
|
+
// Validate --min-records and --without-records mutual exclusion (CLI-1265)
|
|
230
|
+
if (flags['min-records'] > 0 && flags['without-records']) {
|
|
231
|
+
this.error(messages.getMessage('errors.minRecordsWithoutRecords'));
|
|
232
|
+
}
|
|
233
|
+
// Validate --recordtype requires a method that supports record type scoping
|
|
234
|
+
if (flags.recordtype && method === 'metadata') {
|
|
235
|
+
this.error(messages.getMessage('errors.recordtypeMethodRequired'));
|
|
236
|
+
}
|
|
237
|
+
// Validate --profiled mutual exclusion with --method metadata
|
|
238
|
+
if (flags.profiled && method === 'metadata') {
|
|
239
|
+
this.error(messages.getMessage('errors.profiledWithMetadata'));
|
|
240
|
+
}
|
|
241
|
+
// Validate --date-literal mutual exclusion with year-based flags
|
|
242
|
+
// Note: --depth is allowed with --date-literal (controls cascade depth)
|
|
243
|
+
const hasDateLiteral = flags['date-literal'] !== undefined;
|
|
244
|
+
const hasYearFlags = flags.year !== undefined || flags.from !== undefined || flags.to !== undefined;
|
|
245
|
+
if (hasDateLiteral && (hasYearFlags || flags['use-prior'])) {
|
|
246
|
+
this.error(messages.getMessage('errors.dateLiteralMutualExclusion'));
|
|
247
|
+
}
|
|
248
|
+
// Validate --lifetime-primary contract (CLI-2944)
|
|
249
|
+
// AC5: only valid with --method comparative.
|
|
250
|
+
// AC4: mutually exclusive with --use-prior.
|
|
251
|
+
// AC5a: mutually exclusive with --depth (no cascade for the lifetime-vs-X variant).
|
|
252
|
+
// AC3: requires a secondary filter (--date-literal, --year, or --from/--to).
|
|
253
|
+
if (flags['lifetime-primary']) {
|
|
254
|
+
if (method !== 'comparative') {
|
|
255
|
+
this.error(messages.getMessage('errors.lifetimePrimaryMethodRequired'));
|
|
256
|
+
}
|
|
257
|
+
if (flags['use-prior']) {
|
|
258
|
+
this.error(messages.getMessage('errors.lifetimePrimaryUsePriorMutualExclusion'));
|
|
259
|
+
}
|
|
260
|
+
if (flags.depth !== undefined) {
|
|
261
|
+
this.error(messages.getMessage('errors.lifetimePrimaryDepthMutualExclusion'));
|
|
262
|
+
}
|
|
263
|
+
if (!hasDateLiteral && !hasYearFlags) {
|
|
264
|
+
this.error(messages.getMessage('errors.lifetimePrimaryRequiresSecondaryFilter'));
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
// Resolve date literal range (when --date-literal is used)
|
|
268
|
+
let dateLiteralRange;
|
|
269
|
+
if (hasDateLiteral) {
|
|
270
|
+
const validationError = validateDateLiteral(flags['date-literal']);
|
|
271
|
+
if (validationError) {
|
|
272
|
+
this.error(validationError);
|
|
273
|
+
}
|
|
274
|
+
try {
|
|
275
|
+
dateLiteralRange = resolveDateLiteralRange({
|
|
276
|
+
dateLiteral: flags['date-literal'],
|
|
277
|
+
depth: flags.depth,
|
|
278
|
+
dateField: flags['date-field'],
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
catch (err) {
|
|
282
|
+
this.error(err.message);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
// Warn when year-related flags are used with metadata (no time dimension)
|
|
286
|
+
if (hasYearFlags && method === 'metadata') {
|
|
287
|
+
this.warn(messages.getMessage('warnings.yearIgnored'));
|
|
288
|
+
}
|
|
289
|
+
// Resolve year range with method-aware defaults (skipped when using date literals)
|
|
290
|
+
let yearRange;
|
|
291
|
+
if (dateLiteralRange) {
|
|
292
|
+
// Date literal mode: year range is empty (date literals replace year-based scoping)
|
|
293
|
+
yearRange = { entries: [] };
|
|
294
|
+
}
|
|
295
|
+
else {
|
|
296
|
+
try {
|
|
297
|
+
yearRange = resolveYearRange({
|
|
298
|
+
year: flags.year,
|
|
299
|
+
depth: flags.depth,
|
|
300
|
+
from: flags.from,
|
|
301
|
+
to: flags.to,
|
|
302
|
+
usePrior: flags['use-prior'],
|
|
303
|
+
method,
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
catch (err) {
|
|
307
|
+
this.error(messages.getMessage('errors.yearRangeInvalid', [err.message]));
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
// Extract single year for backward compatibility with operation layer
|
|
311
|
+
const year = yearRange.entries.length > 0 ? yearRange.entries[0].year : undefined;
|
|
312
|
+
// Resolve withRecords default for --method full
|
|
313
|
+
const withRecords = DefinitionCreate.resolveWithRecords(method, flags['with-records'], flags['without-records'], parsedObjects, flags.pattern, flags.filter);
|
|
314
|
+
// Initialize services
|
|
315
|
+
const { facade, soqlAdapter, restAdapter } = await this.initConnection(flags);
|
|
316
|
+
const definitionService = new ProfilingDefinitionService({ soqlAdapter, restAdapter });
|
|
317
|
+
const filteringService = new ObjectFilteringService({ restApiAdapter: restAdapter, soqlAdapter });
|
|
318
|
+
const profilingSummaryService = flags.profiled ? new ProfilingSummaryService({ soqlAdapter }) : undefined;
|
|
319
|
+
const recordTypeService = method === 'recordtype' || method === 'full' ? new RecordTypeService({ soqlAdapter }) : undefined;
|
|
320
|
+
const dataAvailabilityService = yearRange.entries.length > 0 ? new DataAvailabilityService({ soqlAdapter }) : undefined;
|
|
321
|
+
// REST client enables server-side definition creation (naming, categorization, dedup)
|
|
322
|
+
// When available, steps 3-7 of the pipeline delegate to the ISV REST API
|
|
323
|
+
const restClient = new ProfilingRestClient(restAdapter);
|
|
324
|
+
const operation = new DefinitionCreateOperation(definitionService, filteringService, undefined, profilingSummaryService, recordTypeService, dataAvailabilityService, restClient);
|
|
325
|
+
// Fetch org identity
|
|
326
|
+
this.spinner.start(messages.getMessage('spinner.connecting'));
|
|
327
|
+
const orgInfoService = new OrgInfoService({ connectionFacade: facade, soqlAdapter, restAdapter });
|
|
328
|
+
const orgIdentityResult = await orgInfoService.getOrgIdentity();
|
|
329
|
+
this.spinner.stop();
|
|
330
|
+
if (orgIdentityResult.success) {
|
|
331
|
+
displayOrgContext(this.log.bind(this), orgIdentityResult.data, facade.instanceUrl);
|
|
332
|
+
}
|
|
333
|
+
// Collect callback results for post-execution rendering
|
|
334
|
+
const callbackResults = [];
|
|
335
|
+
let hasObjectWarnings = false;
|
|
336
|
+
const previewState = {
|
|
337
|
+
recordCounts: new Map(),
|
|
338
|
+
objectLabels: new Map(),
|
|
339
|
+
};
|
|
340
|
+
// Build operation options
|
|
341
|
+
const operationOptions = {
|
|
342
|
+
targetOrg,
|
|
343
|
+
objects: parsedObjects,
|
|
344
|
+
pattern: flags.pattern,
|
|
345
|
+
filter: flags.filter,
|
|
346
|
+
namespace: flags.namespace,
|
|
347
|
+
classification: flags.classification,
|
|
348
|
+
withRecords,
|
|
349
|
+
withoutRecords: flags['without-records'],
|
|
350
|
+
withRecordTypes: flags['with-record-types'],
|
|
351
|
+
method,
|
|
352
|
+
recordType: flags.recordtype,
|
|
353
|
+
recordTypeStatus: flags['record-type-status'],
|
|
354
|
+
category: flags.category,
|
|
355
|
+
minRecords: flags['min-records'],
|
|
356
|
+
limit: flags.limit,
|
|
357
|
+
year: hasYearFlags ? year : undefined,
|
|
358
|
+
yearRange,
|
|
359
|
+
noValueFrequency: flags['no-value-frequency'],
|
|
360
|
+
usePrior: flags['use-prior'],
|
|
361
|
+
lifetimePrimary: flags['lifetime-primary'],
|
|
362
|
+
dateLiteralRange,
|
|
363
|
+
profiled: flags.profiled,
|
|
364
|
+
namePrefix: flags['name-prefix'],
|
|
365
|
+
nameSuffix: flags['name-suffix'],
|
|
366
|
+
timeCategory: flags['time-category'],
|
|
367
|
+
segmentCategory: flags['segment-category'],
|
|
368
|
+
origin: flags.origin,
|
|
369
|
+
dryRun,
|
|
370
|
+
noPrompt: flags['no-prompt'],
|
|
371
|
+
// Precedence: dryRun (operation skips callback) > --json (auto-confirm) > --no-prompt (auto-confirm) > interactive prompt
|
|
372
|
+
onPreviewReady: async (preview) => this.handlePreviewReady(preview, method, flags['no-prompt'], previewState, callbackResults),
|
|
373
|
+
onProgress: (message) => {
|
|
374
|
+
if (message.startsWith('Object not found:')) {
|
|
375
|
+
// Surface "not found" warnings immediately to the user
|
|
376
|
+
const objectName = message.replace('Object not found: ', '');
|
|
377
|
+
this.spinner.stop();
|
|
378
|
+
this.warn(messages.getMessage('warnings.objectNotVerified', [objectName]));
|
|
379
|
+
this.log('');
|
|
380
|
+
hasObjectWarnings = true;
|
|
381
|
+
return;
|
|
382
|
+
}
|
|
383
|
+
else if (message.includes('definitions to create') || message.includes('definition to create')) {
|
|
384
|
+
// Phase 1 complete — stop spinner, preview table will render next
|
|
385
|
+
this.spinner.stop();
|
|
386
|
+
}
|
|
387
|
+
else if (message.startsWith('Complete:')) {
|
|
388
|
+
// Skip the final summary message — the table renders the results
|
|
389
|
+
return;
|
|
390
|
+
}
|
|
391
|
+
else {
|
|
392
|
+
this.spinner.status = message;
|
|
393
|
+
}
|
|
394
|
+
},
|
|
395
|
+
onObjectComplete: (objResult) => {
|
|
396
|
+
callbackResults.push({
|
|
397
|
+
objectName: objResult.objectName,
|
|
398
|
+
objectLabel: previewState.objectLabels.get(objResult.objectName),
|
|
399
|
+
status: objResult.status,
|
|
400
|
+
type: objResult.type,
|
|
401
|
+
definitionKey: objResult.definitionKey,
|
|
402
|
+
category: objResult.category,
|
|
403
|
+
timeCategory: objResult.timeCategory,
|
|
404
|
+
segmentCategory: objResult.segmentCategory,
|
|
405
|
+
fieldCount: objResult.fieldCount,
|
|
406
|
+
});
|
|
407
|
+
// Update spinner with running progress counts
|
|
408
|
+
const counts = { created: 0, skipped: 0, failed: 0 };
|
|
409
|
+
for (const r of callbackResults) {
|
|
410
|
+
if (r.status === 'success')
|
|
411
|
+
counts.created++;
|
|
412
|
+
else if (r.status === 'skip')
|
|
413
|
+
counts.skipped++;
|
|
414
|
+
else if (r.status === 'fail')
|
|
415
|
+
counts.failed++;
|
|
416
|
+
}
|
|
417
|
+
const parts = [`${objResult.current}/${objResult.total}`];
|
|
418
|
+
if (counts.created > 0)
|
|
419
|
+
parts.push(`${counts.created} ${messages.getMessage('spinner.status.created')}`);
|
|
420
|
+
if (counts.skipped > 0)
|
|
421
|
+
parts.push(`${counts.skipped} ${messages.getMessage('spinner.status.skipped')}`);
|
|
422
|
+
if (counts.failed > 0)
|
|
423
|
+
parts.push(`${counts.failed} ${messages.getMessage('spinner.status.failed')}`);
|
|
424
|
+
this.spinner.status = parts.join(', ');
|
|
425
|
+
},
|
|
426
|
+
};
|
|
427
|
+
// Execute operation
|
|
428
|
+
this.log('');
|
|
429
|
+
this.spinner.start(messages.getMessage('spinner.validatingObjects'));
|
|
430
|
+
const result = await operation.execute(operationOptions);
|
|
431
|
+
if (hasObjectWarnings) {
|
|
432
|
+
// Spinner was already stopped by the warning handler; suppress duplicate output
|
|
433
|
+
try {
|
|
434
|
+
this.spinner.stop('');
|
|
435
|
+
}
|
|
436
|
+
catch {
|
|
437
|
+
/* already stopped */
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
else {
|
|
441
|
+
this.spinner.stop();
|
|
442
|
+
}
|
|
443
|
+
// Handle failure
|
|
444
|
+
if (!result.success) {
|
|
445
|
+
return this.handleOperationFailure(result, targetOrg, dryRun);
|
|
446
|
+
}
|
|
447
|
+
const data = result.data;
|
|
448
|
+
// Handle cancellation
|
|
449
|
+
if (data.cancelled) {
|
|
450
|
+
this.log('');
|
|
451
|
+
this.log(messages.getMessage('output.cancelled'));
|
|
452
|
+
return {
|
|
453
|
+
success: true,
|
|
454
|
+
created: 0,
|
|
455
|
+
failed: 0,
|
|
456
|
+
skipped: data.skipped,
|
|
457
|
+
total: data.total,
|
|
458
|
+
dryRun,
|
|
459
|
+
failures: [],
|
|
460
|
+
results: [],
|
|
461
|
+
};
|
|
462
|
+
}
|
|
463
|
+
// Display results tables (suppress in JSON mode — printTable writes directly to stdout)
|
|
464
|
+
if (!this.jsonEnabled()) {
|
|
465
|
+
displayResultsTables(this.log.bind(this), this.warn.bind(this), callbackResults, data, dryRun, data.recordCounts ?? previewState.recordCounts);
|
|
466
|
+
}
|
|
467
|
+
// Display warnings if any (skip "Object not found" warnings already shown inline)
|
|
468
|
+
const remainingWarnings = (result.warnings ?? []).filter((w) => !w.startsWith('Object not found:'));
|
|
469
|
+
if (remainingWarnings.length > 0) {
|
|
470
|
+
this.log('');
|
|
471
|
+
for (const warning of remainingWarnings) {
|
|
472
|
+
this.warn(warning);
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
// Post-creation actions
|
|
476
|
+
await this.handlePostCreationActions(flags, data, dryRun, facade, soqlAdapter, restAdapter, facade.instanceUrl ?? '');
|
|
477
|
+
return {
|
|
478
|
+
success: true,
|
|
479
|
+
created: data.created,
|
|
480
|
+
failed: data.failed,
|
|
481
|
+
skipped: data.skipped,
|
|
482
|
+
total: data.total,
|
|
483
|
+
dryRun,
|
|
484
|
+
failures: data.failures,
|
|
485
|
+
results: data.results,
|
|
486
|
+
availabilityGrid: data.availabilityGrid,
|
|
487
|
+
};
|
|
488
|
+
}
|
|
489
|
+
/**
|
|
490
|
+
* Two-stage confirmation: summary then detailed preview table.
|
|
491
|
+
*/
|
|
492
|
+
async handlePreviewReady(preview, method, noPrompt, previewState, callbackResults) {
|
|
493
|
+
this.spinner.stop();
|
|
494
|
+
// eslint-disable-next-line no-param-reassign -- intentional state mutation for preview callback
|
|
495
|
+
previewState.recordCounts = preview.recordCounts;
|
|
496
|
+
for (const input of [...preview.toCreate, ...preview.toSkip]) {
|
|
497
|
+
if (input.objectLabel)
|
|
498
|
+
previewState.objectLabels.set(input.objectName, input.objectLabel);
|
|
499
|
+
}
|
|
500
|
+
// Stage 1: Summary
|
|
501
|
+
const uniqueObjects = new Set([
|
|
502
|
+
...preview.toCreate.map((i) => i.objectName),
|
|
503
|
+
...preview.toSkip.map((i) => i.objectName),
|
|
504
|
+
]).size;
|
|
505
|
+
const preConfirmEntries = buildPreConfirmSummary(uniqueObjects, method, preview.toCreate.length, preview.toSkip.length);
|
|
506
|
+
// Suppress all display output in JSON mode — this.log() writes to stdout,
|
|
507
|
+
// which would produce invalid JSON when mixed with the JSON payload.
|
|
508
|
+
if (!this.jsonEnabled()) {
|
|
509
|
+
this.log('');
|
|
510
|
+
this.log(renderSummaryBox({
|
|
511
|
+
title: messages.getMessage('output.creationSummary'),
|
|
512
|
+
entries: preConfirmEntries,
|
|
513
|
+
}));
|
|
514
|
+
}
|
|
515
|
+
if (!this.jsonEnabled() && !noPrompt) {
|
|
516
|
+
this.log('');
|
|
517
|
+
const showDetail = await this.confirm({
|
|
518
|
+
message: messages.getMessage('prompt.showDetail'),
|
|
519
|
+
});
|
|
520
|
+
if (!showDetail)
|
|
521
|
+
return false;
|
|
522
|
+
}
|
|
523
|
+
// Stage 2: Detailed preview table
|
|
524
|
+
const previewCallbackResults = preview.toCreate.map((input) => ({
|
|
525
|
+
objectName: input.objectName,
|
|
526
|
+
objectLabel: input.objectLabel,
|
|
527
|
+
status: 'preview',
|
|
528
|
+
type: input.method,
|
|
529
|
+
category: input.category,
|
|
530
|
+
timeCategory: DefinitionCreateOperation.resolveTimeCategory(input),
|
|
531
|
+
segmentCategory: input.recordTypeName,
|
|
532
|
+
}));
|
|
533
|
+
const skipCallbackResults = preview.toSkip.map((input) => ({
|
|
534
|
+
objectName: input.objectName,
|
|
535
|
+
objectLabel: input.objectLabel,
|
|
536
|
+
status: 'skip',
|
|
537
|
+
type: input.method,
|
|
538
|
+
category: input.category,
|
|
539
|
+
timeCategory: DefinitionCreateOperation.resolveTimeCategory(input),
|
|
540
|
+
segmentCategory: input.recordTypeName,
|
|
541
|
+
}));
|
|
542
|
+
const previewData = {
|
|
543
|
+
created: preview.toCreate.length,
|
|
544
|
+
failed: 0,
|
|
545
|
+
skipped: preview.toSkip.length,
|
|
546
|
+
total: preview.total,
|
|
547
|
+
results: [],
|
|
548
|
+
failures: [],
|
|
549
|
+
};
|
|
550
|
+
// Display preview tables (suppress in JSON mode — printTable writes directly to stdout)
|
|
551
|
+
if (!this.jsonEnabled()) {
|
|
552
|
+
displayResultsTables(this.log.bind(this), this.warn.bind(this), [...previewCallbackResults, ...skipCallbackResults], previewData, true, preview.recordCounts);
|
|
553
|
+
}
|
|
554
|
+
if (this.jsonEnabled())
|
|
555
|
+
return true;
|
|
556
|
+
if (noPrompt)
|
|
557
|
+
return true;
|
|
558
|
+
this.log('');
|
|
559
|
+
const confirmed = await this.confirm({
|
|
560
|
+
message: messages.getMessage('prompt.confirm', [String(preview.toCreate.length)]),
|
|
561
|
+
});
|
|
562
|
+
if (confirmed) {
|
|
563
|
+
// eslint-disable-next-line no-param-reassign -- intentional array reset for callback results
|
|
564
|
+
callbackResults.length = 0;
|
|
565
|
+
this.spinner.start(messages.getMessage('output.creating', [preview.toCreate.length]));
|
|
566
|
+
}
|
|
567
|
+
return confirmed;
|
|
568
|
+
}
|
|
569
|
+
/**
|
|
570
|
+
* Handles operation failure by translating error codes to user-friendly messages.
|
|
571
|
+
*/
|
|
572
|
+
handleOperationFailure(result, targetOrg, dryRun) {
|
|
573
|
+
const failure = resolveOperationFailure(result, targetOrg, dryRun, (errorCodeMap, errorCode, fallbackMessage, msgs) => DefinitionCreate.resolveErrorMessage(errorCodeMap, errorCode, fallbackMessage, msgs));
|
|
574
|
+
if (failure.type === 'exit') {
|
|
575
|
+
if (failure.log)
|
|
576
|
+
this.log(failure.log);
|
|
577
|
+
process.exitCode = 2;
|
|
578
|
+
return failure.result;
|
|
579
|
+
}
|
|
580
|
+
this.error(failure.message, { code: failure.code });
|
|
581
|
+
}
|
|
582
|
+
/**
|
|
583
|
+
* Handles post-creation actions: --profile, --open, --logs.
|
|
584
|
+
*/
|
|
585
|
+
async handlePostCreationActions(flags, data, dryRun, _facade, soqlAdapter, restAdapter, instanceUrl) {
|
|
586
|
+
if (flags.profile && data.created > 0 && !dryRun) {
|
|
587
|
+
await this.triggerProfiling(data, soqlAdapter, restAdapter);
|
|
588
|
+
}
|
|
589
|
+
else if (flags.profile && dryRun) {
|
|
590
|
+
this.log('');
|
|
591
|
+
this.log(messages.getMessage('output.profileDryRun', [String(data.created)]));
|
|
592
|
+
}
|
|
593
|
+
if (flags.open && data.created > 0 && !dryRun) {
|
|
594
|
+
this.openInBrowser(data, instanceUrl);
|
|
595
|
+
}
|
|
596
|
+
if (flags.logs) {
|
|
597
|
+
await this.writeSessionLogs(data, dryRun);
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
/**
|
|
601
|
+
* Triggers fire-and-forget profiling for successfully created definitions.
|
|
602
|
+
*/
|
|
603
|
+
async triggerProfiling(data, soqlAdapter, restAdapter) {
|
|
604
|
+
const successResults = data.results.filter((r) => r.status === 'success' && r.definitionId);
|
|
605
|
+
if (successResults.length === 0)
|
|
606
|
+
return;
|
|
607
|
+
const executionService = new ProfilingExecutionService({ restAdapter, soqlAdapter });
|
|
608
|
+
this.log('');
|
|
609
|
+
this.log(messages.getMessage('output.profilingStarting'));
|
|
610
|
+
for (const r of successResults) {
|
|
611
|
+
// eslint-disable-next-line no-await-in-loop -- Sequential triggers to avoid overwhelming the org
|
|
612
|
+
const execResult = await executionService.execute(r.definitionId);
|
|
613
|
+
if (execResult.success) {
|
|
614
|
+
this.log(messages.getMessage('output.profilingSuccess', [r.definitionName ?? '', execResult.data ?? '']));
|
|
615
|
+
}
|
|
616
|
+
else {
|
|
617
|
+
this.warn(messages.getMessage('warnings.profilingFailed', [
|
|
618
|
+
r.definitionName ?? '',
|
|
619
|
+
execResult.message ?? 'unknown error',
|
|
620
|
+
]));
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
/**
|
|
625
|
+
* Opens the first created definition in the default browser.
|
|
626
|
+
*/
|
|
627
|
+
openInBrowser(data, instanceUrl) {
|
|
628
|
+
const firstSuccess = data.results.find((r) => r.status === 'success' && r.definitionId);
|
|
629
|
+
if (!firstSuccess)
|
|
630
|
+
return;
|
|
631
|
+
const url = `${instanceUrl}/lightning/r/pnova__Profiling_Definition__c/${firstSuccess.definitionId}/view`;
|
|
632
|
+
const platform = process.platform;
|
|
633
|
+
if (platform === 'darwin') {
|
|
634
|
+
execFile('open', [url], () => { });
|
|
635
|
+
}
|
|
636
|
+
else if (platform === 'win32') {
|
|
637
|
+
execFile('cmd', ['/c', 'start', url], () => { });
|
|
638
|
+
}
|
|
639
|
+
else {
|
|
640
|
+
execFile('xdg-open', [url], () => { });
|
|
641
|
+
}
|
|
642
|
+
this.log('');
|
|
643
|
+
if (data.created > 1) {
|
|
644
|
+
this.log(messages.getMessage('output.openedMultiple', [String(data.created)]));
|
|
645
|
+
}
|
|
646
|
+
else {
|
|
647
|
+
this.log(messages.getMessage('output.openedSingle'));
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
/**
|
|
651
|
+
* Writes session logs to a timestamped directory.
|
|
652
|
+
*/
|
|
653
|
+
async writeSessionLogs(data, dryRun) {
|
|
654
|
+
const now = new Date();
|
|
655
|
+
const timestamp = now
|
|
656
|
+
.toISOString()
|
|
657
|
+
.replace(/:/g, '-')
|
|
658
|
+
.replace(/\.\d+Z$/, '');
|
|
659
|
+
const sessionDir = join('.cuneiform', 'logs', 'definition-create', timestamp);
|
|
660
|
+
await mkdir(sessionDir, { recursive: true });
|
|
661
|
+
const sessionData = {
|
|
662
|
+
timestamp: now.toISOString(),
|
|
663
|
+
dryRun,
|
|
664
|
+
created: data.created,
|
|
665
|
+
failed: data.failed,
|
|
666
|
+
skipped: data.skipped,
|
|
667
|
+
total: data.total,
|
|
668
|
+
results: data.results,
|
|
669
|
+
failures: data.failures,
|
|
670
|
+
};
|
|
671
|
+
const createdDefs = data.results
|
|
672
|
+
.filter((r) => r.status === 'success')
|
|
673
|
+
.map((r) => ({
|
|
674
|
+
objectName: r.objectName,
|
|
675
|
+
definitionName: r.definitionName,
|
|
676
|
+
definitionId: r.definitionId,
|
|
677
|
+
definitionKey: r.definitionKey,
|
|
678
|
+
}));
|
|
679
|
+
const errors = data.failures.map((f) => ({
|
|
680
|
+
objectName: f.objectName,
|
|
681
|
+
error: f.error,
|
|
682
|
+
errorCode: f.errorCode,
|
|
683
|
+
}));
|
|
684
|
+
await Promise.all([
|
|
685
|
+
writeFile(join(sessionDir, 'session.json'), JSON.stringify(sessionData, null, 2)),
|
|
686
|
+
writeFile(join(sessionDir, 'definitions-created.json'), JSON.stringify(createdDefs, null, 2)),
|
|
687
|
+
writeFile(join(sessionDir, 'errors.json'), JSON.stringify(errors, null, 2)),
|
|
688
|
+
]);
|
|
689
|
+
this.log('');
|
|
690
|
+
this.log(messages.getMessage('output.sessionLog', [`${sessionDir}/`]));
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
//# sourceMappingURL=create.js.map
|