@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,231 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2026, PeerNova, Inc. All Rights Reserved.
|
|
3
|
+
* PROPRIETARY AND CONFIDENTIAL. Unauthorized copying, modification,
|
|
4
|
+
* or distribution is strictly prohibited. Use is governed by the
|
|
5
|
+
* Master Subscription Agreement (MSA) between PeerNova, Inc. and the
|
|
6
|
+
* licensee. See LICENSE file in the repo root.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Display formatting functions for the `sf cuneiform definition create` command.
|
|
10
|
+
*
|
|
11
|
+
* Extracted from the command class to keep the command as a thin orchestration
|
|
12
|
+
* shell. All functions are pure (no `this` references) and accept a `log`
|
|
13
|
+
* callback for output. Functions compose primitives from the shared formatting
|
|
14
|
+
* barrel (`utils/formatting/index.ts`).
|
|
15
|
+
*
|
|
16
|
+
* @module utils/formatting/definition-create-display
|
|
17
|
+
*/
|
|
18
|
+
import { printTable } from '@oclif/table';
|
|
19
|
+
import { Messages } from '@salesforce/core';
|
|
20
|
+
import { OrgInfoService } from '../../services/OrgInfoService.js';
|
|
21
|
+
import { isOrgConnectivityError } from '../../adapters/errors.js';
|
|
22
|
+
import { sectionHeader, renderOrgContext, renderSummaryBox, formatNumber } from './index.js';
|
|
23
|
+
/**
|
|
24
|
+
* Lazily loads messages for the definition.create command.
|
|
25
|
+
* Using a getter to avoid module-level side effects.
|
|
26
|
+
*/
|
|
27
|
+
function getMessages() {
|
|
28
|
+
return Messages.loadMessages('@peernova/cuneiform-sf', 'definition.create');
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Returns column definitions for the definition results table.
|
|
32
|
+
*/
|
|
33
|
+
export function getTableColumns() {
|
|
34
|
+
const messages = getMessages();
|
|
35
|
+
return [
|
|
36
|
+
{ key: 'idx', name: '#' },
|
|
37
|
+
{ key: 'object', name: messages.getMessage('table.header.object') },
|
|
38
|
+
{ key: 'records', name: messages.getMessage('table.header.records') },
|
|
39
|
+
{ key: 'type', name: messages.getMessage('table.header.type') },
|
|
40
|
+
{ key: 'category', name: messages.getMessage('table.header.category') },
|
|
41
|
+
{ key: 'time', name: messages.getMessage('table.header.time') },
|
|
42
|
+
{ key: 'segment', name: messages.getMessage('table.header.segment') },
|
|
43
|
+
];
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Builds table data rows from callback results for table rendering.
|
|
47
|
+
*
|
|
48
|
+
* @param results - The callback results to render
|
|
49
|
+
* @param recordCounts - Optional record counts by object name
|
|
50
|
+
* @returns Array of row data records
|
|
51
|
+
*/
|
|
52
|
+
export function buildTableData(results, recordCounts) {
|
|
53
|
+
return results.map((r, i) => ({
|
|
54
|
+
idx: String(i + 1),
|
|
55
|
+
object: r.objectLabel ?? r.objectName,
|
|
56
|
+
records: recordCounts?.has(r.objectName) ? formatNumber(recordCounts.get(r.objectName)) : '—',
|
|
57
|
+
type: r.type ? r.type.charAt(0).toUpperCase() + r.type.slice(1) : '',
|
|
58
|
+
category: r.category ?? '',
|
|
59
|
+
time: r.timeCategory ?? '',
|
|
60
|
+
segment: r.segmentCategory ?? '',
|
|
61
|
+
}));
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Displays the Org Context section using the shared renderOrgContext utility.
|
|
65
|
+
*
|
|
66
|
+
* @param log - The logging function
|
|
67
|
+
* @param orgIdentity - The org identity data
|
|
68
|
+
* @param instanceUrl - The org instance URL
|
|
69
|
+
*/
|
|
70
|
+
export function displayOrgContext(log, orgIdentity, instanceUrl) {
|
|
71
|
+
const messages = getMessages();
|
|
72
|
+
const orgName = orgIdentity.organizationName ?? '(unknown)';
|
|
73
|
+
const orgType = OrgInfoService.classifyOrgType(orgIdentity.isSandbox ?? false, orgIdentity.organizationType);
|
|
74
|
+
log('');
|
|
75
|
+
log(messages.getMessage('output.title', [orgName, orgType]));
|
|
76
|
+
log('');
|
|
77
|
+
log(renderOrgContext({
|
|
78
|
+
orgName: orgIdentity.organizationName,
|
|
79
|
+
orgId: orgIdentity.organizationId,
|
|
80
|
+
instanceUrl: instanceUrl ?? '',
|
|
81
|
+
isSandbox: orgIdentity.isSandbox ?? false,
|
|
82
|
+
}));
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Displays separate Created and Skipped tables, plus summary footer.
|
|
86
|
+
*
|
|
87
|
+
* @param log - The logging function
|
|
88
|
+
* @param warn - The warning function
|
|
89
|
+
* @param callbackResults - The per-object callback results
|
|
90
|
+
* @param data - The operation result data
|
|
91
|
+
* @param dryRun - Whether this is a dry run
|
|
92
|
+
* @param recordCounts - Optional record counts by object name
|
|
93
|
+
*/
|
|
94
|
+
export function displayResultsTables(log, warn, callbackResults, data, dryRun, recordCounts) {
|
|
95
|
+
const messages = getMessages();
|
|
96
|
+
const created = callbackResults.filter((r) => r.status === 'success' || r.status === 'preview');
|
|
97
|
+
const skipped = callbackResults.filter((r) => r.status === 'skip');
|
|
98
|
+
const failed = callbackResults.filter((r) => r.status === 'fail');
|
|
99
|
+
const columns = getTableColumns();
|
|
100
|
+
// Created table
|
|
101
|
+
if (created.length > 0) {
|
|
102
|
+
const prefix = dryRun
|
|
103
|
+
? messages.getMessage('output.tablePrefix.preview')
|
|
104
|
+
: messages.getMessage('output.tablePrefix.created');
|
|
105
|
+
log('');
|
|
106
|
+
log(sectionHeader(`${prefix} ${formatNumber(created.length)} ${messages.getMessage('output.definitionsTitle')}`));
|
|
107
|
+
log('');
|
|
108
|
+
printTable({
|
|
109
|
+
data: buildTableData(created, recordCounts),
|
|
110
|
+
columns,
|
|
111
|
+
borderStyle: 'headers-only',
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
// Skipped table
|
|
115
|
+
if (skipped.length > 0) {
|
|
116
|
+
log('');
|
|
117
|
+
log(sectionHeader(messages.getMessage('output.skippedExisting', [formatNumber(skipped.length)])));
|
|
118
|
+
log('');
|
|
119
|
+
printTable({
|
|
120
|
+
data: buildTableData(skipped, recordCounts),
|
|
121
|
+
columns,
|
|
122
|
+
borderStyle: 'headers-only',
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
// Failed entries
|
|
126
|
+
if (failed.length > 0 || data.failures.length > 0) {
|
|
127
|
+
log('');
|
|
128
|
+
warn(messages.getMessage('output.failedSummary', [String(data.failed)]));
|
|
129
|
+
for (const f of data.failures) {
|
|
130
|
+
log(` ${f.objectName}: ${f.error}`);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
// Summary footer
|
|
134
|
+
const uniqueObjects = new Set(callbackResults.map((r) => r.objectName)).size;
|
|
135
|
+
const summaryEntries = [
|
|
136
|
+
{ key: messages.getMessage('output.summaryObjects'), value: formatNumber(uniqueObjects) },
|
|
137
|
+
];
|
|
138
|
+
if (dryRun) {
|
|
139
|
+
summaryEntries.push({ key: messages.getMessage('output.summaryPreview'), value: formatNumber(created.length) });
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
summaryEntries.push({ key: messages.getMessage('output.summaryCreated'), value: formatNumber(created.length) });
|
|
143
|
+
}
|
|
144
|
+
summaryEntries.push({ key: messages.getMessage('output.summarySkipped'), value: formatNumber(skipped.length) });
|
|
145
|
+
if (!dryRun) {
|
|
146
|
+
summaryEntries.push({ key: messages.getMessage('output.summaryFailed'), value: formatNumber(failed.length) });
|
|
147
|
+
}
|
|
148
|
+
log('');
|
|
149
|
+
log(renderSummaryBox({
|
|
150
|
+
title: messages.getMessage('output.summaryHeader'),
|
|
151
|
+
entries: summaryEntries,
|
|
152
|
+
}));
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Error code to i18n message key mapping for operation errors.
|
|
156
|
+
*/
|
|
157
|
+
export const ERROR_CODE_MAP = {
|
|
158
|
+
CREATE_FILTER_FAILED: 'errors.filterFailed',
|
|
159
|
+
// CREATE_NO_OBJECTS_FOUND intentionally omitted — operation provides a specific message
|
|
160
|
+
// (e.g., "No objects with outcome fields found...") that is more helpful than the generic
|
|
161
|
+
// i18n fallback. resolveErrorMessage passes result.message through when code is not mapped.
|
|
162
|
+
CREATE_OBJECTS_NOT_FOUND: 'errors.objectsNotFound',
|
|
163
|
+
CREATE_ALL_OBJECTS_SKIPPED: 'errors.allObjectsSkipped',
|
|
164
|
+
CREATE_OPERATION_FAILED: 'errors.operationFailed',
|
|
165
|
+
CREATE_NO_PROFILED_OBJECTS: 'errors.noProfiledObjects',
|
|
166
|
+
};
|
|
167
|
+
/**
|
|
168
|
+
* Handles operation failure by translating error codes to user-friendly messages.
|
|
169
|
+
*
|
|
170
|
+
* Returns a structured object indicating the action to take:
|
|
171
|
+
* - `type: 'exit'` — set process.exitCode and return a result
|
|
172
|
+
* - `type: 'error'` — throw via command's this.error()
|
|
173
|
+
*
|
|
174
|
+
* @param result - The failed operation result
|
|
175
|
+
* @param targetOrg - The target org identifier
|
|
176
|
+
* @param dryRun - Whether this is a dry run
|
|
177
|
+
* @param resolveErrorMessage - The error message resolution function from CuneiformCommand
|
|
178
|
+
* @returns An action descriptor for the command to execute
|
|
179
|
+
*/
|
|
180
|
+
export function resolveOperationFailure(result, targetOrg, dryRun, resolveErrorMessage) {
|
|
181
|
+
const messages = getMessages();
|
|
182
|
+
if (result.message && isOrgConnectivityError(result.message)) {
|
|
183
|
+
return {
|
|
184
|
+
type: 'error',
|
|
185
|
+
message: messages.getMessage('errors.orgUnreachable', [targetOrg]),
|
|
186
|
+
code: 'ORG_CONNECTION_FAILED',
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
if (result.errorCode === 'CREATE_OBJECTS_NOT_FOUND') {
|
|
190
|
+
return {
|
|
191
|
+
type: 'exit',
|
|
192
|
+
log: messages.getMessage('errors.objectsNotFoundDetail'),
|
|
193
|
+
result: { success: false, created: 0, failed: 0, skipped: 0, total: 0, dryRun, failures: [], results: [] },
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
const fallbackMessage = result.message ?? messages.getMessage('errors.operationFailed', [result.errorCode ?? 'UNKNOWN']);
|
|
197
|
+
const i18nMessage = resolveErrorMessage(ERROR_CODE_MAP, result.errorCode, fallbackMessage, messages);
|
|
198
|
+
return {
|
|
199
|
+
type: 'error',
|
|
200
|
+
message: i18nMessage,
|
|
201
|
+
code: result.errorCode,
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Builds the pre-confirmation summary box entries for the preview stage.
|
|
206
|
+
*
|
|
207
|
+
* @param uniqueObjects - Number of unique objects
|
|
208
|
+
* @param method - The profiling method
|
|
209
|
+
* @param toCreateCount - Number of definitions to create
|
|
210
|
+
* @param toSkipCount - Number of definitions to skip
|
|
211
|
+
* @returns Array of summary entries for renderSummaryBox
|
|
212
|
+
*/
|
|
213
|
+
export function buildPreConfirmSummary(uniqueObjects, method, toCreateCount, toSkipCount) {
|
|
214
|
+
const messages = getMessages();
|
|
215
|
+
const entries = [
|
|
216
|
+
{ key: messages.getMessage('output.summaryObjects'), value: formatNumber(uniqueObjects) },
|
|
217
|
+
{ key: messages.getMessage('output.summaryMethod'), value: method },
|
|
218
|
+
{
|
|
219
|
+
key: messages.getMessage('output.summaryToCreate'),
|
|
220
|
+
value: messages.getMessage('output.summaryToCreateSuffix', [formatNumber(toCreateCount)]),
|
|
221
|
+
},
|
|
222
|
+
];
|
|
223
|
+
if (toSkipCount > 0) {
|
|
224
|
+
entries.push({
|
|
225
|
+
key: messages.getMessage('output.summaryExisting'),
|
|
226
|
+
value: messages.getMessage('output.summaryExistingSuffix', [formatNumber(toSkipCount)]),
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
return entries;
|
|
230
|
+
}
|
|
231
|
+
//# sourceMappingURL=definition-create-display.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"definition-create-display.js","sourceRoot":"","sources":["../../../src/utils/formatting/definition-create-display.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;;;GASG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAElE,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE7F;;;GAGG;AACH,SAAS,WAAW;IAClB,OAAO,QAAQ,CAAC,YAAY,CAAC,wBAAwB,EAAE,mBAAmB,CAAC,CAAC;AAC9E,CAAC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AwB,CAAC;YAClD,KAAK,EAAE,QAAQ,CAAC,UAAU,CAAC,8BAA8B,EAAE,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC,CAAC;SAC1F;KACF,CAAC;IACF,IAAI,WAAW,GAAG,CAAC,EAAE,CAAC;QACpB,OAAO,CAAC,IAAI,CAAC;YACX,GAAG,EAAE,QAAQ,CAAC,UAAU,CAAC,wBAAwB,CAAC;YAClD,KAAK,EAAE,QAAQ,CAAC,UAAU,CAAC,8BAA8B,EAAE,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC,CAAC;SACxF,CAAC,CAAC;IACL,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Options for formatting a contextual empty state message.
|
|
3
|
+
*/
|
|
4
|
+
export type EmptyStateOptions = {
|
|
5
|
+
/** The entity type that was searched for (e.g., "objects", "fields", "definitions") */
|
|
6
|
+
readonly entityType: string;
|
|
7
|
+
/** Summary of filters that were applied */
|
|
8
|
+
readonly appliedFilters?: readonly string[];
|
|
9
|
+
/** Suggestions to broaden the search */
|
|
10
|
+
readonly suggestions?: readonly string[];
|
|
11
|
+
/** Related commands the user might want to try */
|
|
12
|
+
readonly relatedCommands?: readonly string[];
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Formats a contextual empty state message with suggestions.
|
|
16
|
+
*
|
|
17
|
+
* Returns an array of lines to be displayed when a query produces no results.
|
|
18
|
+
* Always starts with a "No {entityType} found" header line. Optional sections
|
|
19
|
+
* for applied filters, suggestions, and related commands are included only
|
|
20
|
+
* when their arrays are non-empty.
|
|
21
|
+
*
|
|
22
|
+
* Each section is separated by a blank line. List items within sections use
|
|
23
|
+
* a 2-space indent with a dash prefix.
|
|
24
|
+
*
|
|
25
|
+
* @param options - Configuration for the empty state message
|
|
26
|
+
* @returns An array of formatted lines for display
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* formatEmptyState({ entityType: 'objects' })
|
|
30
|
+
* // ["No objects found matching the specified criteria."]
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* formatEmptyState({ entityType: 'objects', appliedFilters: ['filter: custom'], suggestions: ['Try removing the filter'] })
|
|
34
|
+
*/
|
|
35
|
+
export declare function formatEmptyState(options: EmptyStateOptions): readonly string[];
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2026, PeerNova, Inc. All Rights Reserved.
|
|
3
|
+
* PROPRIETARY AND CONFIDENTIAL. Unauthorized copying, modification,
|
|
4
|
+
* or distribution is strictly prohibited. Use is governed by the
|
|
5
|
+
* Master Subscription Agreement (MSA) between PeerNova, Inc. and the
|
|
6
|
+
* licensee. See LICENSE file in the repo root.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Pure empty state formatting utilities for CLI display output.
|
|
10
|
+
*
|
|
11
|
+
* Provides contextual "no results" messages with applied filters,
|
|
12
|
+
* actionable suggestions, and related command references. All functions
|
|
13
|
+
* are pure (no side effects, no external state).
|
|
14
|
+
*
|
|
15
|
+
* @module utils/formatting/empty-states
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* Indent prefix used for list items (2-space indent + dash + space).
|
|
19
|
+
*/
|
|
20
|
+
const BULLET_PREFIX = ' • ';
|
|
21
|
+
/**
|
|
22
|
+
* Formats a contextual empty state message with suggestions.
|
|
23
|
+
*
|
|
24
|
+
* Returns an array of lines to be displayed when a query produces no results.
|
|
25
|
+
* Always starts with a "No {entityType} found" header line. Optional sections
|
|
26
|
+
* for applied filters, suggestions, and related commands are included only
|
|
27
|
+
* when their arrays are non-empty.
|
|
28
|
+
*
|
|
29
|
+
* Each section is separated by a blank line. List items within sections use
|
|
30
|
+
* a 2-space indent with a dash prefix.
|
|
31
|
+
*
|
|
32
|
+
* @param options - Configuration for the empty state message
|
|
33
|
+
* @returns An array of formatted lines for display
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* formatEmptyState({ entityType: 'objects' })
|
|
37
|
+
* // ["No objects found matching the specified criteria."]
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* formatEmptyState({ entityType: 'objects', appliedFilters: ['filter: custom'], suggestions: ['Try removing the filter'] })
|
|
41
|
+
*/
|
|
42
|
+
export function formatEmptyState(options) {
|
|
43
|
+
const { entityType, appliedFilters, suggestions, relatedCommands } = options;
|
|
44
|
+
const lines = [`• No ${entityType} found matching the specified criteria.`];
|
|
45
|
+
appendSection(lines, 'Filters applied:', appliedFilters);
|
|
46
|
+
appendSection(lines, 'Suggestions:', suggestions);
|
|
47
|
+
appendSection(lines, 'Related commands:', relatedCommands);
|
|
48
|
+
return lines;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Appends a labeled section with bullet items to the output lines.
|
|
52
|
+
*
|
|
53
|
+
* Only appends when the items array is defined and non-empty.
|
|
54
|
+
* A blank line is inserted before each section for visual separation.
|
|
55
|
+
*
|
|
56
|
+
* @param lines - The mutable output array to append to
|
|
57
|
+
* @param heading - The section heading text (e.g., "Filters applied:")
|
|
58
|
+
* @param items - The items to display as a bullet list
|
|
59
|
+
*/
|
|
60
|
+
function appendSection(lines, heading, items) {
|
|
61
|
+
if (!items || items.length === 0) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
lines.push('');
|
|
65
|
+
lines.push(heading);
|
|
66
|
+
for (const item of items) {
|
|
67
|
+
lines.push(`${BULLET_PREFIX}${item}`);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=empty-states.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"empty-states.js","sourceRoot":"","sources":["../../../src/utils/formatting/empty-states.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;;GAQG;AAEH;;GAEG;AACH,MAAM,aAAa,GAAG,MAAM,CAAC;AAgB7B;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAA0B;IACzD,MAAM,EAAE,UAAU,EAAE,cAAc,EAAE,WAAW,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC;IAE7E,MAAM,KAAK,GAAa,CAAC,QAAQ,UAAU,yCAAyC,CAAC,CAAC;IAEtF,aAAa,CAAC,KAAK,EAAE,kBAAkB,EAAE,cAAc,CAAC,CAAC;IACzD,aAAa,CAAC,KAAK,EAAE,cAAc,EAAE,WAAW,CAAC,CAAC;IAClD,aAAa,CAAC,KAAK,EAAE,mBAAmB,EAAE,eAAe,CAAC,CAAC;IAE3D,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;;;;;GASG;AACH,SAAS,aAAa,CAAC,KAAe,EAAE,OAAe,EAAE,KAAoC;IAC3F,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACjC,OAAO;IACT,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACpB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,KAAK,CAAC,IAAI,CAAC,GAAG,aAAa,GAAG,IAAI,EAAE,CAAC,CAAC;IACxC,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Options for formatting an error with structured remediation guidance.
|
|
3
|
+
*/
|
|
4
|
+
export type ErrorRemediationOptions = {
|
|
5
|
+
/** What happened - the error description. */
|
|
6
|
+
readonly what: string;
|
|
7
|
+
/** Why it happened - root cause or context. */
|
|
8
|
+
readonly why?: string;
|
|
9
|
+
/** How to fix - actionable remediation steps. Can be a single string or an array of numbered steps. */
|
|
10
|
+
readonly fix?: string | readonly string[];
|
|
11
|
+
/** Error code for reference. */
|
|
12
|
+
readonly errorCode?: string;
|
|
13
|
+
/** Documentation link. */
|
|
14
|
+
readonly docsUrl?: string;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Formats an error with structured remediation guidance.
|
|
18
|
+
*
|
|
19
|
+
* Returns a multi-line string with what/why/fix sections following the
|
|
20
|
+
* what/why/fix pattern for CLI error display. Only sections with defined
|
|
21
|
+
* values are included; undefined fields are omitted entirely.
|
|
22
|
+
*
|
|
23
|
+
* @param options - The error remediation options
|
|
24
|
+
* @returns A formatted multi-line string with remediation guidance
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* formatErrorWithRemediation({ what: 'Connection failed' })
|
|
28
|
+
* // "Error: Connection failed"
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* formatErrorWithRemediation({ what: 'Could not connect.', why: 'Token expired.', fix: ['Run sf org login web'] })
|
|
32
|
+
*/
|
|
33
|
+
export declare function formatErrorWithRemediation(options: ErrorRemediationOptions): string;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2026, PeerNova, Inc. All Rights Reserved.
|
|
3
|
+
* PROPRIETARY AND CONFIDENTIAL. Unauthorized copying, modification,
|
|
4
|
+
* or distribution is strictly prohibited. Use is governed by the
|
|
5
|
+
* Master Subscription Agreement (MSA) between PeerNova, Inc. and the
|
|
6
|
+
* licensee. See LICENSE file in the repo root.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Pure error formatting utilities for CLI display output.
|
|
10
|
+
*
|
|
11
|
+
* All functions are pure (no side effects, no external state) and return
|
|
12
|
+
* formatted strings with structured remediation guidance (what/why/fix pattern).
|
|
13
|
+
*
|
|
14
|
+
* @module utils/formatting/errors
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Prefix for the "what happened" line.
|
|
18
|
+
*/
|
|
19
|
+
const ERROR_PREFIX = 'Error: ';
|
|
20
|
+
/**
|
|
21
|
+
* Prefix for numbered fix steps (indent + number + dot + space).
|
|
22
|
+
*/
|
|
23
|
+
const STEP_INDENT = ' ';
|
|
24
|
+
/**
|
|
25
|
+
* Formats an error with structured remediation guidance.
|
|
26
|
+
*
|
|
27
|
+
* Returns a multi-line string with what/why/fix sections following the
|
|
28
|
+
* what/why/fix pattern for CLI error display. Only sections with defined
|
|
29
|
+
* values are included; undefined fields are omitted entirely.
|
|
30
|
+
*
|
|
31
|
+
* @param options - The error remediation options
|
|
32
|
+
* @returns A formatted multi-line string with remediation guidance
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* formatErrorWithRemediation({ what: 'Connection failed' })
|
|
36
|
+
* // "Error: Connection failed"
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* formatErrorWithRemediation({ what: 'Could not connect.', why: 'Token expired.', fix: ['Run sf org login web'] })
|
|
40
|
+
*/
|
|
41
|
+
export function formatErrorWithRemediation(options) {
|
|
42
|
+
const sections = [];
|
|
43
|
+
// What: always present (required field)
|
|
44
|
+
sections.push(`${ERROR_PREFIX}${options.what}`);
|
|
45
|
+
// Why: optional root cause
|
|
46
|
+
if (options.why !== undefined) {
|
|
47
|
+
sections.push(`Why: ${options.why}`);
|
|
48
|
+
}
|
|
49
|
+
// Fix: optional remediation (single string or numbered steps)
|
|
50
|
+
if (options.fix !== undefined) {
|
|
51
|
+
if (typeof options.fix === 'string') {
|
|
52
|
+
sections.push(`Fix: ${options.fix}`);
|
|
53
|
+
}
|
|
54
|
+
else if (options.fix.length > 0) {
|
|
55
|
+
const steps = options.fix.map((step, index) => `${STEP_INDENT}${index + 1}. ${step}`);
|
|
56
|
+
sections.push(`Fix:\n${steps.join('\n')}`);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
// Reference: optional error code and/or docs URL
|
|
60
|
+
const referenceParts = [];
|
|
61
|
+
if (options.errorCode !== undefined) {
|
|
62
|
+
referenceParts.push(options.errorCode);
|
|
63
|
+
}
|
|
64
|
+
if (options.docsUrl !== undefined) {
|
|
65
|
+
referenceParts.push(options.docsUrl);
|
|
66
|
+
}
|
|
67
|
+
if (referenceParts.length > 0) {
|
|
68
|
+
sections.push(`Reference: ${referenceParts.join(' | ')}`);
|
|
69
|
+
}
|
|
70
|
+
return sections.join('\n\n');
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/utils/formatting/errors.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;GAOG;AAEH;;GAEG;AACH,MAAM,YAAY,GAAG,SAAS,CAAC;AAE/B;;GAEG;AACH,MAAM,WAAW,GAAG,IAAI,CAAC;AAkBzB;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,0BAA0B,CAAC,OAAgC;IACzE,MAAM,QAAQ,GAAa,EAAE,CAAC;IAE9B,wCAAwC;IACxC,QAAQ,CAAC,IAAI,CAAC,GAAG,YAAY,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;IAEhD,2BAA2B;IAC3B,IAAI,OAAO,CAAC,GAAG,KAAK,SAAS,EAAE,CAAC;QAC9B,QAAQ,CAAC,IAAI,CAAC,QAAQ,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IACvC,CAAC;IAED,8DAA8D;IAC9D,IAAI,OAAO,CAAC,GAAG,KAAK,SAAS,EAAE,CAAC;QAC9B,IAAI,OAAO,OAAO,CAAC,GAAG,KAAK,QAAQ,EAAE,CAAC;YACpC,QAAQ,CAAC,IAAI,CAAC,QAAQ,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QACvC,CAAC;aAAM,IAAI,OAAO,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAClC,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,GAAG,WAAW,GAAG,KAAK,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;YACtF,QAAQ,CAAC,IAAI,CAAC,SAAS,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC7C,CAAC;IACH,CAAC;IAED,iDAAiD;IACjD,MAAM,cAAc,GAAa,EAAE,CAAC;IACpC,IAAI,OAAO,CAAC,SAAS,KAAK,SAAS,EAAE,CAAC;QACpC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACzC,CAAC;IACD,IAAI,OAAO,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;QAClC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACvC,CAAC;IACD,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC9B,QAAQ,CAAC,IAAI,CAAC,cAAc,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAC5D,CAAC;IAED,OAAO,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAC/B,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility for converting Salesforce field API type names to user-friendly display labels.
|
|
3
|
+
*
|
|
4
|
+
* @module utils/formatting/field-types
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Sentinel value returned when the input field type is empty, null, or undefined.
|
|
8
|
+
*/
|
|
9
|
+
export declare const INVALID_DISPLAY = "--";
|
|
10
|
+
/**
|
|
11
|
+
* Converts a Salesforce field API type name to a user-friendly display label.
|
|
12
|
+
*
|
|
13
|
+
* @param fieldType - The Salesforce API field type (e.g., `'string'`, `'reference'`, `'boolean'`).
|
|
14
|
+
* Matching is case-insensitive.
|
|
15
|
+
* @param referenceTo - Optional target object for reference (lookup) fields. When provided and
|
|
16
|
+
* `fieldType` is `'reference'`, the result includes the target object name
|
|
17
|
+
* (e.g., `'Lookup to Account'`).
|
|
18
|
+
* @returns A human-readable label for the field type, or {@link INVALID_DISPLAY} if the input
|
|
19
|
+
* is empty/null/undefined. Unknown types are returned in title case.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* humanizeFieldType('string'); // 'Text'
|
|
24
|
+
* humanizeFieldType('reference', 'Account'); // 'Lookup to Account'
|
|
25
|
+
* humanizeFieldType('reference'); // 'Lookup'
|
|
26
|
+
* humanizeFieldType('BOOLEAN'); // 'Checkbox' (case-insensitive)
|
|
27
|
+
* humanizeFieldType('customtype'); // 'Customtype' (title case fallback)
|
|
28
|
+
* humanizeFieldType(''); // '--'
|
|
29
|
+
* humanizeFieldType(null as unknown as string); // '--'
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export declare function humanizeFieldType(fieldType: string, referenceTo?: string | null): string;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2026, PeerNova, Inc. All Rights Reserved.
|
|
3
|
+
* PROPRIETARY AND CONFIDENTIAL. Unauthorized copying, modification,
|
|
4
|
+
* or distribution is strictly prohibited. Use is governed by the
|
|
5
|
+
* Master Subscription Agreement (MSA) between PeerNova, Inc. and the
|
|
6
|
+
* licensee. See LICENSE file in the repo root.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Utility for converting Salesforce field API type names to user-friendly display labels.
|
|
10
|
+
*
|
|
11
|
+
* @module utils/formatting/field-types
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Sentinel value returned when the input field type is empty, null, or undefined.
|
|
15
|
+
*/
|
|
16
|
+
export const INVALID_DISPLAY = '--';
|
|
17
|
+
/**
|
|
18
|
+
* Mapping of lowercase Salesforce API field type names to human-readable labels.
|
|
19
|
+
*
|
|
20
|
+
* @remarks
|
|
21
|
+
* The `reference` type is handled separately by {@link humanizeFieldType} to incorporate
|
|
22
|
+
* the optional `referenceTo` parameter.
|
|
23
|
+
*/
|
|
24
|
+
const FIELD_TYPE_LABELS = {
|
|
25
|
+
id: 'ID',
|
|
26
|
+
string: 'Text',
|
|
27
|
+
textarea: 'Text Area',
|
|
28
|
+
boolean: 'Checkbox',
|
|
29
|
+
int: 'Integer',
|
|
30
|
+
double: 'Number',
|
|
31
|
+
currency: 'Currency',
|
|
32
|
+
percent: 'Percent',
|
|
33
|
+
date: 'Date',
|
|
34
|
+
datetime: 'Date/Time',
|
|
35
|
+
time: 'Time',
|
|
36
|
+
phone: 'Phone',
|
|
37
|
+
email: 'Email',
|
|
38
|
+
url: 'URL',
|
|
39
|
+
picklist: 'Picklist',
|
|
40
|
+
multipicklist: 'Multi-Select Picklist',
|
|
41
|
+
reference: 'Lookup',
|
|
42
|
+
masterrecord: 'Master-Detail',
|
|
43
|
+
base64: 'Binary',
|
|
44
|
+
combobox: 'Combobox',
|
|
45
|
+
encryptedstring: 'Encrypted Text',
|
|
46
|
+
location: 'Geolocation',
|
|
47
|
+
address: 'Address',
|
|
48
|
+
complexvalue: 'Complex Value',
|
|
49
|
+
long: 'Long Text',
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Converts a Salesforce field API type name to a user-friendly display label.
|
|
53
|
+
*
|
|
54
|
+
* @param fieldType - The Salesforce API field type (e.g., `'string'`, `'reference'`, `'boolean'`).
|
|
55
|
+
* Matching is case-insensitive.
|
|
56
|
+
* @param referenceTo - Optional target object for reference (lookup) fields. When provided and
|
|
57
|
+
* `fieldType` is `'reference'`, the result includes the target object name
|
|
58
|
+
* (e.g., `'Lookup to Account'`).
|
|
59
|
+
* @returns A human-readable label for the field type, or {@link INVALID_DISPLAY} if the input
|
|
60
|
+
* is empty/null/undefined. Unknown types are returned in title case.
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* ```typescript
|
|
64
|
+
* humanizeFieldType('string'); // 'Text'
|
|
65
|
+
* humanizeFieldType('reference', 'Account'); // 'Lookup to Account'
|
|
66
|
+
* humanizeFieldType('reference'); // 'Lookup'
|
|
67
|
+
* humanizeFieldType('BOOLEAN'); // 'Checkbox' (case-insensitive)
|
|
68
|
+
* humanizeFieldType('customtype'); // 'Customtype' (title case fallback)
|
|
69
|
+
* humanizeFieldType(''); // '--'
|
|
70
|
+
* humanizeFieldType(null as unknown as string); // '--'
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
export function humanizeFieldType(fieldType, referenceTo) {
|
|
74
|
+
if (!fieldType) {
|
|
75
|
+
return INVALID_DISPLAY;
|
|
76
|
+
}
|
|
77
|
+
const normalized = fieldType.toLowerCase();
|
|
78
|
+
if (normalized === 'reference' && referenceTo) {
|
|
79
|
+
return `Lookup to ${referenceTo}`;
|
|
80
|
+
}
|
|
81
|
+
const label = FIELD_TYPE_LABELS[normalized];
|
|
82
|
+
if (label) {
|
|
83
|
+
return label;
|
|
84
|
+
}
|
|
85
|
+
// Unknown types: return title case (first letter uppercase, rest lowercase)
|
|
86
|
+
return normalized.charAt(0).toUpperCase() + normalized.slice(1);
|
|
87
|
+
}
|
|
88
|
+
//# sourceMappingURL=field-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field-types.js","sourceRoot":"","sources":["../../../src/utils/formatting/field-types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;GAIG;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,CAAC;AAEpC;;;;;;GAMG;AACH,MAAM,iBAAiB,GAA2B;IAChD,EAAE,EAAE,IAAI;IACR,MAAM,EAAE,MAAM;IACd,QAAQ,EAAE,WAAW;IACrB,OAAO,EAAE,UAAU;IACnB,GAAG,EAAE,SAAS;IACd,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,UAAU;IACpB,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,WAAW;IACrB,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;IACd,GAAG,EAAE,KAAK;IACV,QAAQ,EAAE,UAAU;IACpB,aAAa,EAAE,uBAAuB;IACtC,SAAS,EAAE,QAAQ;IACnB,YAAY,EAAE,eAAe;IAC7B,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,UAAU;IACpB,eAAe,EAAE,gBAAgB;IACjC,QAAQ,EAAE,aAAa;IACvB,OAAO,EAAE,SAAS;IAClB,YAAY,EAAE,eAAe;IAC7B,IAAI,EAAE,WAAW;CAClB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,iBAAiB,CAAC,SAAiB,EAAE,WAA2B;IAC9E,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,OAAO,eAAe,CAAC;IACzB,CAAC;IAED,MAAM,UAAU,GAAG,SAAS,CAAC,WAAW,EAAE,CAAC;IAE3C,IAAI,UAAU,KAAK,WAAW,IAAI,WAAW,EAAE,CAAC;QAC9C,OAAO,aAAa,WAAW,EAAE,CAAC;IACpC,CAAC;IAED,MAAM,KAAK,GAAG,iBAAiB,CAAC,UAAU,CAAC,CAAC;IAC5C,IAAI,KAAK,EAAE,CAAC;QACV,OAAO,KAAK,CAAC;IACf,CAAC;IAED,4EAA4E;IAC5E,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAClE,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared formatting utilities for CLI display output.
|
|
3
|
+
*
|
|
4
|
+
* Re-exports all formatting primitives from individual modules.
|
|
5
|
+
* Commands import from this barrel to access consistent formatting
|
|
6
|
+
* across the CLI.
|
|
7
|
+
*
|
|
8
|
+
* @module utils/formatting
|
|
9
|
+
*/
|
|
10
|
+
export { formatNumber, formatCompact, formatPercent, formatBytes } from './numbers.js';
|
|
11
|
+
export { sectionHeader, sectionHeaderWithCount, sectionSeparator, keyValue, bulletList, SECTION_GAP_LINES, logSectionGap, } from './sections.js';
|
|
12
|
+
export type { KeyValueOptions } from './sections.js';
|
|
13
|
+
export { statusSymbol, booleanDisplay, volumeIndicator, completenessBar } from './indicators.js';
|
|
14
|
+
export type { BooleanDisplayOptions, BooleanDisplayStyle, VolumeThresholds, StatusType, VolumeLevel, } from './indicators.js';
|
|
15
|
+
export { buildColumns, numberColumn, booleanColumn, renderAlignedTable } from './tables.js';
|
|
16
|
+
export type { ColumnDef, ColumnAlignment } from './tables.js';
|
|
17
|
+
export { formatErrorWithRemediation } from './errors.js';
|
|
18
|
+
export type { ErrorRemediationOptions } from './errors.js';
|
|
19
|
+
export { formatEmptyState } from './empty-states.js';
|
|
20
|
+
export type { EmptyStateOptions } from './empty-states.js';
|
|
21
|
+
export { renderSummaryBox, displaySummaryBox, renderCompletionMessage, renderWarningBlock, renderOrgContext, renderContextualHeader, } from './command-display.js';
|
|
22
|
+
export type { SummaryEntry, SummaryBoxOptions, CompletionMessageOptions, WarningBlockOptions, OrgContext, ContextualHeaderOptions, } from './command-display.js';
|
|
23
|
+
export { loadingMessage } from './loading-messages.js';
|
|
24
|
+
export { formatNamespace } from './namespace-display.js';
|
|
25
|
+
export type { NamespaceDisplayOptions } from './namespace-display.js';
|
|
26
|
+
export { buildRecordAgeColumns, buildRecordAgeTableData } from './record-age-grid.js';
|
|
27
|
+
export type { RecordAgeTableRow } from './record-age-grid.js';
|
|
28
|
+
export { buildBusinessProcessColumns, buildBusinessProcessTableData } from './business-process-grid.js';
|
|
29
|
+
export type { BusinessProcessGridEntry } from './business-process-grid.js';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2026, PeerNova, Inc. All Rights Reserved.
|
|
3
|
+
* PROPRIETARY AND CONFIDENTIAL. Unauthorized copying, modification,
|
|
4
|
+
* or distribution is strictly prohibited. Use is governed by the
|
|
5
|
+
* Master Subscription Agreement (MSA) between PeerNova, Inc. and the
|
|
6
|
+
* licensee. See LICENSE file in the repo root.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Shared formatting utilities for CLI display output.
|
|
10
|
+
*
|
|
11
|
+
* Re-exports all formatting primitives from individual modules.
|
|
12
|
+
* Commands import from this barrel to access consistent formatting
|
|
13
|
+
* across the CLI.
|
|
14
|
+
*
|
|
15
|
+
* @module utils/formatting
|
|
16
|
+
*/
|
|
17
|
+
export { formatNumber, formatCompact, formatPercent, formatBytes } from './numbers.js';
|
|
18
|
+
export { sectionHeader, sectionHeaderWithCount, sectionSeparator, keyValue, bulletList, SECTION_GAP_LINES, logSectionGap, } from './sections.js';
|
|
19
|
+
export { statusSymbol, booleanDisplay, volumeIndicator, completenessBar } from './indicators.js';
|
|
20
|
+
export { buildColumns, numberColumn, booleanColumn, renderAlignedTable } from './tables.js';
|
|
21
|
+
export { formatErrorWithRemediation } from './errors.js';
|
|
22
|
+
export { formatEmptyState } from './empty-states.js';
|
|
23
|
+
export { renderSummaryBox, displaySummaryBox, renderCompletionMessage, renderWarningBlock, renderOrgContext, renderContextualHeader, } from './command-display.js';
|
|
24
|
+
export { loadingMessage } from './loading-messages.js';
|
|
25
|
+
export { formatNamespace } from './namespace-display.js';
|
|
26
|
+
export { buildRecordAgeColumns, buildRecordAgeTableData } from './record-age-grid.js';
|
|
27
|
+
export { buildBusinessProcessColumns, buildBusinessProcessTableData } from './business-process-grid.js';
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/formatting/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;;GAQG;AAEH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACvF,OAAO,EACL,aAAa,EACb,sBAAsB,EACtB,gBAAgB,EAChB,QAAQ,EACR,UAAU,EACV,iBAAiB,EACjB,aAAa,GACd,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAQjG,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAE5F,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AAEzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,uBAAuB,EACvB,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,sBAAsB,CAAC;AAS9B,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,OAAO,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAEtF,OAAO,EAAE,2BAA2B,EAAE,6BAA6B,EAAE,MAAM,4BAA4B,CAAC"}
|