vaspera 2.5.0
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/CHANGELOG.md +184 -0
- package/LICENSE +21 -0
- package/README.md +809 -0
- package/dist/__tests__/integration/certification-flow.test.d.ts +5 -0
- package/dist/__tests__/integration/certification-flow.test.d.ts.map +1 -0
- package/dist/__tests__/integration/certification-flow.test.js +245 -0
- package/dist/__tests__/integration/certification-flow.test.js.map +1 -0
- package/dist/__tests__/integration/commands.test.d.ts +5 -0
- package/dist/__tests__/integration/commands.test.d.ts.map +1 -0
- package/dist/__tests__/integration/commands.test.js +93 -0
- package/dist/__tests__/integration/commands.test.js.map +1 -0
- package/dist/action/diff-mode.d.ts +34 -0
- package/dist/action/diff-mode.d.ts.map +1 -0
- package/dist/action/diff-mode.js +201 -0
- package/dist/action/diff-mode.js.map +1 -0
- package/dist/action/diff-mode.test.d.ts +5 -0
- package/dist/action/diff-mode.test.d.ts.map +1 -0
- package/dist/action/diff-mode.test.js +162 -0
- package/dist/action/diff-mode.test.js.map +1 -0
- package/dist/action/index.d.ts +10 -0
- package/dist/action/index.d.ts.map +1 -0
- package/dist/action/index.js +231 -0
- package/dist/action/index.js.map +1 -0
- package/dist/action/pr-comment.d.ts +30 -0
- package/dist/action/pr-comment.d.ts.map +1 -0
- package/dist/action/pr-comment.js +301 -0
- package/dist/action/pr-comment.js.map +1 -0
- package/dist/action/pr-comment.test.d.ts +5 -0
- package/dist/action/pr-comment.test.d.ts.map +1 -0
- package/dist/action/pr-comment.test.js +189 -0
- package/dist/action/pr-comment.test.js.map +1 -0
- package/dist/action/sarif-upload.d.ts +104 -0
- package/dist/action/sarif-upload.d.ts.map +1 -0
- package/dist/action/sarif-upload.js +188 -0
- package/dist/action/sarif-upload.js.map +1 -0
- package/dist/action/sarif-upload.test.d.ts +5 -0
- package/dist/action/sarif-upload.test.d.ts.map +1 -0
- package/dist/action/sarif-upload.test.js +206 -0
- package/dist/action/sarif-upload.test.js.map +1 -0
- package/dist/action/types.d.ts +104 -0
- package/dist/action/types.d.ts.map +1 -0
- package/dist/action/types.js +33 -0
- package/dist/action/types.js.map +1 -0
- package/dist/action/types.test.d.ts +5 -0
- package/dist/action/types.test.d.ts.map +1 -0
- package/dist/action/types.test.js +79 -0
- package/dist/action/types.test.js.map +1 -0
- package/dist/agents/agent-integrity.d.ts +111 -0
- package/dist/agents/agent-integrity.d.ts.map +1 -0
- package/dist/agents/agent-integrity.js +308 -0
- package/dist/agents/agent-integrity.js.map +1 -0
- package/dist/agents/agent-privacy.d.ts +68 -0
- package/dist/agents/agent-privacy.d.ts.map +1 -0
- package/dist/agents/agent-privacy.js +345 -0
- package/dist/agents/agent-privacy.js.map +1 -0
- package/dist/agents/exploit-chain.d.ts +64 -0
- package/dist/agents/exploit-chain.d.ts.map +1 -0
- package/dist/agents/exploit-chain.js +477 -0
- package/dist/agents/exploit-chain.js.map +1 -0
- package/dist/agents/exploit-chain.test.d.ts +5 -0
- package/dist/agents/exploit-chain.test.d.ts.map +1 -0
- package/dist/agents/exploit-chain.test.js +455 -0
- package/dist/agents/exploit-chain.test.js.map +1 -0
- package/dist/agents/index.d.ts +14 -0
- package/dist/agents/index.d.ts.map +1 -0
- package/dist/agents/index.js +19 -0
- package/dist/agents/index.js.map +1 -0
- package/dist/agents/logic-flaw-detector.d.ts +55 -0
- package/dist/agents/logic-flaw-detector.d.ts.map +1 -0
- package/dist/agents/logic-flaw-detector.js +454 -0
- package/dist/agents/logic-flaw-detector.js.map +1 -0
- package/dist/agents/zero-day-hunter.d.ts +69 -0
- package/dist/agents/zero-day-hunter.d.ts.map +1 -0
- package/dist/agents/zero-day-hunter.js +591 -0
- package/dist/agents/zero-day-hunter.js.map +1 -0
- package/dist/certification/artifacts.d.ts +21 -0
- package/dist/certification/artifacts.d.ts.map +1 -0
- package/dist/certification/artifacts.js +275 -0
- package/dist/certification/artifacts.js.map +1 -0
- package/dist/certification/autofix.d.ts +122 -0
- package/dist/certification/autofix.d.ts.map +1 -0
- package/dist/certification/autofix.js +476 -0
- package/dist/certification/autofix.js.map +1 -0
- package/dist/certification/badge.d.ts +56 -0
- package/dist/certification/badge.d.ts.map +1 -0
- package/dist/certification/badge.js +155 -0
- package/dist/certification/badge.js.map +1 -0
- package/dist/certification/cache.d.ts +121 -0
- package/dist/certification/cache.d.ts.map +1 -0
- package/dist/certification/cache.js +275 -0
- package/dist/certification/cache.js.map +1 -0
- package/dist/certification/cache.test.d.ts +5 -0
- package/dist/certification/cache.test.d.ts.map +1 -0
- package/dist/certification/cache.test.js +270 -0
- package/dist/certification/cache.test.js.map +1 -0
- package/dist/certification/consensus.d.ts +105 -0
- package/dist/certification/consensus.d.ts.map +1 -0
- package/dist/certification/consensus.js +353 -0
- package/dist/certification/consensus.js.map +1 -0
- package/dist/certification/consensus.test.d.ts +5 -0
- package/dist/certification/consensus.test.d.ts.map +1 -0
- package/dist/certification/consensus.test.js +342 -0
- package/dist/certification/consensus.test.js.map +1 -0
- package/dist/certification/index.d.ts +14 -0
- package/dist/certification/index.d.ts.map +1 -0
- package/dist/certification/index.js +14 -0
- package/dist/certification/index.js.map +1 -0
- package/dist/certification/rules.d.ts +89 -0
- package/dist/certification/rules.d.ts.map +1 -0
- package/dist/certification/rules.js +317 -0
- package/dist/certification/rules.js.map +1 -0
- package/dist/certification/sarif.d.ts +107 -0
- package/dist/certification/sarif.d.ts.map +1 -0
- package/dist/certification/sarif.js +191 -0
- package/dist/certification/sarif.js.map +1 -0
- package/dist/certification/store.d.ts +255 -0
- package/dist/certification/store.d.ts.map +1 -0
- package/dist/certification/store.js +835 -0
- package/dist/certification/store.js.map +1 -0
- package/dist/certification/store.test.d.ts +5 -0
- package/dist/certification/store.test.d.ts.map +1 -0
- package/dist/certification/store.test.js +468 -0
- package/dist/certification/store.test.js.map +1 -0
- package/dist/certification/summary.d.ts +72 -0
- package/dist/certification/summary.d.ts.map +1 -0
- package/dist/certification/summary.js +296 -0
- package/dist/certification/summary.js.map +1 -0
- package/dist/certification/types.d.ts +138 -0
- package/dist/certification/types.d.ts.map +1 -0
- package/dist/certification/types.js +34 -0
- package/dist/certification/types.js.map +1 -0
- package/dist/commands/audits/api-check.d.ts +3 -0
- package/dist/commands/audits/api-check.d.ts.map +1 -0
- package/dist/commands/audits/api-check.js +71 -0
- package/dist/commands/audits/api-check.js.map +1 -0
- package/dist/commands/audits/deadcode.d.ts +3 -0
- package/dist/commands/audits/deadcode.d.ts.map +1 -0
- package/dist/commands/audits/deadcode.js +63 -0
- package/dist/commands/audits/deadcode.js.map +1 -0
- package/dist/commands/audits/deps.d.ts +3 -0
- package/dist/commands/audits/deps.d.ts.map +1 -0
- package/dist/commands/audits/deps.js +56 -0
- package/dist/commands/audits/deps.js.map +1 -0
- package/dist/commands/audits/errors.d.ts +3 -0
- package/dist/commands/audits/errors.d.ts.map +1 -0
- package/dist/commands/audits/errors.js +65 -0
- package/dist/commands/audits/errors.js.map +1 -0
- package/dist/commands/audits/index.d.ts +3 -0
- package/dist/commands/audits/index.d.ts.map +1 -0
- package/dist/commands/audits/index.js +15 -0
- package/dist/commands/audits/index.js.map +1 -0
- package/dist/commands/audits/perf.d.ts +3 -0
- package/dist/commands/audits/perf.d.ts.map +1 -0
- package/dist/commands/audits/perf.js +85 -0
- package/dist/commands/audits/perf.js.map +1 -0
- package/dist/commands/audits/secrets.d.ts +3 -0
- package/dist/commands/audits/secrets.d.ts.map +1 -0
- package/dist/commands/audits/secrets.js +71 -0
- package/dist/commands/audits/secrets.js.map +1 -0
- package/dist/commands/certification/certify.d.ts +3 -0
- package/dist/commands/certification/certify.d.ts.map +1 -0
- package/dist/commands/certification/certify.js +108 -0
- package/dist/commands/certification/certify.js.map +1 -0
- package/dist/commands/certification/index.d.ts +3 -0
- package/dist/commands/certification/index.d.ts.map +1 -0
- package/dist/commands/certification/index.js +17 -0
- package/dist/commands/certification/index.js.map +1 -0
- package/dist/commands/certification/performance.d.ts +3 -0
- package/dist/commands/certification/performance.d.ts.map +1 -0
- package/dist/commands/certification/performance.js +89 -0
- package/dist/commands/certification/performance.js.map +1 -0
- package/dist/commands/certification/quality.d.ts +3 -0
- package/dist/commands/certification/quality.d.ts.map +1 -0
- package/dist/commands/certification/quality.js +92 -0
- package/dist/commands/certification/quality.js.map +1 -0
- package/dist/commands/certification/redteam.d.ts +3 -0
- package/dist/commands/certification/redteam.d.ts.map +1 -0
- package/dist/commands/certification/redteam.js +114 -0
- package/dist/commands/certification/redteam.js.map +1 -0
- package/dist/commands/certification/reliability.d.ts +3 -0
- package/dist/commands/certification/reliability.d.ts.map +1 -0
- package/dist/commands/certification/reliability.js +93 -0
- package/dist/commands/certification/reliability.js.map +1 -0
- package/dist/commands/certification/security.d.ts +3 -0
- package/dist/commands/certification/security.d.ts.map +1 -0
- package/dist/commands/certification/security.js +90 -0
- package/dist/commands/certification/security.js.map +1 -0
- package/dist/commands/certification/typesafety.d.ts +3 -0
- package/dist/commands/certification/typesafety.d.ts.map +1 -0
- package/dist/commands/certification/typesafety.js +87 -0
- package/dist/commands/certification/typesafety.js.map +1 -0
- package/dist/commands/core/add-tests.d.ts +3 -0
- package/dist/commands/core/add-tests.d.ts.map +1 -0
- package/dist/commands/core/add-tests.js +29 -0
- package/dist/commands/core/add-tests.js.map +1 -0
- package/dist/commands/core/audit.d.ts +3 -0
- package/dist/commands/core/audit.d.ts.map +1 -0
- package/dist/commands/core/audit.js +64 -0
- package/dist/commands/core/audit.js.map +1 -0
- package/dist/commands/core/fix-critical.d.ts +3 -0
- package/dist/commands/core/fix-critical.d.ts.map +1 -0
- package/dist/commands/core/fix-critical.js +22 -0
- package/dist/commands/core/fix-critical.js.map +1 -0
- package/dist/commands/core/fix-high.d.ts +3 -0
- package/dist/commands/core/fix-high.d.ts.map +1 -0
- package/dist/commands/core/fix-high.js +32 -0
- package/dist/commands/core/fix-high.js.map +1 -0
- package/dist/commands/core/fix-medium.d.ts +3 -0
- package/dist/commands/core/fix-medium.d.ts.map +1 -0
- package/dist/commands/core/fix-medium.js +29 -0
- package/dist/commands/core/fix-medium.js.map +1 -0
- package/dist/commands/core/fix-rls.d.ts +3 -0
- package/dist/commands/core/fix-rls.d.ts.map +1 -0
- package/dist/commands/core/fix-rls.js +17 -0
- package/dist/commands/core/fix-rls.js.map +1 -0
- package/dist/commands/core/harden.d.ts +3 -0
- package/dist/commands/core/harden.d.ts.map +1 -0
- package/dist/commands/core/harden.js +19 -0
- package/dist/commands/core/harden.js.map +1 -0
- package/dist/commands/core/index.d.ts +3 -0
- package/dist/commands/core/index.d.ts.map +1 -0
- package/dist/commands/core/index.js +21 -0
- package/dist/commands/core/index.js.map +1 -0
- package/dist/commands/core/preflight.d.ts +3 -0
- package/dist/commands/core/preflight.d.ts.map +1 -0
- package/dist/commands/core/preflight.js +50 -0
- package/dist/commands/core/preflight.js.map +1 -0
- package/dist/commands/core/verify.d.ts +3 -0
- package/dist/commands/core/verify.d.ts.map +1 -0
- package/dist/commands/core/verify.js +32 -0
- package/dist/commands/core/verify.js.map +1 -0
- package/dist/commands/index.d.ts +28 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +37 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/types.d.ts +9 -0
- package/dist/commands/types.d.ts.map +1 -0
- package/dist/commands/types.js +5 -0
- package/dist/commands/types.js.map +1 -0
- package/dist/compliance/cis.d.ts +29 -0
- package/dist/compliance/cis.d.ts.map +1 -0
- package/dist/compliance/cis.js +316 -0
- package/dist/compliance/cis.js.map +1 -0
- package/dist/compliance/frameworks/eu-ai-act.d.ts +55 -0
- package/dist/compliance/frameworks/eu-ai-act.d.ts.map +1 -0
- package/dist/compliance/frameworks/eu-ai-act.js +621 -0
- package/dist/compliance/frameworks/eu-ai-act.js.map +1 -0
- package/dist/compliance/frameworks/index.d.ts +67 -0
- package/dist/compliance/frameworks/index.d.ts.map +1 -0
- package/dist/compliance/frameworks/index.js +97 -0
- package/dist/compliance/frameworks/index.js.map +1 -0
- package/dist/compliance/frameworks/iso-42001.d.ts +59 -0
- package/dist/compliance/frameworks/iso-42001.d.ts.map +1 -0
- package/dist/compliance/frameworks/iso-42001.js +719 -0
- package/dist/compliance/frameworks/iso-42001.js.map +1 -0
- package/dist/compliance/frameworks/mitre-atlas.d.ts +58 -0
- package/dist/compliance/frameworks/mitre-atlas.d.ts.map +1 -0
- package/dist/compliance/frameworks/mitre-atlas.js +686 -0
- package/dist/compliance/frameworks/mitre-atlas.js.map +1 -0
- package/dist/compliance/frameworks/nist-ai-rmf.d.ts +51 -0
- package/dist/compliance/frameworks/nist-ai-rmf.d.ts.map +1 -0
- package/dist/compliance/frameworks/nist-ai-rmf.js +677 -0
- package/dist/compliance/frameworks/nist-ai-rmf.js.map +1 -0
- package/dist/compliance/frameworks/owasp-llm.d.ts +58 -0
- package/dist/compliance/frameworks/owasp-llm.d.ts.map +1 -0
- package/dist/compliance/frameworks/owasp-llm.js +399 -0
- package/dist/compliance/frameworks/owasp-llm.js.map +1 -0
- package/dist/compliance/gdpr.d.ts +34 -0
- package/dist/compliance/gdpr.d.ts.map +1 -0
- package/dist/compliance/gdpr.js +319 -0
- package/dist/compliance/gdpr.js.map +1 -0
- package/dist/compliance/hipaa.d.ts +29 -0
- package/dist/compliance/hipaa.d.ts.map +1 -0
- package/dist/compliance/hipaa.js +205 -0
- package/dist/compliance/hipaa.js.map +1 -0
- package/dist/compliance/index.d.ts +18 -0
- package/dist/compliance/index.d.ts.map +1 -0
- package/dist/compliance/index.js +26 -0
- package/dist/compliance/index.js.map +1 -0
- package/dist/compliance/iso27001.d.ts +30 -0
- package/dist/compliance/iso27001.d.ts.map +1 -0
- package/dist/compliance/iso27001.js +332 -0
- package/dist/compliance/iso27001.js.map +1 -0
- package/dist/compliance/mapper.d.ts +42 -0
- package/dist/compliance/mapper.d.ts.map +1 -0
- package/dist/compliance/mapper.js +269 -0
- package/dist/compliance/mapper.js.map +1 -0
- package/dist/compliance/mapper.test.d.ts +5 -0
- package/dist/compliance/mapper.test.d.ts.map +1 -0
- package/dist/compliance/mapper.test.js +360 -0
- package/dist/compliance/mapper.test.js.map +1 -0
- package/dist/compliance/pci-dss.d.ts +29 -0
- package/dist/compliance/pci-dss.d.ts.map +1 -0
- package/dist/compliance/pci-dss.js +247 -0
- package/dist/compliance/pci-dss.js.map +1 -0
- package/dist/compliance/report.d.ts +25 -0
- package/dist/compliance/report.d.ts.map +1 -0
- package/dist/compliance/report.js +254 -0
- package/dist/compliance/report.js.map +1 -0
- package/dist/compliance/report.test.d.ts +5 -0
- package/dist/compliance/report.test.d.ts.map +1 -0
- package/dist/compliance/report.test.js +128 -0
- package/dist/compliance/report.test.js.map +1 -0
- package/dist/compliance/soc2.d.ts +30 -0
- package/dist/compliance/soc2.d.ts.map +1 -0
- package/dist/compliance/soc2.js +262 -0
- package/dist/compliance/soc2.js.map +1 -0
- package/dist/compliance/soc2.test.d.ts +5 -0
- package/dist/compliance/soc2.test.d.ts.map +1 -0
- package/dist/compliance/soc2.test.js +86 -0
- package/dist/compliance/soc2.test.js.map +1 -0
- package/dist/compliance/types.d.ts +125 -0
- package/dist/compliance/types.d.ts.map +1 -0
- package/dist/compliance/types.js +10 -0
- package/dist/compliance/types.js.map +1 -0
- package/dist/config/flags.d.ts +456 -0
- package/dist/config/flags.d.ts.map +1 -0
- package/dist/config/flags.js +464 -0
- package/dist/config/flags.js.map +1 -0
- package/dist/config/index.d.ts +10 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +10 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/severity-overrides.d.ts +209 -0
- package/dist/config/severity-overrides.d.ts.map +1 -0
- package/dist/config/severity-overrides.js +380 -0
- package/dist/config/severity-overrides.js.map +1 -0
- package/dist/cost/index.d.ts +11 -0
- package/dist/cost/index.d.ts.map +1 -0
- package/dist/cost/index.js +12 -0
- package/dist/cost/index.js.map +1 -0
- package/dist/cost/pricing.d.ts +57 -0
- package/dist/cost/pricing.d.ts.map +1 -0
- package/dist/cost/pricing.js +196 -0
- package/dist/cost/pricing.js.map +1 -0
- package/dist/cost/pricing.test.d.ts +5 -0
- package/dist/cost/pricing.test.d.ts.map +1 -0
- package/dist/cost/pricing.test.js +195 -0
- package/dist/cost/pricing.test.js.map +1 -0
- package/dist/cost/tracker.d.ts +100 -0
- package/dist/cost/tracker.d.ts.map +1 -0
- package/dist/cost/tracker.js +366 -0
- package/dist/cost/tracker.js.map +1 -0
- package/dist/cost/tracker.test.d.ts +5 -0
- package/dist/cost/tracker.test.d.ts.map +1 -0
- package/dist/cost/tracker.test.js +360 -0
- package/dist/cost/tracker.test.js.map +1 -0
- package/dist/cost/types.d.ts +135 -0
- package/dist/cost/types.d.ts.map +1 -0
- package/dist/cost/types.js +9 -0
- package/dist/cost/types.js.map +1 -0
- package/dist/enterprise/auth/oidc.d.ts +231 -0
- package/dist/enterprise/auth/oidc.d.ts.map +1 -0
- package/dist/enterprise/auth/oidc.js +372 -0
- package/dist/enterprise/auth/oidc.js.map +1 -0
- package/dist/enterprise/auth/oidc.test.d.ts +5 -0
- package/dist/enterprise/auth/oidc.test.d.ts.map +1 -0
- package/dist/enterprise/auth/oidc.test.js +435 -0
- package/dist/enterprise/auth/oidc.test.js.map +1 -0
- package/dist/enterprise/index.d.ts +14 -0
- package/dist/enterprise/index.d.ts.map +1 -0
- package/dist/enterprise/index.js +19 -0
- package/dist/enterprise/index.js.map +1 -0
- package/dist/enterprise/integrations/chat.d.ts +205 -0
- package/dist/enterprise/integrations/chat.d.ts.map +1 -0
- package/dist/enterprise/integrations/chat.js +624 -0
- package/dist/enterprise/integrations/chat.js.map +1 -0
- package/dist/enterprise/integrations/chat.test.d.ts +5 -0
- package/dist/enterprise/integrations/chat.test.d.ts.map +1 -0
- package/dist/enterprise/integrations/chat.test.js +557 -0
- package/dist/enterprise/integrations/chat.test.js.map +1 -0
- package/dist/enterprise/integrations/ticketing.d.ts +257 -0
- package/dist/enterprise/integrations/ticketing.d.ts.map +1 -0
- package/dist/enterprise/integrations/ticketing.js +548 -0
- package/dist/enterprise/integrations/ticketing.js.map +1 -0
- package/dist/enterprise/integrations/ticketing.test.d.ts +5 -0
- package/dist/enterprise/integrations/ticketing.test.d.ts.map +1 -0
- package/dist/enterprise/integrations/ticketing.test.js +693 -0
- package/dist/enterprise/integrations/ticketing.test.js.map +1 -0
- package/dist/enterprise/policy/opa.d.ts +194 -0
- package/dist/enterprise/policy/opa.d.ts.map +1 -0
- package/dist/enterprise/policy/opa.js +385 -0
- package/dist/enterprise/policy/opa.js.map +1 -0
- package/dist/enterprise/policy/opa.test.d.ts +5 -0
- package/dist/enterprise/policy/opa.test.d.ts.map +1 -0
- package/dist/enterprise/policy/opa.test.js +702 -0
- package/dist/enterprise/policy/opa.test.js.map +1 -0
- package/dist/enterprise/signing/kms.d.ts +211 -0
- package/dist/enterprise/signing/kms.d.ts.map +1 -0
- package/dist/enterprise/signing/kms.js +480 -0
- package/dist/enterprise/signing/kms.js.map +1 -0
- package/dist/enterprise/signing/kms.test.d.ts +5 -0
- package/dist/enterprise/signing/kms.test.d.ts.map +1 -0
- package/dist/enterprise/signing/kms.test.js +511 -0
- package/dist/enterprise/signing/kms.test.js.map +1 -0
- package/dist/eval/fixtures.d.ts +58 -0
- package/dist/eval/fixtures.d.ts.map +1 -0
- package/dist/eval/fixtures.js +571 -0
- package/dist/eval/fixtures.js.map +1 -0
- package/dist/eval/fixtures.test.d.ts +5 -0
- package/dist/eval/fixtures.test.d.ts.map +1 -0
- package/dist/eval/fixtures.test.js +193 -0
- package/dist/eval/fixtures.test.js.map +1 -0
- package/dist/eval/harness.d.ts +30 -0
- package/dist/eval/harness.d.ts.map +1 -0
- package/dist/eval/harness.js +221 -0
- package/dist/eval/harness.js.map +1 -0
- package/dist/eval/harness.test.d.ts +5 -0
- package/dist/eval/harness.test.d.ts.map +1 -0
- package/dist/eval/harness.test.js +314 -0
- package/dist/eval/harness.test.js.map +1 -0
- package/dist/eval/index.d.ts +15 -0
- package/dist/eval/index.d.ts.map +1 -0
- package/dist/eval/index.js +18 -0
- package/dist/eval/index.js.map +1 -0
- package/dist/eval/metrics.d.ts +56 -0
- package/dist/eval/metrics.d.ts.map +1 -0
- package/dist/eval/metrics.js +298 -0
- package/dist/eval/metrics.js.map +1 -0
- package/dist/eval/metrics.test.d.ts +5 -0
- package/dist/eval/metrics.test.d.ts.map +1 -0
- package/dist/eval/metrics.test.js +426 -0
- package/dist/eval/metrics.test.js.map +1 -0
- package/dist/eval/report.d.ts +30 -0
- package/dist/eval/report.d.ts.map +1 -0
- package/dist/eval/report.js +333 -0
- package/dist/eval/report.js.map +1 -0
- package/dist/eval/report.test.d.ts +5 -0
- package/dist/eval/report.test.d.ts.map +1 -0
- package/dist/eval/report.test.js +275 -0
- package/dist/eval/report.test.js.map +1 -0
- package/dist/eval/types.d.ts +234 -0
- package/dist/eval/types.d.ts.map +1 -0
- package/dist/eval/types.js +27 -0
- package/dist/eval/types.js.map +1 -0
- package/dist/http-server.d.ts +3 -0
- package/dist/http-server.d.ts.map +1 -0
- package/dist/http-server.js +127 -0
- package/dist/http-server.js.map +1 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4120 -0
- package/dist/index.js.map +1 -0
- package/dist/logger.d.ts +46 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +131 -0
- package/dist/logger.js.map +1 -0
- package/dist/multimodel/consensus.d.ts +49 -0
- package/dist/multimodel/consensus.d.ts.map +1 -0
- package/dist/multimodel/consensus.js +454 -0
- package/dist/multimodel/consensus.js.map +1 -0
- package/dist/multimodel/consensus.test.d.ts +5 -0
- package/dist/multimodel/consensus.test.d.ts.map +1 -0
- package/dist/multimodel/consensus.test.js +415 -0
- package/dist/multimodel/consensus.test.js.map +1 -0
- package/dist/multimodel/index.d.ts +13 -0
- package/dist/multimodel/index.d.ts.map +1 -0
- package/dist/multimodel/index.js +14 -0
- package/dist/multimodel/index.js.map +1 -0
- package/dist/multimodel/runner.d.ts +95 -0
- package/dist/multimodel/runner.d.ts.map +1 -0
- package/dist/multimodel/runner.js +312 -0
- package/dist/multimodel/runner.js.map +1 -0
- package/dist/multimodel/runner.test.d.ts +5 -0
- package/dist/multimodel/runner.test.d.ts.map +1 -0
- package/dist/multimodel/runner.test.js +224 -0
- package/dist/multimodel/runner.test.js.map +1 -0
- package/dist/multimodel/types.d.ts +202 -0
- package/dist/multimodel/types.d.ts.map +1 -0
- package/dist/multimodel/types.js +10 -0
- package/dist/multimodel/types.js.map +1 -0
- package/dist/observability/index.d.ts +9 -0
- package/dist/observability/index.d.ts.map +1 -0
- package/dist/observability/index.js +9 -0
- package/dist/observability/index.js.map +1 -0
- package/dist/observability/otel.d.ts +102 -0
- package/dist/observability/otel.d.ts.map +1 -0
- package/dist/observability/otel.js +284 -0
- package/dist/observability/otel.js.map +1 -0
- package/dist/plugins/index.d.ts +10 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/index.js +10 -0
- package/dist/plugins/index.js.map +1 -0
- package/dist/plugins/loader.d.ts +78 -0
- package/dist/plugins/loader.d.ts.map +1 -0
- package/dist/plugins/loader.js +470 -0
- package/dist/plugins/loader.js.map +1 -0
- package/dist/plugins/types.d.ts +304 -0
- package/dist/plugins/types.d.ts.map +1 -0
- package/dist/plugins/types.js +100 -0
- package/dist/plugins/types.js.map +1 -0
- package/dist/sbom/cyclonedx.d.ts +30 -0
- package/dist/sbom/cyclonedx.d.ts.map +1 -0
- package/dist/sbom/cyclonedx.js +392 -0
- package/dist/sbom/cyclonedx.js.map +1 -0
- package/dist/sbom/cyclonedx.test.d.ts +5 -0
- package/dist/sbom/cyclonedx.test.d.ts.map +1 -0
- package/dist/sbom/cyclonedx.test.js +244 -0
- package/dist/sbom/cyclonedx.test.js.map +1 -0
- package/dist/sbom/index.d.ts +13 -0
- package/dist/sbom/index.d.ts.map +1 -0
- package/dist/sbom/index.js +15 -0
- package/dist/sbom/index.js.map +1 -0
- package/dist/sbom/provenance.d.ts +37 -0
- package/dist/sbom/provenance.d.ts.map +1 -0
- package/dist/sbom/provenance.js +268 -0
- package/dist/sbom/provenance.js.map +1 -0
- package/dist/sbom/provenance.test.d.ts +5 -0
- package/dist/sbom/provenance.test.d.ts.map +1 -0
- package/dist/sbom/provenance.test.js +189 -0
- package/dist/sbom/provenance.test.js.map +1 -0
- package/dist/sbom/signing.d.ts +87 -0
- package/dist/sbom/signing.d.ts.map +1 -0
- package/dist/sbom/signing.js +354 -0
- package/dist/sbom/signing.js.map +1 -0
- package/dist/sbom/signing.test.d.ts +5 -0
- package/dist/sbom/signing.test.d.ts.map +1 -0
- package/dist/sbom/signing.test.js +170 -0
- package/dist/sbom/signing.test.js.map +1 -0
- package/dist/sbom/types.d.ts +384 -0
- package/dist/sbom/types.d.ts.map +1 -0
- package/dist/sbom/types.js +17 -0
- package/dist/sbom/types.js.map +1 -0
- package/dist/scanners/agent/credential-scope-audit.d.ts +40 -0
- package/dist/scanners/agent/credential-scope-audit.d.ts.map +1 -0
- package/dist/scanners/agent/credential-scope-audit.js +404 -0
- package/dist/scanners/agent/credential-scope-audit.js.map +1 -0
- package/dist/scanners/agent/exfil-path-graph.d.ts +50 -0
- package/dist/scanners/agent/exfil-path-graph.d.ts.map +1 -0
- package/dist/scanners/agent/exfil-path-graph.js +764 -0
- package/dist/scanners/agent/exfil-path-graph.js.map +1 -0
- package/dist/scanners/agent/index.d.ts +43 -0
- package/dist/scanners/agent/index.d.ts.map +1 -0
- package/dist/scanners/agent/index.js +616 -0
- package/dist/scanners/agent/index.js.map +1 -0
- package/dist/scanners/agent/manifest-audit.d.ts +43 -0
- package/dist/scanners/agent/manifest-audit.d.ts.map +1 -0
- package/dist/scanners/agent/manifest-audit.js +403 -0
- package/dist/scanners/agent/manifest-audit.js.map +1 -0
- package/dist/scanners/agent/payloads/index.d.ts +44 -0
- package/dist/scanners/agent/payloads/index.d.ts.map +1 -0
- package/dist/scanners/agent/payloads/index.js +184 -0
- package/dist/scanners/agent/payloads/index.js.map +1 -0
- package/dist/scanners/agent/permission-minimiser.d.ts +48 -0
- package/dist/scanners/agent/permission-minimiser.d.ts.map +1 -0
- package/dist/scanners/agent/permission-minimiser.js +551 -0
- package/dist/scanners/agent/permission-minimiser.js.map +1 -0
- package/dist/scanners/agent/prompt-injection-fuzzer.d.ts +39 -0
- package/dist/scanners/agent/prompt-injection-fuzzer.d.ts.map +1 -0
- package/dist/scanners/agent/prompt-injection-fuzzer.js +720 -0
- package/dist/scanners/agent/prompt-injection-fuzzer.js.map +1 -0
- package/dist/scanners/agent/sandbox-audit.d.ts +44 -0
- package/dist/scanners/agent/sandbox-audit.d.ts.map +1 -0
- package/dist/scanners/agent/sandbox-audit.js +425 -0
- package/dist/scanners/agent/sandbox-audit.js.map +1 -0
- package/dist/scanners/agent/supply-chain-mcp.d.ts +53 -0
- package/dist/scanners/agent/supply-chain-mcp.d.ts.map +1 -0
- package/dist/scanners/agent/supply-chain-mcp.js +479 -0
- package/dist/scanners/agent/supply-chain-mcp.js.map +1 -0
- package/dist/scanners/agent/tool-description-drift.d.ts +62 -0
- package/dist/scanners/agent/tool-description-drift.d.ts.map +1 -0
- package/dist/scanners/agent/tool-description-drift.js +365 -0
- package/dist/scanners/agent/tool-description-drift.js.map +1 -0
- package/dist/scanners/agent/types.d.ts +840 -0
- package/dist/scanners/agent/types.d.ts.map +1 -0
- package/dist/scanners/agent/types.js +149 -0
- package/dist/scanners/agent/types.js.map +1 -0
- package/dist/scanners/bandit.d.ts +25 -0
- package/dist/scanners/bandit.d.ts.map +1 -0
- package/dist/scanners/bandit.js +129 -0
- package/dist/scanners/bandit.js.map +1 -0
- package/dist/scanners/binary-analysis.d.ts +41 -0
- package/dist/scanners/binary-analysis.d.ts.map +1 -0
- package/dist/scanners/binary-analysis.js +587 -0
- package/dist/scanners/binary-analysis.js.map +1 -0
- package/dist/scanners/binary-analysis.test.d.ts +5 -0
- package/dist/scanners/binary-analysis.test.d.ts.map +1 -0
- package/dist/scanners/binary-analysis.test.js +291 -0
- package/dist/scanners/binary-analysis.test.js.map +1 -0
- package/dist/scanners/brakeman.d.ts +30 -0
- package/dist/scanners/brakeman.d.ts.map +1 -0
- package/dist/scanners/brakeman.js +271 -0
- package/dist/scanners/brakeman.js.map +1 -0
- package/dist/scanners/dependencies.d.ts +22 -0
- package/dist/scanners/dependencies.d.ts.map +1 -0
- package/dist/scanners/dependencies.js +202 -0
- package/dist/scanners/dependencies.js.map +1 -0
- package/dist/scanners/dependencies.test.d.ts +5 -0
- package/dist/scanners/dependencies.test.d.ts.map +1 -0
- package/dist/scanners/dependencies.test.js +185 -0
- package/dist/scanners/dependencies.test.js.map +1 -0
- package/dist/scanners/eslint.d.ts +25 -0
- package/dist/scanners/eslint.d.ts.map +1 -0
- package/dist/scanners/eslint.js +220 -0
- package/dist/scanners/eslint.js.map +1 -0
- package/dist/scanners/gosec.d.ts +25 -0
- package/dist/scanners/gosec.d.ts.map +1 -0
- package/dist/scanners/gosec.js +128 -0
- package/dist/scanners/gosec.js.map +1 -0
- package/dist/scanners/index.d.ts +128 -0
- package/dist/scanners/index.d.ts.map +1 -0
- package/dist/scanners/index.js +811 -0
- package/dist/scanners/index.js.map +1 -0
- package/dist/scanners/index.test.d.ts +5 -0
- package/dist/scanners/index.test.d.ts.map +1 -0
- package/dist/scanners/index.test.js +424 -0
- package/dist/scanners/index.test.js.map +1 -0
- package/dist/scanners/memory-safety.d.ts +44 -0
- package/dist/scanners/memory-safety.d.ts.map +1 -0
- package/dist/scanners/memory-safety.js +571 -0
- package/dist/scanners/memory-safety.js.map +1 -0
- package/dist/scanners/memory-safety.test.d.ts +5 -0
- package/dist/scanners/memory-safety.test.d.ts.map +1 -0
- package/dist/scanners/memory-safety.test.js +321 -0
- package/dist/scanners/memory-safety.test.js.map +1 -0
- package/dist/scanners/race-condition.d.ts +25 -0
- package/dist/scanners/race-condition.d.ts.map +1 -0
- package/dist/scanners/race-condition.js +443 -0
- package/dist/scanners/race-condition.js.map +1 -0
- package/dist/scanners/race-condition.test.d.ts +5 -0
- package/dist/scanners/race-condition.test.d.ts.map +1 -0
- package/dist/scanners/race-condition.test.js +428 -0
- package/dist/scanners/race-condition.test.js.map +1 -0
- package/dist/scanners/secrets.d.ts +25 -0
- package/dist/scanners/secrets.d.ts.map +1 -0
- package/dist/scanners/secrets.js +367 -0
- package/dist/scanners/secrets.js.map +1 -0
- package/dist/scanners/secrets.test.d.ts +5 -0
- package/dist/scanners/secrets.test.d.ts.map +1 -0
- package/dist/scanners/secrets.test.js +160 -0
- package/dist/scanners/secrets.test.js.map +1 -0
- package/dist/scanners/semgrep.d.ts +33 -0
- package/dist/scanners/semgrep.d.ts.map +1 -0
- package/dist/scanners/semgrep.js +350 -0
- package/dist/scanners/semgrep.js.map +1 -0
- package/dist/scanners/semgrep.test.d.ts +8 -0
- package/dist/scanners/semgrep.test.d.ts.map +1 -0
- package/dist/scanners/semgrep.test.js +254 -0
- package/dist/scanners/semgrep.test.js.map +1 -0
- package/dist/scanners/trivy.d.ts +26 -0
- package/dist/scanners/trivy.d.ts.map +1 -0
- package/dist/scanners/trivy.js +187 -0
- package/dist/scanners/trivy.js.map +1 -0
- package/dist/scanners/types.d.ts +210 -0
- package/dist/scanners/types.d.ts.map +1 -0
- package/dist/scanners/types.js +106 -0
- package/dist/scanners/types.js.map +1 -0
- package/dist/scanners/types.test.d.ts +5 -0
- package/dist/scanners/types.test.d.ts.map +1 -0
- package/dist/scanners/types.test.js +103 -0
- package/dist/scanners/types.test.js.map +1 -0
- package/dist/scanners/typescript.d.ts +32 -0
- package/dist/scanners/typescript.d.ts.map +1 -0
- package/dist/scanners/typescript.js +300 -0
- package/dist/scanners/typescript.js.map +1 -0
- package/dist/scanners/typescript.test.d.ts +5 -0
- package/dist/scanners/typescript.test.d.ts.map +1 -0
- package/dist/scanners/typescript.test.js +296 -0
- package/dist/scanners/typescript.test.js.map +1 -0
- package/dist/transcripts/index.d.ts +13 -0
- package/dist/transcripts/index.d.ts.map +1 -0
- package/dist/transcripts/index.js +17 -0
- package/dist/transcripts/index.js.map +1 -0
- package/dist/transcripts/logger.d.ts +190 -0
- package/dist/transcripts/logger.d.ts.map +1 -0
- package/dist/transcripts/logger.js +385 -0
- package/dist/transcripts/logger.js.map +1 -0
- package/dist/transcripts/logger.test.d.ts +5 -0
- package/dist/transcripts/logger.test.d.ts.map +1 -0
- package/dist/transcripts/logger.test.js +227 -0
- package/dist/transcripts/logger.test.js.map +1 -0
- package/dist/transcripts/redaction.d.ts +125 -0
- package/dist/transcripts/redaction.d.ts.map +1 -0
- package/dist/transcripts/redaction.js +416 -0
- package/dist/transcripts/redaction.js.map +1 -0
- package/dist/transcripts/redaction.test.d.ts +5 -0
- package/dist/transcripts/redaction.test.d.ts.map +1 -0
- package/dist/transcripts/redaction.test.js +267 -0
- package/dist/transcripts/redaction.test.js.map +1 -0
- package/dist/transcripts/signing.d.ts +108 -0
- package/dist/transcripts/signing.d.ts.map +1 -0
- package/dist/transcripts/signing.js +173 -0
- package/dist/transcripts/signing.js.map +1 -0
- package/dist/transcripts/verifier.d.ts +133 -0
- package/dist/transcripts/verifier.d.ts.map +1 -0
- package/dist/transcripts/verifier.js +489 -0
- package/dist/transcripts/verifier.js.map +1 -0
- package/dist/transcripts/verifier.test.d.ts +5 -0
- package/dist/transcripts/verifier.test.d.ts.map +1 -0
- package/dist/transcripts/verifier.test.js +330 -0
- package/dist/transcripts/verifier.test.js.map +1 -0
- package/dist/util/concurrency.d.ts +221 -0
- package/dist/util/concurrency.d.ts.map +1 -0
- package/dist/util/concurrency.js +339 -0
- package/dist/util/concurrency.js.map +1 -0
- package/dist/util/index.d.ts +12 -0
- package/dist/util/index.d.ts.map +1 -0
- package/dist/util/index.js +12 -0
- package/dist/util/index.js.map +1 -0
- package/dist/util/json.d.ts +63 -0
- package/dist/util/json.d.ts.map +1 -0
- package/dist/util/json.js +134 -0
- package/dist/util/json.js.map +1 -0
- package/dist/util/paths.d.ts +56 -0
- package/dist/util/paths.d.ts.map +1 -0
- package/dist/util/paths.js +128 -0
- package/dist/util/paths.js.map +1 -0
- package/dist/util/retry.d.ts +185 -0
- package/dist/util/retry.d.ts.map +1 -0
- package/dist/util/retry.js +338 -0
- package/dist/util/retry.js.map +1 -0
- package/package.json +79 -0
|
@@ -0,0 +1,693 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tests for Ticketing Integrations
|
|
3
|
+
*/
|
|
4
|
+
import { describe, it, expect, beforeEach, vi } from "vitest";
|
|
5
|
+
import { JiraClient, ServiceNowClient, LinearClient, TicketingClient, createJiraClient, createServiceNowClient, createLinearClient, createTicketingClient, } from "./ticketing.js";
|
|
6
|
+
// Mock fetch
|
|
7
|
+
const mockFetch = vi.fn();
|
|
8
|
+
global.fetch = mockFetch;
|
|
9
|
+
describe("JiraClient", () => {
|
|
10
|
+
let client;
|
|
11
|
+
let config;
|
|
12
|
+
beforeEach(() => {
|
|
13
|
+
vi.clearAllMocks();
|
|
14
|
+
config = {
|
|
15
|
+
platform: "jira",
|
|
16
|
+
baseUrl: "https://company.atlassian.net",
|
|
17
|
+
apiToken: "api-token-xxx",
|
|
18
|
+
email: "user@company.com",
|
|
19
|
+
defaultProject: "SEC",
|
|
20
|
+
isCloud: true,
|
|
21
|
+
};
|
|
22
|
+
client = new JiraClient(config);
|
|
23
|
+
});
|
|
24
|
+
describe("createTicket", () => {
|
|
25
|
+
it("creates issue successfully", async () => {
|
|
26
|
+
mockFetch.mockResolvedValueOnce({
|
|
27
|
+
ok: true,
|
|
28
|
+
json: async () => ({
|
|
29
|
+
id: "10001",
|
|
30
|
+
key: "SEC-123",
|
|
31
|
+
}),
|
|
32
|
+
});
|
|
33
|
+
const request = {
|
|
34
|
+
title: "Security Finding: SQL Injection",
|
|
35
|
+
description: "Critical SQL injection vulnerability found",
|
|
36
|
+
};
|
|
37
|
+
const result = await client.createTicket(request);
|
|
38
|
+
expect(result.id).toBe("10001");
|
|
39
|
+
expect(result.key).toBe("SEC-123");
|
|
40
|
+
expect(result.url).toContain("SEC-123");
|
|
41
|
+
expect(result.platform).toBe("jira");
|
|
42
|
+
expect(mockFetch).toHaveBeenCalledWith("https://company.atlassian.net/rest/api/3/issue", expect.objectContaining({
|
|
43
|
+
method: "POST",
|
|
44
|
+
headers: expect.objectContaining({
|
|
45
|
+
Authorization: expect.stringContaining("Basic"),
|
|
46
|
+
"Content-Type": "application/json",
|
|
47
|
+
}),
|
|
48
|
+
}));
|
|
49
|
+
});
|
|
50
|
+
it("maps severity from findings to priority", async () => {
|
|
51
|
+
mockFetch.mockResolvedValue({
|
|
52
|
+
ok: true,
|
|
53
|
+
json: async () => ({ id: "10001", key: "SEC-124" }),
|
|
54
|
+
});
|
|
55
|
+
await client.createTicket({
|
|
56
|
+
title: "Critical Finding",
|
|
57
|
+
description: "test",
|
|
58
|
+
findings: [
|
|
59
|
+
{
|
|
60
|
+
id: "f1",
|
|
61
|
+
severity: "critical",
|
|
62
|
+
category: "vuln",
|
|
63
|
+
description: "Critical issue",
|
|
64
|
+
evidence: "",
|
|
65
|
+
confidence: 95,
|
|
66
|
+
verifications: [],
|
|
67
|
+
created_at: new Date().toISOString(),
|
|
68
|
+
},
|
|
69
|
+
],
|
|
70
|
+
});
|
|
71
|
+
const body = JSON.parse(mockFetch.mock.calls[0][1].body);
|
|
72
|
+
expect(body.fields.priority.name).toBe("Highest");
|
|
73
|
+
});
|
|
74
|
+
it("uses specified priority over finding severity", async () => {
|
|
75
|
+
mockFetch.mockResolvedValueOnce({
|
|
76
|
+
ok: true,
|
|
77
|
+
json: async () => ({ id: "10001", key: "SEC-125" }),
|
|
78
|
+
});
|
|
79
|
+
await client.createTicket({
|
|
80
|
+
title: "Test",
|
|
81
|
+
description: "test",
|
|
82
|
+
priority: "Low",
|
|
83
|
+
findings: [
|
|
84
|
+
{
|
|
85
|
+
id: "f1",
|
|
86
|
+
severity: "critical",
|
|
87
|
+
category: "vuln",
|
|
88
|
+
description: "Critical",
|
|
89
|
+
evidence: "",
|
|
90
|
+
confidence: 95,
|
|
91
|
+
verifications: [],
|
|
92
|
+
created_at: new Date().toISOString(),
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
});
|
|
96
|
+
const body = JSON.parse(mockFetch.mock.calls[0][1].body);
|
|
97
|
+
expect(body.fields.priority.name).toBe("Low");
|
|
98
|
+
});
|
|
99
|
+
it("uses custom issue type", async () => {
|
|
100
|
+
const customConfig = {
|
|
101
|
+
...config,
|
|
102
|
+
defaultIssueType: "Security Bug",
|
|
103
|
+
};
|
|
104
|
+
const customClient = new JiraClient(customConfig);
|
|
105
|
+
mockFetch.mockResolvedValueOnce({
|
|
106
|
+
ok: true,
|
|
107
|
+
json: async () => ({ id: "10001", key: "SEC-126" }),
|
|
108
|
+
});
|
|
109
|
+
await customClient.createTicket({
|
|
110
|
+
title: "Test",
|
|
111
|
+
description: "test",
|
|
112
|
+
});
|
|
113
|
+
const body = JSON.parse(mockFetch.mock.calls[0][1].body);
|
|
114
|
+
expect(body.fields.issuetype.name).toBe("Security Bug");
|
|
115
|
+
});
|
|
116
|
+
it("includes labels", async () => {
|
|
117
|
+
mockFetch.mockResolvedValueOnce({
|
|
118
|
+
ok: true,
|
|
119
|
+
json: async () => ({ id: "10001", key: "SEC-127" }),
|
|
120
|
+
});
|
|
121
|
+
await client.createTicket({
|
|
122
|
+
title: "Test",
|
|
123
|
+
description: "test",
|
|
124
|
+
labels: ["security", "automated"],
|
|
125
|
+
});
|
|
126
|
+
const body = JSON.parse(mockFetch.mock.calls[0][1].body);
|
|
127
|
+
expect(body.fields.labels).toContain("security");
|
|
128
|
+
expect(body.fields.labels).toContain("automated");
|
|
129
|
+
});
|
|
130
|
+
it("handles API errors", async () => {
|
|
131
|
+
mockFetch.mockResolvedValueOnce({
|
|
132
|
+
ok: false,
|
|
133
|
+
status: 400,
|
|
134
|
+
text: async () => "Project not found",
|
|
135
|
+
});
|
|
136
|
+
await expect(client.createTicket({
|
|
137
|
+
title: "Test",
|
|
138
|
+
description: "test",
|
|
139
|
+
})).rejects.toThrow("Jira API error");
|
|
140
|
+
});
|
|
141
|
+
});
|
|
142
|
+
describe("addComment", () => {
|
|
143
|
+
it("adds comment to issue", async () => {
|
|
144
|
+
mockFetch.mockResolvedValueOnce({
|
|
145
|
+
ok: true,
|
|
146
|
+
json: async () => ({ id: "comment-1" }),
|
|
147
|
+
});
|
|
148
|
+
await client.addComment("SEC-123", "New information about this finding");
|
|
149
|
+
expect(mockFetch).toHaveBeenCalledWith("https://company.atlassian.net/rest/api/3/issue/SEC-123/comment", expect.objectContaining({
|
|
150
|
+
method: "POST",
|
|
151
|
+
}));
|
|
152
|
+
});
|
|
153
|
+
});
|
|
154
|
+
describe("attachFile", () => {
|
|
155
|
+
it("attaches file to issue", async () => {
|
|
156
|
+
mockFetch.mockResolvedValueOnce({
|
|
157
|
+
ok: true,
|
|
158
|
+
json: async () => [{ id: "attachment-1" }],
|
|
159
|
+
});
|
|
160
|
+
await client.attachFile("SEC-123", "report.json", '{"findings": []}');
|
|
161
|
+
expect(mockFetch).toHaveBeenCalledWith("https://company.atlassian.net/rest/api/3/issue/SEC-123/attachments", expect.objectContaining({
|
|
162
|
+
method: "POST",
|
|
163
|
+
headers: expect.objectContaining({
|
|
164
|
+
"X-Atlassian-Token": "no-check",
|
|
165
|
+
}),
|
|
166
|
+
}));
|
|
167
|
+
});
|
|
168
|
+
});
|
|
169
|
+
describe("searchIssues", () => {
|
|
170
|
+
it("searches issues with JQL", async () => {
|
|
171
|
+
mockFetch.mockResolvedValueOnce({
|
|
172
|
+
ok: true,
|
|
173
|
+
json: async () => ({
|
|
174
|
+
issues: [
|
|
175
|
+
{ key: "SEC-1", fields: { summary: "Issue 1" } },
|
|
176
|
+
{ key: "SEC-2", fields: { summary: "Issue 2" } },
|
|
177
|
+
],
|
|
178
|
+
}),
|
|
179
|
+
});
|
|
180
|
+
const results = await client.searchIssues('project = SEC AND labels = "vaspera"');
|
|
181
|
+
expect(results).toHaveLength(2);
|
|
182
|
+
expect(results[0].key).toBe("SEC-1");
|
|
183
|
+
});
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
describe("ServiceNowClient", () => {
|
|
187
|
+
let client;
|
|
188
|
+
let config;
|
|
189
|
+
beforeEach(() => {
|
|
190
|
+
vi.clearAllMocks();
|
|
191
|
+
config = {
|
|
192
|
+
platform: "servicenow",
|
|
193
|
+
baseUrl: "https://company.service-now.com",
|
|
194
|
+
apiToken: "oauth-token",
|
|
195
|
+
};
|
|
196
|
+
client = new ServiceNowClient(config);
|
|
197
|
+
});
|
|
198
|
+
describe("createTicket", () => {
|
|
199
|
+
it("creates incident successfully", async () => {
|
|
200
|
+
mockFetch.mockResolvedValueOnce({
|
|
201
|
+
ok: true,
|
|
202
|
+
json: async () => ({
|
|
203
|
+
result: {
|
|
204
|
+
sys_id: "abc123",
|
|
205
|
+
number: "INC0001234",
|
|
206
|
+
},
|
|
207
|
+
}),
|
|
208
|
+
});
|
|
209
|
+
const request = {
|
|
210
|
+
title: "Security Incident",
|
|
211
|
+
description: "Vulnerability detected",
|
|
212
|
+
};
|
|
213
|
+
const result = await client.createTicket(request);
|
|
214
|
+
expect(result.id).toBe("abc123");
|
|
215
|
+
expect(result.key).toBe("INC0001234");
|
|
216
|
+
expect(result.url).toContain("abc123");
|
|
217
|
+
expect(result.platform).toBe("servicenow");
|
|
218
|
+
expect(mockFetch).toHaveBeenCalledWith("https://company.service-now.com/api/now/table/incident", expect.objectContaining({
|
|
219
|
+
method: "POST",
|
|
220
|
+
headers: expect.objectContaining({
|
|
221
|
+
Authorization: expect.stringContaining("Bearer"),
|
|
222
|
+
}),
|
|
223
|
+
}));
|
|
224
|
+
});
|
|
225
|
+
it("maps severity to priority", async () => {
|
|
226
|
+
mockFetch.mockResolvedValue({
|
|
227
|
+
ok: true,
|
|
228
|
+
json: async () => ({
|
|
229
|
+
result: { sys_id: "abc", number: "INC001" },
|
|
230
|
+
}),
|
|
231
|
+
});
|
|
232
|
+
await client.createTicket({
|
|
233
|
+
title: "Critical",
|
|
234
|
+
description: "test",
|
|
235
|
+
findings: [
|
|
236
|
+
{
|
|
237
|
+
id: "f1",
|
|
238
|
+
severity: "critical",
|
|
239
|
+
category: "vuln",
|
|
240
|
+
description: "Critical",
|
|
241
|
+
evidence: "",
|
|
242
|
+
confidence: 95,
|
|
243
|
+
verifications: [],
|
|
244
|
+
created_at: new Date().toISOString(),
|
|
245
|
+
},
|
|
246
|
+
],
|
|
247
|
+
});
|
|
248
|
+
const body = JSON.parse(mockFetch.mock.calls[0][1].body);
|
|
249
|
+
expect(body.priority).toBe("1");
|
|
250
|
+
});
|
|
251
|
+
it("sets assignment group", async () => {
|
|
252
|
+
mockFetch.mockResolvedValueOnce({
|
|
253
|
+
ok: true,
|
|
254
|
+
json: async () => ({
|
|
255
|
+
result: { sys_id: "abc", number: "INC001" },
|
|
256
|
+
}),
|
|
257
|
+
});
|
|
258
|
+
await client.createTicket({
|
|
259
|
+
title: "Test",
|
|
260
|
+
description: "test",
|
|
261
|
+
project: "Security Team",
|
|
262
|
+
});
|
|
263
|
+
const body = JSON.parse(mockFetch.mock.calls[0][1].body);
|
|
264
|
+
expect(body.assignment_group).toBe("Security Team");
|
|
265
|
+
});
|
|
266
|
+
it("handles API errors", async () => {
|
|
267
|
+
mockFetch.mockResolvedValueOnce({
|
|
268
|
+
ok: false,
|
|
269
|
+
status: 401,
|
|
270
|
+
text: async () => "Invalid credentials",
|
|
271
|
+
});
|
|
272
|
+
await expect(client.createTicket({
|
|
273
|
+
title: "Test",
|
|
274
|
+
description: "test",
|
|
275
|
+
})).rejects.toThrow("ServiceNow API error");
|
|
276
|
+
});
|
|
277
|
+
});
|
|
278
|
+
describe("addWorkNote", () => {
|
|
279
|
+
it("adds work note to incident", async () => {
|
|
280
|
+
mockFetch.mockResolvedValueOnce({
|
|
281
|
+
ok: true,
|
|
282
|
+
json: async () => ({ result: {} }),
|
|
283
|
+
});
|
|
284
|
+
await client.addWorkNote("abc123", "Investigation update");
|
|
285
|
+
expect(mockFetch).toHaveBeenCalledWith("https://company.service-now.com/api/now/table/incident/abc123", expect.objectContaining({
|
|
286
|
+
method: "PATCH",
|
|
287
|
+
}));
|
|
288
|
+
});
|
|
289
|
+
});
|
|
290
|
+
});
|
|
291
|
+
describe("LinearClient", () => {
|
|
292
|
+
let client;
|
|
293
|
+
let config;
|
|
294
|
+
beforeEach(() => {
|
|
295
|
+
vi.clearAllMocks();
|
|
296
|
+
config = {
|
|
297
|
+
platform: "linear",
|
|
298
|
+
baseUrl: "https://api.linear.app",
|
|
299
|
+
apiToken: "lin_api_xxxxxxxxxxxxx",
|
|
300
|
+
teamId: "TEAM-123",
|
|
301
|
+
};
|
|
302
|
+
client = new LinearClient(config);
|
|
303
|
+
});
|
|
304
|
+
describe("createTicket", () => {
|
|
305
|
+
it("creates issue via GraphQL", async () => {
|
|
306
|
+
mockFetch.mockResolvedValueOnce({
|
|
307
|
+
ok: true,
|
|
308
|
+
json: async () => ({
|
|
309
|
+
data: {
|
|
310
|
+
issueCreate: {
|
|
311
|
+
success: true,
|
|
312
|
+
issue: {
|
|
313
|
+
id: "issue-abc",
|
|
314
|
+
identifier: "SEC-42",
|
|
315
|
+
url: "https://linear.app/company/issue/SEC-42",
|
|
316
|
+
},
|
|
317
|
+
},
|
|
318
|
+
},
|
|
319
|
+
}),
|
|
320
|
+
});
|
|
321
|
+
const request = {
|
|
322
|
+
title: "Security Finding",
|
|
323
|
+
description: "Vulnerability detected",
|
|
324
|
+
};
|
|
325
|
+
const result = await client.createTicket(request);
|
|
326
|
+
expect(result.id).toBe("issue-abc");
|
|
327
|
+
expect(result.key).toBe("SEC-42");
|
|
328
|
+
expect(result.url).toContain("SEC-42");
|
|
329
|
+
expect(result.platform).toBe("linear");
|
|
330
|
+
expect(mockFetch).toHaveBeenCalledWith("https://api.linear.app/graphql", expect.objectContaining({
|
|
331
|
+
method: "POST",
|
|
332
|
+
headers: expect.objectContaining({
|
|
333
|
+
Authorization: "lin_api_xxxxxxxxxxxxx",
|
|
334
|
+
}),
|
|
335
|
+
}));
|
|
336
|
+
});
|
|
337
|
+
it("maps severity to priority number", async () => {
|
|
338
|
+
mockFetch.mockResolvedValue({
|
|
339
|
+
ok: true,
|
|
340
|
+
json: async () => ({
|
|
341
|
+
data: {
|
|
342
|
+
issueCreate: {
|
|
343
|
+
success: true,
|
|
344
|
+
issue: { id: "i", identifier: "SEC-1", url: "url" },
|
|
345
|
+
},
|
|
346
|
+
},
|
|
347
|
+
}),
|
|
348
|
+
});
|
|
349
|
+
// Critical -> 0 (urgent)
|
|
350
|
+
await client.createTicket({
|
|
351
|
+
title: "Critical",
|
|
352
|
+
description: "test",
|
|
353
|
+
findings: [
|
|
354
|
+
{
|
|
355
|
+
id: "f1",
|
|
356
|
+
severity: "critical",
|
|
357
|
+
category: "vuln",
|
|
358
|
+
description: "Critical",
|
|
359
|
+
evidence: "",
|
|
360
|
+
confidence: 95,
|
|
361
|
+
verifications: [],
|
|
362
|
+
created_at: new Date().toISOString(),
|
|
363
|
+
},
|
|
364
|
+
],
|
|
365
|
+
});
|
|
366
|
+
let body = JSON.parse(mockFetch.mock.calls[0][1].body);
|
|
367
|
+
expect(body.variables.input.priority).toBe(0);
|
|
368
|
+
// Low -> 3
|
|
369
|
+
await client.createTicket({
|
|
370
|
+
title: "Low",
|
|
371
|
+
description: "test",
|
|
372
|
+
findings: [
|
|
373
|
+
{
|
|
374
|
+
id: "f2",
|
|
375
|
+
severity: "low",
|
|
376
|
+
category: "style",
|
|
377
|
+
description: "Low",
|
|
378
|
+
evidence: "",
|
|
379
|
+
confidence: 80,
|
|
380
|
+
verifications: [],
|
|
381
|
+
created_at: new Date().toISOString(),
|
|
382
|
+
},
|
|
383
|
+
],
|
|
384
|
+
});
|
|
385
|
+
body = JSON.parse(mockFetch.mock.calls[1][1].body);
|
|
386
|
+
expect(body.variables.input.priority).toBe(3);
|
|
387
|
+
});
|
|
388
|
+
it("handles GraphQL errors", async () => {
|
|
389
|
+
mockFetch.mockResolvedValueOnce({
|
|
390
|
+
ok: true,
|
|
391
|
+
json: async () => ({
|
|
392
|
+
errors: [{ message: "Team not found" }],
|
|
393
|
+
}),
|
|
394
|
+
});
|
|
395
|
+
await expect(client.createTicket({
|
|
396
|
+
title: "Test",
|
|
397
|
+
description: "test",
|
|
398
|
+
})).rejects.toThrow("Team not found");
|
|
399
|
+
});
|
|
400
|
+
it("handles unsuccessful creation", async () => {
|
|
401
|
+
mockFetch.mockResolvedValueOnce({
|
|
402
|
+
ok: true,
|
|
403
|
+
json: async () => ({
|
|
404
|
+
data: {
|
|
405
|
+
issueCreate: {
|
|
406
|
+
success: false,
|
|
407
|
+
},
|
|
408
|
+
},
|
|
409
|
+
}),
|
|
410
|
+
});
|
|
411
|
+
await expect(client.createTicket({
|
|
412
|
+
title: "Test",
|
|
413
|
+
description: "test",
|
|
414
|
+
})).rejects.toThrow("Failed to create Linear issue");
|
|
415
|
+
});
|
|
416
|
+
});
|
|
417
|
+
describe("addComment", () => {
|
|
418
|
+
it("adds comment via GraphQL", async () => {
|
|
419
|
+
mockFetch.mockResolvedValueOnce({
|
|
420
|
+
ok: true,
|
|
421
|
+
json: async () => ({
|
|
422
|
+
data: {
|
|
423
|
+
commentCreate: {
|
|
424
|
+
success: true,
|
|
425
|
+
},
|
|
426
|
+
},
|
|
427
|
+
}),
|
|
428
|
+
});
|
|
429
|
+
await client.addComment("issue-abc", "New comment");
|
|
430
|
+
expect(mockFetch).toHaveBeenCalledWith(expect.any(String), expect.objectContaining({
|
|
431
|
+
body: expect.stringContaining("commentCreate"),
|
|
432
|
+
}));
|
|
433
|
+
});
|
|
434
|
+
});
|
|
435
|
+
describe("getTeamId", () => {
|
|
436
|
+
it("finds team by name", async () => {
|
|
437
|
+
mockFetch.mockResolvedValueOnce({
|
|
438
|
+
ok: true,
|
|
439
|
+
json: async () => ({
|
|
440
|
+
data: {
|
|
441
|
+
teams: {
|
|
442
|
+
nodes: [
|
|
443
|
+
{ id: "team-1", name: "Security" },
|
|
444
|
+
{ id: "team-2", name: "Engineering" },
|
|
445
|
+
],
|
|
446
|
+
},
|
|
447
|
+
},
|
|
448
|
+
}),
|
|
449
|
+
});
|
|
450
|
+
const teamId = await client.getTeamId("Security");
|
|
451
|
+
expect(teamId).toBe("team-1");
|
|
452
|
+
});
|
|
453
|
+
it("returns null for unknown team", async () => {
|
|
454
|
+
mockFetch.mockResolvedValueOnce({
|
|
455
|
+
ok: true,
|
|
456
|
+
json: async () => ({
|
|
457
|
+
data: {
|
|
458
|
+
teams: {
|
|
459
|
+
nodes: [],
|
|
460
|
+
},
|
|
461
|
+
},
|
|
462
|
+
}),
|
|
463
|
+
});
|
|
464
|
+
const teamId = await client.getTeamId("NonExistent");
|
|
465
|
+
expect(teamId).toBeNull();
|
|
466
|
+
});
|
|
467
|
+
});
|
|
468
|
+
});
|
|
469
|
+
describe("TicketingClient", () => {
|
|
470
|
+
beforeEach(() => {
|
|
471
|
+
vi.clearAllMocks();
|
|
472
|
+
mockFetch.mockResolvedValue({
|
|
473
|
+
ok: true,
|
|
474
|
+
json: async () => ({
|
|
475
|
+
id: "10001",
|
|
476
|
+
key: "SEC-123",
|
|
477
|
+
}),
|
|
478
|
+
});
|
|
479
|
+
});
|
|
480
|
+
describe("constructor", () => {
|
|
481
|
+
it("creates Jira client", () => {
|
|
482
|
+
const client = new TicketingClient({
|
|
483
|
+
platform: "jira",
|
|
484
|
+
baseUrl: "https://company.atlassian.net",
|
|
485
|
+
apiToken: "token",
|
|
486
|
+
isCloud: true,
|
|
487
|
+
});
|
|
488
|
+
expect(client.getPlatform()).toBe("jira");
|
|
489
|
+
});
|
|
490
|
+
it("creates ServiceNow client", () => {
|
|
491
|
+
const client = new TicketingClient({
|
|
492
|
+
platform: "servicenow",
|
|
493
|
+
baseUrl: "https://company.service-now.com",
|
|
494
|
+
apiToken: "token",
|
|
495
|
+
});
|
|
496
|
+
expect(client.getPlatform()).toBe("servicenow");
|
|
497
|
+
});
|
|
498
|
+
it("creates Linear client", () => {
|
|
499
|
+
const client = new TicketingClient({
|
|
500
|
+
platform: "linear",
|
|
501
|
+
baseUrl: "https://api.linear.app",
|
|
502
|
+
apiToken: "lin_api_xxx",
|
|
503
|
+
teamId: "TEAM-1",
|
|
504
|
+
});
|
|
505
|
+
expect(client.getPlatform()).toBe("linear");
|
|
506
|
+
});
|
|
507
|
+
it("throws for unsupported platform", () => {
|
|
508
|
+
expect(() => new TicketingClient({
|
|
509
|
+
platform: "github",
|
|
510
|
+
baseUrl: "https://github.com",
|
|
511
|
+
apiToken: "token",
|
|
512
|
+
})).toThrow("Unsupported ticketing platform");
|
|
513
|
+
});
|
|
514
|
+
});
|
|
515
|
+
describe("createTicket", () => {
|
|
516
|
+
it("delegates to underlying client", async () => {
|
|
517
|
+
const client = new TicketingClient({
|
|
518
|
+
platform: "jira",
|
|
519
|
+
baseUrl: "https://company.atlassian.net",
|
|
520
|
+
apiToken: "token",
|
|
521
|
+
isCloud: true,
|
|
522
|
+
});
|
|
523
|
+
const result = await client.createTicket({
|
|
524
|
+
title: "Test",
|
|
525
|
+
description: "test",
|
|
526
|
+
});
|
|
527
|
+
expect(result.key).toBe("SEC-123");
|
|
528
|
+
});
|
|
529
|
+
});
|
|
530
|
+
describe("createTicketsForFindings", () => {
|
|
531
|
+
it("creates ticket for each finding", async () => {
|
|
532
|
+
mockFetch.mockResolvedValue({
|
|
533
|
+
ok: true,
|
|
534
|
+
json: async () => ({ id: "10001", key: "SEC-123" }),
|
|
535
|
+
});
|
|
536
|
+
const client = new TicketingClient({
|
|
537
|
+
platform: "jira",
|
|
538
|
+
baseUrl: "https://company.atlassian.net",
|
|
539
|
+
apiToken: "token",
|
|
540
|
+
isCloud: true,
|
|
541
|
+
});
|
|
542
|
+
const findings = [
|
|
543
|
+
{
|
|
544
|
+
id: "f1",
|
|
545
|
+
severity: "critical",
|
|
546
|
+
category: "vulnerability",
|
|
547
|
+
description: "SQL injection",
|
|
548
|
+
evidence: "",
|
|
549
|
+
confidence: 95,
|
|
550
|
+
verifications: [],
|
|
551
|
+
created_at: new Date().toISOString(),
|
|
552
|
+
},
|
|
553
|
+
{
|
|
554
|
+
id: "f2",
|
|
555
|
+
severity: "high",
|
|
556
|
+
category: "code-quality",
|
|
557
|
+
description: "Hardcoded secret",
|
|
558
|
+
evidence: "",
|
|
559
|
+
confidence: 90,
|
|
560
|
+
verifications: [],
|
|
561
|
+
created_at: new Date().toISOString(),
|
|
562
|
+
},
|
|
563
|
+
];
|
|
564
|
+
const results = await client.createTicketsForFindings(findings);
|
|
565
|
+
expect(results.created).toHaveLength(2);
|
|
566
|
+
expect(mockFetch).toHaveBeenCalledTimes(2);
|
|
567
|
+
});
|
|
568
|
+
it("respects severity filter", async () => {
|
|
569
|
+
mockFetch.mockResolvedValue({
|
|
570
|
+
ok: true,
|
|
571
|
+
json: async () => ({ id: "10001", key: "SEC-123" }),
|
|
572
|
+
});
|
|
573
|
+
const client = new TicketingClient({
|
|
574
|
+
platform: "jira",
|
|
575
|
+
baseUrl: "https://company.atlassian.net",
|
|
576
|
+
apiToken: "token",
|
|
577
|
+
isCloud: true,
|
|
578
|
+
});
|
|
579
|
+
const findings = [
|
|
580
|
+
{
|
|
581
|
+
id: "f1",
|
|
582
|
+
severity: "critical",
|
|
583
|
+
category: "vulnerability",
|
|
584
|
+
description: "Critical issue",
|
|
585
|
+
evidence: "",
|
|
586
|
+
confidence: 95,
|
|
587
|
+
verifications: [],
|
|
588
|
+
created_at: new Date().toISOString(),
|
|
589
|
+
},
|
|
590
|
+
{
|
|
591
|
+
id: "f2",
|
|
592
|
+
severity: "low",
|
|
593
|
+
category: "style",
|
|
594
|
+
description: "Style issue",
|
|
595
|
+
evidence: "",
|
|
596
|
+
confidence: 80,
|
|
597
|
+
verifications: [],
|
|
598
|
+
created_at: new Date().toISOString(),
|
|
599
|
+
},
|
|
600
|
+
];
|
|
601
|
+
const results = await client.createTicketsForFindings(findings, {
|
|
602
|
+
minSeverity: "high",
|
|
603
|
+
});
|
|
604
|
+
// Only critical should be created (high and above)
|
|
605
|
+
expect(results.created).toHaveLength(1);
|
|
606
|
+
expect(mockFetch).toHaveBeenCalledTimes(1);
|
|
607
|
+
});
|
|
608
|
+
it("groups findings by category when requested", async () => {
|
|
609
|
+
mockFetch.mockResolvedValue({
|
|
610
|
+
ok: true,
|
|
611
|
+
json: async () => ({ id: "10001", key: "SEC-123" }),
|
|
612
|
+
});
|
|
613
|
+
const client = new TicketingClient({
|
|
614
|
+
platform: "jira",
|
|
615
|
+
baseUrl: "https://company.atlassian.net",
|
|
616
|
+
apiToken: "token",
|
|
617
|
+
isCloud: true,
|
|
618
|
+
});
|
|
619
|
+
const findings = [
|
|
620
|
+
{
|
|
621
|
+
id: "f1",
|
|
622
|
+
severity: "high",
|
|
623
|
+
category: "vulnerability",
|
|
624
|
+
description: "Issue 1",
|
|
625
|
+
evidence: "",
|
|
626
|
+
confidence: 90,
|
|
627
|
+
verifications: [],
|
|
628
|
+
created_at: new Date().toISOString(),
|
|
629
|
+
},
|
|
630
|
+
{
|
|
631
|
+
id: "f2",
|
|
632
|
+
severity: "high",
|
|
633
|
+
category: "vulnerability",
|
|
634
|
+
description: "Issue 2",
|
|
635
|
+
evidence: "",
|
|
636
|
+
confidence: 85,
|
|
637
|
+
verifications: [],
|
|
638
|
+
created_at: new Date().toISOString(),
|
|
639
|
+
},
|
|
640
|
+
{
|
|
641
|
+
id: "f3",
|
|
642
|
+
severity: "medium",
|
|
643
|
+
category: "code-quality",
|
|
644
|
+
description: "Issue 3",
|
|
645
|
+
evidence: "",
|
|
646
|
+
confidence: 80,
|
|
647
|
+
verifications: [],
|
|
648
|
+
created_at: new Date().toISOString(),
|
|
649
|
+
},
|
|
650
|
+
];
|
|
651
|
+
const results = await client.createTicketsForFindings(findings, {
|
|
652
|
+
groupByCategory: true,
|
|
653
|
+
});
|
|
654
|
+
// 2 categories: vulnerability and code-quality
|
|
655
|
+
expect(results.created).toHaveLength(2);
|
|
656
|
+
expect(mockFetch).toHaveBeenCalledTimes(2);
|
|
657
|
+
});
|
|
658
|
+
});
|
|
659
|
+
});
|
|
660
|
+
describe("Factory Functions", () => {
|
|
661
|
+
it("createJiraClient creates Jira client", () => {
|
|
662
|
+
const client = createJiraClient({
|
|
663
|
+
baseUrl: "https://company.atlassian.net",
|
|
664
|
+
apiToken: "token",
|
|
665
|
+
isCloud: true,
|
|
666
|
+
});
|
|
667
|
+
expect(client).toBeInstanceOf(JiraClient);
|
|
668
|
+
});
|
|
669
|
+
it("createServiceNowClient creates ServiceNow client", () => {
|
|
670
|
+
const client = createServiceNowClient({
|
|
671
|
+
baseUrl: "https://company.service-now.com",
|
|
672
|
+
apiToken: "token",
|
|
673
|
+
});
|
|
674
|
+
expect(client).toBeInstanceOf(ServiceNowClient);
|
|
675
|
+
});
|
|
676
|
+
it("createLinearClient creates Linear client", () => {
|
|
677
|
+
const client = createLinearClient({
|
|
678
|
+
baseUrl: "https://api.linear.app",
|
|
679
|
+
apiToken: "lin_api_xxx",
|
|
680
|
+
teamId: "TEAM-1",
|
|
681
|
+
});
|
|
682
|
+
expect(client).toBeInstanceOf(LinearClient);
|
|
683
|
+
});
|
|
684
|
+
it("createTicketingClient creates unified client", () => {
|
|
685
|
+
const client = createTicketingClient({
|
|
686
|
+
platform: "jira",
|
|
687
|
+
baseUrl: "https://company.atlassian.net",
|
|
688
|
+
apiToken: "token",
|
|
689
|
+
});
|
|
690
|
+
expect(client).toBeInstanceOf(TicketingClient);
|
|
691
|
+
});
|
|
692
|
+
});
|
|
693
|
+
//# sourceMappingURL=ticketing.test.js.map
|