fix(core): update

This commit is contained in:
Philipp Kunz 2020-06-10 05:15:22 +00:00
parent a4e280f9f0
commit 4f9e81f612
5 changed files with 3708 additions and 498 deletions

4171
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -3,11 +3,11 @@
"version": "5.0.4", "version": "5.0.4",
"private": false, "private": false,
"description": "easy cloudflare management", "description": "easy cloudflare management",
"main": "dist/index.js", "main": "dist_ts/index.js",
"typings": "dist/index.d.ts", "typings": "dist_ts/index.d.ts",
"scripts": { "scripts": {
"test": "(tstest test/)", "test": "(tstest test/)",
"build": "(tsbuild)" "build": "(tsbuild --web)"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
@ -24,21 +24,21 @@
}, },
"homepage": "https://gitlab.com/pushrocks/cflare#readme", "homepage": "https://gitlab.com/pushrocks/cflare#readme",
"dependencies": { "dependencies": {
"@pushrocks/smartdelay": "^2.0.6", "@pushrocks/smartdelay": "^2.0.9",
"@pushrocks/smartlog": "^2.0.21", "@pushrocks/smartlog": "^2.0.28",
"@pushrocks/smartpromise": "^3.0.6", "@pushrocks/smartpromise": "^3.0.6",
"@pushrocks/smartrequest": "^1.1.47", "@pushrocks/smartrequest": "^1.1.47",
"@pushrocks/smartstring": "^3.0.18", "@pushrocks/smartstring": "^3.0.18",
"@tsclass/tsclass": "^3.0.7" "@tsclass/tsclass": "^3.0.17"
}, },
"devDependencies": { "devDependencies": {
"@gitzone/tsbuild": "^2.1.17", "@gitzone/tsbuild": "^2.1.24",
"@gitzone/tsrun": "^1.2.8", "@gitzone/tsrun": "^1.2.12",
"@gitzone/tstest": "^1.0.28", "@gitzone/tstest": "^1.0.33",
"@pushrocks/qenv": "^4.0.6", "@pushrocks/qenv": "^4.0.10",
"@pushrocks/tapbundle": "^3.2.0", "@pushrocks/tapbundle": "^3.2.1",
"@types/node": "^13.7.2", "@types/node": "^14.0.13",
"tslint": "^6.0.0", "tslint": "^6.1.2",
"tslint-config-prettier": "^1.18.0" "tslint-config-prettier": "^1.18.0"
}, },
"files": [ "files": [

View File

@ -1,4 +1,5 @@
import plugins = require('./cloudflare.plugins'); import plugins = require('./cloudflare.plugins');
import { logger } from './cloudflare.logger';
import * as interfaces from './interfaces'; import * as interfaces from './interfaces';
// interfaces // interfaces
@ -46,7 +47,7 @@ export class CloudflareAccount {
if (filteredResponse.length >= 1) { if (filteredResponse.length >= 1) {
return filteredResponse[0].id; return filteredResponse[0].id;
} else { } else {
plugins.smartlog.defaultLogger.log( logger.log(
'error', 'error',
`the domain ${domainName} does not appear to be in this account!` `the domain ${domainName} does not appear to be in this account!`
); );

View File

@ -1,6 +1,7 @@
import * as plugins from './cloudflare.plugins'; import * as plugins from './cloudflare.plugins';
import * as interfaces from './interfaces'; import * as interfaces from './interfaces';
import { WorkerManager } from './cloudflare.classes.workermanager'; import { WorkerManager } from './cloudflare.classes.workermanager';
import { logger } from './cloudflare.logger';
export interface IWorkerRoute extends interfaces.ICflareWorkerRoute { export interface IWorkerRoute extends interfaces.ICflareWorkerRoute {
zoneName: string; zoneName: string;
@ -66,7 +67,7 @@ export class CloudflareWorker {
routeIdForUpdate = existingRoute.id; routeIdForUpdate = existingRoute.id;
if (existingRoute.script === this.id) { if (existingRoute.script === this.id) {
routeStatus = 'alreadyUpToDate'; routeStatus = 'alreadyUpToDate';
plugins.smartlog.defaultLogger.log('info', `route already exists, no update needed`); logger.log('info', `route already exists, no update needed`);
} }
} }
} }

3
ts/cloudflare.logger.ts Normal file
View File

@ -0,0 +1,3 @@
import * as plugins from './cloudflare.plugins';
export const logger = new plugins.smartlog.ConsoleLog();