@soos-io/api-client
Advanced tools
Comparing version 1.1.9 to 1.2.0-pre.1
@@ -10,9 +10,9 @@ import { LogLevel } from "../enums"; | ||
setMinLogLevel(minLogLevel: LogLevel): void; | ||
debug(message?: any, ...optionalParams: any[]): void; | ||
info(message?: any, ...optionalParams: any[]): void; | ||
warn(message?: any, ...optionalParams: any[]): void; | ||
error(message?: any, ...optionalParams: any[]): void; | ||
group(...label: any[]): void; | ||
debug(message?: unknown, ...optionalParams: unknown[]): void; | ||
info(message?: unknown, ...optionalParams: unknown[]): void; | ||
warn(message?: unknown, ...optionalParams: unknown[]): void; | ||
error(message?: unknown, ...optionalParams: unknown[]): void; | ||
group(...label: unknown[]): void; | ||
groupEnd(): void; | ||
always(message?: any, ...optionalParams: any[]): void; | ||
always(message?: unknown, ...optionalParams: unknown[]): void; | ||
logLineSeparator(): void; | ||
@@ -19,0 +19,0 @@ } |
@@ -102,3 +102,3 @@ import { AttributionFileTypeEnum, AttributionFormatEnum, FileMatchTypeEnum, HashAlgorithmEnum } from "./../enums"; | ||
startScan({ clientId, projectHash, analysisId, scanType, scanUrl, }: IStartScanParams): Promise<void>; | ||
waitForScanToFinish({ scanStatusUrl, scanUrl, scanType, isFirstCheckComplete, }: IWaitForScanToFinishParams): Promise<ScanStatus>; | ||
waitForScanToFinish({ scanStatusUrl, scanUrl, scanType, }: IWaitForScanToFinishParams): Promise<ScanStatus>; | ||
private getColorBySeverity; | ||
@@ -105,0 +105,0 @@ private getResetColor; |
@@ -150,3 +150,4 @@ "use strict"; | ||
} | ||
async waitForScanToFinish({ scanStatusUrl, scanUrl, scanType, isFirstCheckComplete = false, }) { | ||
async waitForScanToFinish({ scanStatusUrl, scanUrl, scanType, }) { | ||
await (0, utilities_1.sleep)(constants_1.SOOS_CONSTANTS.Status.DelayTime); | ||
const scanStatus = await this.analysisApiClient.getScanStatus({ | ||
@@ -157,14 +158,4 @@ scanStatusUrl: scanStatusUrl, | ||
logging_1.soosLogger.info(`${utilities_1.StringUtilities.fromCamelToTitleCase(scanStatus.status)}...`); | ||
await (0, utilities_1.sleep)(constants_1.SOOS_CONSTANTS.Status.DelayTime); | ||
return await this.waitForScanToFinish({ scanStatusUrl, scanUrl, scanType }); | ||
} | ||
if (!isFirstCheckComplete) { | ||
await (0, utilities_1.sleep)(constants_1.SOOS_CONSTANTS.Status.DelayTime); | ||
return await this.waitForScanToFinish({ | ||
scanStatusUrl, | ||
scanUrl, | ||
scanType, | ||
isFirstCheckComplete: true, | ||
}); | ||
} | ||
if (scanStatus.errors.length > 0) { | ||
@@ -276,3 +267,3 @@ logging_1.soosLogger.group("Errors:"); | ||
}); | ||
var finalAttributionStatus = await this.waitForAttributionToFinish({ | ||
const finalAttributionStatus = await this.waitForAttributionToFinish({ | ||
clientId, | ||
@@ -301,3 +292,3 @@ projectHash, | ||
else { | ||
FileSystem.writeFileSync(outputFile, output); | ||
FileSystem.writeFileSync(outputFile, await output.text()); | ||
} | ||
@@ -382,3 +373,3 @@ } | ||
}); | ||
var manifestFormats = !runManifestMatching | ||
const manifestFormats = !runManifestMatching | ||
? [] | ||
@@ -410,3 +401,3 @@ : filteredPackageManagers.flatMap((fpm) => { | ||
}); | ||
var archiveHashFormats = !runFileHashing | ||
const archiveHashFormats = !runFileHashing | ||
? [] | ||
@@ -438,3 +429,3 @@ : filteredPackageManagers.flatMap((fpm) => { | ||
}); | ||
var contentHashFormats = !runFileHashing | ||
const contentHashFormats = !runFileHashing | ||
? [] | ||
@@ -565,3 +556,3 @@ : filteredPackageManagers.flatMap((fpm) => { | ||
const filename = Path.basename(filePath); | ||
var fileDigests = fileFormat.hashAlgorithms.map((ha) => { | ||
const fileDigests = fileFormat.hashAlgorithms.map((ha) => { | ||
const digest = (0, utilities_1.generateFileHash)(ha.hashAlgorithm, ha.bufferEncoding, ha.digestEncoding, filePath); | ||
@@ -568,0 +559,0 @@ logging_1.soosLogger.debug(`Found '${filePath}' (${ha.hashAlgorithm}:${digest})`); |
@@ -87,3 +87,3 @@ "use strict"; | ||
static async handleRepositoryPagination(response, client, dateToFilter) { | ||
let data = response.data; | ||
const data = response.data; | ||
let nextUrl = data.next; | ||
@@ -101,3 +101,3 @@ let isWithinDateRange = data.values.every((repo) => utilities_1.DateUtilities.isWithinDateRange(new Date(repo.updated_on), new Date(dateToFilter))); | ||
async handleCommitPagination(response, client, dateToFilter) { | ||
let data = response.data; | ||
const data = response.data; | ||
let nextUrl = data.next; | ||
@@ -104,0 +104,0 @@ let lastCommitDate = new Date(data.values[data.values.length - 1].date); |
@@ -75,3 +75,3 @@ "use strict"; | ||
let data = response.data; | ||
let nextUrl = GitHubApiClient.getNextPageUrl(response); | ||
const nextUrl = GitHubApiClient.getNextPageUrl(response); | ||
if (nextUrl) { | ||
@@ -78,0 +78,0 @@ SOOSLogger_1.soosLogger.debug("Fetching next page", nextUrl); |
@@ -8,4 +8,4 @@ import { IContributorAuditRepositories, IContributorAuditRepository } from "../../api/SOOSHooksApiClient"; | ||
updateContributors(acc: IContributorAuditRepositories[], repo: IContributorAuditRepository, username: string, commitDate: string): IContributorAuditRepositories[]; | ||
mergeContributors(contributorsArray: IContributorAuditRepositories[][]): any[]; | ||
mergeContributors(contributorsArray: IContributorAuditRepositories[][]): IContributorAuditRepositories[]; | ||
}; | ||
export { ParamUtilities, DataMappingUtilities }; |
@@ -44,5 +44,5 @@ "use strict"; | ||
if (existingContributor) { | ||
contributor.repositories.forEach((repo) => { | ||
if (!existingContributor.repositories.find((r) => r.id === repo.id)) { | ||
existingContributor.repositories.push(repo); | ||
contributor.repositories.forEach((repository) => { | ||
if (!existingContributor.repositories.find((r) => r.id === repository.id)) { | ||
existingContributor.repositories.push(repository); | ||
} | ||
@@ -49,0 +49,0 @@ }); |
{ | ||
"name": "@soos-io/api-client", | ||
"version": "1.1.9", | ||
"description": "This is the SOOS API Client for registered clients leveraging the various integrations to the SOOS platform.", | ||
"version": "1.2.0-pre.1", | ||
"description": "This is the SOOS API Client for registered clients leveraging the various integrations to the SOOS platform. Register for a free trial today at https://app.soos.io/register", | ||
"main": "dist/index.js", | ||
@@ -15,5 +15,8 @@ "scripts": { | ||
"format:fix": "prettier ./src --write", | ||
"lint": "eslint --max-warnings 0", | ||
"lint:fix": "eslint --max-warnings 0 --fix", | ||
"typecheck": "tsc --noEmit", | ||
"test": "jest", | ||
"check": "npm run format && npm run typecheck && npm run test && (npm outdated || exit 0)", | ||
"knip": "knip", | ||
"check": "npm run format && npm run lint && npm run typecheck && npm run test && (npm outdated || exit 0)", | ||
"patch": "npm version patch --no-git-tag-version", | ||
@@ -57,3 +60,3 @@ "build:link": "npm run build && npm link" | ||
"axios": "^1.7.9", | ||
"form-data": "^4.0.1", | ||
"form-data": "^4.0.2", | ||
"glob": "^11.0.1", | ||
@@ -66,11 +69,15 @@ "tslib": "^2.8.1" | ||
"devDependencies": { | ||
"@eslint/js": "^9.20.0", | ||
"@types/argparse": "^2.0.17", | ||
"@types/jest": "^29.5.14", | ||
"@types/node": "^20.17.19", | ||
"eslint": "^9.20.1", | ||
"globals": "^16.0.0", | ||
"jest": "^29.1.2", | ||
"knip": "^5.44.4", | ||
"prettier": "^3.5.1", | ||
"ts-jest": "^29.2.5", | ||
"ts-node": "^10.9.2", | ||
"typescript": "^5.7.3" | ||
"typescript": "^5.7.3", | ||
"typescript-eslint": "^8.24.1" | ||
} | ||
} |
@@ -14,1 +14,5 @@ # [About SOOS](https://soos.io/) | ||
This is the SOOS API Client for registered clients leveraging the various integrations to the SOOS platform. | ||
## SOOS Badge Status | ||
[](https://app.soos.io) | ||
[](https://app.soos.io) |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
339257
75
3443
17
12
1
Updatedform-data@^4.0.2