@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,163 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2026, PeerNova, Inc. All Rights Reserved.
|
|
3
|
+
* PROPRIETARY AND CONFIDENTIAL. Unauthorized copying, modification,
|
|
4
|
+
* or distribution is strictly prohibited. Use is governed by the
|
|
5
|
+
* Master Subscription Agreement (MSA) between PeerNova, Inc. and the
|
|
6
|
+
* licensee. See LICENSE file in the repo root.
|
|
7
|
+
*/
|
|
8
|
+
import { createSuccessResult, createFailureResult } from '../../models/service-result.js';
|
|
9
|
+
import { AdapterErrorCodes } from '../errors.js';
|
|
10
|
+
/**
|
|
11
|
+
* Creates a mock Tooling API adapter for testing.
|
|
12
|
+
*
|
|
13
|
+
* @param config - Optional configuration for responses and errors
|
|
14
|
+
* @returns Mock adapter with call recording
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* const { adapter, calls, setResponse, setError } = createMockToolingApiAdapter();
|
|
19
|
+
*
|
|
20
|
+
* // Configure custom fields response
|
|
21
|
+
* setResponse('customFields:Account', [
|
|
22
|
+
* { Id: '00N123', DeveloperName: 'Custom__c', TableEnumOrId: 'Account' }
|
|
23
|
+
* ]);
|
|
24
|
+
*
|
|
25
|
+
* // Use in test
|
|
26
|
+
* const result = await adapter.queryCustomFields('Account');
|
|
27
|
+
* expect(result.success).to.be.true;
|
|
28
|
+
* expect(calls).to.have.lengthOf(1);
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export function createMockToolingApiAdapter(config) {
|
|
32
|
+
const calls = [];
|
|
33
|
+
const responses = new Map(config?.responses);
|
|
34
|
+
const errors = new Map(config?.errors);
|
|
35
|
+
const throws = new Map();
|
|
36
|
+
const defaultQueryResult = {
|
|
37
|
+
done: true,
|
|
38
|
+
totalSize: 0,
|
|
39
|
+
records: [],
|
|
40
|
+
};
|
|
41
|
+
const recordCall = (method, args) => {
|
|
42
|
+
calls.push({ method, args, timestamp: Date.now() });
|
|
43
|
+
};
|
|
44
|
+
const checkThrow = (key) => {
|
|
45
|
+
const throwError = throws.get(key);
|
|
46
|
+
if (throwError) {
|
|
47
|
+
throw throwError;
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
const adapter = {
|
|
51
|
+
query: (soql) => {
|
|
52
|
+
recordCall('query', [soql]);
|
|
53
|
+
checkThrow(`query:${soql}`);
|
|
54
|
+
const error = errors.get(`query:${soql}`);
|
|
55
|
+
if (error) {
|
|
56
|
+
return Promise.resolve(createFailureResult({ done: true, totalSize: 0, records: [] }, AdapterErrorCodes.TOOLING_QUERY_FAILED, error.message));
|
|
57
|
+
}
|
|
58
|
+
const response = responses.get(`query:${soql}`);
|
|
59
|
+
if (response) {
|
|
60
|
+
return Promise.resolve(createSuccessResult(response, { message: `Query returned ${response.records.length} records` }));
|
|
61
|
+
}
|
|
62
|
+
return Promise.resolve(createSuccessResult(defaultQueryResult, { message: 'Query returned 0 records' }));
|
|
63
|
+
},
|
|
64
|
+
queryAll: (soql) => {
|
|
65
|
+
recordCall('queryAll', [soql]);
|
|
66
|
+
checkThrow(`queryAll:${soql}`);
|
|
67
|
+
const error = errors.get(`queryAll:${soql}`);
|
|
68
|
+
if (error) {
|
|
69
|
+
return Promise.resolve(createFailureResult({ done: true, totalSize: 0, records: [] }, AdapterErrorCodes.TOOLING_QUERY_FAILED, error.message));
|
|
70
|
+
}
|
|
71
|
+
const response = responses.get(`queryAll:${soql}`);
|
|
72
|
+
if (response) {
|
|
73
|
+
return Promise.resolve(createSuccessResult(response, { message: `QueryAll returned ${response.records.length} records` }));
|
|
74
|
+
}
|
|
75
|
+
return Promise.resolve(createSuccessResult(defaultQueryResult, { message: 'QueryAll returned 0 records' }));
|
|
76
|
+
},
|
|
77
|
+
queryCustomFields: (objectName) => {
|
|
78
|
+
recordCall('queryCustomFields', [objectName]);
|
|
79
|
+
checkThrow(`customFields:${objectName}`);
|
|
80
|
+
const error = errors.get(`customFields:${objectName}`);
|
|
81
|
+
if (error) {
|
|
82
|
+
return Promise.resolve(createFailureResult([], AdapterErrorCodes.TOOLING_QUERY_FAILED, error.message));
|
|
83
|
+
}
|
|
84
|
+
const response = responses.get(`customFields:${objectName}`);
|
|
85
|
+
if (response) {
|
|
86
|
+
return Promise.resolve(createSuccessResult(response, { message: `Found ${response.length} custom fields` }));
|
|
87
|
+
}
|
|
88
|
+
return Promise.resolve(createSuccessResult([], { message: 'Found 0 custom fields' }));
|
|
89
|
+
},
|
|
90
|
+
queryValidationRules: (objectName) => {
|
|
91
|
+
recordCall('queryValidationRules', [objectName]);
|
|
92
|
+
checkThrow(`validationRules:${objectName}`);
|
|
93
|
+
const error = errors.get(`validationRules:${objectName}`);
|
|
94
|
+
if (error) {
|
|
95
|
+
return Promise.resolve(createFailureResult([], AdapterErrorCodes.TOOLING_QUERY_FAILED, error.message));
|
|
96
|
+
}
|
|
97
|
+
const response = responses.get(`validationRules:${objectName}`);
|
|
98
|
+
if (response) {
|
|
99
|
+
return Promise.resolve(createSuccessResult(response, { message: `Found ${response.length} validation rules` }));
|
|
100
|
+
}
|
|
101
|
+
return Promise.resolve(createSuccessResult([], { message: 'Found 0 validation rules' }));
|
|
102
|
+
},
|
|
103
|
+
queryTabs: () => {
|
|
104
|
+
recordCall('queryTabs', []);
|
|
105
|
+
checkThrow('tabs');
|
|
106
|
+
const error = errors.get('tabs');
|
|
107
|
+
if (error) {
|
|
108
|
+
return Promise.resolve(createFailureResult([], AdapterErrorCodes.TOOLING_QUERY_FAILED, error.message));
|
|
109
|
+
}
|
|
110
|
+
const response = responses.get('tabs');
|
|
111
|
+
if (response) {
|
|
112
|
+
return Promise.resolve(createSuccessResult(response, { message: `Found ${response.length} tabs` }));
|
|
113
|
+
}
|
|
114
|
+
return Promise.resolve(createSuccessResult([], { message: 'Found 0 tabs' }));
|
|
115
|
+
},
|
|
116
|
+
queryTabByObject: (objectName) => {
|
|
117
|
+
recordCall('queryTabByObject', [objectName]);
|
|
118
|
+
checkThrow(`tabByObject:${objectName}`);
|
|
119
|
+
const error = errors.get(`tabByObject:${objectName}`);
|
|
120
|
+
if (error) {
|
|
121
|
+
return Promise.resolve(createFailureResult(null, AdapterErrorCodes.TOOLING_QUERY_FAILED, error.message));
|
|
122
|
+
}
|
|
123
|
+
// Check for object-specific response first
|
|
124
|
+
const objectResponse = responses.get(`tabByObject:${objectName}`);
|
|
125
|
+
if (objectResponse !== undefined) {
|
|
126
|
+
if (objectResponse === null) {
|
|
127
|
+
return Promise.resolve(createSuccessResult(null, { message: `No tab found for object: ${objectName}` }));
|
|
128
|
+
}
|
|
129
|
+
return Promise.resolve(createSuccessResult(objectResponse, { message: `Found tab for object: ${objectName}` }));
|
|
130
|
+
}
|
|
131
|
+
// Fall back to checking the tabs list (if queryTabs responses were set)
|
|
132
|
+
const allTabs = responses.get('tabs');
|
|
133
|
+
if (allTabs) {
|
|
134
|
+
const tab = allTabs.find((t) => t.SobjectName === objectName) ?? null;
|
|
135
|
+
if (tab) {
|
|
136
|
+
return Promise.resolve(createSuccessResult(tab, { message: `Found tab for object: ${objectName}` }));
|
|
137
|
+
}
|
|
138
|
+
return Promise.resolve(createSuccessResult(null, { message: `No tab found for object: ${objectName}` }));
|
|
139
|
+
}
|
|
140
|
+
return Promise.resolve(createSuccessResult(null, { message: `No tab found for object: ${objectName}` }));
|
|
141
|
+
},
|
|
142
|
+
};
|
|
143
|
+
return {
|
|
144
|
+
adapter,
|
|
145
|
+
calls,
|
|
146
|
+
resetCalls: () => {
|
|
147
|
+
calls.length = 0;
|
|
148
|
+
},
|
|
149
|
+
setResponse: (key, response) => {
|
|
150
|
+
responses.set(key, response);
|
|
151
|
+
},
|
|
152
|
+
setError: (key, error) => {
|
|
153
|
+
errors.set(key, error);
|
|
154
|
+
},
|
|
155
|
+
setThrow: (key, error) => {
|
|
156
|
+
throws.set(key, error);
|
|
157
|
+
},
|
|
158
|
+
clearThrow: (key) => {
|
|
159
|
+
throws.delete(key);
|
|
160
|
+
},
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
//# sourceMappingURL=mock-tooling-adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mock-tooling-adapter.js","sourceRoot":"","sources":["../../../src/adapters/testing/mock-tooling-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAC1F,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAGjD;;;;;;;;;;;;;;;;;;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;gBACvG,CAAC;gBACD,OAAO,OAAO,CAAC,OAAO,CAAC,mBAAmB,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,4BAA4B,UAAU,EAAE,EAAE,CAAC,CAAC,CAAC;YAC3G,CAAC;YAED,OAAO,OAAO,CAAC,OAAO,CAAC,mBAAmB,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,4BAA4B,UAAU,EAAE,EAAE,CAAC,CAAC,CAAC;QAC3G,CAAC;KACF,CAAC;IAEF,OAAO;QACL,OAAO;QACP,KAAK;QACL,UAAU,EAAE,GAAS,EAAE;YACrB,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;QACnB,CAAC;QACD,WAAW,EAAE,CAAC,GAAW,EAAE,QAAiB,EAAQ,EAAE;YACpD,SAAS,CAAC,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;QAC/B,CAAC;QACD,QAAQ,EAAE,CAAC,GAAW,EAAE,KAAY,EAAQ,EAAE;YAC5C,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACzB,CAAC;QACD,QAAQ,EAAE,CAAC,GAAW,EAAE,KAAY,EAAQ,EAAE;YAC5C,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACzB,CAAC;QACD,UAAU,EAAE,CAAC,GAAW,EAAQ,EAAE;YAChC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QACrB,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import sinon from 'sinon';
|
|
2
|
+
import type { IConnectionFacade } from '../connection-facade.js';
|
|
3
|
+
/**
|
|
4
|
+
* Named sinon stubs for the tooling API sub-object.
|
|
5
|
+
*
|
|
6
|
+
* Each stub corresponds to a method on IToolingApi and can be configured
|
|
7
|
+
* with the full sinon stub API (.resolves, .rejects, .onFirstCall, etc.).
|
|
8
|
+
*/
|
|
9
|
+
export type StubTooling = {
|
|
10
|
+
/** Stub for tooling.query */
|
|
11
|
+
queryStub: sinon.SinonStub;
|
|
12
|
+
/** Stub for tooling.queryMore */
|
|
13
|
+
queryMoreStub: sinon.SinonStub;
|
|
14
|
+
/** Stub for tooling.executeAnonymous */
|
|
15
|
+
executeAnonymousStub: sinon.SinonStub;
|
|
16
|
+
/** Stub for tooling.create */
|
|
17
|
+
createStub: sinon.SinonStub;
|
|
18
|
+
/** Stub for tooling.destroy */
|
|
19
|
+
destroyStub: sinon.SinonStub;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Named sinon stubs for a stub-backed IConnectionFacade.
|
|
23
|
+
*
|
|
24
|
+
* Use the individual stubs to configure call behaviour directly with sinon's
|
|
25
|
+
* `.resolves()`, `.rejects()`, `.onFirstCall()`, etc. — no `as unknown as`
|
|
26
|
+
* cast is required because the `connection` property satisfies all of
|
|
27
|
+
* IConnectionFacade.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```typescript
|
|
31
|
+
* const stubConn = createStubConnection();
|
|
32
|
+
* stubConn.queryStub.resolves({ done: true, totalSize: 1, records: [{ Id: '001' }] });
|
|
33
|
+
* const adapter = new SoqlQueryAdapter(stubConn.connection);
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export type StubConnection = {
|
|
37
|
+
/** The fully-typed IConnectionFacade backed by sinon stubs */
|
|
38
|
+
connection: IConnectionFacade;
|
|
39
|
+
/** Stub for connection.query */
|
|
40
|
+
queryStub: sinon.SinonStub;
|
|
41
|
+
/** Stub for connection.queryMore */
|
|
42
|
+
queryMoreStub: sinon.SinonStub;
|
|
43
|
+
/** Stub for connection.request */
|
|
44
|
+
requestStub: sinon.SinonStub;
|
|
45
|
+
/** Stub for connection.identity */
|
|
46
|
+
identityStub: sinon.SinonStub;
|
|
47
|
+
/**
|
|
48
|
+
* Stub for connection.sobject.
|
|
49
|
+
*
|
|
50
|
+
* By default this stub returns an object whose `describe` and `find`
|
|
51
|
+
* properties are themselves sinon stubs. Access the inner stubs via
|
|
52
|
+
* `stubConn.sobjectDescribeStub` and `stubConn.sobjectFindStub`.
|
|
53
|
+
*/
|
|
54
|
+
sobjectStub: sinon.SinonStub;
|
|
55
|
+
/** Stub for the describe method returned by sobject() */
|
|
56
|
+
sobjectDescribeStub: sinon.SinonStub;
|
|
57
|
+
/** Stub for the find method returned by sobject() */
|
|
58
|
+
sobjectFindStub: sinon.SinonStub;
|
|
59
|
+
/** Named stubs for the tooling API sub-object */
|
|
60
|
+
tooling: StubTooling;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Creates a fully-typed IConnectionFacade backed by sinon stubs.
|
|
64
|
+
*
|
|
65
|
+
* All properties required by IConnectionFacade are provided, so TypeScript
|
|
66
|
+
* accepts the return value as a valid IConnectionFacade without any type cast.
|
|
67
|
+
* Each method is a sinon stub that can be configured with the full sinon API.
|
|
68
|
+
*
|
|
69
|
+
* Prefer this factory over hand-rolling partial objects with
|
|
70
|
+
* `as unknown as IConnectionFacade` in adapter unit tests.
|
|
71
|
+
*
|
|
72
|
+
* @returns StubConnection containing the connection and all underlying stubs
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```typescript
|
|
76
|
+
* import { createStubConnection } from '../../../src/adapters/testing/index.js';
|
|
77
|
+
*
|
|
78
|
+
* let stubConn: StubConnection;
|
|
79
|
+
*
|
|
80
|
+
* beforeEach(() => {
|
|
81
|
+
* stubConn = createStubConnection();
|
|
82
|
+
* adapter = new SoqlQueryAdapter(stubConn.connection);
|
|
83
|
+
* });
|
|
84
|
+
*
|
|
85
|
+
* it('returns records on success', async () => {
|
|
86
|
+
* stubConn.queryStub.resolves({ done: true, totalSize: 1, records: [{ Id: '001' }] });
|
|
87
|
+
* const result = await adapter.query('SELECT Id FROM Account');
|
|
88
|
+
* expect(result.success).to.equal(true);
|
|
89
|
+
* expect(result.data.records).to.have.lengthOf(1);
|
|
90
|
+
* });
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
export declare function createStubConnection(): StubConnection;
|
|
@@ -0,0 +1,97 @@
|
|
|
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
|
+
* Creates a fully-typed IConnectionFacade backed by sinon stubs.
|
|
12
|
+
*
|
|
13
|
+
* All properties required by IConnectionFacade are provided, so TypeScript
|
|
14
|
+
* accepts the return value as a valid IConnectionFacade without any type cast.
|
|
15
|
+
* Each method is a sinon stub that can be configured with the full sinon API.
|
|
16
|
+
*
|
|
17
|
+
* Prefer this factory over hand-rolling partial objects with
|
|
18
|
+
* `as unknown as IConnectionFacade` in adapter unit tests.
|
|
19
|
+
*
|
|
20
|
+
* @returns StubConnection containing the connection and all underlying stubs
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```typescript
|
|
24
|
+
* import { createStubConnection } from '../../../src/adapters/testing/index.js';
|
|
25
|
+
*
|
|
26
|
+
* let stubConn: StubConnection;
|
|
27
|
+
*
|
|
28
|
+
* beforeEach(() => {
|
|
29
|
+
* stubConn = createStubConnection();
|
|
30
|
+
* adapter = new SoqlQueryAdapter(stubConn.connection);
|
|
31
|
+
* });
|
|
32
|
+
*
|
|
33
|
+
* it('returns records on success', async () => {
|
|
34
|
+
* stubConn.queryStub.resolves({ done: true, totalSize: 1, records: [{ Id: '001' }] });
|
|
35
|
+
* const result = await adapter.query('SELECT Id FROM Account');
|
|
36
|
+
* expect(result.success).to.equal(true);
|
|
37
|
+
* expect(result.data.records).to.have.lengthOf(1);
|
|
38
|
+
* });
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export function createStubConnection() {
|
|
42
|
+
// Top-level connection stubs
|
|
43
|
+
const queryStub = sinon.stub();
|
|
44
|
+
const queryMoreStub = sinon.stub();
|
|
45
|
+
const requestStub = sinon.stub();
|
|
46
|
+
const identityStub = sinon.stub();
|
|
47
|
+
// sobject inner stubs
|
|
48
|
+
const sobjectDescribeStub = sinon.stub();
|
|
49
|
+
const sobjectFindStub = sinon.stub();
|
|
50
|
+
const sobjectStub = sinon.stub().returns({
|
|
51
|
+
describe: sobjectDescribeStub,
|
|
52
|
+
find: sobjectFindStub,
|
|
53
|
+
});
|
|
54
|
+
// Tooling API stubs
|
|
55
|
+
const toolingQueryStub = sinon.stub();
|
|
56
|
+
const toolingQueryMoreStub = sinon.stub();
|
|
57
|
+
const toolingExecuteAnonymousStub = sinon.stub();
|
|
58
|
+
const toolingCreateStub = sinon.stub();
|
|
59
|
+
const toolingDestroyStub = sinon.stub();
|
|
60
|
+
// Assemble the fully-typed connection. Because every required property is
|
|
61
|
+
// supplied, no `as unknown as` cast is needed.
|
|
62
|
+
const connection = {
|
|
63
|
+
version: '58.0',
|
|
64
|
+
accessToken: 'mock-access-token',
|
|
65
|
+
instanceUrl: 'https://test.salesforce.com',
|
|
66
|
+
query: queryStub,
|
|
67
|
+
queryMore: queryMoreStub,
|
|
68
|
+
sobject: sobjectStub,
|
|
69
|
+
request: requestStub,
|
|
70
|
+
identity: identityStub,
|
|
71
|
+
tooling: {
|
|
72
|
+
query: toolingQueryStub,
|
|
73
|
+
queryMore: toolingQueryMoreStub,
|
|
74
|
+
executeAnonymous: toolingExecuteAnonymousStub,
|
|
75
|
+
create: toolingCreateStub,
|
|
76
|
+
destroy: toolingDestroyStub,
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
return {
|
|
80
|
+
connection,
|
|
81
|
+
queryStub,
|
|
82
|
+
queryMoreStub,
|
|
83
|
+
requestStub,
|
|
84
|
+
identityStub,
|
|
85
|
+
sobjectStub,
|
|
86
|
+
sobjectDescribeStub,
|
|
87
|
+
sobjectFindStub,
|
|
88
|
+
tooling: {
|
|
89
|
+
queryStub: toolingQueryStub,
|
|
90
|
+
queryMoreStub: toolingQueryMoreStub,
|
|
91
|
+
executeAnonymousStub: toolingExecuteAnonymousStub,
|
|
92
|
+
createStub: toolingCreateStub,
|
|
93
|
+
destroyStub: toolingDestroyStub,
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=stub-connection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stub-connection.js","sourceRoot":"","sources":["../../../src/adapters/testing/stub-connection.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,4GAA4G;AAC5G,OAAO,KAAK,MAAM,OAAO,CAAC;AAgE1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,UAAU,oBAAoB;IAClC,6BAA6B;IAC7B,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC/B,MAAM,aAAa,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IACnC,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IACjC,MAAM,YAAY,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAElC,sBAAsB;IACtB,MAAM,mBAAmB,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IACzC,MAAM,eAAe,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IACrC,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC;QACvC,QAAQ,EAAE,mBAAmB;QAC7B,IAAI,EAAE,eAAe;KACS,CAAC,CAAC;IAElC,oBAAoB;IACpB,MAAM,gBAAgB,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IACtC,MAAM,oBAAoB,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC1C,MAAM,2BAA2B,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IACjD,MAAM,iBAAiB,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IACvC,MAAM,kBAAkB,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAExC,2EAA2E;IAC3E,+CAA+C;IAC/C,MAAM,UAAU,GAAsB;QACpC,OAAO,EAAE,MAAM;QACf,WAAW,EAAE,mBAAmB;QAChC,WAAW,EAAE,6BAA6B;QAC1C,KAAK,EAAE,SAAS;QAChB,SAAS,EAAE,aAAa;QACxB,OAAO,EAAE,WAAW;QACpB,OAAO,EAAE,WAAW;QACpB,QAAQ,EAAE,YAAY;QACtB,OAAO,EAAE;YACP,KAAK,EAAE,gBAAgB;YACvB,SAAS,EAAE,oBAAoB;YAC/B,gBAAgB,EAAE,2BAA2B;YAC7C,MAAM,EAAE,iBAAiB;YACzB,OAAO,EAAE,kBAAkB;SAC5B;KACF,CAAC;IAEF,OAAO;QACL,UAAU;QACV,SAAS;QACT,aAAa;QACb,WAAW;QACX,YAAY;QACZ,WAAW;QACX,mBAAmB;QACnB,eAAe;QACf,OAAO,EAAE;YACP,SAAS,EAAE,gBAAgB;YAC3B,aAAa,EAAE,oBAAoB;YACnC,oBAAoB,EAAE,2BAA2B;YACjD,UAAU,EAAE,iBAAiB;YAC7B,WAAW,EAAE,kBAAkB;SAChC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import sinon from 'sinon';
|
|
2
|
+
import type { IRestApiAdapter } from '../rest/rest-api-adapter.js';
|
|
3
|
+
/**
|
|
4
|
+
* Named sinon stubs for a stub-backed IRestApiAdapter.
|
|
5
|
+
*
|
|
6
|
+
* Use the individual stubs to configure call behaviour directly with sinon's
|
|
7
|
+
* `.resolves()`, `.rejects()`, `.onFirstCall()`, etc. — no `as unknown as`
|
|
8
|
+
* cast is required because the `adapter` property satisfies IRestApiAdapter.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* const stubRest = createStubRestAdapter();
|
|
13
|
+
* stubRest.describeObjectStub.resolves(createSuccessResult(mockDescribe));
|
|
14
|
+
* const service = new ContactPointService(stubRest.adapter);
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export type StubRestAdapter = {
|
|
18
|
+
/** The fully-typed IRestApiAdapter backed by sinon stubs */
|
|
19
|
+
adapter: IRestApiAdapter;
|
|
20
|
+
/** Stub for adapter.describeObject */
|
|
21
|
+
describeObjectStub: sinon.SinonStub;
|
|
22
|
+
/** Stub for adapter.describeGlobal */
|
|
23
|
+
describeGlobalStub: sinon.SinonStub;
|
|
24
|
+
/** Stub for adapter.getRecordCount */
|
|
25
|
+
getRecordCountStub: sinon.SinonStub;
|
|
26
|
+
/** Stub for adapter.getRecordCounts */
|
|
27
|
+
getRecordCountsStub: sinon.SinonStub;
|
|
28
|
+
/** Stub for adapter.describeObjects */
|
|
29
|
+
describeObjectsStub: sinon.SinonStub;
|
|
30
|
+
/** Stub for adapter.insertRecord */
|
|
31
|
+
insertRecordStub: sinon.SinonStub;
|
|
32
|
+
/** Stub for adapter.updateRecord */
|
|
33
|
+
updateRecordStub: sinon.SinonStub;
|
|
34
|
+
/** Stub for adapter.deleteRecord */
|
|
35
|
+
deleteRecordStub: sinon.SinonStub;
|
|
36
|
+
/** Stub for adapter.invalidateCache */
|
|
37
|
+
invalidateCacheStub: sinon.SinonStub;
|
|
38
|
+
/** Stub for adapter.request */
|
|
39
|
+
requestStub: sinon.SinonStub;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Creates a fully-typed IRestApiAdapter backed by sinon stubs.
|
|
43
|
+
*
|
|
44
|
+
* All methods required by IRestApiAdapter are provided as sinon stubs,
|
|
45
|
+
* so TypeScript accepts the return value without any type cast.
|
|
46
|
+
*
|
|
47
|
+
* Prefer this factory over `sinon.createStubInstance(RestApiAdapter)` or
|
|
48
|
+
* hand-rolling partial objects with `as sinon.SinonStubbedInstance<IRestApiAdapter>`.
|
|
49
|
+
*
|
|
50
|
+
* @returns StubRestAdapter containing the adapter and all underlying stubs
|
|
51
|
+
*/
|
|
52
|
+
export declare function createStubRestAdapter(): StubRestAdapter;
|
|
@@ -0,0 +1,58 @@
|
|
|
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
|
+
* Creates a fully-typed IRestApiAdapter backed by sinon stubs.
|
|
12
|
+
*
|
|
13
|
+
* All methods required by IRestApiAdapter are provided as sinon stubs,
|
|
14
|
+
* so TypeScript accepts the return value without any type cast.
|
|
15
|
+
*
|
|
16
|
+
* Prefer this factory over `sinon.createStubInstance(RestApiAdapter)` or
|
|
17
|
+
* hand-rolling partial objects with `as sinon.SinonStubbedInstance<IRestApiAdapter>`.
|
|
18
|
+
*
|
|
19
|
+
* @returns StubRestAdapter containing the adapter and all underlying stubs
|
|
20
|
+
*/
|
|
21
|
+
export function createStubRestAdapter() {
|
|
22
|
+
const describeObjectStub = sinon.stub();
|
|
23
|
+
const describeGlobalStub = sinon.stub();
|
|
24
|
+
const getRecordCountStub = sinon.stub();
|
|
25
|
+
const getRecordCountsStub = sinon.stub();
|
|
26
|
+
const describeObjectsStub = sinon.stub();
|
|
27
|
+
const insertRecordStub = sinon.stub();
|
|
28
|
+
const updateRecordStub = sinon.stub();
|
|
29
|
+
const deleteRecordStub = sinon.stub();
|
|
30
|
+
const invalidateCacheStub = sinon.stub();
|
|
31
|
+
const requestStub = sinon.stub();
|
|
32
|
+
const adapter = {
|
|
33
|
+
describeObject: describeObjectStub,
|
|
34
|
+
describeGlobal: describeGlobalStub,
|
|
35
|
+
getRecordCount: getRecordCountStub,
|
|
36
|
+
getRecordCounts: getRecordCountsStub,
|
|
37
|
+
describeObjects: describeObjectsStub,
|
|
38
|
+
insertRecord: insertRecordStub,
|
|
39
|
+
updateRecord: updateRecordStub,
|
|
40
|
+
deleteRecord: deleteRecordStub,
|
|
41
|
+
invalidateCache: invalidateCacheStub,
|
|
42
|
+
request: requestStub,
|
|
43
|
+
};
|
|
44
|
+
return {
|
|
45
|
+
adapter,
|
|
46
|
+
describeObjectStub,
|
|
47
|
+
describeGlobalStub,
|
|
48
|
+
getRecordCountStub,
|
|
49
|
+
getRecordCountsStub,
|
|
50
|
+
describeObjectsStub,
|
|
51
|
+
insertRecordStub,
|
|
52
|
+
updateRecordStub,
|
|
53
|
+
deleteRecordStub,
|
|
54
|
+
invalidateCacheStub,
|
|
55
|
+
requestStub,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=stub-rest-adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stub-rest-adapter.js","sourceRoot":"","sources":["../../../src/adapters/testing/stub-rest-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,4GAA4G;AAC5G,OAAO,KAAK,MAAM,OAAO,CAAC;AA0C1B;;;;;;;;;;GAUG;AACH,MAAM,UAAU,qBAAqB;IACnC,MAAM,kBAAkB,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IACxC,MAAM,kBAAkB,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IACxC,MAAM,kBAAkB,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IACxC,MAAM,mBAAmB,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IACzC,MAAM,mBAAmB,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IACzC,MAAM,gBAAgB,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IACtC,MAAM,gBAAgB,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IACtC,MAAM,gBAAgB,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IACtC,MAAM,mBAAmB,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IACzC,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAEjC,MAAM,OAAO,GAAoB;QAC/B,cAAc,EAAE,kBAAkB;QAClC,cAAc,EAAE,kBAAkB;QAClC,cAAc,EAAE,kBAAkB;QAClC,eAAe,EAAE,mBAAmB;QACpC,eAAe,EAAE,mBAAmB;QACpC,YAAY,EAAE,gBAAgB;QAC9B,YAAY,EAAE,gBAAgB;QAC9B,YAAY,EAAE,gBAAgB;QAC9B,eAAe,EAAE,mBAAmB;QACpC,OAAO,EAAE,WAAW;KACrB,CAAC;IAEF,OAAO;QACL,OAAO;QACP,kBAAkB;QAClB,kBAAkB;QAClB,kBAAkB;QAClB,mBAAmB;QACnB,mBAAmB;QACnB,gBAAgB;QAChB,gBAAgB;QAChB,gBAAgB;QAChB,mBAAmB;QACnB,WAAW;KACZ,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import sinon from 'sinon';
|
|
2
|
+
import type { ISoqlQueryAdapter } from '../soql/soql-query-adapter.js';
|
|
3
|
+
/**
|
|
4
|
+
* Named sinon stubs for a stub-backed ISoqlQueryAdapter.
|
|
5
|
+
*
|
|
6
|
+
* Use the individual stubs to configure call behaviour directly with sinon's
|
|
7
|
+
* `.resolves()`, `.rejects()`, `.onFirstCall()`, etc. — no `as unknown as`
|
|
8
|
+
* cast is required because the `adapter` property satisfies ISoqlQueryAdapter.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* const stubSoql = createStubSoqlAdapter();
|
|
13
|
+
* stubSoql.queryStub.resolves(createSuccessResult({ done: true, totalSize: 1, records: [{ Id: '001' }] }));
|
|
14
|
+
* const service = new MyService(stubSoql.adapter);
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export type StubSoqlAdapter = {
|
|
18
|
+
/** The fully-typed ISoqlQueryAdapter backed by sinon stubs */
|
|
19
|
+
adapter: ISoqlQueryAdapter;
|
|
20
|
+
/** Stub for adapter.query */
|
|
21
|
+
queryStub: sinon.SinonStub;
|
|
22
|
+
/** Stub for adapter.queryAll */
|
|
23
|
+
queryAllStub: sinon.SinonStub;
|
|
24
|
+
/** Stub for adapter.queryChunked */
|
|
25
|
+
queryChunkedStub: sinon.SinonStub;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Creates a fully-typed ISoqlQueryAdapter backed by sinon stubs.
|
|
29
|
+
*
|
|
30
|
+
* All methods required by ISoqlQueryAdapter are provided as sinon stubs,
|
|
31
|
+
* so TypeScript accepts the return value without any type cast.
|
|
32
|
+
*
|
|
33
|
+
* Prefer this factory over hand-rolling `{ query: sinon.stub(), queryAll: sinon.stub(), queryChunked: sinon.stub() }`
|
|
34
|
+
* partial objects in service unit tests.
|
|
35
|
+
*
|
|
36
|
+
* @returns StubSoqlAdapter containing the adapter and all underlying stubs
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```typescript
|
|
40
|
+
* import { createStubSoqlAdapter, type StubSoqlAdapter } from '../../../src/adapters/testing/index.js';
|
|
41
|
+
*
|
|
42
|
+
* let stubSoql: StubSoqlAdapter;
|
|
43
|
+
*
|
|
44
|
+
* beforeEach(() => {
|
|
45
|
+
* stubSoql = createStubSoqlAdapter();
|
|
46
|
+
* service = new ProfilingDefinitionService(stubSoql.adapter, mockApexAdapter);
|
|
47
|
+
* });
|
|
48
|
+
*
|
|
49
|
+
* it('queries definitions', async () => {
|
|
50
|
+
* stubSoql.queryStub.resolves(createSuccessResult({ done: true, totalSize: 0, records: [] }));
|
|
51
|
+
* const result = await service.getAll();
|
|
52
|
+
* expect(result.success).to.equal(true);
|
|
53
|
+
* });
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
export declare function createStubSoqlAdapter(): StubSoqlAdapter;
|
|
@@ -0,0 +1,50 @@
|
|
|
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
|
+
* Creates a fully-typed ISoqlQueryAdapter backed by sinon stubs.
|
|
12
|
+
*
|
|
13
|
+
* All methods required by ISoqlQueryAdapter are provided as sinon stubs,
|
|
14
|
+
* so TypeScript accepts the return value without any type cast.
|
|
15
|
+
*
|
|
16
|
+
* Prefer this factory over hand-rolling `{ query: sinon.stub(), queryAll: sinon.stub(), queryChunked: sinon.stub() }`
|
|
17
|
+
* partial objects in service unit tests.
|
|
18
|
+
*
|
|
19
|
+
* @returns StubSoqlAdapter containing the adapter and all underlying stubs
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* import { createStubSoqlAdapter, type StubSoqlAdapter } from '../../../src/adapters/testing/index.js';
|
|
24
|
+
*
|
|
25
|
+
* let stubSoql: StubSoqlAdapter;
|
|
26
|
+
*
|
|
27
|
+
* beforeEach(() => {
|
|
28
|
+
* stubSoql = createStubSoqlAdapter();
|
|
29
|
+
* service = new ProfilingDefinitionService(stubSoql.adapter, mockApexAdapter);
|
|
30
|
+
* });
|
|
31
|
+
*
|
|
32
|
+
* it('queries definitions', async () => {
|
|
33
|
+
* stubSoql.queryStub.resolves(createSuccessResult({ done: true, totalSize: 0, records: [] }));
|
|
34
|
+
* const result = await service.getAll();
|
|
35
|
+
* expect(result.success).to.equal(true);
|
|
36
|
+
* });
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export function createStubSoqlAdapter() {
|
|
40
|
+
const queryStub = sinon.stub();
|
|
41
|
+
const queryAllStub = sinon.stub();
|
|
42
|
+
const queryChunkedStub = sinon.stub();
|
|
43
|
+
const adapter = {
|
|
44
|
+
query: queryStub,
|
|
45
|
+
queryAll: queryAllStub,
|
|
46
|
+
queryChunked: queryChunkedStub,
|
|
47
|
+
};
|
|
48
|
+
return { adapter, queryStub, queryAllStub, queryChunkedStub };
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=stub-soql-adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stub-soql-adapter.js","sourceRoot":"","sources":["../../../src/adapters/testing/stub-soql-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,4GAA4G;AAC5G,OAAO,KAAK,MAAM,OAAO,CAAC;AA4B1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,UAAU,qBAAqB;IACnC,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC/B,MAAM,YAAY,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAClC,MAAM,gBAAgB,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAEtC,MAAM,OAAO,GAAsB;QACjC,KAAK,EAAE,SAAS;QAChB,QAAQ,EAAE,YAAY;QACtB,YAAY,EAAE,gBAAgB;KAC/B,CAAC;IAEF,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,gBAAgB,EAAE,CAAC;AAChE,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Record of a mock adapter method call.
|
|
3
|
+
*/
|
|
4
|
+
export type CallRecord = {
|
|
5
|
+
/** Name of the method that was called */
|
|
6
|
+
method: string;
|
|
7
|
+
/** Arguments passed to the method */
|
|
8
|
+
args: unknown[];
|
|
9
|
+
/** Timestamp when the call was made */
|
|
10
|
+
timestamp: number;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Configuration for mock adapters.
|
|
14
|
+
*
|
|
15
|
+
* @template T The type of the default response
|
|
16
|
+
*/
|
|
17
|
+
export type MockAdapterConfig<T> = {
|
|
18
|
+
/** Map of input keys to expected responses */
|
|
19
|
+
responses?: Map<string, T>;
|
|
20
|
+
/** Map of input keys to errors that should be thrown */
|
|
21
|
+
errors?: Map<string, Error>;
|
|
22
|
+
/** Default response when no specific mapping exists */
|
|
23
|
+
defaultResponse?: T;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Mock adapter wrapper with call recording and configuration.
|
|
27
|
+
*
|
|
28
|
+
* @template T The type of the adapter being mocked
|
|
29
|
+
*/
|
|
30
|
+
export type MockAdapter<T> = {
|
|
31
|
+
/** The mock adapter instance */
|
|
32
|
+
adapter: T;
|
|
33
|
+
/** List of recorded method calls */
|
|
34
|
+
calls: CallRecord[];
|
|
35
|
+
/** Resets the call recording history */
|
|
36
|
+
resetCalls(): void;
|
|
37
|
+
/** Sets a response for a specific key */
|
|
38
|
+
setResponse(key: string, response: unknown): void;
|
|
39
|
+
/** Sets an error for a specific key (returns failure ServiceResult) */
|
|
40
|
+
setError(key: string, error: Error): void;
|
|
41
|
+
/**
|
|
42
|
+
* Sets an exception to throw for a specific key.
|
|
43
|
+
* Unlike setError (which returns a failure ServiceResult), setThrow causes
|
|
44
|
+
* the mock to throw an exception, allowing tests to verify service-level
|
|
45
|
+
* exception handling.
|
|
46
|
+
*/
|
|
47
|
+
setThrow(key: string, error: Error): void;
|
|
48
|
+
/** Clears a previously configured exception for a specific key */
|
|
49
|
+
clearThrow(key: string): void;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Configuration for mock connection facade.
|
|
53
|
+
*/
|
|
54
|
+
export type MockConnectionConfig = {
|
|
55
|
+
/** API version to return */
|
|
56
|
+
version?: string;
|
|
57
|
+
/** Access token for authentication (required for connection validation) */
|
|
58
|
+
accessToken?: string;
|
|
59
|
+
/** Instance URL for the Salesforce org (required for connection validation) */
|
|
60
|
+
instanceUrl?: string;
|
|
61
|
+
/** Default query result */
|
|
62
|
+
defaultQueryResult?: unknown;
|
|
63
|
+
/** Default describe result */
|
|
64
|
+
defaultDescribeResult?: unknown;
|
|
65
|
+
/** Default identity result */
|
|
66
|
+
defaultIdentity?: {
|
|
67
|
+
user_id: string;
|
|
68
|
+
organization_id: string;
|
|
69
|
+
username: string;
|
|
70
|
+
};
|
|
71
|
+
};
|