Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
387f00078f | |||
fe2f45e3a9 | |||
90c9bfc906 | |||
4f9e81f612 | |||
a4e280f9f0 | |||
52bd80aebd |
4
.gitignore
vendored
4
.gitignore
vendored
@ -15,8 +15,6 @@ node_modules/
|
|||||||
|
|
||||||
# builds
|
# builds
|
||||||
dist/
|
dist/
|
||||||
dist_web/
|
dist_*/
|
||||||
dist_serve/
|
|
||||||
dist_ts_web/
|
|
||||||
|
|
||||||
# custom
|
# custom
|
@ -24,13 +24,14 @@ mirror:
|
|||||||
- docker
|
- docker
|
||||||
- notpriv
|
- notpriv
|
||||||
|
|
||||||
snyk:
|
audit:
|
||||||
image: registry.gitlab.com/hosttoday/ht-docker-node:snyk
|
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||||
stage: security
|
stage: security
|
||||||
script:
|
script:
|
||||||
- npmci npm prepare
|
- npmci npm prepare
|
||||||
- npmci command npm install --ignore-scripts
|
- 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:
|
tags:
|
||||||
- lossless
|
- lossless
|
||||||
- docker
|
- docker
|
||||||
|
4173
package-lock.json
generated
4173
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
31
package.json
31
package.json
@ -1,13 +1,13 @@
|
|||||||
{
|
{
|
||||||
"name": "@mojoio/cloudflare",
|
"name": "@mojoio/cloudflare",
|
||||||
"version": "5.0.3",
|
"version": "5.0.6",
|
||||||
"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,28 +24,29 @@
|
|||||||
},
|
},
|
||||||
"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": [
|
||||||
"ts/**/*",
|
"ts/**/*",
|
||||||
"ts_web/**/*",
|
"ts_web/**/*",
|
||||||
"dist/**/*",
|
"dist/**/*",
|
||||||
"dist_web/**/*",
|
"dist_*/**/*",
|
||||||
|
"dist_ts/**/*",
|
||||||
"dist_ts_web/**/*",
|
"dist_ts_web/**/*",
|
||||||
"assets/**/*",
|
"assets/**/*",
|
||||||
"cli.js",
|
"cli.js",
|
||||||
|
21
readme.md
21
readme.md
@ -8,13 +8,20 @@ easy cloudflare management
|
|||||||
* [docs (typedoc)](https://mojoio.gitlab.io/cloudflare/)
|
* [docs (typedoc)](https://mojoio.gitlab.io/cloudflare/)
|
||||||
|
|
||||||
## Status for master
|
## Status for master
|
||||||
[](https://gitlab.com/mojoio/cloudflare/commits/master)
|
|
||||||
[](https://gitlab.com/mojoio/cloudflare/commits/master)
|
Status Category | Status Badge
|
||||||
[](https://www.npmjs.com/package/@mojoio/cloudflare)
|
-- | --
|
||||||
[](https://snyk.io/test/npm/@mojoio/cloudflare)
|
GitLab Pipelines | [](https://lossless.cloud)
|
||||||
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
GitLab Pipline Test Coverage | [](https://lossless.cloud)
|
||||||
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
npm | [](https://lossless.cloud)
|
||||||
[](https://prettier.io/)
|
Snyk | [](https://lossless.cloud)
|
||||||
|
TypeScript Support | [](https://lossless.cloud)
|
||||||
|
node Support | [](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||||
|
Code Style | [](https://lossless.cloud)
|
||||||
|
PackagePhobia (total standalone install weight) | [](https://lossless.cloud)
|
||||||
|
PackagePhobia (package size on registry) | [](https://lossless.cloud)
|
||||||
|
BundlePhobia (total size when bundled) | [](https://lossless.cloud)
|
||||||
|
Platform support | [](https://lossless.cloud) [](https://lossless.cloud)
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
|
@ -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,10 +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', `the domain ${domainName} does not appear to be in this account!`);
|
||||||
'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!`);
|
throw new Error(`the domain ${domainName} does not appear to be in this account!`);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -260,9 +258,8 @@ export class CloudflareAccount {
|
|||||||
console.log(response.body);
|
console.log(response.body);
|
||||||
throw new Error(`request failed for ${requestUrl}`);
|
throw new Error(`request failed for ${requestUrl}`);
|
||||||
} else {
|
} else {
|
||||||
console.log(response.statusCode);
|
|
||||||
console.log(response.body);
|
console.log(response.body);
|
||||||
throw Error('request failed');
|
throw new Error(`request failed for ${requestUrl} with status${response.statusCode}}`);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
import * as plugins from './cloudflare.plugins';
|
import * as plugins from './cloudflare.plugins';
|
||||||
|
|
||||||
export class CloudflareRecord {
|
export class CloudflareRecord {}
|
||||||
|
|
||||||
}
|
|
||||||
|
@ -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`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -47,5 +47,4 @@ export class CloudflareZone implements interfaces.ICflareZone {
|
|||||||
paused: boolean;
|
paused: boolean;
|
||||||
type: string;
|
type: string;
|
||||||
checked_on: string;
|
checked_on: string;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
3
ts/cloudflare.logger.ts
Normal file
3
ts/cloudflare.logger.ts
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
import * as plugins from './cloudflare.plugins';
|
||||||
|
|
||||||
|
export const logger = new plugins.smartlog.ConsoleLog();
|
Reference in New Issue
Block a user