From 9da9ebb01ea0c689795856f1c2a2309f38e52809 Mon Sep 17 00:00:00 2001 From: Phil Kunz Date: Sun, 17 May 2020 16:21:25 +0000 Subject: [PATCH] fix(core): update --- .gitignore | 4 +-- .gitlab-ci.yml | 7 ++-- package.json | 9 ++--- readme.md | 59 +++++++++++++++++++++++++++++++ ts/smartacme.classes.smartacme.ts | 2 +- 5 files changed, 70 insertions(+), 11 deletions(-) create mode 100644 readme.md diff --git a/.gitignore b/.gitignore index 91c0db0..ef13c79 100644 --- a/.gitignore +++ b/.gitignore @@ -15,8 +15,6 @@ node_modules/ # builds dist/ -dist_web/ -dist_serve/ -dist_ts_web/ +dist_*/ # custom \ No newline at end of file diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a95dfb6..8ebc8b5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -24,13 +24,14 @@ mirror: - docker - notpriv -snyk: - image: registry.gitlab.com/hosttoday/ht-docker-node:snyk +audit: + image: registry.gitlab.com/hosttoday/ht-docker-node:npmci stage: security script: - npmci npm prepare - npmci command npm install --ignore-scripts - - npmci command snyk test + - npmci command npm config set registry https://registry.npmjs.org + - npmci command npm audit --audit-level=high tags: - lossless - docker diff --git a/package.json b/package.json index f986671..7a8c9a1 100644 --- a/package.json +++ b/package.json @@ -3,8 +3,8 @@ "version": "3.0.5", "private": false, "description": "acme with an easy yet powerful interface in TypeScript", - "main": "dist/index.js", - "typings": "dist/index.d.ts", + "main": "dist_ts/index.js", + "typings": "dist_ts/index.d.ts", "scripts": { "test": "(tstest test/)", "build": "(tsbuild)" @@ -54,11 +54,12 @@ "ts/**/*", "ts_web/**/*", "dist/**/*", - "dist_web/**/*", + "dist_*/**/*", + "dist_ts/**/*", "dist_ts_web/**/*", "assets/**/*", "cli.js", "npmextra.json", "readme.md" ] -} +} \ No newline at end of file diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..91318b0 --- /dev/null +++ b/readme.md @@ -0,0 +1,59 @@ +# @pushrocks/smartuniverse +acme with an easy yet powerful interface in TypeScript + +## Availabililty and Links +* [npmjs.org (npm package)](https://www.npmjs.com/package/@pushrocks/smartuniverse) +* [gitlab.com (source)](https://gitlab.com/pushrocks/smartuniverse) +* [github.com (source mirror)](https://github.com/pushrocks/smartuniverse) +* [docs (typedoc)](https://pushrocks.gitlab.io/smartuniverse/) + +## Status for master +[![pipeline status](https://gitlab.com/pushrocks/smartuniverse/badges/master/pipeline.svg)](https://gitlab.com/pushrocks/smartuniverse/commits/master) +[![coverage report](https://gitlab.com/pushrocks/smartuniverse/badges/master/coverage.svg)](https://gitlab.com/pushrocks/smartuniverse/commits/master) +[![npm downloads per month](https://img.shields.io/npm/dm/@pushrocks/smartuniverse.svg)](https://www.npmjs.com/package/@pushrocks/smartuniverse) +[![Known Vulnerabilities](https://snyk.io/test/npm/@pushrocks/smartuniverse/badge.svg)](https://snyk.io/test/npm/@pushrocks/smartuniverse) +[![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 + +Use TypeScript for best in class instellisense. + +```javascript +import { SmartAcme } from 'smartacme'; + +const run = async () => { + smartAcmeInstance = new smartacme.SmartAcme({ + accountEmail: 'domains@lossless.org', + accountPrivateKey: null, + mongoDescriptor: { + mongoDbName: testQenv.getEnvVarRequired('MONGODB_DATABASE'), + mongoDbPass: testQenv.getEnvVarRequired('MONGODB_PASSWORD'), + mongoDbUrl: testQenv.getEnvVarRequired('MONGODB_URL') + }, + removeChallenge: async dnsChallenge => { + // somehow provide a function that is able to remove the dns challenge + }, + setChallenge: async dnsChallenge => { + // somehow provide a function that is able to the dns challenge + }, + environment: 'integration' + }); + await smartAcmeInstance.init(); + + // myCert has properties for public/private keys and csr ;) + const myCert = await smartAcmeInstance.getCertificateForDomain('bleu.de'); +}; +``` + +## 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. + +> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh) +| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy) + +[![repo-footer](https://lossless.gitlab.io/publicrelations/repofooter.svg)](https://maintainedby.lossless.com) diff --git a/ts/smartacme.classes.smartacme.ts b/ts/smartacme.classes.smartacme.ts index 8eb812b..68191a4 100644 --- a/ts/smartacme.classes.smartacme.ts +++ b/ts/smartacme.classes.smartacme.ts @@ -124,7 +124,7 @@ export class SmartAcme { } else if (retrievedCertificate && !retrievedCertificate.shouldBeRenewed()) { return retrievedCertificate; } else if (retrievedCertificate && retrievedCertificate.shouldBeRenewed()) { - // await retrievedCertificate.delete(); + await retrievedCertificate.delete(); } // lets make sure others get the same interest