@4is-cronicle/plugin-tools
Advanced tools
Comparing version 0.1.7 to 0.2.3
import { IJobInput, IJobOutput } from './interfaces'; | ||
export * from '@4lch4/logger'; | ||
export { IJobInput, IJobOutput }; | ||
export declare function initJob<P>(): Promise<IJobInput<P>>; | ||
export declare function endJob(output: IJobOutput): Promise<void>; |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.endJob = exports.initJob = void 0; | ||
const utils_1 = require("./utils"); | ||
__exportStar(require("@4lch4/logger"), exports); | ||
async function initJob() { | ||
@@ -26,3 +11,2 @@ const ioUtil = new utils_1.IOUtil(); | ||
async function endJob(output) { | ||
output = Object.assign(Object.assign({}, output), { code: output.code || 0 }); | ||
console.log(JSON.stringify(output)); | ||
@@ -29,0 +13,0 @@ process.exit(output.code); |
@@ -8,7 +8,3 @@ export interface IJobInput<P> { | ||
log_file: string; | ||
params: P | any; | ||
chain_data?: any; | ||
source_event?: string; | ||
chain_code?: number; | ||
chain_description?: string; | ||
params: P; | ||
} |
export declare class IOUtil { | ||
readPipedInput<T = any>(): Promise<T>; | ||
readPipedInput<T>(): Promise<T>; | ||
} |
{ | ||
"name": "@4is-cronicle/plugin-tools", | ||
"displayName": "Cronicle Plugin Tools", | ||
"version": "0.1.7", | ||
"description": "A library of helper functions for new Cronicle Plugins.", | ||
"version": "0.2.3", | ||
"description": "A lib of helper functions for new Cronicle Plugins.", | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"type": "module", | ||
"scripts": { | ||
"scan": "snyk monitor && snyk code test", | ||
"build": "tsc", | ||
"lint": "npm run pretty && prettier -c .", | ||
"pretty": "prettier --write .", | ||
"prepublishOnly": "npm run test && npm run build", | ||
"test": "npm run lint && echo 'No actual test files available, previous tasks completed successfully.'" | ||
"prepublishOnly": "npm run build" | ||
}, | ||
"keywords": ["cronicle", "cronicle-tools", "cronicle-plugin"], | ||
"keywords": [ | ||
"cronicle", | ||
"cronicle-tools", | ||
"cronicle-plugin" | ||
], | ||
"author": { | ||
@@ -23,22 +21,17 @@ "name": "4lch4", | ||
}, | ||
"bugs": { | ||
"email": "bugs@4lch4.email", | ||
"url": "https://git.4lch4.io/4lch4/Cronicle-Plugin-Tools/issues" | ||
}, | ||
"homepage": "https://git.4lch4.io/4lch4/Cronicle-Plugin-Tools", | ||
"license": "MIT", | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"license": "MIT", | ||
"devDependencies": { | ||
"@types/node": "^16.11.47", | ||
"prettier": "^2.7.1", | ||
"snyk": "^1.981.0", | ||
"ts-node": "^10.9.1", | ||
"typescript": "^4.7.4" | ||
"@types/node": "^17.0.14", | ||
"prettier": "^2.5.1", | ||
"ts-node": "^10.4.0", | ||
"typescript": "^4.5.5" | ||
}, | ||
"dependencies": { | ||
"@4lch4/logger": "^1.9.2", | ||
"dotenv": "^16.0.1" | ||
"commander": "^9.0.0", | ||
"discord-ts-webhook": "^1.2.1", | ||
"dotenv": "^16.0.0" | ||
} | ||
} |
@@ -1,53 +0,5 @@ | ||
[![Drone Build Status][0]][1] [![NPM License][2]][3] [![NPM Version][4]][5] [![Monthly Downloads (NPM)][6]][7] [![Snyk Vulnerabilities for npm package][8]][9] | ||
# Cronicle Tools | ||
[![code style: prettier][10]][11] [![Discord][12]][13] [![Twitter-Profile][14]][15] | ||
This project is to provide some helper functions to a new NodeJS module that wishes to be a [Cronicle Plugin][0]. | ||
# Cronicle Plugin Tools | ||
This project is to provide some helper functions to a new NodeJS module that wishes to be a [Cronicle Plugin][16]. | ||
## Exported Members | ||
The following list defines/describes the members that are exported by the [@4is-cronicle/plugin-tools][17] package: | ||
- [@4lch4/logger][18] | ||
- All exported members of the `@4lch4/logger` library are also exported by `@4is-cronicle/plugin-tools`. | ||
- Interfaces | ||
- [IJobInput][20] | ||
- [IJobOutput][21] | ||
- Top-Level Functions | ||
- `initJob` | ||
- Initialize a Cronicle job. Returns the job input object read from STDIN. | ||
- Returns an object of type [IJobInput][20]. | ||
- `endJob` | ||
- Ends the execution of the job by writing the output to STDOUT using `JSON.stringify()` and then exiting the process using the code provided in `output.code`. The exit code defaults to **0** unless otherwise specified. | ||
- Requires a parameter object of type [IJobOutput][21]. | ||
[0]: https://img.shields.io/drone/build/4IS-Cronicle/Plugin-Tools/main?server=https%3A%2F%2Fdrone.4lch4.io&style=flat-square | ||
[1]: https://drone.4lch4.io/4IS-Cronicle/Plugin-Tools | ||
[2]: https://flat.badgen.net/npm/license/@4is-cronicle/plugin-tools | ||
[3]: https://npmjs.com/package/@4is-cronicle/plugin-tools | ||
[4]: https://flat.badgen.net/npm/v/@4is-cronicle/plugin-tools | ||
[5]: https://npmjs.com/package/@4is-cronicle/plugin-tools | ||
[6]: https://flat.badgen.net/npm/@4is-cronicle/plugin-tools | ||
[7]: https://npmjs.com/package/@4is-cronicle/plugin-tools | ||
[8]: https://img.shields.io/snyk/vulnerabilities/npm/@4is-cronicle/plugin-tools?style=flat-square | ||
[9]: https://app.snyk.io/org/alcha/project/b6b04336-9e6f-4207-bbd1-7b95e11232ff | ||
[10]: https://flat.badgen.net/badge/code%20style/prettier/ff69b4 | ||
[11]: https://github.com/prettier/prettier | ||
[12]: https://flat.badgen.net/discord/online-members/W72x4Ks | ||
[13]: https://discord.gg/W72x4Ks | ||
[14]: https://flat.badgen.net/twitter/follow/4lch4 | ||
[15]: https://twitter.com/4lch4 | ||
[16]: https://github.com/jhuckaby/Cronicle#plugins | ||
[17]: https://npmjs.com/package/@4is-cronicle/plugin-tools | ||
[18]: https://npmjs.com/package/@4lch4/logger | ||
[19]: | ||
<!-- [0]: https://github.com/jhuckaby/Cronicle#plugins | ||
[1]: https://npmjs.com/package/@4is-cronicle/plugin-tools | ||
[2]: https://npmjs.com/package/@4lch4/logger --> | ||
[20]: ./src/interfaces/IJobInput.ts | ||
[21]: ./src/interfaces/IJobOutput.ts | ||
[0]: https://github.com/jhuckaby/Cronicle#plugins |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4
12571
3
21
178
6
No
+ Addedcommander@^9.0.0
+ Addeddiscord-ts-webhook@^1.2.1
+ Addedasynckit@0.4.0(transitive)
+ Addedcombined-stream@1.0.8(transitive)
+ Addedcommander@9.5.0(transitive)
+ Addeddelayed-stream@1.0.0(transitive)
+ Addeddiscord-ts-webhook@1.2.1(transitive)
+ Addedform-data@3.0.2(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addednode-fetch@2.7.0(transitive)
+ Addedtr46@0.0.3(transitive)
+ Addedwebidl-conversions@3.0.1(transitive)
+ Addedwhatwg-url@5.0.0(transitive)
- Removed@4lch4/logger@^1.9.2
- Removed@4lch4/logger@1.11.0(transitive)
- Removedansi-colors@4.1.3(transitive)
- Removedansi-styles@4.3.0(transitive)
- Removedchalk@4.1.2(transitive)
- Removedcolor-convert@2.0.1(transitive)
- Removedcolor-name@1.1.4(transitive)
- Removeddayjs@1.11.13(transitive)
- Removedfs-extra@10.1.0(transitive)
- Removedgraceful-fs@4.2.11(transitive)
- Removedhas-flag@4.0.0(transitive)
- Removedjsonfile@6.1.0(transitive)
- Removedsupports-color@7.2.0(transitive)
- Removeduniversalify@2.0.1(transitive)
Updateddotenv@^16.0.0