Comparing version 0.3.3 to 0.3.5
#!/usr/bin/env node | ||
"use strict"; | ||
/* | ||
* Copyright (c) 2022 Nango, all rights reserved. | ||
*/ | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const commander_1 = require("commander"); | ||
const axios_1 = __importDefault(require("axios")); | ||
const path_1 = __importDefault(require("path")); | ||
const program = new commander_1.Command(); | ||
import { Command } from 'commander'; | ||
import axios from 'axios'; | ||
import path from 'path'; | ||
const program = new Command(); | ||
let hostport = process.env['PIZZLY_HOSTPORT'] || 'http://localhost:3004'; | ||
@@ -23,4 +18,4 @@ // Test from the package rool (/packages/cli) with 'node dist/index.js' | ||
.action(async () => { | ||
let url = path_1.default.join(hostport, '/config'); | ||
await axios_1.default | ||
let url = path.join(hostport, '/config'); | ||
await axios | ||
.get(url) | ||
@@ -32,4 +27,3 @@ .then((res) => { | ||
.catch((err) => { | ||
var _a, _b; | ||
console.log(`❌ Error: ${((_b = (_a = err.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.error) || err}`); | ||
console.log(`❌ Error: ${err.response?.data?.error || err}`); | ||
}); | ||
@@ -42,4 +36,4 @@ }); | ||
.action(async (provider_config_key) => { | ||
let url = path_1.default.join(hostport, `/config/${provider_config_key}`); | ||
await axios_1.default | ||
let url = path.join(hostport, `/config/${provider_config_key}`); | ||
await axios | ||
.get(url) | ||
@@ -51,4 +45,3 @@ .then((res) => { | ||
.catch((err) => { | ||
var _a, _b; | ||
console.log(`❌ Error: ${((_b = (_a = err.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.error) || err}`); | ||
console.log(`❌ Error: ${err.response?.data?.error || err}`); | ||
}); | ||
@@ -72,4 +65,4 @@ }); | ||
}; | ||
let url = path_1.default.join(hostport, `/config`); | ||
await axios_1.default | ||
let url = path.join(hostport, `/config`); | ||
await axios | ||
.post(url, body) | ||
@@ -80,4 +73,3 @@ .then((_) => { | ||
.catch((err) => { | ||
var _a, _b; | ||
console.log(`❌ Error: ${((_b = (_a = err.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.error) || err}`); | ||
console.log(`❌ Error: ${err.response?.data?.error || err}`); | ||
}); | ||
@@ -101,4 +93,4 @@ }); | ||
}; | ||
let url = path_1.default.join(hostport, `/config`); | ||
await axios_1.default | ||
let url = path.join(hostport, `/config`); | ||
await axios | ||
.put(url, body) | ||
@@ -109,4 +101,3 @@ .then((_) => { | ||
.catch((err) => { | ||
var _a, _b; | ||
console.log(`❌ Error: ${((_b = (_a = err.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.error) || err}`); | ||
console.log(`❌ Error: ${err.response?.data?.error || err}`); | ||
}); | ||
@@ -119,4 +110,4 @@ }); | ||
.action(async (provider_config_key) => { | ||
let url = path_1.default.join(hostport, `/config/${provider_config_key}`); | ||
await axios_1.default | ||
let url = path.join(hostport, `/config/${provider_config_key}`); | ||
await axios | ||
.delete(url) | ||
@@ -127,4 +118,3 @@ .then((_) => { | ||
.catch((err) => { | ||
var _a, _b; | ||
console.log(`❌ Error: ${((_b = (_a = err.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.error) || err}`); | ||
console.log(`❌ Error: ${err.response?.data?.error || err}`); | ||
}); | ||
@@ -138,4 +128,4 @@ }); | ||
.action(async (connection_id, provider_config_key) => { | ||
let url = path_1.default.join(hostport, `/connection/${connection_id}`); | ||
await axios_1.default | ||
let url = path.join(hostport, `/connection/${connection_id}`); | ||
await axios | ||
.get(url, { params: { provider_config_key: provider_config_key } }) | ||
@@ -147,6 +137,6 @@ .then((res) => { | ||
.catch((err) => { | ||
var _a, _b; | ||
console.log(`❌ Error: ${((_b = (_a = err.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.error) || err}`); | ||
console.log(`❌ Error: ${err.response?.data?.error || err}`); | ||
}); | ||
}); | ||
program.parseAsync(process.argv); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "pizzly", | ||
"version": "0.3.3", | ||
"version": "0.3.5", | ||
"description": "Pizzly's CLI tool.", | ||
@@ -5,0 +5,0 @@ "type": "module", |
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
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
0
12747
274