Use dependency-submission-toolkit published on npmjs.com

This commit is contained in:
Lane Seppala
2022-06-28 11:20:49 -06:00
parent 410db7b9b4
commit 0281eb47c2
4 changed files with 18 additions and 19 deletions
Generated Vendored
+9 -9
View File
@@ -3491,7 +3491,7 @@ class Dependency {
this.scope = scope;
}
/**
* toJSON is a custom JSON-serializer. It will be called when JSON.stringfy()
* toJSON is a custom JSON-serializer. It will be called when JSON.stringify()
* is called with this class or any object containing this class.
*
* @returns {object} with keys package_url, relationship, scope, and
@@ -3519,14 +3519,14 @@ class Manifest {
}
/**
* addIndirectDependency adds a package as an indirect dependency to the
* manifest. Direct dependencies take precendence over indirect dependencies
* manifest. Direct dependencies take precedence over indirect dependencies
* if a package is added as both.
*
* @param {Package} pkg
* @param {DependencyScope} scope
*/
addDirectDependency(pkg, scope) {
// will overwrite any previous indirect assigments
// will overwrite any previous indirect assignments
this.resolved[pkg.packageID()] = new Dependency(pkg, 'direct', scope);
}
/**
@@ -3540,7 +3540,7 @@ class Manifest {
addIndirectDependency(pkg, scope) {
var _a;
var _b, _c;
// nullish assigment to keep any previous assignments, including direct assigments
// nullish assignment to keep any previous assignments, including direct assignments
(_a = (_b = this.resolved)[_c = pkg.packageID()]) !== null && _a !== void 0 ? _a : (_b[_c] = new Dependency(pkg, 'indirect', scope));
}
hasDependency(pkg) {
@@ -3632,7 +3632,7 @@ class PackageCache {
/**
* 'cache.package()' will be the most commonly used method of PackageCache.
* package(identifier) will create and add a new Package to the PackageCache if no
* Packaging with a matching identifer exists in PackageCache, or return an existing
* Packaging with a matching identifier exists in PackageCache, or return an existing
* Package if a match is found. The mutation in this case is expected; do not
* use package(identifier) to determine if a package is already added.
* Instead, use hasPackage or lookupPackage.
@@ -3884,11 +3884,11 @@ function jobFromContext(context) {
}
exports.jobFromContext = jobFromContext;
/**
* Snapshot is the top-level container for Dependency Submisison
* Snapshot is the top-level container for Dependency Submission
*/
class Snapshot {
/**
* All construor parameters of a Snapshot are optional, but can be specified for specific overrides
* All constructor parameters of a Snapshot are optional, but can be specified for specific overrides
*
* @param {Detector} detector
* @param {Context} context
@@ -3935,7 +3935,7 @@ function submitSnapshot(snapshot, context = github.context) {
core.notice('Submitting snapshot...');
core.notice(snapshot.prettyJSON());
const repo = context.repo;
const githubToken = core.getInput('token') || core.getIDToken;
const githubToken = core.getInput('token') || (yield core.getIDToken());
const octokit = new rest_1.Octokit({
auth: githubToken
});
@@ -3948,7 +3948,7 @@ function submitSnapshot(snapshot, context = github.context) {
repo: repo.repo,
data: JSON.stringify(snapshot)
});
core.notice('Snapshot sucessfully created at ' + response.data.created_at.toString());
core.notice('Snapshot successfully created at ' + response.data.created_at.toString());
}
catch (error) {
if (error instanceof request_error_1.RequestError) {