Compare commits

..

No commits in common. "master" and "v1.0.7" have entirely different histories.

22 changed files with 1794 additions and 6310 deletions

View File

@ -1,66 +0,0 @@
name: Default (not tags)
on:
push:
tags-ignore:
- '**'
env:
IMAGE: registry.gitlab.com/hosttoday/ht-docker-node:npmci
NPMCI_COMPUTED_REPOURL: https://${{gitea.repository_owner}}:${{secrets.GITEA_TOKEN}}@gitea.lossless.digital/${{gitea.repository}}.git
NPMCI_TOKEN_NPM: ${{secrets.NPMCI_TOKEN_NPM}}
NPMCI_TOKEN_NPM2: ${{secrets.NPMCI_TOKEN_NPM2}}
NPMCI_GIT_GITHUBTOKEN: ${{secrets.NPMCI_GIT_GITHUBTOKEN}}
NPMCI_URL_CLOUDLY: ${{secrets.NPMCI_URL_CLOUDLY}}
jobs:
security:
runs-on: ubuntu-latest
continue-on-error: true
container:
image: ${{ env.IMAGE }}
steps:
- uses: actions/checkout@v3
- name: Install pnpm and npmci
run: |
pnpm install -g pnpm
pnpm install -g @shipzone/npmci
- name: Run npm prepare
run: npmci npm prepare
- name: Audit production dependencies
run: |
npmci command npm config set registry https://registry.npmjs.org
npmci command pnpm audit --audit-level=high --prod
continue-on-error: true
- name: Audit development dependencies
run: |
npmci command npm config set registry https://registry.npmjs.org
npmci command pnpm audit --audit-level=high --dev
continue-on-error: true
test:
if: ${{ always() }}
needs: security
runs-on: ubuntu-latest
container:
image: ${{ env.IMAGE }}
steps:
- uses: actions/checkout@v3
- name: Test stable
run: |
npmci node install stable
npmci npm install
npmci npm test
- name: Test build
run: |
npmci node install stable
npmci npm install
npmci npm build

View File

@ -1,124 +0,0 @@
name: Default (tags)
on:
push:
tags:
- '*'
env:
IMAGE: registry.gitlab.com/hosttoday/ht-docker-node:npmci
NPMCI_COMPUTED_REPOURL: https://${{gitea.repository_owner}}:${{secrets.GITEA_TOKEN}}@gitea.lossless.digital/${{gitea.repository}}.git
NPMCI_TOKEN_NPM: ${{secrets.NPMCI_TOKEN_NPM}}
NPMCI_TOKEN_NPM2: ${{secrets.NPMCI_TOKEN_NPM2}}
NPMCI_GIT_GITHUBTOKEN: ${{secrets.NPMCI_GIT_GITHUBTOKEN}}
NPMCI_URL_CLOUDLY: ${{secrets.NPMCI_URL_CLOUDLY}}
jobs:
security:
runs-on: ubuntu-latest
continue-on-error: true
container:
image: ${{ env.IMAGE }}
steps:
- uses: actions/checkout@v3
- name: Prepare
run: |
pnpm install -g pnpm
pnpm install -g @shipzone/npmci
npmci npm prepare
- name: Audit production dependencies
run: |
npmci command npm config set registry https://registry.npmjs.org
npmci command pnpm audit --audit-level=high --prod
continue-on-error: true
- name: Audit development dependencies
run: |
npmci command npm config set registry https://registry.npmjs.org
npmci command pnpm audit --audit-level=high --dev
continue-on-error: true
test:
if: ${{ always() }}
needs: security
runs-on: ubuntu-latest
container:
image: ${{ env.IMAGE }}
steps:
- uses: actions/checkout@v3
- name: Prepare
run: |
pnpm install -g pnpm
pnpm install -g @shipzone/npmci
npmci npm prepare
- name: Test stable
run: |
npmci node install stable
npmci npm install
npmci npm test
- name: Test build
run: |
npmci node install stable
npmci npm install
npmci npm build
release:
needs: test
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
container:
image: ${{ env.IMAGE }}
steps:
- uses: actions/checkout@v3
- name: Prepare
run: |
pnpm install -g pnpm
pnpm install -g @shipzone/npmci
npmci npm prepare
- name: Release
run: |
npmci node install stable
npmci npm publish
metadata:
needs: test
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
container:
image: ${{ env.IMAGE }}
continue-on-error: true
steps:
- uses: actions/checkout@v3
- name: Prepare
run: |
pnpm install -g pnpm
pnpm install -g @shipzone/npmci
npmci npm prepare
- name: Code quality
run: |
npmci command npm install -g typescript
npmci npm install
- name: Trigger
run: npmci trigger
- name: Build docs and upload artifacts
run: |
npmci node install stable
npmci npm install
pnpm install -g @git.zone/tsdoc
npmci command tsdoc
continue-on-error: true

4
.gitignore vendored
View File

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

View File

@ -4,7 +4,7 @@ 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
@ -12,38 +12,27 @@ stages:
- release - release
- metadata - metadata
before_script: # ====================
- pnpm install -g pnpm # security stage
- pnpm install -g @shipzone/npmci # ====================
mirror:
stage: security
script:
- npmci git mirror
tags:
- docker
- notpriv
snyk:
stage: security
script:
- npmci npm prepare - npmci npm prepare
- npmci command npm install -g snyk
# ==================== - npmci command npm install --ignore-scripts
# security stage - npmci command snyk test
# ====================
# ====================
# security stage
# ====================
auditProductionDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security
script:
- npmci command npm config set registry https://registry.npmjs.org
- npmci command pnpm audit --audit-level=high --prod
tags: tags:
- lossless
- docker - docker
allow_failure: true - notpriv
auditDevDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security
script:
- npmci command npm config set registry https://registry.npmjs.org
- npmci command pnpm audit --audit-level=high --dev
tags:
- lossless
- docker
allow_failure: true
# ==================== # ====================
# test stage # test stage
@ -52,22 +41,26 @@ auditDevDependencies:
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
@ -77,7 +70,6 @@ release:
only: only:
- tags - tags
tags: tags:
- lossless
- docker - docker
- notpriv - notpriv
@ -87,14 +79,12 @@ release:
codequality: codequality:
stage: metadata stage: metadata
allow_failure: true allow_failure: true
only:
- tags
script: script:
- npmci command npm install -g typescript - npmci command npm install -g tslint typescript
- npmci npm prepare - npmci npm prepare
- npmci npm install - npmci npm install
- npmci command "tslint -c tslint.json ./ts/**/*.ts"
tags: tags:
- lossless
- docker - docker
- priv - priv
@ -105,18 +95,20 @@ trigger:
only: only:
- tags - tags
tags: tags:
- lossless
- docker - docker
- notpriv - notpriv
pages: pages:
image: hosttoday/ht-docker-dbase:npmci
services:
- docker:stable-dind
stage: metadata stage: metadata
script: script:
- npmci node install stable - npmci command npm install -g @gitzone/tsdoc
- npmci npm prepare
- npmci npm install - npmci npm install
- npmci command npm run buildDocs - npmci command tsdoc
tags: tags:
- lossless
- docker - docker
- notpriv - notpriv
only: only:

24
.vscode/launch.json vendored
View File

@ -2,10 +2,28 @@
"version": "0.2.0", "version": "0.2.0",
"configurations": [ "configurations": [
{ {
"command": "npm test", "name": "current file",
"name": "Run npm test", "type": "node",
"request": "launch", "request": "launch",
"type": "node-terminal" "args": [
"${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,13 +11,7 @@
}, },
"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,32 +1,17 @@
{ {
"gitzone": { "gitzone": {
"projectType": "npm",
"module": { "module": {
"githost": "code.foss.global", "githost": "gitlab.com",
"gitscope": "push.rocks", "gitscope": "pushrocks",
"gitrepo": "smartcrypto", "gitrepo": "smartcrypto",
"description": "A library providing easy methods for cryptographic operations, including key pair generation.", "shortDescription": "easy crypto methods",
"npmPackagename": "@push.rocks/smartcrypto", "npmPackagename": "@pushrocks/smartcrypto",
"license": "MIT", "license": "MIT",
"projectDomain": "push.rocks", "projectDomain": "push.rocks"
"keywords": [
"cryptography",
"encryption",
"security",
"public key",
"private key",
"RSA",
"key pair generation",
"node-forge",
"typescript"
]
} }
}, },
"npmci": { "npmci": {
"npmGlobalTools": [], "npmGlobalTools": [],
"npmAccessLevel": "public" "npmAccessLevel": "public"
},
"tsdoc": {
"legal": "\n## License and Legal Information\n\nThis repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository. \n\n**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.\n\n### Trademarks\n\nThis project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.\n\n### Company Information\n\nTask Venture Capital GmbH \nRegistered at District court Bremen HRB 35230 HB, Germany\n\nFor any legal inquiries or if you require further information, please contact us via email at hello@task.vc.\n\nBy using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.\n"
} }
} }

1637
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,59 +1,39 @@
{ {
"name": "@push.rocks/smartcrypto", "name": "@pushrocks/smartcrypto",
"version": "2.0.5", "version": "1.0.7",
"private": false, "private": false,
"description": "A library providing easy methods for cryptographic operations, including key pair generation.", "description": "easy crypto methods",
"main": "dist_ts/index.js", "main": "dist/index.js",
"typings": "dist_ts/index.d.ts", "typings": "dist/index.d.ts",
"author": "Lossless GmbH", "author": "Lossless GmbH",
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {
"test": "(tstest test/ --web)", "test": "(tstest test/)",
"build": "(tsbuild --web)", "build": "(tsbuild)",
"buildDocs": "tsdoc" "format": "(gitzone format)"
}, },
"devDependencies": { "devDependencies": {
"@git.zone/tsbuild": "^2.1.72", "@gitzone/tsbuild": "^2.1.17",
"@git.zone/tsrun": "^1.2.46", "@gitzone/tstest": "^1.0.24",
"@git.zone/tstest": "^1.0.86", "@pushrocks/tapbundle": "^3.0.13",
"@push.rocks/tapbundle": "^5.0.15", "@types/node": "^12.7.8",
"@types/node": "^20.11.17" "tslint": "^5.20.0",
"tslint-config-prettier": "^1.18.0"
}, },
"dependencies": { "dependencies": {
"@push.rocks/smartpromise": "^4.0.3", "@pushrocks/smartpromise": "^3.0.5",
"@types/node-forge": "^1.3.11", "@types/node-forge": "^0.8.6",
"node-forge": "^1.3.1" "node-forge": "^0.9.1"
}, },
"files": [ "files": [
"ts/**/*", "ts/*",
"ts_web/**/*", "ts_web/*",
"dist/**/*", "dist/*",
"dist_*/**/*", "dist_web/*",
"dist_ts/**/*", "dist_ts_web/*",
"dist_ts_web/**/*", "assets/*",
"assets/**/*",
"cli.js", "cli.js",
"npmextra.json", "npmextra.json",
"readme.md" "readme.md"
], ]
"browserslist": [
"last 1 chrome versions"
],
"type": "module",
"keywords": [
"cryptography",
"encryption",
"security",
"public key",
"private key",
"RSA",
"key pair generation",
"node-forge",
"typescript"
],
"homepage": "https://code.foss.global/push.rocks/smartcrypto",
"repository": {
"type": "git",
"url": "https://code.foss.global/push.rocks/smartcrypto.git"
}
} }

5832
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -1 +0,0 @@

114
readme.md
View File

@ -1,102 +1,26 @@
# @push.rocks/smartcrypto # @pushrocks/smartcrypto
easy crypto methods easy crypto methods
## Install ## Availabililty and Links
To install `@push.rocks/smartcrypto`, open a terminal and run the following command: * [npmjs.org (npm package)](https://www.npmjs.com/package/@pushrocks/smartcrypto)
```bash * [gitlab.com (source)](https://gitlab.com/pushrocks/smartcrypto)
npm install @push.rocks/smartcrypto * [github.com (source mirror)](https://github.com/pushrocks/smartcrypto)
``` * [docs (typedoc)](https://pushrocks.gitlab.io/smartcrypto/)
This will add `@push.rocks/smartcrypto` to your project's dependencies.
## 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)
[![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)
[![TypeScript](https://img.shields.io/badge/TypeScript->=%203.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
[![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-prettier-ff69b4.svg)](https://prettier.io/)
## Usage ## Usage
This guide demonstrates how to use `@push.rocks/smartcrypto` effectively by covering its main functionalities. The module offers straightforward methods for handling cryptographic operations. We'll go through generating keys, encrypting and decrypting data, and converting keys to various formats.
### Setting up your project For further information read the linked docs at the top of this readme.
Firstly, ensure you have a TypeScript project configured to use ES Modules. Initialize `@push.rocks/smartcrypto` in your project as shown:
```typescript > MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
import { Smartcrypto } from '@push.rocks/smartcrypto'; | By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy)
const smartCrypto = new Smartcrypto(); [![repo-footer](https://lossless.gitlab.io/publicrelations/repofooter.svg)](https://maintainedby.lossless.com)
```
### Generating a Key Pair
Generating a new RSA key pair is a common requirement. Let's see how `@push.rocks/smartcrypto` simplifies this process:
```typescript
(async () => {
const keyPair = await smartCrypto.createKeyPair();
console.log('Public Key:', keyPair.publicKey.toPemString());
console.log('Private Key:', keyPair.privateKey.toPemString());
})();
```
This asynchronous function generates a new RSA key pair and logs the PEM-formatted public and private keys. This is particularly useful for creating keys for secure communication.
### Working with Public and Private Keys
You can manipulate public and private keys using their respective classes. For instance, converting a private key to a PEM string for storage or transmission is straightforward:
```typescript
import { PrivateKey } from '@push.rocks/smartcrypto';
// Assuming you already have a privateKey object:
const privateKeyPemString = privateKey.toPemString();
console.log(privateKeyPemString);
```
Similarly, you can create a `PrivateKey` object from a PEM string. This is useful when you retrieve a stored key and need to use it in your application:
```typescript
const privateKeyFromPem = PrivateKey.fromPemString(privateKeyPemString);
```
The same methods apply to public keys with the `PublicKey` class:
```typescript
import { PublicKey } from '@push.rocks/smartcrypto';
const publicKeyPemString = publicKey.toPemString();
console.log(publicKeyPemString);
const publicKeyFromPem = PublicKey.fromPemString(publicKeyPemString);
```
### Advanced Usage
Beyond basic key generation and format conversion, `@push.rocks/smartcrypto` leverages `node-forge` for advanced cryptographic operations. You can engage in more complex scenarios such as signing data, verifying signatures, and even using the library for SSH key generation.
```typescript
// Example: Signing a message with RSA private key
const message = 'Hello, SmartCrypto!';
const signedMessage = privateKey.signMessage(message);
console.log('Signed Message:', signedMessage);
// Example: Verifying a signature with the corresponding public key
const isVerified = publicKey.verifyMessage(message, signedMessage);
console.log('Is the message verified?', isVerified);
```
Note: The `.signMessage` and `.verifyMessage` methods are conceptual and may require specific implementation or extension of the base classes provided by `@push.rocks/smartcrypto`.
### Conclusion
`@push.rocks/smartcrypto` provides an easy-to-use interface for cryptographic operations, significantly reducing the complexity of managing keys and performing secure data transmission. The examples above showcase a subset of what's possible, encouraging you to explore further and integrate cryptography seamlessly into your Node.js applications.
For more advanced use cases and customization, refer to the [node-forge](https://github.com/digitalbazaar/forge) documentation. `@push.rocks/smartcrypto` is designed to work smoothly with `node-forge`, enabling you to extend its functionalities according to your project's needs.
## License and Legal Information
This repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository.
**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.
### Trademarks
This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.
### Company Information
Task Venture Capital GmbH
Registered at District court Bremen HRB 35230 HB, Germany
For any legal inquiries or if you require further information, please contact us via email at hello@task.vc.
By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.

View File

@ -1,16 +1,8 @@
import { expect, tap } from '@push.rocks/tapbundle'; import { expect, tap } from '@pushrocks/tapbundle';
import * as smartcrypto from '../ts/index.js'; import * as smartcrypto from '../ts/index';
let testSmartCrypto: smartcrypto.Smartcrypto;
tap.test('first test', async () => { tap.test('first test', async () => {
testSmartCrypto = new smartcrypto.Smartcrypto(); console.log('hi');
expect(testSmartCrypto).toBeInstanceOf(smartcrypto.Smartcrypto);
});
tap.test('should create a private public keypair', async () => {
const keypair = await testSmartCrypto.createKeyPair();
console.log(keypair);
}); });
tap.start(); tap.start();

View File

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

View File

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

View File

@ -1,6 +1,6 @@
import * as plugins from './smartcrypto.plugins.js'; import * as plugins from './smartcrypto.plugins';
import { PublicKey } from './smartcrypto.classes.publickey.js'; import { PublicKey } from './smartcrypto.classes.publickey';
import { PrivateKey } from './smartcrypto.classes.privatekey.js'; import { PrivateKey } from './smartcrypto.classes.privatekey';
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.js'; import * as plugins from './smartcrypto.plugins';
export class PrivateKey { export class PrivateKey {
// STATIC // STATIC
@ -21,8 +21,4 @@ export class PrivateKey {
public toPemString(): string { public toPemString(): string {
return plugins.nodeForge.pki.privateKeyToPem(this.forgePrivateKey); return plugins.nodeForge.pki.privateKeyToPem(this.forgePrivateKey);
} }
public toOpenSSH(): string {
return plugins.nodeForge.ssh.privateKeyToOpenSSH(this.forgePrivateKey, 'user@host');
}
} }

View File

@ -1,4 +1,4 @@
import * as plugins from './smartcrypto.plugins.js'; import * as plugins from './smartcrypto.plugins';
export class PublicKey { export class PublicKey {
// STATIC // STATIC
@ -21,8 +21,4 @@ export class PublicKey {
public toPemString(): string { public toPemString(): string {
return plugins.nodeForge.pki.publicKeyToPem(this.forgePublicKey); return plugins.nodeForge.pki.publicKeyToPem(this.forgePublicKey);
} }
public toOpenSSH(): string {
return plugins.nodeForge.ssh.publicKeyToOpenSSH(this.forgePublicKey, 'user@host');
}
} }

View File

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

View File

@ -1,9 +1,9 @@
// @pushrocks scope // @pushrocks scope
import * as smartpromise from '@push.rocks/smartpromise'; import * as smartpromise from '@pushrocks/smartpromise';
export { smartpromise }; export { smartpromise };
// third party scope // third party scope
import nodeForge from 'node-forge'; import * as nodeForge from 'node-forge';
export { nodeForge }; export { nodeForge };

View File

@ -1,14 +0,0 @@
{
"compilerOptions": {
"experimentalDecorators": true,
"useDefineForClassFields": false,
"target": "ES2022",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"esModuleInterop": true,
"verbatimModuleSyntax": true
},
"exclude": [
"dist_*/**/*.d.ts"
]
}

17
tslint.json Normal file
View File

@ -0,0 +1,17 @@
{
"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"
}