4 Commits

Author SHA1 Message Date
0d3a8dde59 2.0.0 2022-10-23 23:53:34 +02:00
548c8147e6 BREAKING CHANGE(core): switch to esm 2022-10-23 23:53:34 +02:00
cf6d1b2b04 1.0.11 2021-02-20 17:52:21 +00:00
214677b3c4 fix(core): update 2021-02-20 17:52:21 +00:00
18 changed files with 4498 additions and 11396 deletions

4
.gitignore vendored
View File

@ -15,8 +15,6 @@ node_modules/
# builds # builds
dist/ dist/
dist_web/ dist_*/
dist_serve/
dist_ts_web/
# custom # custom

View File

@ -3,36 +3,47 @@ image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
cache: cache:
paths: paths:
- .npmci_cache/ - .npmci_cache/
key: "$CI_BUILD_STAGE" key: '$CI_BUILD_STAGE'
stages: stages:
- security - security
- test - test
- release - release
- metadata - metadata
before_script:
- pnpm install -g pnpm
- pnpm install -g @shipzone/npmci
- npmci npm prepare
# ==================== # ====================
# security stage # security stage
# ==================== # ====================
mirror: # ====================
# security stage
# ====================
auditProductionDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security stage: security
script: script:
- npmci git mirror - npmci command npm config set registry https://registry.npmjs.org
- npmci command pnpm audit --audit-level=high --prod
tags: tags:
- docker - lossless
- notpriv - docker
allow_failure: true
snyk: auditDevDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security stage: security
script: script:
- npmci npm prepare - npmci command npm config set registry https://registry.npmjs.org
- npmci command npm install -g snyk - npmci command pnpm audit --audit-level=high --dev
- npmci command npm install --ignore-scripts
- npmci command snyk test
tags: tags:
- docker - lossless
- notpriv - docker
allow_failure: true
# ==================== # ====================
# test stage # test stage
@ -41,37 +52,34 @@ snyk:
testStable: testStable:
stage: test stage: test
script: script:
- npmci npm prepare - npmci node install stable
- npmci node install stable - npmci npm install
- npmci npm install - npmci npm test
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/ coverage: /\d+.?\d+?\%\s*coverage/
tags: tags:
- docker - docker
- priv
testBuild: testBuild:
stage: test stage: test
script: script:
- npmci npm prepare - npmci node install stable
- npmci node install stable - npmci npm install
- npmci npm install - npmci command npm run build
- npmci command npm run build
coverage: /\d+.?\d+?\%\s*coverage/ coverage: /\d+.?\d+?\%\s*coverage/
tags: tags:
- docker - docker
- notpriv
release: release:
stage: release stage: release
script: script:
- npmci node install stable - npmci node install stable
- npmci npm publish - npmci npm publish
only: only:
- tags - tags
tags: tags:
- docker - lossless
- notpriv - docker
- notpriv
# ==================== # ====================
# metadata stage # metadata stage
@ -79,36 +87,36 @@ release:
codequality: codequality:
stage: metadata stage: metadata
allow_failure: true allow_failure: true
only:
- tags
script: script:
- npmci command npm install -g tslint typescript - npmci command npm install -g typescript
- npmci npm prepare - npmci npm prepare
- npmci npm install - npmci npm install
- npmci command "tslint -c tslint.json ./ts/**/*.ts"
tags: tags:
- docker - lossless
- priv - docker
- priv
trigger: trigger:
stage: metadata stage: metadata
script: script:
- npmci trigger - npmci trigger
only: only:
- tags - tags
tags: tags:
- docker - lossless
- notpriv - docker
- notpriv
pages: pages:
image: hosttoday/ht-docker-dbase:npmci
services:
- docker:stable-dind
stage: metadata stage: metadata
script: script:
- npmci command npm install -g @gitzone/tsdoc - npmci node install stable
- npmci npm prepare
- npmci npm install - npmci npm install
- npmci command tsdoc - npmci command npm run buildDocs
tags: tags:
- lossless
- docker - docker
- notpriv - notpriv
only: only:
@ -116,5 +124,5 @@ pages:
artifacts: artifacts:
expire_in: 1 week expire_in: 1 week
paths: paths:
- public - public
allow_failure: true allow_failure: true

24
.vscode/launch.json vendored
View File

@ -2,28 +2,10 @@
"version": "0.2.0", "version": "0.2.0",
"configurations": [ "configurations": [
{ {
"name": "current file", "command": "npm test",
"type": "node", "name": "Run npm test",
"request": "launch", "request": "launch",
"args": [ "type": "node-terminal"
"${relativeFile}"
],
"runtimeArgs": ["-r", "@gitzone/tsrun"],
"cwd": "${workspaceRoot}",
"protocol": "inspector",
"internalConsoleOptions": "openOnSessionStart"
},
{
"name": "test.ts",
"type": "node",
"request": "launch",
"args": [
"test/test.ts"
],
"runtimeArgs": ["-r", "@gitzone/tsrun"],
"cwd": "${workspaceRoot}",
"protocol": "inspector",
"internalConsoleOptions": "openOnSessionStart"
} }
] ]
} }

View File

@ -11,7 +11,13 @@
}, },
"gitzone": { "gitzone": {
"type": "object", "type": "object",
"description": "settings for gitzone" "description": "settings for gitzone",
"properties": {
"projectType": {
"type": "string",
"enum": ["website", "element", "service", "npm", "wcc"]
}
}
} }
} }
} }

View File

@ -1,10 +1,11 @@
{ {
"gitzone": { "gitzone": {
"projectType": "npm",
"module": { "module": {
"githost": "gitlab.com", "githost": "gitlab.com",
"gitscope": "pushrocks", "gitscope": "pushrocks",
"gitrepo": "smartcrypto", "gitrepo": "smartcrypto",
"shortDescription": "easy crypto methods", "description": "easy crypto methods",
"npmPackagename": "@pushrocks/smartcrypto", "npmPackagename": "@pushrocks/smartcrypto",
"license": "MIT", "license": "MIT",
"projectDomain": "push.rocks" "projectDomain": "push.rocks"

11264
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{ {
"name": "@pushrocks/smartcrypto", "name": "@pushrocks/smartcrypto",
"version": "1.0.10", "version": "2.0.0",
"private": false, "private": false,
"description": "easy crypto methods", "description": "easy crypto methods",
"main": "dist_ts/index.js", "main": "dist_ts/index.js",
@ -9,30 +9,35 @@
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {
"test": "(tstest test/ --web)", "test": "(tstest test/ --web)",
"build": "(tsbuild --web)" "build": "(tsbuild --web)",
"buildDocs": "tsdoc"
}, },
"devDependencies": { "devDependencies": {
"@gitzone/tsbuild": "^2.1.25", "@gitzone/tsbuild": "^2.1.25",
"@gitzone/tsrun": "^1.2.39",
"@gitzone/tstest": "^1.0.52", "@gitzone/tstest": "^1.0.52",
"@pushrocks/tapbundle": "^3.2.14", "@pushrocks/tapbundle": "^5.0.4",
"@types/node": "^14.14.31", "@types/node": "^18.11.4"
"tslint": "^6.1.3",
"tslint-config-prettier": "^1.18.0"
}, },
"dependencies": { "dependencies": {
"@pushrocks/smartpromise": "^3.1.3", "@pushrocks/smartpromise": "^3.1.3",
"@types/node-forge": "^0.9.7", "@types/node-forge": "^1.3.0",
"node-forge": "^0.10.0" "node-forge": "^1.3.1"
}, },
"files": [ "files": [
"ts/*", "ts/**/*",
"ts_web/*", "ts_web/**/*",
"dist/*", "dist/**/*",
"dist_web/*", "dist_*/**/*",
"dist_ts_web/*", "dist_ts/**/*",
"assets/*", "dist_ts_web/**/*",
"assets/**/*",
"cli.js", "cli.js",
"npmextra.json", "npmextra.json",
"readme.md" "readme.md"
] ],
"browserslist": [
"last 1 chrome versions"
],
"type": "module"
} }

4351
pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -8,16 +8,32 @@ easy crypto methods
* [docs (typedoc)](https://pushrocks.gitlab.io/smartcrypto/) * [docs (typedoc)](https://pushrocks.gitlab.io/smartcrypto/)
## Status for master ## Status for master
[![build status](https://gitlab.com/pushrocks/smartcrypto/badges/master/build.svg)](https://gitlab.com/pushrocks/smartcrypto/commits/master)
[![coverage report](https://gitlab.com/pushrocks/smartcrypto/badges/master/coverage.svg)](https://gitlab.com/pushrocks/smartcrypto/commits/master) Status Category | Status Badge
[![npm downloads per month](https://img.shields.io/npm/dm/@pushrocks/smartcrypto.svg)](https://www.npmjs.com/package/@pushrocks/smartcrypto) -- | --
[![Known Vulnerabilities](https://snyk.io/test/npm/@pushrocks/smartcrypto/badge.svg)](https://snyk.io/test/npm/@pushrocks/smartcrypto) GitLab Pipelines | [![pipeline status](https://gitlab.com/pushrocks/smartcrypto/badges/master/pipeline.svg)](https://lossless.cloud)
[![TypeScript](https://img.shields.io/badge/TypeScript->=%203.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/) GitLab Pipline Test Coverage | [![coverage report](https://gitlab.com/pushrocks/smartcrypto/badges/master/coverage.svg)](https://lossless.cloud)
[![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/) npm | [![npm downloads per month](https://badgen.net/npm/dy/@pushrocks/smartcrypto)](https://lossless.cloud)
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-prettier-ff69b4.svg)](https://prettier.io/) Snyk | [![Known Vulnerabilities](https://badgen.net/snyk/pushrocks/smartcrypto)](https://lossless.cloud)
TypeScript Support | [![TypeScript](https://badgen.net/badge/TypeScript/>=%203.x/blue?icon=typescript)](https://lossless.cloud)
node Support | [![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
Code Style | [![Code Style](https://badgen.net/badge/style/prettier/purple)](https://lossless.cloud)
PackagePhobia (total standalone install weight) | [![PackagePhobia](https://badgen.net/packagephobia/install/@pushrocks/smartcrypto)](https://lossless.cloud)
PackagePhobia (package size on registry) | [![PackagePhobia](https://badgen.net/packagephobia/publish/@pushrocks/smartcrypto)](https://lossless.cloud)
BundlePhobia (total size when bundled) | [![BundlePhobia](https://badgen.net/bundlephobia/minzip/@pushrocks/smartcrypto)](https://lossless.cloud)
Platform support | [![Supports Windows 10](https://badgen.net/badge/supports%20Windows%2010/yes/green?icon=windows)](https://lossless.cloud) [![Supports Mac OS X](https://badgen.net/badge/supports%20Mac%20OS%20X/yes/green?icon=apple)](https://lossless.cloud)
## Usage ## Usage
## Contribution
We are always happy for code contributions. If you are not the code contributing type that is ok. Still, maintaining Open Source repositories takes considerable time and thought. If you like the quality of what we do and our modules are useful to you we would appreciate a little monthly contribution: You can [contribute one time](https://lossless.link/contribute-onetime) or [contribute monthly](https://lossless.link/contribute). :)
## Contribution
We are always happy for code contributions. If you are not the code contributing type that is ok. Still, maintaining Open Source repositories takes considerable time and thought. If you like the quality of what we do and our modules are useful to you we would appreciate a little monthly contribution: You can [contribute one time](https://lossless.link/contribute-onetime) or [contribute monthly](https://lossless.link/contribute). :)
For further information read the linked docs at the top of this readme. For further information read the linked docs at the top of this readme.
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh) > MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)

View File

@ -1,11 +1,11 @@
import { expect, tap } from '@pushrocks/tapbundle'; import { expect, tap } from '@pushrocks/tapbundle';
import * as smartcrypto from '../ts/index'; import * as smartcrypto from '../ts/index.js';
let testSmartCrypto: smartcrypto.Smartcrypto; let testSmartCrypto: smartcrypto.Smartcrypto;
tap.test('first test', async () => { tap.test('first test', async () => {
testSmartCrypto = new smartcrypto.Smartcrypto(); testSmartCrypto = new smartcrypto.Smartcrypto();
expect(testSmartCrypto).to.be.instanceOf(smartcrypto.Smartcrypto); expect(testSmartCrypto).toBeInstanceOf(smartcrypto.Smartcrypto);
}); });
tap.start(); tap.start();

8
ts/00_commitinfo_data.ts Normal file
View File

@ -0,0 +1,8 @@
/**
* autocreated commitinfo by @pushrocks/commitinfo
*/
export const commitinfo = {
name: '@pushrocks/smartcrypto',
version: '2.0.0',
description: 'easy crypto methods'
}

View File

@ -1,10 +1,8 @@
export * from './smartcrypto.classes.smartcrypto'; export * from './smartcrypto.classes.smartcrypto.js';
export * from './smartcrypto.classes.keypair'; export * from './smartcrypto.classes.keypair.js';
export * from './smartcrypto.classes.privatekey'; export * from './smartcrypto.classes.privatekey.js';
export * from './smartcrypto.classes.publickey'; export * from './smartcrypto.classes.publickey.js';
import { nodeForge } from './smartcrypto.plugins'; import { nodeForge } from './smartcrypto.plugins.js';
export { export { nodeForge };
nodeForge
};

View File

@ -1,6 +1,6 @@
import * as plugins from './smartcrypto.plugins'; import * as plugins from './smartcrypto.plugins.js';
import { PublicKey } from './smartcrypto.classes.publickey'; import { PublicKey } from './smartcrypto.classes.publickey.js';
import { PrivateKey } from './smartcrypto.classes.privatekey'; import { PrivateKey } from './smartcrypto.classes.privatekey.js';
export class KeyPair { export class KeyPair {
// STATIC // STATIC
@ -16,7 +16,7 @@ export class KeyPair {
done.resolve( done.resolve(
new KeyPair({ new KeyPair({
privateKey: new PrivateKey(keypair.privateKey), privateKey: new PrivateKey(keypair.privateKey),
publicKey: new PublicKey(keypair.publicKey) publicKey: new PublicKey(keypair.publicKey),
}) })
); );
}); });

View File

@ -1,4 +1,4 @@
import * as plugins from './smartcrypto.plugins'; import * as plugins from './smartcrypto.plugins.js';
export class PrivateKey { export class PrivateKey {
// STATIC // STATIC

View File

@ -1,4 +1,4 @@
import * as plugins from './smartcrypto.plugins'; import * as plugins from './smartcrypto.plugins.js';
export class PublicKey { export class PublicKey {
// STATIC // STATIC

View File

@ -1,5 +1,5 @@
import * as plugins from './smartcrypto.plugins'; import * as plugins from './smartcrypto.plugins.js';
import { KeyPair } from './smartcrypto.classes.keypair'; import { KeyPair } from './smartcrypto.classes.keypair.js';
export class Smartcrypto { export class Smartcrypto {
public async createKeyPair(): Promise<KeyPair> { public async createKeyPair(): Promise<KeyPair> {

10
tsconfig.json Normal file
View File

@ -0,0 +1,10 @@
{
"compilerOptions": {
"experimentalDecorators": true,
"useDefineForClassFields": false,
"target": "ES2022",
"module": "ES2022",
"moduleResolution": "nodenext",
"esModuleInterop": true
}
}

View File

@ -1,17 +0,0 @@
{
"extends": ["tslint:latest", "tslint-config-prettier"],
"rules": {
"semicolon": [true, "always"],
"no-console": false,
"ordered-imports": false,
"object-literal-sort-keys": false,
"member-ordering": {
"options":{
"order": [
"static-method"
]
}
}
},
"defaultSeverity": "warning"
}