Socket
Socket
Sign inDemoInstall

virtual-device-sdk

Package Overview
Dependencies
13
Maintainers
4
Versions
72
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.8.4 to 1.9.0

17

lib/src/BatchValidator.js
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {

@@ -13,6 +16,7 @@ extendStatics(d, b);

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) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());

@@ -28,4 +32,4 @@ });

while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {

@@ -50,2 +54,3 @@ case 0: case 1: t = op; break;

Object.defineProperty(exports, "__esModule", { value: true });
exports.BatchValidator = void 0;
var VirtualDeviceValidator_1 = require("./VirtualDeviceValidator");

@@ -52,0 +57,0 @@ var BatchValidator = (function (_super) {

import { IVirtualDeviceValidatorResult } from "./VirtualDeviceValidator";
export declare class ConsolePrinter {
private static rpad(s, padString, length);
private static concat(buffer, line, error);
private static rpad;
private static concat;
private totalTests;

@@ -16,3 +16,3 @@ private totalSequences;

printSummary(output: string): string;
private sequenceHasError(sequence, testResults);
private sequenceHasError;
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ConsolePrinter = void 0;
var chalk = require("chalk");

@@ -4,0 +5,0 @@ var path = require("path");

@@ -5,2 +5,2 @@ import { ConsolePrinter } from "./ConsolePrinter";

import { IVirtualDeviceValidatorResult, IVirtualDeviceValidatorResultItem, VirtualDeviceScriptUnauthorizedError, VirtualDeviceValidator } from "./VirtualDeviceValidator";
export { ConsolePrinter, ICard, IVirtualDeviceValidatorResult, IVirtualDeviceResult, VirtualDevice, VirtualDeviceScript, VirtualDeviceScriptUnauthorizedError, VirtualDeviceValidator, IVirtualDeviceValidatorResultItem };
export { ConsolePrinter, ICard, IVirtualDeviceValidatorResult, IVirtualDeviceResult, VirtualDevice, VirtualDeviceScript, VirtualDeviceScriptUnauthorizedError, VirtualDeviceValidator, IVirtualDeviceValidatorResultItem, };
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.VirtualDeviceValidator = exports.VirtualDeviceScriptUnauthorizedError = exports.VirtualDeviceScript = exports.VirtualDevice = exports.ConsolePrinter = void 0;
var ConsolePrinter_1 = require("./ConsolePrinter");
exports.ConsolePrinter = ConsolePrinter_1.ConsolePrinter;
Object.defineProperty(exports, "ConsolePrinter", { enumerable: true, get: function () { return ConsolePrinter_1.ConsolePrinter; } });
var VirtualDevice_1 = require("./VirtualDevice");
exports.VirtualDevice = VirtualDevice_1.VirtualDevice;
Object.defineProperty(exports, "VirtualDevice", { enumerable: true, get: function () { return VirtualDevice_1.VirtualDevice; } });
var VirtualDeviceScript_1 = require("./VirtualDeviceScript");
exports.VirtualDeviceScript = VirtualDeviceScript_1.VirtualDeviceScript;
Object.defineProperty(exports, "VirtualDeviceScript", { enumerable: true, get: function () { return VirtualDeviceScript_1.VirtualDeviceScript; } });
var VirtualDeviceValidator_1 = require("./VirtualDeviceValidator");
exports.VirtualDeviceScriptUnauthorizedError = VirtualDeviceValidator_1.VirtualDeviceScriptUnauthorizedError;
exports.VirtualDeviceValidator = VirtualDeviceValidator_1.VirtualDeviceValidator;
Object.defineProperty(exports, "VirtualDeviceScriptUnauthorizedError", { enumerable: true, get: function () { return VirtualDeviceValidator_1.VirtualDeviceScriptUnauthorizedError; } });
Object.defineProperty(exports, "VirtualDeviceValidator", { enumerable: true, get: function () { return VirtualDeviceValidator_1.VirtualDeviceValidator; } });
//# sourceMappingURL=Index.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PrettyPrinter = void 0;
var VirtualDeviceValidator_1 = require("./VirtualDeviceValidator");

@@ -105,3 +106,3 @@ var PrettyPrinter = (function () {

var icon = statusIcon(test_3);
var html_1 = "\n <tr" + ((test_3.result && trStyles(test_3.result)) || "") + ">\n <td style=\"" + tdAndThStyleProps + "text-align:center;\">" + (icon ? icon : "") + "</td>\n <td " + tdStyles + ">" + test_3.test.input + "</td>\n <td " + tdStyles + ">" + (test_3.test.expected.streamURL
var htmlTest = "\n <tr" + ((test_3.result && trStyles(test_3.result)) || "") + ">\n <td style=\"" + tdAndThStyleProps + "text-align:center;\">" + (icon ? icon : "") + "</td>\n <td " + tdStyles + ">" + test_3.test.input + "</td>\n <td " + tdStyles + ">" + (test_3.test.expected.streamURL
? test_3.test.expected.streamURL

@@ -111,3 +112,3 @@ : test_3.test.expected.transcript || "") + "</td>\n <td " + tdStyles + ">" + (test_3.actual && test_3.actual.streamURL

: (test_3.actual && test_3.actual.transcript) || "") + "</td>\n </tr>";
testsHTML.push(html_1);
testsHTML.push(htmlTest);
}

@@ -114,0 +115,0 @@ var html = "\n <div style=\"margin-bottom:16px;\" class=\"sequence\">\n <p style=\"margin:0 0 2px;font-weight:bold;\" class=\"heading\">Sequence: " + key + "</p>\n <table style=\"border-collapse:collapse;\">\n <thead>\n <tr>\n <th " + thStyles + ">Result</th>\n <th " + thStyles + ">Input</th>\n <th " + thStyles + ">Expected</th>\n <th " + thStyles + ">Actual</th>\n </tr>\n </thead>\n <tbody>" + testsHTML.join("") + "</tbody>\n </table>\n </div>";

@@ -0,1 +1,2 @@

#!/usr/bin/env node
export {};

@@ -30,3 +30,3 @@ #!/usr/bin/env node

var directory = ".";
var file;
var fileTest;
if (path) {

@@ -40,9 +40,9 @@ if (!fs.existsSync(path)) {

else {
file = path;
fileTest = path;
}
}
if (file) {
console.log("Running Test:" + file);
script.executeFile(file).then(function (result) {
console.log(printer.printResult(file, result));
if (fileTest) {
console.log("Running Test:" + fileTest);
script.executeFile(fileTest).then(function (result) {
console.log(printer.printResult(fileTest, result));
if (result.result !== "success") {

@@ -49,0 +49,0 @@ process.exit(1);

"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {

@@ -13,6 +16,7 @@ extendStatics(d, b);

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) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());

@@ -28,4 +32,4 @@ });

while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {

@@ -50,2 +54,3 @@ case 0: case 1: t = op; break;

Object.defineProperty(exports, "__esModule", { value: true });
exports.SequencedValidator = void 0;
var VirtualDeviceValidator_1 = require("./VirtualDeviceValidator");

@@ -52,0 +57,0 @@ var SequencedValidator = (function (_super) {

@@ -1,2 +0,2 @@

import * as retrier from "retry";
export declare const retry: (fn: (bailFunction: any, num: any) => any, opts: retrier.OperationOptions) => Promise<{}>;
import { OperationOptions } from "retry";
export declare const retry: (fn: (bailFunction: any, num: any) => any, opts: OperationOptions) => Promise<unknown>;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.retry = void 0;
var retrier = require("retry");

@@ -4,0 +5,0 @@ exports.retry = function (fn, opts) {

@@ -19,13 +19,13 @@ export interface IVirtualDeviceConfiguration {

arg0: string | IVirtualDeviceConfiguration;
locale: string | undefined;
voiceID: string | undefined;
skipSTT: boolean | undefined;
asyncMode: boolean | undefined;
stt: string | undefined;
locationLat: string | undefined;
locationLong: string | undefined;
conversationId: string | undefined;
screenMode: string | undefined;
client: string | undefined;
projectId: string | undefined;
locale?: string | undefined;
voiceID?: string | undefined;
skipSTT?: boolean | undefined;
asyncMode?: boolean | undefined;
stt?: string | undefined;
locationLat?: string | undefined;
locationLong?: string | undefined;
conversationId?: string | undefined;
screenMode?: string | undefined;
client?: string | undefined;
projectId?: string | undefined;
baseURL: string;

@@ -52,7 +52,7 @@ homophones: {

stopConversation(uuid: string): Promise<IVirtualDeviceResult[] | any>;
waitForSessionToEnd(): Promise<{}>;
private handleBatchResponse(data);
private handleAsynchResponse(data);
private applyHomophones(result);
private processMessages(messages);
waitForSessionToEnd(): Promise<unknown>;
private handleBatchResponse;
private handleAsynchResponse;
private applyHomophones;
private processMessages;
}

@@ -59,0 +59,0 @@ export interface IConversationResult {

"use strict";
var __assign = (this && this.__assign) || Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
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) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());

@@ -25,4 +29,4 @@ });

while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {

@@ -47,2 +51,3 @@ case 0: case 1: t = op; break;

Object.defineProperty(exports, "__esModule", { value: true });
exports.VirtualDevice = void 0;
var fs = require("fs");

@@ -210,4 +215,4 @@ var http = require("http");

return __awaiter(this, void 0, void 0, function () {
var path, _i, _a, key, parameterValue, parameterName, _b, parameterValue_2, element, procesedMessages, error_1, url;
var _this = this;
var path, _i, _a, key, parameterValue, parameterName, _b, parameterValue_2, element, procesedMessages, error_1, url;
return __generator(this, function (_c) {

@@ -314,4 +319,4 @@ switch (_c.label) {

return __awaiter(this, void 0, void 0, function () {
var path, url, responsePromise;
var _this = this;
var path, url, responsePromise;
return __generator(this, function (_a) {

@@ -461,3 +466,3 @@ switch (_a.label) {

}
return __assign({}, json, { results: results });
return __assign(__assign({}, json), { results: results });
};

@@ -482,3 +487,3 @@ VirtualDevice.prototype.handleAsynchResponse = function (data) {

var homophone = homophones_1[_a];
result.transcript = result.transcript.split(new RegExp("\\b" + homophone + "\\b", "i")).join(word);
result.transcript = result.transcript.split(new RegExp("(?<=[\\s,.:;\"']|^)" + homophone + "(?=[\\s,.:;\"']|$)", "i")).join(word);
}

@@ -485,0 +490,0 @@ }

@@ -22,4 +22,4 @@ import { IVirtualDeviceTestSequence, IVirtualDeviceValidatorResult, IVirtualDeviceValidatorResultItem } from "./VirtualDeviceValidator";

checkAuth(scriptContents: string): Promise<any>;
private detectInvocationName(input);
private tokenize(script);
private detectInvocationName;
private tokenize;
}
"use strict";
var __assign = (this && this.__assign) || Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
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) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());

@@ -25,4 +29,4 @@ });

while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {

@@ -47,2 +51,3 @@ case 0: case 1: t = op; break;

Object.defineProperty(exports, "__esModule", { value: true });
exports.VirtualDeviceScript = void 0;
var fs = require("fs");

@@ -197,3 +202,3 @@ var path = require("path");

}
var fileContents = fs.readFileSync(filePath, "UTF-8");
var fileContents = fs.readFileSync(filePath, "utf-8");
return this.execute(fileContents);

@@ -200,0 +205,0 @@ };

@@ -5,3 +5,3 @@ import { IVirtualDeviceResult, VirtualDevice } from "./VirtualDevice";

export declare abstract class VirtualDeviceValidator {
protected token: string | undefined;
protected token?: string | undefined;
private sourceAPIBaseURL;

@@ -51,6 +51,6 @@ private subscribers;

export declare class ValidatorError {
message: string | undefined;
property: string | undefined;
expected: string | string[] | undefined;
actual: string | null | undefined;
message?: string | undefined;
property?: string | undefined;
expected?: string | string[] | undefined;
actual?: string | null | undefined;
static asArray(message: string): ValidatorError[];

@@ -66,5 +66,5 @@ static propertyError(property: string, expected: undefined | string | string[], actual: null | string): ValidatorError;

export declare class Validator {
private static checkString(property, value, expected, caseSensitive?);
private static checkObject(parentProperty, value?, expected?);
private static toRegex(expectedValue);
private static checkString;
private static checkObject;
private static toRegex;
resultItem: IVirtualDeviceValidatorResultItem;

@@ -71,0 +71,0 @@ error?: Error;

"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) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());

@@ -17,4 +18,4 @@ });

while (_) try {
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [0, t.value];
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {

@@ -39,2 +40,3 @@ case 0: case 1: t = op; break;

Object.defineProperty(exports, "__esModule", { value: true });
exports.Validator = exports.ValidatorError = exports.VirtualDeviceValidator = exports.VirtualDeviceValidatorUnauthorizedMessage = exports.VirtualDeviceScriptUnauthorizedError = void 0;
var https = require("https");

@@ -41,0 +43,0 @@ var VirtualDevice_1 = require("./VirtualDevice");

@@ -6,6 +6,6 @@ export declare class YAMLParser {

private static TWO_SPACES;
private static countAtStart(line, value);
private static countAtStart;
constructor(yamlContents: string);
parse(): Value[];
private parseLine(line, context);
private parseLine;
}

@@ -24,4 +24,4 @@ export declare class YAMLContext {

tabs: number;
private _name;
private _value;
private _name?;
private _value?;
static cleanString(s?: string): string | undefined;

@@ -28,0 +28,0 @@ constructor(line: number, tabs: number, _name?: string | undefined, _value?: any);

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Value = exports.YAMLContext = exports.YAMLParser = void 0;
var YAMLParser = (function () {

@@ -4,0 +5,0 @@ function YAMLParser(yamlContents) {

@@ -7,3 +7,3 @@ {

"typings": "./lib/src/Index.d.ts",
"version": "1.8.4",
"version": "1.9.0",
"engines": {

@@ -56,5 +56,5 @@ "node": "> 6.0.0"

"sinon-chai": "^2.14.0",
"ts-node": "^4.1.0",
"tslint": "^4.0.2",
"typescript": "^2.4.1"
"ts-node": "^8.10.2",
"tslint": "^6.1.3",
"typescript": "^3.9.10"
},

@@ -61,0 +61,0 @@ "dependencies": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc