@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,207 @@
|
|
|
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
|
+
* Creates a mock connection facade for testing adapters.
|
|
10
|
+
*
|
|
11
|
+
* @param config - Optional configuration
|
|
12
|
+
* @returns Mock connection facade with call recording
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* // Basic usage
|
|
17
|
+
* const { connection } = createMockConnection();
|
|
18
|
+
* const adapter = new SoqlQueryAdapter(connection);
|
|
19
|
+
*
|
|
20
|
+
* // With configuration
|
|
21
|
+
* const { connection, calls } = createMockConnection({
|
|
22
|
+
* version: '58.0',
|
|
23
|
+
* defaultQueryResult: { done: true, totalSize: 0, records: [] }
|
|
24
|
+
* });
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export function createMockConnection(config) {
|
|
28
|
+
const calls = [];
|
|
29
|
+
const queryResults = new Map();
|
|
30
|
+
const describeResults = new Map();
|
|
31
|
+
const errors = new Map();
|
|
32
|
+
const executeAnonymousResults = new Map();
|
|
33
|
+
const requestResults = new Map();
|
|
34
|
+
/* eslint-disable camelcase -- Salesforce API uses snake_case for identity response */
|
|
35
|
+
let identityResult = config?.defaultIdentity ?? {
|
|
36
|
+
user_id: '005xx000001ABCDEF',
|
|
37
|
+
organization_id: '00Dxx000001ABCDEF',
|
|
38
|
+
username: 'test@example.com',
|
|
39
|
+
};
|
|
40
|
+
/* eslint-enable camelcase */
|
|
41
|
+
const throws = new Map();
|
|
42
|
+
const recordCall = (method, args) => {
|
|
43
|
+
calls.push({ method, args, timestamp: Date.now() });
|
|
44
|
+
};
|
|
45
|
+
const checkThrow = (method, key) => {
|
|
46
|
+
const throwKey = `${method}:${key}`;
|
|
47
|
+
const throwError = throws.get(throwKey);
|
|
48
|
+
if (throwError) {
|
|
49
|
+
throw throwError;
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
const checkError = (method, key) => {
|
|
53
|
+
const errorKey = `${method}:${key}`;
|
|
54
|
+
const error = errors.get(errorKey);
|
|
55
|
+
if (error) {
|
|
56
|
+
throw error;
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
const tooling = {
|
|
60
|
+
query: (soql) => {
|
|
61
|
+
recordCall('tooling.query', [soql]);
|
|
62
|
+
checkThrow('tooling.query', soql);
|
|
63
|
+
checkError('tooling.query', soql);
|
|
64
|
+
const result = queryResults.get(`tooling:${soql}`);
|
|
65
|
+
if (result)
|
|
66
|
+
return Promise.resolve(result);
|
|
67
|
+
return Promise.resolve((config?.defaultQueryResult ?? { done: true, totalSize: 0, records: [] }));
|
|
68
|
+
},
|
|
69
|
+
queryMore: (locator) => {
|
|
70
|
+
recordCall('tooling.queryMore', [locator]);
|
|
71
|
+
checkThrow('tooling.queryMore', locator);
|
|
72
|
+
checkError('tooling.queryMore', locator);
|
|
73
|
+
const result = queryResults.get(`tooling:more:${locator}`);
|
|
74
|
+
if (result)
|
|
75
|
+
return Promise.resolve(result);
|
|
76
|
+
return Promise.resolve({ done: true, totalSize: 0, records: [] });
|
|
77
|
+
},
|
|
78
|
+
executeAnonymous: (apex) => {
|
|
79
|
+
recordCall('tooling.executeAnonymous', [apex]);
|
|
80
|
+
checkThrow('tooling.executeAnonymous', apex);
|
|
81
|
+
checkError('tooling.executeAnonymous', apex);
|
|
82
|
+
const result = executeAnonymousResults.get(apex);
|
|
83
|
+
if (result)
|
|
84
|
+
return Promise.resolve(result);
|
|
85
|
+
return Promise.resolve({ success: true, compiled: true });
|
|
86
|
+
},
|
|
87
|
+
create: (type, record) => {
|
|
88
|
+
recordCall('tooling.create', [type, record]);
|
|
89
|
+
checkThrow('tooling.create', type);
|
|
90
|
+
checkError('tooling.create', type);
|
|
91
|
+
return Promise.resolve({ id: `${type}Id123`, success: true });
|
|
92
|
+
},
|
|
93
|
+
destroy: (type, id) => {
|
|
94
|
+
recordCall('tooling.destroy', [type, id]);
|
|
95
|
+
checkThrow('tooling.destroy', `${type}:${id}`);
|
|
96
|
+
checkError('tooling.destroy', `${type}:${id}`);
|
|
97
|
+
return Promise.resolve({ id, success: true });
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
const createSObjectApi = (name) => ({
|
|
101
|
+
describe: () => {
|
|
102
|
+
recordCall('sobject.describe', [name]);
|
|
103
|
+
checkError('sobject.describe', name);
|
|
104
|
+
const result = describeResults.get(name);
|
|
105
|
+
if (result)
|
|
106
|
+
return Promise.resolve(result);
|
|
107
|
+
return Promise.resolve(config?.defaultDescribeResult ?? {
|
|
108
|
+
name,
|
|
109
|
+
label: name,
|
|
110
|
+
labelPlural: `${name}s`,
|
|
111
|
+
custom: false,
|
|
112
|
+
createable: true,
|
|
113
|
+
updateable: true,
|
|
114
|
+
deletable: true,
|
|
115
|
+
queryable: true,
|
|
116
|
+
searchable: true,
|
|
117
|
+
fields: [],
|
|
118
|
+
});
|
|
119
|
+
},
|
|
120
|
+
find: (conditions, fields) => {
|
|
121
|
+
recordCall('sobject.find', [name, conditions, fields]);
|
|
122
|
+
return {
|
|
123
|
+
limit: () => createSObjectApi(name).find(conditions, fields),
|
|
124
|
+
execute: () => {
|
|
125
|
+
recordCall('sobject.find.execute', [name, conditions, fields]);
|
|
126
|
+
return Promise.resolve([]);
|
|
127
|
+
},
|
|
128
|
+
};
|
|
129
|
+
},
|
|
130
|
+
});
|
|
131
|
+
const connection = {
|
|
132
|
+
tooling,
|
|
133
|
+
version: config?.version ?? '58.0',
|
|
134
|
+
accessToken: config?.accessToken ?? 'mock-access-token',
|
|
135
|
+
instanceUrl: config?.instanceUrl ?? 'https://test.salesforce.com',
|
|
136
|
+
query: (soql) => {
|
|
137
|
+
recordCall('query', [soql]);
|
|
138
|
+
checkThrow('query', soql);
|
|
139
|
+
checkError('query', soql);
|
|
140
|
+
const result = queryResults.get(soql);
|
|
141
|
+
if (result)
|
|
142
|
+
return Promise.resolve(result);
|
|
143
|
+
return Promise.resolve((config?.defaultQueryResult ?? { done: true, totalSize: 0, records: [] }));
|
|
144
|
+
},
|
|
145
|
+
queryMore: (locator) => {
|
|
146
|
+
recordCall('queryMore', [locator]);
|
|
147
|
+
checkThrow('queryMore', locator);
|
|
148
|
+
checkError('queryMore', locator);
|
|
149
|
+
const result = queryResults.get(`more:${locator}`);
|
|
150
|
+
if (result)
|
|
151
|
+
return Promise.resolve(result);
|
|
152
|
+
return Promise.resolve({ done: true, totalSize: 0, records: [] });
|
|
153
|
+
},
|
|
154
|
+
sobject: (name) => {
|
|
155
|
+
recordCall('sobject', [name]);
|
|
156
|
+
return createSObjectApi(name);
|
|
157
|
+
},
|
|
158
|
+
request: (request) => {
|
|
159
|
+
const url = typeof request === 'string' ? request : request.url;
|
|
160
|
+
recordCall('request', [request]);
|
|
161
|
+
checkThrow('request', url);
|
|
162
|
+
checkError('request', url);
|
|
163
|
+
const result = requestResults.get(url);
|
|
164
|
+
if (result)
|
|
165
|
+
return Promise.resolve(result);
|
|
166
|
+
return Promise.resolve({});
|
|
167
|
+
},
|
|
168
|
+
identity: () => {
|
|
169
|
+
recordCall('identity', []);
|
|
170
|
+
checkThrow('identity', '');
|
|
171
|
+
checkError('identity', '');
|
|
172
|
+
return Promise.resolve(identityResult);
|
|
173
|
+
},
|
|
174
|
+
};
|
|
175
|
+
return {
|
|
176
|
+
connection,
|
|
177
|
+
calls,
|
|
178
|
+
resetCalls: () => {
|
|
179
|
+
calls.length = 0;
|
|
180
|
+
},
|
|
181
|
+
setQueryResult: (soql, result) => {
|
|
182
|
+
queryResults.set(soql, result);
|
|
183
|
+
},
|
|
184
|
+
setDescribeResult: (objectName, result) => {
|
|
185
|
+
describeResults.set(objectName, result);
|
|
186
|
+
},
|
|
187
|
+
setError: (method, key, error) => {
|
|
188
|
+
errors.set(`${method}:${key}`, error);
|
|
189
|
+
},
|
|
190
|
+
setIdentity: (identity) => {
|
|
191
|
+
identityResult = identity;
|
|
192
|
+
},
|
|
193
|
+
setExecuteAnonymousResult: (apex, result) => {
|
|
194
|
+
executeAnonymousResults.set(apex, result);
|
|
195
|
+
},
|
|
196
|
+
setRequestResult: (url, result) => {
|
|
197
|
+
requestResults.set(url, result);
|
|
198
|
+
},
|
|
199
|
+
setThrow: (method, key, error) => {
|
|
200
|
+
throws.set(`${method}:${key}`, error);
|
|
201
|
+
},
|
|
202
|
+
clearThrow: (method, key) => {
|
|
203
|
+
throws.delete(`${method}:${key}`);
|
|
204
|
+
},
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
//# sourceMappingURL=mock-connection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mock-connection.js","sourceRoot":"","sources":["../../../src/adapters/testing/mock-connection.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAkEH;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,oBAAoB,CAAC,MAA6B;IAChE,MAAM,KAAK,GAAiB,EAAE,CAAC;IAC/B,MAAM,YAAY,GAAG,IAAI,GAAG,EAAmB,CAAC;IAChD,MAAM,eAAe,GAAG,IAAI,GAAG,EAAiC,CAAC;IACjE,MAAM,MAAM,GAAG,IAAI,GAAG,EAAiB,CAAC;IACxC,MAAM,uBAAuB,GAAG,IAAI,GAAG,EAAkC,CAAC;IAC1E,MAAM,cAAc,GAAG,IAAI,GAAG,EAAmB,CAAC;IAClD,sFAAsF;IACtF,IAAI,cAAc,GAAG,MAAM,EAAE,eAAe,IAAI;QAC9C,OAAO,EAAE,mBAAmB;QAC5B,eAAe,EAAE,mBAAmB;QACpC,QAAQ,EAAE,kBAAkB;KAC7B,CAAC;IACF,6BAA6B;IAE7B,MAAM,MAAM,GAAG,IAAI,GAAG,EAAiB,CAAC;IAExC,MAAM,UAAU,GAAG,CAAC,MAAc,EAAE,IAAe,EAAQ,EAAE;QAC3D,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IACtD,CAAC,CAAC;IAEF,MAAM,UAAU,GAAG,CAAC,MAAc,EAAE,GAAW,EAAQ,EAAE;QACvD,MAAM,QAAQ,GAAG,GAAG,MAAM,IAAI,GAAG,EAAE,CAAC;Q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|
6
|
+
/** Type-safe Console mock with all methods stubbed */
|
|
7
|
+
logger: Console;
|
|
8
|
+
/** Direct reference to the log stub for assertion access */
|
|
9
|
+
logStub: sinon.SinonStub;
|
|
10
|
+
/** Direct reference to the warn stub for assertion access */
|
|
11
|
+
warnStub: sinon.SinonStub;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Create a type-safe mock Console logger for testing.
|
|
15
|
+
*
|
|
16
|
+
* Replaces the common `{ log: sinon.stub() } as unknown as Console` pattern
|
|
17
|
+
* with a properly typed factory that satisfies the Console interface.
|
|
18
|
+
*
|
|
19
|
+
* @returns MockLogger with logger instance and direct stub references
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* const { logger, logStub } = createMockLogger();
|
|
24
|
+
* const service = new MyService(connection, config, logger);
|
|
25
|
+
* await service.doWork();
|
|
26
|
+
* expect(logStub.calledWith('Processing...')).to.be.true;
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export declare function createMockLogger(): MockLogger;
|
|
@@ -0,0 +1,57 @@
|
|
|
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
|
+
// eslint-disable-next-line import/no-extraneous-dependencies -- test-only factory, sinon is a devDependency
|
|
9
|
+
import sinon from 'sinon';
|
|
10
|
+
/**
|
|
11
|
+
* Create a type-safe mock Console logger for testing.
|
|
12
|
+
*
|
|
13
|
+
* Replaces the common `{ log: sinon.stub() } as unknown as Console` pattern
|
|
14
|
+
* with a properly typed factory that satisfies the Console interface.
|
|
15
|
+
*
|
|
16
|
+
* @returns MockLogger with logger instance and direct stub references
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* const { logger, logStub } = createMockLogger();
|
|
21
|
+
* const service = new MyService(connection, config, logger);
|
|
22
|
+
* await service.doWork();
|
|
23
|
+
* expect(logStub.calledWith('Processing...')).to.be.true;
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export function createMockLogger() {
|
|
27
|
+
const logStub = sinon.stub();
|
|
28
|
+
const warnStub = sinon.stub();
|
|
29
|
+
// Build a Console-compatible object with all required methods stubbed
|
|
30
|
+
const logger = {
|
|
31
|
+
log: logStub,
|
|
32
|
+
warn: warnStub,
|
|
33
|
+
error: sinon.stub(),
|
|
34
|
+
info: sinon.stub(),
|
|
35
|
+
debug: sinon.stub(),
|
|
36
|
+
dir: sinon.stub(),
|
|
37
|
+
dirxml: sinon.stub(),
|
|
38
|
+
table: sinon.stub(),
|
|
39
|
+
trace: sinon.stub(),
|
|
40
|
+
assert: sinon.stub(),
|
|
41
|
+
clear: sinon.stub(),
|
|
42
|
+
count: sinon.stub(),
|
|
43
|
+
countReset: sinon.stub(),
|
|
44
|
+
group: sinon.stub(),
|
|
45
|
+
groupCollapsed: sinon.stub(),
|
|
46
|
+
groupEnd: sinon.stub(),
|
|
47
|
+
time: sinon.stub(),
|
|
48
|
+
timeEnd: sinon.stub(),
|
|
49
|
+
timeLog: sinon.stub(),
|
|
50
|
+
timeStamp: sinon.stub(),
|
|
51
|
+
profile: sinon.stub(),
|
|
52
|
+
profileEnd: sinon.stub(),
|
|
53
|
+
Console: console.Console, // eslint-disable-line no-console -- required Console constructor property
|
|
54
|
+
};
|
|
55
|
+
return { logger, logStub, warnStub };
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=mock-logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mock-logger.js","sourceRoot":"","sources":["../../../src/adapters/testing/mock-logger.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;A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AAM,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;AACvC,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { McpAdapters } from '../../mcp/config/mcp-config.js';
|
|
2
|
+
import type { IConnectionFacade } from '../connection-facade.js';
|
|
3
|
+
import { type MockSalesforceConnectionConfig } from './mock-salesforce-connection.js';
|
|
4
|
+
/**
|
|
5
|
+
* Configuration for McpAdapters mock.
|
|
6
|
+
*/
|
|
7
|
+
export type MockMcpAdaptersConfig = MockSalesforceConnectionConfig & {
|
|
8
|
+
/** Override the facade mock (e.g., to provide identity() or instanceUrl) */
|
|
9
|
+
readonly facade?: Partial<IConnectionFacade>;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Creates a mock McpAdapters suitable for MCP handler unit tests.
|
|
13
|
+
*
|
|
14
|
+
* Handler tests stub at the service level (e.g., `sinon.stub(ProfilingDefinitionService.prototype)`),
|
|
15
|
+
* so the adapter fields only need to satisfy the TypeScript type — they are never invoked directly.
|
|
16
|
+
* The single `as unknown as` casts are isolated here so test files have zero type-safety bypasses.
|
|
17
|
+
*
|
|
18
|
+
* @param config - Optional overrides for connection and facade properties
|
|
19
|
+
* @returns A McpAdapters-typed mock
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* import { createMockAdapters } from '../../../src/adapters/testing/index.js';
|
|
24
|
+
*
|
|
25
|
+
* let mockAdapters: McpAdapters;
|
|
26
|
+
*
|
|
27
|
+
* beforeEach(() => {
|
|
28
|
+
* mockAdapters = createMockAdapters();
|
|
29
|
+
* });
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export declare function createMockAdapters(config?: MockMcpAdaptersConfig): McpAdapters;
|
|
@@ -0,0 +1,52 @@
|
|
|
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 { createMockSalesforceConnection } from './mock-salesforce-connection.js';
|
|
9
|
+
/**
|
|
10
|
+
* Creates a mock McpAdapters suitable for MCP handler unit tests.
|
|
11
|
+
*
|
|
12
|
+
* Handler tests stub at the service level (e.g., `sinon.stub(ProfilingDefinitionService.prototype)`),
|
|
13
|
+
* so the adapter fields only need to satisfy the TypeScript type — they are never invoked directly.
|
|
14
|
+
* The single `as unknown as` casts are isolated here so test files have zero type-safety bypasses.
|
|
15
|
+
*
|
|
16
|
+
* @param config - Optional overrides for connection and facade properties
|
|
17
|
+
* @returns A McpAdapters-typed mock
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```typescript
|
|
21
|
+
* import { createMockAdapters } from '../../../src/adapters/testing/index.js';
|
|
22
|
+
*
|
|
23
|
+
* let mockAdapters: McpAdapters;
|
|
24
|
+
*
|
|
25
|
+
* beforeEach(() => {
|
|
26
|
+
* mockAdapters = createMockAdapters();
|
|
27
|
+
* });
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export function createMockAdapters(config) {
|
|
31
|
+
const connection = createMockSalesforceConnection(config);
|
|
32
|
+
/* eslint-disable camelcase -- Salesforce Identity API returns snake_case fields */
|
|
33
|
+
const defaultFacade = {
|
|
34
|
+
identity: () => Promise.resolve({
|
|
35
|
+
user_id: 'test-user',
|
|
36
|
+
organization_id: 'test-org',
|
|
37
|
+
username: config?.username ?? 'test@example.com',
|
|
38
|
+
}),
|
|
39
|
+
instanceUrl: config?.instanceUrl ?? 'https://test.salesforce.com',
|
|
40
|
+
...config?.facade,
|
|
41
|
+
};
|
|
42
|
+
/* eslint-enable camelcase */
|
|
43
|
+
// eslint-disable-next-line test-quality/no-type-safety-bypass -- isolated cast: adapters are never invoked in handler tests (services are stubbed); only type satisfaction is needed
|
|
44
|
+
return {
|
|
45
|
+
connection,
|
|
46
|
+
facade: defaultFacade,
|
|
47
|
+
soql: {},
|
|
48
|
+
rest: {},
|
|
49
|
+
tooling: {},
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=mock-mcp-adapters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mock-mcp-adapters.js","sourceRoot":"","sources":["../../../src/adapters/testing/mock-mcp-adapters.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,EAAE,8BAA8B,EAAuC,MAAM,iCAAiC,CAAC;AAUtH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAA8B;IAC/D,MAAM,UAAU,GAAe,8BAA8B,CAAC,MAAM,CAAC,CAAC;IAEtE,mFAAmF;IACnF,MAAM,aAAa,GAAG;QACpB,QAAQ,EAAE,GAAG,EAAE,CACb,OAAO,CAAC,OAAO,CAAC;YACd,OAAO,EAAE,WAAW;YACpB,eAAe,EAAE,UAAU;YAC3B,QAAQ,EAAE,MAAM,EAAE,QAAQ,IAAI,kBAAkB;SACjD,CAAC;QACJ,WAAW,EAAE,MAAM,EAAE,WAAW,IAAI,6BAA6B;QACjE,GAAG,MAAM,EAAE,MAAM;KAClB,CAAC;IACF,6BAA6B;IAE7B,qLAAqL;IACrL,OAAO;QACL,UAAU;QACV,MAAM,EAAE,aAAiD;QACzD,IAAI,EAAE,EAAoC;QAC1C,IAAI,EAAE,EAAoC;QAC1C,OAAO,EAAE,EAAuC;KACjD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import sinon from 'sinon';
|
|
2
|
+
import type { Config } from '@oclif/core';
|
|
3
|
+
/**
|
|
4
|
+
* Creates a minimal mock oclif Config object for use in SfCommand unit tests.
|
|
5
|
+
*
|
|
6
|
+
* SfCommand constructors require a Config instance, but tests that stub `parse()` never
|
|
7
|
+
* access it at runtime. This factory satisfies the type system without requiring a real
|
|
8
|
+
* oclif config, eliminating the `{} as never` pattern across command test files.
|
|
9
|
+
*
|
|
10
|
+
* All methods are sinon stubs. All required properties are populated with sensible test
|
|
11
|
+
* defaults. Optional overrides let individual tests supply specific values when needed.
|
|
12
|
+
*
|
|
13
|
+
* @param sandbox - Sinon sandbox used to create all method stubs (enables automatic restore)
|
|
14
|
+
* @param overrides - Optional partial Config values to override defaults
|
|
15
|
+
* @returns A Config-compatible object with stubbed methods
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* const cmd = new SummaryStop([], createMockOclifConfig($$.SANDBOX));
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare function createMockOclifConfig(sandbox: sinon.SinonSandbox, overrides?: Partial<Config>): Config;
|
|
@@ -0,0 +1,90 @@
|
|
|
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
|
+
* Creates a minimal mock oclif Config object for use in SfCommand unit tests.
|
|
10
|
+
*
|
|
11
|
+
* SfCommand constructors require a Config instance, but tests that stub `parse()` never
|
|
12
|
+
* access it at runtime. This factory satisfies the type system without requiring a real
|
|
13
|
+
* oclif config, eliminating the `{} as never` pattern across command test files.
|
|
14
|
+
*
|
|
15
|
+
* All methods are sinon stubs. All required properties are populated with sensible test
|
|
16
|
+
* defaults. Optional overrides let individual tests supply specific values when needed.
|
|
17
|
+
*
|
|
18
|
+
* @param sandbox - Sinon sandbox used to create all method stubs (enables automatic restore)
|
|
19
|
+
* @param overrides - Optional partial Config values to override defaults
|
|
20
|
+
* @returns A Config-compatible object with stubbed methods
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```typescript
|
|
24
|
+
* const cmd = new SummaryStop([], createMockOclifConfig($$.SANDBOX));
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export function createMockOclifConfig(sandbox, overrides = {}) {
|
|
28
|
+
// Cast to Config: the class has private/protected fields (warned, _base, etc.) that are
|
|
29
|
+
// unreachable from outside. Tests that use this factory stub parse() and never access the
|
|
30
|
+
// config object at runtime, so the incomplete implementation is safe.
|
|
31
|
+
const config = {
|
|
32
|
+
// Required string properties
|
|
33
|
+
arch: 'x64',
|
|
34
|
+
bin: 'sf',
|
|
35
|
+
cacheDir: '/tmp/sf-test-cache',
|
|
36
|
+
channel: 'stable',
|
|
37
|
+
configDir: '/tmp/sf-test-config',
|
|
38
|
+
dataDir: '/tmp/sf-test-data',
|
|
39
|
+
dirname: 'sf',
|
|
40
|
+
home: '/tmp/sf-test-home',
|
|
41
|
+
name: '@peernova/cuneiform-sf',
|
|
42
|
+
root: '/tmp/sf-test-root',
|
|
43
|
+
shell: 'zsh',
|
|
44
|
+
userAgent: 'sf/0.0.0',
|
|
45
|
+
version: '0.0.0',
|
|
46
|
+
// Required boolean properties
|
|
47
|
+
isSingleCommandCLI: false,
|
|
48
|
+
valid: true,
|
|
49
|
+
windows: false,
|
|
50
|
+
// Required array properties
|
|
51
|
+
commandIDs: [],
|
|
52
|
+
commands: [],
|
|
53
|
+
topics: [],
|
|
54
|
+
// Required map/object properties
|
|
55
|
+
plugins: new Map(),
|
|
56
|
+
// Required complex properties
|
|
57
|
+
topicSeparator: ':',
|
|
58
|
+
platform: 'darwin',
|
|
59
|
+
pjson: {
|
|
60
|
+
name: '@peernova/cuneiform-sf',
|
|
61
|
+
version: '0.0.0',
|
|
62
|
+
oclif: {},
|
|
63
|
+
},
|
|
64
|
+
updateConfig: {},
|
|
65
|
+
versionDetails: {
|
|
66
|
+
architecture: 'x64',
|
|
67
|
+
cliVersion: '0.0.0',
|
|
68
|
+
nodeVersion: 'v20.0.0',
|
|
69
|
+
},
|
|
70
|
+
// Required stub methods
|
|
71
|
+
findCommand: sandbox.stub().returns(undefined),
|
|
72
|
+
findMatches: sandbox.stub().returns([]),
|
|
73
|
+
findTopic: sandbox.stub().returns(undefined),
|
|
74
|
+
getAllCommandIDs: sandbox.stub().returns([]),
|
|
75
|
+
getAllCommands: sandbox.stub().returns([]),
|
|
76
|
+
getPluginsList: sandbox.stub().returns([]),
|
|
77
|
+
runCommand: sandbox.stub().resolves(),
|
|
78
|
+
runHook: sandbox.stub().resolves({ successes: [], failures: [] }),
|
|
79
|
+
s3Key: sandbox.stub().returns(''),
|
|
80
|
+
s3Url: sandbox.stub().returns(''),
|
|
81
|
+
scopedEnvVar: sandbox.stub().returns(undefined),
|
|
82
|
+
scopedEnvVarKey: sandbox.stub().returns(''),
|
|
83
|
+
scopedEnvVarKeys: sandbox.stub().returns([]),
|
|
84
|
+
scopedEnvVarTrue: sandbox.stub().returns(false),
|
|
85
|
+
// Apply any test-specific overrides
|
|
86
|
+
...overrides,
|
|
87
|
+
};
|
|
88
|
+
return config;
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=mock-oclif-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mock-oclif-config.js","sourceRoot":"","sources":["../../../src/adapters/testing/mock-oclif-config.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,qBAAqB,CAAC,OAA2B,EAAE,YAA6B,EAAE;IAChG,wFAAwF;IACxF,0FAA0F;IAC1F,sEAAsE;IACtE,MAAM,MAAM,GAAG;QACb,6BAA6B;QAC7B,IAAI,EAAE,KAAK;QACX,GAAG,EAAE,IAAI;QACT,QAAQ,EAAE,oBAAoB;QAC9B,OAAO,EAAE,QAAQ;QACjB,SAAS,EAAE,qBAA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A0B;QAC7D,OAAO,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAsB;QACtF,KAAK,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,EAAE,CAAoB;QACpD,KAAK,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,EAAE,CAAoB;QACpD,YAAY,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,SAAS,CAA2B;QACzE,eAAe,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,EAAE,CAA8B;QACxE,gBAAgB,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,EAAE,CAA+B;QAC1E,gBAAgB,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,KAAK,CAA+B;QAE7E,oCAAoC;QACpC,GAAG,SAAS;KACQ,CAAC;IAEvB,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { IRestApiAdapter } from '../rest/rest-api-adapter.js';
|
|
2
|
+
import type { MockAdapterConfig, MockAdapter } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Creates a mock REST API adapter for testing.
|
|
5
|
+
*
|
|
6
|
+
* @param config - Optional configuration for responses and errors
|
|
7
|
+
* @returns Mock adapter with call recording
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* const { adapter, calls, setResponse, setError } = createMockRestApiAdapter();
|
|
12
|
+
*
|
|
13
|
+
* // Configure describe result
|
|
14
|
+
* setResponse('describe:Account', {
|
|
15
|
+
* name: 'Account',
|
|
16
|
+
* label: 'Account',
|
|
17
|
+
* fields: [{ name: 'Id', type: 'id' }]
|
|
18
|
+
* });
|
|
19
|
+
*
|
|
20
|
+
* // Use in test
|
|
21
|
+
* const result = await adapter.describeObject('Account');
|
|
22
|
+
* expect(result.success).to.be.true;
|
|
23
|
+
* expect(calls).to.have.lengthOf(1);
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export declare function createMockRestApiAdapter(config?: MockAdapterConfig<unknown>): MockAdapter<IRestApiAdapter>;
|