api-testing
Advanced tools
Comparing version 1.1.0 to 1.2.0
@@ -5,1 +5,4 @@ ## 1.1.0 / 2020-06-09 | ||
* Updated eslint rules | ||
## 1.2.0 / 2020-06-22 | ||
* Add utility function in action API for creating change tags. |
@@ -10,5 +10,34 @@ 'use strict'; | ||
const singletons = {}; | ||
let cachedTags = {}; | ||
module.exports = { | ||
/** | ||
* Add tag to database if not already added. | ||
* | ||
* @param {string} tag name | ||
* @return {Promise<string>} tag name | ||
*/ | ||
async makeTag(tag) { | ||
if (cachedTags[tag]) { | ||
return tag; | ||
} | ||
const root = await this.root(); | ||
const tagList = await root.list('tags', { tglimit: 50 }); | ||
const existingTags = tagList.reduce((obj, row) => { | ||
obj[row.name] = true; | ||
return obj; | ||
}, {}); | ||
if (!existingTags[tag]) { | ||
const { managetags } = await root.action('managetags', { | ||
operation: 'create', | ||
tag, | ||
token: await root.token() | ||
}, true); | ||
assert.isOk(managetags.tag); | ||
} | ||
cachedTags = { ...existingTags }; | ||
return tag; | ||
}, | ||
async root() { | ||
@@ -15,0 +44,0 @@ if (singletons.root) { |
{ | ||
"name": "api-testing", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
79409
30
1188
1