New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@code.gov/code-gov-adapter

Package Overview
Dependencies
Maintainers
3
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@code.gov/code-gov-adapter - npm Package Compare versions

Comparing version 1.1.7 to 1.1.8

dependency_licenses.json

2

CONTRIBUTING.md

@@ -9,3 +9,3 @@ # Welcome!

- Report bugs and request features via [Github Issues](https://github.com/GSA/code-gov-api/issues).
- Report bugs and request features via [Github Issues](https://github.com/GSA/code-gov-adapters/issues).
- Join the [mailing list](http://code.us15.list-manage.com/subscribe?u=57dec439b29289fc14396b8db&id=a317168ea7) and stay up to date with our latest news.

@@ -12,0 +12,0 @@ - [Share your ideas](mailto://code@gsa.gov) for how to improve Code.gov. We're always open to suggestions.

{
"name": "@code.gov/code-gov-adapter",
"version": "1.1.7",
"version": "1.1.8",
"description": "A collection of adapters used by Code.gov",

@@ -8,2 +8,4 @@ "main": "index.js",

"test": "./node_modules/.bin/nyc mocha --opts tests/mocha.opts tests",
"test-console": "./node_modules/.bin/nyc mocha --opts tests/mocha.opts.console tests",
"licenses": "license-checker --json --relativeLicensePath --out dependency_licenses.json",
"lint": "./node_modules/.bin/eslint .",

@@ -35,3 +37,3 @@ "lint-fix": "./node_modules/.bin/eslint . --fix"

"eslint-plugin-standard": "^4.0.0",
"mocha": "^5.2.0",
"mocha": "^7.1.1",
"mocha-junit-reporter": "^1.18.0",

@@ -44,2 +46,3 @@ "nock": "^10.0.1",

"elasticsearch": "^15.1.1",
"license-checker": "github:davglass/license-checker#pull/234/head",
"lodash": "^4.17.15",

@@ -46,0 +49,0 @@ "moment": "^2.22.2"

# Code.gov Adapters
[![CircleCI](https://circleci.com/gh/GSA/code-gov-adapters/tree/master.svg?style=svg)](https://circleci.com/gh/GSA/code-gov-adapters/tree/master)
[![Maintainability](https://api.codeclimate.com/v1/badges/e1477b41ad84c1828f5d/maintainability)](https://codeclimate.com/github/GSA/code-gov-adapters/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/e1477b41ad84c1828f5d/test_coverage)](https://codeclimate.com/github/GSA/code-gov-adapters/test_coverage)

@@ -28,2 +31,31 @@ A collection of adapters used by Code.gov.

npm i @code.gov/code-gov-adapters
```
```
## Contributing
Here’s how you can help contribute to code.gov:
- Source Code Policy
- To provide feedback on the [Federal Source Code Policy](https://sourcecode.cio.gov/), follow [this issue tracker](https://github.com/WhiteHouse/source-code-policy/issues)
- Code.gov
- To provide feedback on code-gov-adapters, please checkout our [Contributing Guildelines](CONTRIBUTING.md).
- To contribute to the Code.gov harvester, go to the [code-gov-harvester] repo at (https://github.com/GSA/code-gov-harvester)
- To contribute to the Code.gov integrations, go to the [code-gov-integrations] repo at (https://github.com/GSA/code-gov-integrations)
- To contribute to the Code.gov data, go to the [code-gov-data] repo at (https://github.com/GSA/code-gov-data)
- Checkout [code-gov](https://github.com/GSA/code-gov) for a list of additional project repositories. If you aren't sure where your question or idea fits, this is a good place to share it.
## Generating License Data
To update the `dependency_licenses.json` file, run `npm run licenses`.
## License
As stated in [CONTRIBUTING](CONTRIBUTING.md):
> [..] this project is in the worldwide public domain (in the public domain within the United States, and copyright and related rights in the work worldwide are waived through the [CC0 1.0 Universal public domain dedication](https://creativecommons.org/publicdomain/zero/1.0/)).
> All contributions to this project will be released under the CC0
> dedication. By submitting a pull request, you are agreeing to comply
> with this waiver of copyright interest.

@@ -34,4 +34,457 @@ const expect = require('chai').expect;

it('should ', () => {
const result = getFlattenedMappingPropertiesByType();
expect(result).to.equal(false);
const testData = {
"properties" : {
"additionalInformation" : {
"type" : "object",
"dynamic" : "true"
},
"agency" : {
"properties" : {
"acronym" : {
"type" : "keyword",
"fields" : {
"keyword" : {
"type" : "keyword",
"normalizer" : "lowercase"
}
}
},
"codeUrl" : {
"type" : "keyword",
"normalizer" : "lowercase"
},
"complianceDashboard" : {
"type" : "boolean"
},
"fallback_file" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"name" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"normalizer" : "lowercase"
}
},
"analyzer" : "englishfulltext"
},
"requirements" : {
"properties" : {
"agencyWidePolicy" : {
"type" : "float"
},
"inventoryRequirement" : {
"type" : "float"
},
"openSourceRequirement" : {
"type" : "float"
},
"overallCompliance" : {
"type" : "float"
},
"schemaFormat" : {
"type" : "float"
}
}
},
"website" : {
"type" : "keyword",
"normalizer" : "lowercase"
}
}
},
"contact" : {
"properties" : {
"URL" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"email" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"normalizer" : "lowercase"
}
},
"analyzer" : "englishfulltext"
},
"name" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"normalizer" : "lowercase"
}
},
"analyzer" : "englishfulltext"
},
"phone" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"normalizer" : "lowercase"
}
},
"analyzer" : "englishfulltext"
},
"twitter" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"normalizer" : "lowercase"
}
},
"analyzer" : "englishfulltext"
}
}
},
"date" : {
"properties" : {
"created" : {
"type" : "date",
"ignore_malformed" : true
},
"lastModified" : {
"type" : "date",
"ignore_malformed" : true
},
"metadataLastUpdated" : {
"type" : "date",
"ignore_malformed" : true
}
}
},
"description" : {
"type" : "text",
"analyzer" : "englishfulltext"
},
"disclaimerText" : {
"type" : "text",
"analyzer" : "englishfulltext"
},
"disclaimerURL" : {
"type" : "keyword",
"normalizer" : "lowercase"
},
"downloadURL" : {
"type" : "keyword",
"normalizer" : "lowercase"
},
"events" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"normalizer" : "lowercase"
}
},
"analyzer" : "englishfulltext"
},
"homepageURL" : {
"type" : "keyword",
"normalizer" : "lowercase"
},
"laborHours" : {
"type" : "integer"
},
"languages" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"normalizer" : "lowercase"
}
},
"analyzer" : "englishfulltext"
},
"measurementType" : {
"properties" : {
"ifOther" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"normalizer" : "lowercase"
}
},
"analyzer" : "englishfulltext"
},
"method" : {
"type" : "keyword"
}
}
},
"name" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"normalizer" : "lowercase"
}
},
"analyzer" : "englishfulltext"
},
"organization" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"normalizer" : "lowercase"
}
},
"analyzer" : "englishfulltext"
},
"partners" : {
"type" : "nested",
"include_in_root" : true,
"properties" : {
"email" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword"
}
},
"analyzer" : "englishfulltext"
},
"name" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword"
}
},
"analyzer" : "englishfulltext"
}
}
},
"permissions" : {
"properties" : {
"exemptionText" : {
"type" : "text",
"analyzer" : "englishfulltext"
},
"licenses" : {
"type" : "nested",
"properties" : {
"URL" : {
"type" : "keyword",
"normalizer" : "lowercase"
},
"name" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"normalizer" : "lowercase"
}
},
"analyzer" : "englishfulltext"
}
}
},
"usageType" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"normalizer" : "lowercase"
}
},
"analyzer" : "englishfulltext"
}
}
},
"relatedCode" : {
"type" : "nested",
"properties" : {
"URL" : {
"type" : "keyword",
"normalizer" : "lowercase"
},
"codeName" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"codeURL" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"isGovernmentRepo" : {
"type" : "boolean"
},
"name" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"normalizer" : "lowercase"
}
},
"analyzer" : "englishfulltext"
}
}
},
"repoID" : {
"type" : "keyword",
"normalizer" : "lowercase"
},
"repositoryURL" : {
"type" : "keyword"
},
"reusedCode" : {
"type" : "nested",
"properties" : {
"URL" : {
"type" : "keyword",
"normalizer" : "lowercase"
},
"name" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"normalizer" : "lowercase"
}
},
"analyzer" : "englishfulltext"
}
}
},
"score" : {
"type" : "integer"
},
"status" : {
"type" : "keyword",
"normalizer" : "lowercase"
},
"tags" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"normalizer" : "lowercase"
}
},
"analyzer" : "englishfulltext"
},
"targetOperatingSystems" : {
"type" : "keyword",
"normalizer" : "lowercase"
},
"vcs" : {
"type" : "keyword",
"normalizer" : "lowercase"
},
"version" : {
"type" : "keyword",
"normalizer" : "lowercase"
}
}
};
const expectedData = {
"object": [
'additionalInformation'
],
"keyword": [
'agency.acronym',
'agency.codeUrl',
'agency.website',
'disclaimerURL',
'downloadURL',
'homepageURL',
'measurementType.method',
'permissions.licenses.URL',
'relatedCode.URL',
'repoID',
'repositoryURL',
'reusedCode.URL',
'status',
'targetOperatingSystems',
'vcs',
'version'
],
"boolean": [
'agency.complianceDashboard',
'relatedCode.isGovernmentRepo'
],
"text": [
'agency.fallback_file',
'agency.name',
'contact.URL',
'contact.email',
'contact.name',
'contact.phone',
'contact.twitter',
'description',
'disclaimerText',
'events',
'languages',
'measurementType.ifOther',
'name',
'organization',
'partners.email',
'partners.name',
'permissions.exemptionText',
'permissions.licenses.name',
'permissions.usageType',
'relatedCode.codeName',
'relatedCode.codeURL',
'relatedCode.name',
'reusedCode.name',
'tags'
],
"float": [
'agency.requirements.agencyWidePolicy',
'agency.requirements.inventoryRequirement',
'agency.requirements.openSourceRequirement',
'agency.requirements.overallCompliance',
'agency.requirements.schemaFormat'
],
"date": [
'date.created',
'date.lastModified',
'date.metadataLastUpdated'
],
"integer": [
'laborHours',
'score'
],
"nested": [
'partners',
'permissions.licenses',
'relatedCode',
'reusedCode'
]
};
const result = getFlattenedMappingPropertiesByType(testData);
expect(result).to.deep.equal(expectedData);
});

@@ -107,3 +560,3 @@ });

describe('createFieldSearchQuery', () => {
it('should ', () => {
it.skip('should ', () => {
const result = createFieldSearchQuery();

@@ -114,3 +567,3 @@ expect(result).to.equal(false);

describe('_addMatchPhraseForFullText', () => {
it('should ', () => {
it.skip('should ', () => {
const result = _addMatchPhraseForFullText();

@@ -121,3 +574,3 @@ expect(result).to.equal(false);

describe('_addMatchForFullText', () => {
it('should ', () => {
it.skip('should ', () => {
const result = _addMatchForFullText();

@@ -128,3 +581,3 @@ expect(result).to.equal(false);

describe('_addCommonCutoffForFullText', () => {
it('should ', () => {
it.skip('should ', () => {
const result = _addCommonCutoffForFullText();

@@ -135,3 +588,3 @@ expect(result).to.equal(false);

describe('_addFullTextQuery', () => {
it('should ', () => {
it.skip('should ', () => {
const result = _addFullTextQuery();

@@ -142,3 +595,3 @@ expect(result).to.equal(false);

describe('_processFilterValue', () => {
it('should ', () => {
it.skip('should ', () => {
const result = _processFilterValue();

@@ -149,3 +602,3 @@ expect(result).to.equal(false);

describe('_addStringFilter', () => {
it('should ', () => {
it.skip('should ', () => {
const result = _addStringFilter();

@@ -156,3 +609,3 @@ expect(result).to.equal(false);

describe('_addNestedFilter', () => {
it('should ', () => {
it.skip('should ', () => {
const result = _addNestedFilter();

@@ -163,3 +616,3 @@ expect(result).to.equal(false);

describe('_addStringFilters', () => {
it('should ', () => {
it.skip('should ', () => {
const result = _addStringFilters();

@@ -170,3 +623,3 @@ expect(result).to.equal(false);

describe('_getRanges', () => {
it('should ', () => {
it.skip('should ', () => {
const result = _getRanges();

@@ -177,3 +630,3 @@ expect(result).to.equal(false);

describe('_processDate', () => {
it('should ', () => {
it.skip('should ', () => {
const result = _processDate();

@@ -184,3 +637,3 @@ expect(result).to.equal(false);

describe('_addRangeFilter', () => {
it('should ', () => {
it.skip('should ', () => {
const result = _addRangeFilter();

@@ -191,3 +644,3 @@ expect(result).to.equal(false);

describe('_addDateRangeFilters', () => {
it('should ', () => {
it.skip('should ', () => {
const result = _addDateRangeFilters();

@@ -198,3 +651,3 @@ expect(result).to.equal(false);

describe('_addSizeFromParams', () => {
it('should ', () => {
it.skip('should ', () => {
const result = _addSizeFromParams();

@@ -205,3 +658,3 @@ expect(result).to.equal(false);

describe('_addIncludeExclude', () => {
it('should ', () => {
it.skip('should ', () => {
const result = _addIncludeExclude();

@@ -212,3 +665,3 @@ expect(result).to.equal(false);

describe('_addFieldFilters', () => {
it('should ', () => {
it.skip('should ', () => {
const result = _addFieldFilters();

@@ -219,3 +672,3 @@ expect(result).to.equal(false);

describe('_getSortValues', () => {
it('should ', () => {
it.skip('should ', () => {
const result = _getSortValues();

@@ -226,3 +679,3 @@ expect(result).to.equal(false);

describe('_getSortOptions', () => {
it('should ', () => {
it.skip('should ', () => {
const result = _getSortOptions();

@@ -233,3 +686,3 @@ expect(result).to.equal(false);

describe('_addSortOrder', () => {
it('should ', () => {
it.skip('should ', () => {
const result = _addSortOrder();

@@ -240,3 +693,3 @@ expect(result).to.equal(false);

describe('createReposSearchQuery', () => {
it('should ', () => {
it.skip('should ', () => {
const result = createReposSearchQuery();

@@ -247,3 +700,3 @@ expect(result).to.equal(false);

describe('getTermTypes', () => {
it('should ', () => {
it.skip('should ', () => {
const result = getTermTypes();

@@ -254,3 +707,3 @@ expect(result).to.equal(false);

describe('searchTermsQuery', () => {
it('should ', () => {
it.skip('should ', () => {
const result = searchTermsQuery();

@@ -261,3 +714,3 @@ expect(result).to.equal(false);

describe('getQueryByTerm', () => {
it('should ', () => {
it.skip('should ', () => {
const result = getQueryByTerm();

@@ -268,3 +721,3 @@ expect(result).to.equal(false);

describe('getLanguagesSearchQuery', () => {
it('should ', () => {
it.skip('should ', () => {
const result = getLanguagesSearchQuery();

@@ -271,0 +724,0 @@ expect(result).to.equal(false);

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc