From fe2f45e3a9ecd2613dfea9c946e967c7570c1464 Mon Sep 17 00:00:00 2001 From: Phil Kunz Date: Wed, 10 Jun 2020 05:34:47 +0000 Subject: [PATCH] fix(core): update --- .gitignore | 4 +--- .gitlab-ci.yml | 7 ++++--- package.json | 5 +++-- readme.md | 21 ++++++++++++++------- ts/cloudflare.classes.account.ts | 5 +---- ts/cloudflare.classes.record.ts | 4 +--- ts/cloudflare.classes.zone.ts | 1 - ts/cloudflare.classes.zonemanager.ts | 4 ++-- ts/cloudflare.logger.ts | 2 +- 9 files changed, 27 insertions(+), 26 deletions(-) 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 dd41396..f5c0a93 100644 --- a/package.json +++ b/package.json @@ -45,11 +45,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 index ecca492..6d187e5 100644 --- a/readme.md +++ b/readme.md @@ -8,13 +8,20 @@ easy cloudflare management * [docs (typedoc)](https://mojoio.gitlab.io/cloudflare/) ## Status for master -[![pipeline status](https://gitlab.com/mojoio/cloudflare/badges/master/pipeline.svg)](https://gitlab.com/mojoio/cloudflare/commits/master) -[![coverage report](https://gitlab.com/mojoio/cloudflare/badges/master/coverage.svg)](https://gitlab.com/mojoio/cloudflare/commits/master) -[![npm downloads per month](https://img.shields.io/npm/dm/@mojoio/cloudflare.svg)](https://www.npmjs.com/package/@mojoio/cloudflare) -[![Known Vulnerabilities](https://snyk.io/test/npm/@mojoio/cloudflare/badge.svg)](https://snyk.io/test/npm/@mojoio/cloudflare) -[![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/) + +Status Category | Status Badge +-- | -- +GitLab Pipelines | [![pipeline status](https://gitlab.com/mojoio/cloudflare/badges/master/pipeline.svg)](https://lossless.cloud) +GitLab Pipline Test Coverage | [![coverage report](https://gitlab.com/mojoio/cloudflare/badges/master/coverage.svg)](https://lossless.cloud) +npm | [![npm downloads per month](https://badgen.net/npm/dy/@mojoio/cloudflare)](https://lossless.cloud) +Snyk | [![Known Vulnerabilities](https://badgen.net/snyk/mojoio/cloudflare)](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/@mojoio/cloudflare)](https://lossless.cloud) +PackagePhobia (package size on registry) | [![PackagePhobia](https://badgen.net/packagephobia/publish/@mojoio/cloudflare)](https://lossless.cloud) +BundlePhobia (total size when bundled) | [![BundlePhobia](https://badgen.net/bundlephobia/minzip/@mojoio/cloudflare)](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 diff --git a/ts/cloudflare.classes.account.ts b/ts/cloudflare.classes.account.ts index 9655a5f..00ea55f 100644 --- a/ts/cloudflare.classes.account.ts +++ b/ts/cloudflare.classes.account.ts @@ -47,10 +47,7 @@ export class CloudflareAccount { if (filteredResponse.length >= 1) { return filteredResponse[0].id; } else { - logger.log( - 'error', - `the domain ${domainName} does not appear to be in this account!` - ); + logger.log('error', `the domain ${domainName} does not appear to be in this account!`); throw new Error(`the domain ${domainName} does not appear to be in this account!`); } }, diff --git a/ts/cloudflare.classes.record.ts b/ts/cloudflare.classes.record.ts index 564d6ee..9bbbe36 100644 --- a/ts/cloudflare.classes.record.ts +++ b/ts/cloudflare.classes.record.ts @@ -1,5 +1,3 @@ import * as plugins from './cloudflare.plugins'; -export class CloudflareRecord { - -} +export class CloudflareRecord {} diff --git a/ts/cloudflare.classes.zone.ts b/ts/cloudflare.classes.zone.ts index c53ee66..c8e43d9 100644 --- a/ts/cloudflare.classes.zone.ts +++ b/ts/cloudflare.classes.zone.ts @@ -47,5 +47,4 @@ export class CloudflareZone implements interfaces.ICflareZone { paused: boolean; type: string; checked_on: string; - } diff --git a/ts/cloudflare.classes.zonemanager.ts b/ts/cloudflare.classes.zonemanager.ts index e76a75a..0e44897 100644 --- a/ts/cloudflare.classes.zonemanager.ts +++ b/ts/cloudflare.classes.zonemanager.ts @@ -14,14 +14,14 @@ export class ZoneManager { public async getZones(zoneName: string) { let requestRoute = `/zones?per_page=50`; // may be optionally filtered by domain name - + if (zoneName) { requestRoute = `${requestRoute}&name=${zoneName}`; } const response: any = await this.cfAccount.request('GET', requestRoute); const apiObjects: interfaces.ICflareZone[] = response.result; - + const cloudflareZoneArray = []; for (const apiObject of apiObjects) { cloudflareZoneArray.push(CloudflareZone.createFromApiObject(apiObject)); diff --git a/ts/cloudflare.logger.ts b/ts/cloudflare.logger.ts index 2789007..e29f934 100644 --- a/ts/cloudflare.logger.ts +++ b/ts/cloudflare.logger.ts @@ -1,3 +1,3 @@ import * as plugins from './cloudflare.plugins'; -export const logger = new plugins.smartlog.ConsoleLog(); \ No newline at end of file +export const logger = new plugins.smartlog.ConsoleLog();