UNPKG

@ylveracode/veracode-cli

Version:

a NodeJS based API wrapper for utilizing the Veracode APIs

48 lines (47 loc) 1.96 kB
"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.getApplications = void 0; const queryHandler_1 = require("../queryHandler"); function getApplications(appName, appGUID, lagacyAppId) { return __awaiter(this, void 0, void 0, function* () { let applications = ''; let path = '/appsec/v1/applications'; let params = { size: 500 }; if (appGUID) { path = path + '/' + appGUID; } else { if (appName) { console.log('adding application name: ', appName); params.name = appName; } if (lagacyAppId) { params.legacy_id = lagacyAppId; } } try { const applicationRes = yield queryHandler_1.request('GET', queryHandler_1.DEFAULT_API_HOST, path, params); applications = applicationRes.data; } catch (e) { console.log(e); console.log(Object.keys(e)); console.log(e.errno); console.log(e.code); console.log(e.config); console.log(e.isAxiosError); console.log(e.toJSON()); } return applications; }); } exports.getApplications = getApplications;