@renovatebot/osv-offline
Advanced tools
Comparing version 1.4.1 to 1.5.0
import { Result } from './types'; | ||
export declare function tryDownloadDb(): Promise<Result>; | ||
export declare function tryDownloadDb(githubToken?: string): Promise<Result>; |
@@ -23,3 +23,3 @@ "use strict"; | ||
}; | ||
async function tryDownloadDb() { | ||
async function tryDownloadDb(githubToken) { | ||
await fs_extra_1.default.ensureDir(osv_offline_db_1.OsvOfflineDb.rootDirectory); | ||
@@ -42,3 +42,3 @@ if (process.env['OSV_OFFLINE_DISABLE_DOWNLOAD']?.toLowerCase() === 'true') { | ||
const octokitOptions = { | ||
auth: process.env['GITHUB_COM_TOKEN'], | ||
auth: githubToken ?? process.env['GITHUB_COM_TOKEN'], | ||
request: { fetch: node_fetch_1.default }, | ||
@@ -45,0 +45,0 @@ }; |
@@ -13,3 +13,3 @@ import { Ecosystem, Osv } from '@renovatebot/osv-offline-db'; | ||
*/ | ||
static create(): Promise<OsvOffline>; | ||
static create(githubToken?: string): Promise<OsvOffline>; | ||
/** | ||
@@ -16,0 +16,0 @@ * Query the local database for any package vulnerabilities |
@@ -13,4 +13,4 @@ "use strict"; | ||
*/ | ||
async initialize() { | ||
const result = await (0, download_1.tryDownloadDb)(); | ||
async initialize(githubToken) { | ||
const result = await (0, download_1.tryDownloadDb)(githubToken); | ||
if (!result.success) { | ||
@@ -25,5 +25,5 @@ throw result.error; | ||
*/ | ||
static async create() { | ||
static async create(githubToken) { | ||
const instance = new OsvOffline(); | ||
await instance.initialize(); | ||
await instance.initialize(githubToken); | ||
return instance; | ||
@@ -30,0 +30,0 @@ } |
{ | ||
"name": "@renovatebot/osv-offline", | ||
"version": "1.4.1", | ||
"version": "1.5.0", | ||
"main": "dist/index.js", | ||
@@ -26,4 +26,4 @@ "types": "dist/index.d.ts", | ||
"@types/fs-extra": "11.0.4", | ||
"@types/luxon": "3.4.0", | ||
"@types/node": "20.10.8", | ||
"@types/luxon": "3.4.1", | ||
"@types/node": "20.11.1", | ||
"@types/node-fetch": "2.6.10", | ||
@@ -30,0 +30,0 @@ "prettier": "2.8.8", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9860