@capriza/create-capriza-connector
Advanced tools
Comparing version 0.0.26 to 0.0.27
55
index.js
#!/usr/bin/env node | ||
var childProcess = require ("child_process"); | ||
var fs = require ("fs-extra"); | ||
var path = require ("path"); | ||
var chalk = require ("chalk"); | ||
var cwd = process.cwd(); | ||
var connectorName = process.argv[2] || "my-connector"; | ||
console.log (`\nCreating connector: ${chalk.green(connectorName)}\n`); | ||
console.log (`\n${chalk.bold(chalk.red("This package is deprecated"))}\n`); | ||
console.log (`\nPlease use the following script to install Capriza connector ${chalk.green(`npx @capriza/create-connector ${connectorName}`)}`); | ||
var packageJson = { | ||
name: connectorName, | ||
version: "1.0.0", | ||
main: "index.js", | ||
license: "UNLICENSED", | ||
description: "My Connector for approvals", | ||
repository: "private" | ||
}; | ||
//write initial package.json | ||
fs.writeFileSync ("package.json", JSON.stringify(packageJson)); | ||
//install my-connector basic template and copy the content of it from the node_modules to the root | ||
childProcess.execSync (`npm install @capriza/my-connector`, {cwd: cwd}); | ||
fs.copySync (path.join(cwd, `node_modules`, `@capriza`, `my-connector`), `.`); | ||
fs.removeSync (path.join(cwd, `node_modules`)); | ||
fs.removeSync (path.join(cwd, `package-lock.json`)); | ||
//write the updated package.json (with my-connector scripts) | ||
var myConnectorPackageJson = require (path.join(cwd, `package.json`)); | ||
packageJson.scripts = myConnectorPackageJson.scripts; | ||
fs.writeFileSync ("package.json", JSON.stringify(packageJson)); | ||
//re-install connector-controller | ||
childProcess.execSync (`npm install @capriza/connector-controller`, {cwd: cwd}); | ||
//done | ||
console.log (`${chalk.bold(chalk.green("Done :)"))}`); | ||
console.log (); | ||
console.log (`You can go ahead and start to test your ${chalk.bold(connectorName)} by running:\n`); | ||
console.log (`\t${chalk.bold("npm run bltester")}`); | ||
console.log (); | ||
console.log (`Once ready, in order to connect to your connector to Capriza's cloud, you need to:\n`); | ||
console.log (`1. Set a caprizaConfig.json file that should look like this:\n`); | ||
console.log (JSON.stringify( | ||
{ | ||
"connectorId": "xxxx-xxxx-xxxx-xxxxxxx-xxxxx", | ||
"apiUrl": "https://approvals[dev/test].capriza.com", | ||
"creds": { | ||
"apiKey": "<Environment API key>", | ||
"apiSecret": "<Environment API secret>" | ||
} | ||
}, | ||
" ", 3)); | ||
console.log (); | ||
console.log ("* The connectorId, apiKey and apiSecret can be generated using the capriza dashboard\n"); | ||
console.log (`2. Set a systemConfig.json file, which includes required parameters that are relevant to the source system (system url, user credentials).`); | ||
console.log (`3. Set the path of these 2 files in the resources/config.json file.`); | ||
console.log (); | ||
console.log (chalk.bold(chalk.yellow(`Capriza\n\n\n`))); |
{ | ||
"name": "@capriza/create-capriza-connector", | ||
"version": "0.0.26", | ||
"version": "0.0.27", | ||
"description": "Create a Capriza connector bootstrap program", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
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
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
0
1
863
7