Skip to content

Commit

Permalink
fix: extract types and drop api client dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
aarlaud committed May 6, 2024
1 parent ccd9f75 commit f8b81f6
Show file tree
Hide file tree
Showing 8 changed files with 5,124 additions and 1,267 deletions.
3 changes: 3 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@ module.exports = {
testEnvironment: 'node',
collectCoverageFrom: ['lib/**/*.ts'],
coverageReporters: ['text-summary', 'html'],
moduleNameMapper: {
axios: 'axios/dist/node/axios.cjs',
},
};
2,253 changes: 992 additions & 1,261 deletions package-lock.json

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
"node-fetch": "^2.6.7",
"ora": "^5.4.1",
"prettier": "^2.6.2",
"snyk-api-ts-client": "^1.11.2",
"snyk-request-manager": "^1.8.2",
"snyk-request-manager": "^1.8.4",
"yargs": "^17.5.1"
},
"devDependencies": {
Expand Down Expand Up @@ -56,7 +55,7 @@
"author": "Snyk Tech Services",
"license": "Apache-2.0",
"engines": {
"node": ">=14.0.0"
"node": ">=20.0.0"
},
"files": [
"bin",
Expand Down
3 changes: 2 additions & 1 deletion src/lib/common/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,8 @@ export const createImportFile = async (
integrations,
);
if (
(integration.integrations == {} || integration.org.id == '') &&
(Object.keys(integration.integrations).length == 0 ||
integration.org.id == '') &&
!userPromptedForDetails
) {
const provideDetails = await promptUserForDetails(
Expand Down
2 changes: 1 addition & 1 deletion src/lib/snyk/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Org } from 'snyk-api-ts-client';
import { Org } from './types/org';
import { requestsManager } from 'snyk-request-manager';
import * as debugLib from 'debug';
import { Integration } from '../types';
Expand Down
18 changes: 18 additions & 0 deletions src/lib/snyk/types/aggregatedissues.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/no-namespace */
/* eslint-disable @typescript-eslint/ban-types */
import { Project } from './org';
interface IssuesWithVulnsPaths {
issues: {
pkgVersionsWithPaths: {
[key: string]: Array<Array<string>>;
}[];
}[];
}
export declare type AggregatedIssuesWithVulnPaths = IssuesWithVulnsPaths &
Project.AggregatedissuesPostResponseType;
export declare const getAggregatedIssuesWithVulnPaths: (
classContext: Object,
body: Project.AggregatedissuesPostBodyType,
) => Promise<AggregatedIssuesWithVulnPaths>;
export {};
Loading

0 comments on commit f8b81f6

Please sign in to comment.