Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@bitdiver/model

Package Overview
Dependencies
Maintainers
2
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bitdiver/model - npm Package Compare versions

Comparing version 3.0.4 to 3.1.0

dist/src/StepNormal.d.ts

2

dist/src/EnvironmentRun.d.ts

@@ -9,3 +9,3 @@ import { EnvironmentOptions } from './interfaceEnvironmentOptions';

_status: number;
description: string;
description?: string;
startTime: number;

@@ -12,0 +12,0 @@ map: Map<any, any>;

import { EnvironmentRun } from './EnvironmentRun';
import { EnvironmentTestcase } from './EnvironmentTestcase';
import { LogAdapterInterface } from '@bitdiver/logadapter';
import { StepNormal } from './StepNormal';
import { StepSingle } from './StepSingle';
import { StepBase } from './StepBase';

@@ -8,4 +10,4 @@ interface GenerateLogsRequest {

environmentRun: EnvironmentRun;
/** The test case environment */
environmentTestcase?: EnvironmentTestcase;
/** The test case environment. Or for SingleSteps an array of test case environments */
environmentTestcase?: EnvironmentTestcase | EnvironmentTestcase[];
/** The log adapter to use */

@@ -18,3 +20,3 @@ logAdapter: LogAdapterInterface;

/** If this is a step log, the step instance object */
step?: StepBase;
step?: StepNormal | StepSingle | StepBase;
}

@@ -21,0 +23,0 @@ /**

export { EnvironmentRun } from './EnvironmentRun';
export { EnvironmentTestcase } from './EnvironmentTestcase';
export { StepBase } from './StepBase';
export { StepNormal } from './StepNormal';
export { StepSingle } from './StepSingle';
export { StepRegistry } from './StepRegistry';
export { generateLogs } from './generateLogs';
export { STATUS_OK, STATUS_UNKNOWN, STATUS_WARNING, STATUS_ERROR, STATUS_FATAL, StepType, DIR_BASE_DATA } from './constants';
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DIR_BASE_DATA = exports.StepType = exports.STATUS_FATAL = exports.STATUS_ERROR = exports.STATUS_WARNING = exports.STATUS_UNKNOWN = exports.STATUS_OK = exports.generateLogs = exports.StepRegistry = exports.StepBase = exports.EnvironmentTestcase = exports.EnvironmentRun = void 0;
exports.DIR_BASE_DATA = exports.StepType = exports.STATUS_FATAL = exports.STATUS_ERROR = exports.STATUS_WARNING = exports.STATUS_UNKNOWN = exports.STATUS_OK = exports.generateLogs = exports.StepRegistry = exports.StepSingle = exports.StepNormal = exports.StepBase = exports.EnvironmentTestcase = exports.EnvironmentRun = void 0;
var EnvironmentRun_1 = require("./EnvironmentRun");

@@ -10,2 +10,6 @@ Object.defineProperty(exports, "EnvironmentRun", { enumerable: true, get: function () { return EnvironmentRun_1.EnvironmentRun; } });

Object.defineProperty(exports, "StepBase", { enumerable: true, get: function () { return StepBase_1.StepBase; } });
var StepNormal_1 = require("./StepNormal");
Object.defineProperty(exports, "StepNormal", { enumerable: true, get: function () { return StepNormal_1.StepNormal; } });
var StepSingle_1 = require("./StepSingle");
Object.defineProperty(exports, "StepSingle", { enumerable: true, get: function () { return StepSingle_1.StepSingle; } });
var StepRegistry_1 = require("./StepRegistry");

@@ -12,0 +16,0 @@ Object.defineProperty(exports, "StepRegistry", { enumerable: true, get: function () { return StepRegistry_1.StepRegistry; } });

import { LogAdapterConsole } from '@bitdiver/logadapter';
import { StepType } from './constants';
export interface StepOptions {
/** The name of this step */
name: string;
/** The type of this step */
type?: StepType;
/** The Logadapter used by the step */

@@ -9,0 +6,0 @@ logAdapter?: LogAdapterConsole;

@@ -11,3 +11,3 @@ import { LogAdapterInterface } from '@bitdiver/logadapter';

*/
export declare class StepBase {
export declare abstract class StepBase {
/** The Logadapter used by the step */

@@ -17,13 +17,40 @@ logAdapter: LogAdapterInterface;

type: StepType;
/** creates a unique step instance id */
stepInstanceId: string;
/** The name of this step */
name: string;
/** An optional description for this step */
description?: string;
/**
* The idea of the testmode is to test the run of a step without executing it completly.
* So the suite could be tested. This is important for long running tests
*The mode is set by the runner
*/
testMode: boolean;
/**
* Normaly a step will only be executed if there is data defined for the testcase.
* but some steps do not need any data. Then this must be set to false.
*/
needData: boolean;
/** This is set by the runner. The number of this stepin the list of all the steps
* Start with '1'
*/
countCurrent: number;
/** This is set by the runner. How many steps to be excuted in this run */
countAll: number;
/**
* If this is set to true, the step will executed even if the testcase is already failed
* This is important for cleanup steps, for Example.
*/
runOnError: boolean;
/**
* Allows to define how many parallel exection are possible on a per step basis.
* This value is normaly defined in the runner, but when given here it will overwrite
* the runner if this value is less
*/
maxParallelSteps: number;
environmentTestcase?: EnvironmentTestcase;
environmentRun?: EnvironmentRun;
data?: any;
environmentTestcase?: EnvironmentTestcase | EnvironmentTestcase[];
/** The data for this step */
data?: any | any[];
constructor(opts: StepOptions);

@@ -58,3 +85,3 @@ /**

*/
logDebug(options: any, environmentTestcase?: EnvironmentTestcase): Promise<void[]>;
logDebug(options: any, environmentTestcase?: EnvironmentTestcase): Promise<void>;
/**

@@ -66,3 +93,3 @@ * Logs a info message.

*/
logInfo(options: any, environmentTestcase?: EnvironmentTestcase): Promise<void[]>;
logInfo(options: any, environmentTestcase?: EnvironmentTestcase): Promise<void>;
/**

@@ -74,3 +101,3 @@ * Logs a warning message.

*/
logWarning(options: any, environmentTestcase?: EnvironmentTestcase): Promise<void[]>;
logWarning(options: any, environmentTestcase?: EnvironmentTestcase): Promise<void>;
/**

@@ -83,3 +110,3 @@ * Logs a error message.

*/
logError(options: any, environmentTestcase?: EnvironmentTestcase): Promise<void[]>;
logError(options: any, environmentTestcase?: EnvironmentTestcase): Promise<void>;
/**

@@ -92,3 +119,3 @@ * Logs a fatal message.

*/
logFatal(options: any, environmentTestcase?: EnvironmentTestcase): Promise<void[]>;
logFatal(options: any, environmentTestcase?: EnvironmentTestcase): Promise<void>;
/**

@@ -102,3 +129,3 @@ * Calls the logger with the given messageObj.

*/
_log(messageObj: any, logLevel?: string, environmentTestcase?: EnvironmentTestcase): Promise<void[]>;
_log(messageObj: any, logLevel?: string, environmentTestcase?: EnvironmentTestcase | EnvironmentTestcase[]): Promise<void>;
}

@@ -19,22 +19,31 @@ "use strict";

this.type = constants_1.StepType.normal;
// creates a unique step instance id
/** creates a unique step instance id */
this.stepInstanceId = (0, uuid_1.v4)();
// The idea of the testmode is to test the run of a step without executing it completly.
// So the suite could be tested. This is important for long running tests
// The mode is set by the runner
/**
* The idea of the testmode is to test the run of a step without executing it completly.
* So the suite could be tested. This is important for long running tests
*The mode is set by the runner
*/
this.testMode = false;
// Normaly a step will only be executed if there is data defined for the testcase.
// but some steps do not need any data. Then this must be set to false.
/**
* Normaly a step will only be executed if there is data defined for the testcase.
* but some steps do not need any data. Then this must be set to false.
*/
this.needData = true;
// This is set by the runner. The number of this stepin the list of all the steps
// Start with '1'
/** This is set by the runner. The number of this stepin the list of all the steps
* Start with '1'
*/
this.countCurrent = 0;
// This is set by the runner. How many steps to be excuted in this run
/** This is set by the runner. How many steps to be excuted in this run */
this.countAll = 0;
// If this is set to true, the step will executed even if the testcase is already failed
// This is important for cleanup steps, for Example.
/**
* If this is set to true, the step will executed even if the testcase is already failed
* This is important for cleanup steps, for Example.
*/
this.runOnError = false;
// Allows to define how many parallel exection are possible on a per step basis.
// This value is normaly defined in the runner, but when given here it will overwrite
// the runner if this value is less
/**
* Allows to define how many parallel exection are possible on a per step basis.
* This value is normaly defined in the runner, but when given here it will overwrite
* the runner if this value is less
*/
this.maxParallelSteps = 10;

@@ -46,5 +55,2 @@ // The name of this step

}
if (opts.type !== undefined) {
this.type = opts.type;
}
if (opts.needData !== undefined) {

@@ -98,6 +104,4 @@ this.needData = opts.needData;

*/
async logDebug(options, environmentTestcase
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
) {
return await this._log(options, logadapter_1.LEVEL_DEBUG, environmentTestcase);
async logDebug(options, environmentTestcase) {
await this._log(options, logadapter_1.LEVEL_DEBUG, environmentTestcase);
}

@@ -110,6 +114,4 @@ /**

*/
async logInfo(options, environmentTestcase
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
) {
return await this._log(options, logadapter_1.LEVEL_INFO, environmentTestcase);
async logInfo(options, environmentTestcase) {
await this._log(options, logadapter_1.LEVEL_INFO, environmentTestcase);
}

@@ -122,6 +124,4 @@ /**

*/
async logWarning(options, environmentTestcase
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
) {
return await this._log(options, logadapter_1.LEVEL_WARNING, environmentTestcase);
async logWarning(options, environmentTestcase) {
await this._log(options, logadapter_1.LEVEL_WARNING, environmentTestcase);
}

@@ -135,6 +135,4 @@ /**

*/
async logError(options, environmentTestcase
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
) {
return await this._log(options, logadapter_1.LEVEL_ERROR, environmentTestcase);
async logError(options, environmentTestcase) {
await this._log(options, logadapter_1.LEVEL_ERROR, environmentTestcase);
}

@@ -148,6 +146,4 @@ /**

*/
async logFatal(options, environmentTestcase
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
) {
return await this._log(options, logadapter_1.LEVEL_FATAL, environmentTestcase);
async logFatal(options, environmentTestcase) {
await this._log(options, logadapter_1.LEVEL_FATAL, environmentTestcase);
}

@@ -162,5 +158,3 @@ /**

*/
async _log(messageObj, logLevel, environmentTestcase
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
) {
async _log(messageObj, logLevel, environmentTestcase) {
if (logLevel === undefined) {

@@ -177,3 +171,3 @@ logLevel = logadapter_1.LEVEL_INFO;

}
return await (0, generateLogs_1.generateLogs)({
await (0, generateLogs_1.generateLogs)({
environmentRun: this.environmentRun,

@@ -180,0 +174,0 @@ environmentTestcase,

{
"name": "@bitdiver/model",
"version": "3.0.4",
"version": "3.1.0",
"description": "",

@@ -50,3 +50,3 @@ "main": "dist/src/index.js",

"@types/uuid": "^9.0.0",
"@xhubio/build-base": "1.0.54"
"@xhubio/build-base": "1.0.55"
},

@@ -53,0 +53,0 @@ "keywords": [

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc