@adonisjs/hash
Advanced tools
Comparing version 6.0.7 to 7.0.0
declare module '@ioc:Adonis/Core/Hash' { | ||
import { IocContract } from '@adonisjs/fold'; | ||
import { ApplicationContract } from '@ioc:Adonis/Core/Application'; | ||
import { ManagerContract } from '@poppinss/manager'; | ||
@@ -14,3 +14,2 @@ /** | ||
*/ | ||
hash(value: string): Promise<string>; | ||
make(value: string): Promise<string>; | ||
@@ -110,3 +109,3 @@ /** | ||
*/ | ||
export interface HashContract extends ManagerContract<IocContract, HashDriverContract, HashDriverContract, { | ||
export interface HashContract extends ManagerContract<ApplicationContract, HashDriverContract, HashDriverContract, { | ||
[P in keyof HashersList]: HashersList[P]['implementation']; | ||
@@ -118,3 +117,2 @@ }> { | ||
*/ | ||
hash(value: string): ReturnType<HashDriverContract['hash']>; | ||
make(value: string): ReturnType<HashDriverContract['make']>; | ||
@@ -121,0 +119,0 @@ /** |
@@ -17,3 +17,3 @@ "use strict"; | ||
this.app.container.singleton('Adonis/Core/Hash', () => { | ||
const config = this.app.container.use('Adonis/Core/Config').get('hash', {}); | ||
const config = this.app.container.resolveBinding('Adonis/Core/Config').get('hash', {}); | ||
const { Hash } = require('../src/Hash'); | ||
@@ -20,0 +20,0 @@ return new Hash(this, config); |
@@ -24,6 +24,2 @@ /// <reference path="../../adonis-typings/hash.d.ts" /> | ||
/** | ||
* Alias for [[this.make]] | ||
*/ | ||
hash(value: string): Promise<string>; | ||
/** | ||
* Hash a value using argon algorithm. The options can be used to override | ||
@@ -30,0 +26,0 @@ * default settings. |
@@ -44,9 +44,2 @@ "use strict"; | ||
/** | ||
* Alias for [[this.make]] | ||
*/ | ||
hash(value) { | ||
process.emitWarning('DeprecationWarning', 'Hash.hash() is deprecated. Use Hash.make() instead'); | ||
return this.make(value); | ||
} | ||
/** | ||
* Hash a value using argon algorithm. The options can be used to override | ||
@@ -53,0 +46,0 @@ * default settings. |
@@ -14,6 +14,2 @@ /// <reference path="../../adonis-typings/hash.d.ts" /> | ||
/** | ||
* Alias for [[this.make]] | ||
*/ | ||
hash(value: string): Promise<string>; | ||
/** | ||
* Returns hash for a given value | ||
@@ -20,0 +16,0 @@ */ |
@@ -30,9 +30,2 @@ "use strict"; | ||
/** | ||
* Alias for [[this.make]] | ||
*/ | ||
hash(value) { | ||
process.emitWarning('DeprecationWarning', 'Hash.hash() is deprecated. Use Hash.make() instead'); | ||
return this.make(value); | ||
} | ||
/** | ||
* Returns hash for a given value | ||
@@ -39,0 +32,0 @@ */ |
@@ -9,6 +9,2 @@ /// <reference path="../../adonis-typings/hash.d.ts" /> | ||
/** | ||
* Alias for [[this.make]] | ||
*/ | ||
hash(value: string): Promise<string>; | ||
/** | ||
* Returns hash for a given value | ||
@@ -15,0 +11,0 @@ */ |
@@ -20,12 +20,6 @@ "use strict"; | ||
/** | ||
* Alias for [[this.make]] | ||
*/ | ||
hash(value) { | ||
return Promise.resolve(value); | ||
} | ||
/** | ||
* Returns hash for a given value | ||
*/ | ||
make(value) { | ||
return this.hash(value); | ||
return Promise.resolve(value); | ||
} | ||
@@ -32,0 +26,0 @@ /** |
/// <reference path="../../adonis-typings/hash.d.ts" /> | ||
import { Manager } from '@poppinss/manager'; | ||
import { IocContract } from '@adonisjs/fold'; | ||
import { ApplicationContract } from '@ioc:Adonis/Core/Application'; | ||
import { HashConfig, HashContract, HashDriverContract, HashersList } from '@ioc:Adonis/Core/Hash'; | ||
@@ -9,3 +9,3 @@ /** | ||
*/ | ||
export declare class Hash<Config extends HashConfig> extends Manager<IocContract, HashDriverContract, HashDriverContract, { | ||
export declare class Hash<Config extends HashConfig> extends Manager<ApplicationContract, HashDriverContract, HashDriverContract, { | ||
[P in keyof HashersList]: HashersList[P]['implementation']; | ||
@@ -24,3 +24,3 @@ }> implements HashContract { | ||
get isFaked(): boolean; | ||
constructor(container: any, config: Config); | ||
constructor(application: ApplicationContract, config: Config); | ||
/** | ||
@@ -70,6 +70,2 @@ * Validate config | ||
/** | ||
* Alias for [[this.make]] | ||
*/ | ||
hash(value: string): never | any; | ||
/** | ||
* Hash value using the default driver | ||
@@ -76,0 +72,0 @@ */ |
@@ -20,4 +20,4 @@ "use strict"; | ||
class Hash extends manager_1.Manager { | ||
constructor(container, config) { | ||
super(container); | ||
constructor(application, config) { | ||
super(application); | ||
this.config = config; | ||
@@ -102,11 +102,2 @@ this.singleton = true; | ||
/** | ||
* Alias for [[this.make]] | ||
*/ | ||
hash(value) { | ||
if (this.fakeDriver) { | ||
return this.fakeDriver.hash(value); | ||
} | ||
return this.use().hash(value); | ||
} | ||
/** | ||
* Hash value using the default driver | ||
@@ -113,0 +104,0 @@ */ |
202
package.json
{ | ||
"name": "@adonisjs/hash", | ||
"version": "6.0.7", | ||
"description": "Multi driver hash module with support for PHC string formats", | ||
"main": "build/providers/HashProvider", | ||
"files": [ | ||
"build/adonis-typings", | ||
"build/providers", | ||
"build/src", | ||
"build/standalone.d.ts", | ||
"build/standalone.js" | ||
], | ||
"scripts": { | ||
"mrm": "mrm --preset=@adonisjs/mrm-preset", | ||
"pretest": "npm run lint", | ||
"test": "node japaFile.js", | ||
"clean": "del build", | ||
"compile": "npm run lint && npm run clean && tsc", | ||
"build": "npm run compile", | ||
"commit": "git-cz", | ||
"release": "np", | ||
"version": "npm run build", | ||
"format": "prettier --write .", | ||
"prepublishOnly": "npm run build", | ||
"lint": "eslint . --ext=.ts", | ||
"sync-labels": "github-label-sync --labels ./node_modules/@adonisjs/mrm-preset/gh-labels.json adonisjs/hash" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+ssh://git@github.com/poppinss/hash.git" | ||
}, | ||
"keywords": [ | ||
"hash", | ||
"bcrypt", | ||
"argon2" | ||
], | ||
"author": "poppinss,virk", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/poppinss/hash/issues" | ||
}, | ||
"homepage": "https://github.com/poppinss/hash#readme", | ||
"devDependencies": { | ||
"@adonisjs/application": "^3.0.21", | ||
"@adonisjs/mrm-preset": "^2.4.0", | ||
"@adonisjs/require-ts": "^1.1.0", | ||
"@poppinss/dev-utils": "^1.0.11", | ||
"@types/node": "^14.14.9", | ||
"argon2": "^0.27.0", | ||
"bcrypt": "^5.0.0", | ||
"commitizen": "^4.2.2", | ||
"cz-conventional-changelog": "^3.3.0", | ||
"del-cli": "^3.0.1", | ||
"eslint": "^7.14.0", | ||
"eslint-config-prettier": "^6.15.0", | ||
"eslint-plugin-adonis": "^1.0.15", | ||
"eslint-plugin-prettier": "^3.1.4", | ||
"github-label-sync": "^2.0.0", | ||
"husky": "^4.3.0", | ||
"japa": "^3.1.1", | ||
"mrm": "^2.5.12", | ||
"np": "^7.0.0", | ||
"npm-audit-html": "^1.5.0", | ||
"phc-argon2": "^1.0.11", | ||
"phc-bcrypt": "^1.0.4", | ||
"prettier": "^2.2.0", | ||
"typescript": "^4.1.2" | ||
}, | ||
"nyc": { | ||
"exclude": [ | ||
"test" | ||
], | ||
"extension": [ | ||
".ts" | ||
] | ||
}, | ||
"husky": { | ||
"hooks": { | ||
"pre-commit": "npm audit --production --json | ./node_modules/.bin/npm-audit-html && git add npm-audit.html", | ||
"commit-msg": "node ./node_modules/@adonisjs/mrm-preset/validateCommit/conventional/validate.js" | ||
} | ||
}, | ||
"config": { | ||
"commitizen": { | ||
"path": "cz-conventional-changelog" | ||
} | ||
}, | ||
"np": { | ||
"contents": ".", | ||
"anyBranch": false | ||
}, | ||
"dependencies": { | ||
"@phc/format": "^1.0.0", | ||
"@poppinss/manager": "^3.0.8", | ||
"@poppinss/utils": "^2.5.9" | ||
}, | ||
"peerDependencies": { | ||
"@adonisjs/application": "^3.0.0" | ||
}, | ||
"publishConfig": { | ||
"access": "public", | ||
"tag": "latest" | ||
} | ||
"name": "@adonisjs/hash", | ||
"version": "7.0.0", | ||
"description": "Multi driver hash module with support for PHC string formats", | ||
"main": "build/providers/HashProvider", | ||
"files": [ | ||
"build/adonis-typings", | ||
"build/providers", | ||
"build/src", | ||
"build/standalone.d.ts", | ||
"build/standalone.js" | ||
], | ||
"scripts": { | ||
"mrm": "mrm --preset=@adonisjs/mrm-preset", | ||
"pretest": "npm run lint", | ||
"test": "node japaFile.js", | ||
"clean": "del build", | ||
"compile": "npm run lint && npm run clean && tsc", | ||
"build": "npm run compile", | ||
"commit": "git-cz", | ||
"release": "np", | ||
"version": "npm run build", | ||
"format": "prettier --write .", | ||
"prepublishOnly": "npm run build", | ||
"lint": "eslint . --ext=.ts", | ||
"sync-labels": "github-label-sync --labels ./node_modules/@adonisjs/mrm-preset/gh-labels.json adonisjs/hash" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+ssh://git@github.com/poppinss/hash.git" | ||
}, | ||
"keywords": [ | ||
"hash", | ||
"bcrypt", | ||
"argon2" | ||
], | ||
"author": "poppinss,virk", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/poppinss/hash/issues" | ||
}, | ||
"homepage": "https://github.com/poppinss/hash#readme", | ||
"devDependencies": { | ||
"@adonisjs/application": "^4.0.2", | ||
"@adonisjs/mrm-preset": "^3.0.0", | ||
"@adonisjs/require-ts": "^2.0.2", | ||
"@poppinss/dev-utils": "^1.1.0", | ||
"@types/node": "^14.14.25", | ||
"argon2": "^0.27.1", | ||
"bcrypt": "^5.0.0", | ||
"commitizen": "^4.2.3", | ||
"cz-conventional-changelog": "^3.3.0", | ||
"del-cli": "^3.0.1", | ||
"eslint": "^7.19.0", | ||
"eslint-config-prettier": "^7.2.0", | ||
"eslint-plugin-adonis": "^1.2.0", | ||
"eslint-plugin-prettier": "^3.3.1", | ||
"github-label-sync": "^2.0.0", | ||
"husky": "^5.0.9", | ||
"japa": "^3.1.1", | ||
"mrm": "^2.5.18", | ||
"np": "^7.3.0", | ||
"phc-argon2": "^1.1.0", | ||
"phc-bcrypt": "^1.0.5", | ||
"prettier": "^2.2.1", | ||
"typescript": "^4.1.4" | ||
}, | ||
"nyc": { | ||
"exclude": [ | ||
"test" | ||
], | ||
"extension": [ | ||
".ts" | ||
] | ||
}, | ||
"husky": { | ||
"hooks": { | ||
"commit-msg": "node ./node_modules/@adonisjs/mrm-preset/validateCommit/conventional/validate.js" | ||
} | ||
}, | ||
"config": { | ||
"commitizen": { | ||
"path": "cz-conventional-changelog" | ||
} | ||
}, | ||
"np": { | ||
"contents": ".", | ||
"anyBranch": false | ||
}, | ||
"dependencies": { | ||
"@phc/format": "^1.0.0", | ||
"@poppinss/manager": "^4.0.0", | ||
"@poppinss/utils": "^3.0.2" | ||
}, | ||
"peerDependencies": { | ||
"@adonisjs/application": "^4.0.0" | ||
}, | ||
"publishConfig": { | ||
"access": "public", | ||
"tag": "latest" | ||
} | ||
} |
@@ -16,3 +16,3 @@ <div align="center"> | ||
[![circleci-image]][circleci-url] [![npm-image]][npm-url] ![][typescript-image] [![license-image]][license-url] [![audit-report-image]][audit-report-url] | ||
[![circleci-image]][circleci-url] [![npm-image]][npm-url] ![][typescript-image] [![license-image]][license-url] [![synk-image]][synk-url] | ||
@@ -53,3 +53,3 @@ </div> | ||
[audit-report-image]: https://img.shields.io/badge/-Audit%20Report-blueviolet?style=for-the-badge | ||
[audit-report-url]: https://htmlpreview.github.io/?https://github.com/adonisjs/hash/blob/develop/npm-audit.html "audit-report" | ||
[synk-image]: https://img.shields.io/snyk/vulnerabilities/github/adonisjs/hash?label=Synk%20Vulnerabilities&style=for-the-badge | ||
[synk-url]: https://snyk.io/test/github/adonisjs/hash?targetFile=package.json "synk" |
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
23
27135
733
+ Added@adonisjs/application@4.0.4(transitive)
+ Added@adonisjs/config@3.0.9(transitive)
+ Added@adonisjs/env@3.0.9(transitive)
+ Added@adonisjs/fold@8.2.0(transitive)
+ Added@adonisjs/logger@4.1.6(transitive)
+ Added@adonisjs/profiler@6.0.9(transitive)
+ Added@poppinss/file-generator@1.0.2(transitive)
+ Added@poppinss/manager@4.0.4(transitive)
+ Added@poppinss/utils@3.3.14.0.45.0.0(transitive)
+ Added@types/bytes@3.1.4(transitive)
+ Added@types/he@1.2.3(transitive)
+ Addedbytes@3.1.2(transitive)
+ Addedcamel-case@4.1.2(transitive)
+ Addedcapital-case@1.0.4(transitive)
+ Addedchange-case@4.1.2(transitive)
+ Addedconstant-case@3.0.4(transitive)
+ Addeddot-case@3.0.4(transitive)
+ Addeddotenv@16.4.5(transitive)
+ Addedflattie@1.1.1(transitive)
+ Addedhe@1.2.0(transitive)
+ Addedheader-case@2.0.4(transitive)
+ Addedjest-worker@27.5.1(transitive)
+ Addedkind-of@6.0.3(transitive)
+ Addedlodash@4.17.21(transitive)
+ Addedlower-case@2.0.2(transitive)
+ Addedno-case@3.0.4(transitive)
+ Addedparam-case@3.0.4(transitive)
+ Addedpascal-case@3.1.2(transitive)
+ Addedpath-case@3.0.4(transitive)
+ Addedpluralize@8.0.0(transitive)
+ Addedsentence-case@3.0.4(transitive)
+ Addedslugify@1.6.6(transitive)
+ Addedsnake-case@3.0.4(transitive)
+ Addedsupports-color@8.1.1(transitive)
+ Addedtruncatise@0.0.8(transitive)
+ Addedtslib@2.8.1(transitive)
+ Addedupper-case@2.0.2(transitive)
+ Addedupper-case-first@2.0.2(transitive)
- Removed@adonisjs/application@3.0.21(transitive)
- Removed@adonisjs/config@2.0.3(transitive)
- Removed@adonisjs/env@2.0.9(transitive)
- Removed@adonisjs/fold@7.0.9(transitive)
- Removed@adonisjs/logger@3.0.4(transitive)
- Removed@adonisjs/profiler@5.0.4(transitive)
- Removed@poppinss/manager@3.0.8(transitive)
- Removed@poppinss/utils@2.5.10(transitive)
- Removeddotenv@8.6.0(transitive)
- Removedjest-worker@26.6.2(transitive)
- Removedklona@2.0.6(transitive)
- Removedsupports-color@7.2.0(transitive)
Updated@poppinss/manager@^4.0.0
Updated@poppinss/utils@^3.0.2