@perforce-perfecto/scriptless-helpers 1.50.0 → 1.52.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/index.d.ts +2 -0
- package/src/index.js +2 -0
- package/src/index.js.map +1 -1
- package/src/lib/loops-iteration-state-helper.d.ts +12 -0
- package/src/lib/loops-iteration-state-helper.js +48 -0
- package/src/lib/loops-iteration-state-helper.js.map +1 -0
- package/src/types/loop-iteration-state.d.ts +4 -0
- package/src/types/loop-iteration-state.js +3 -0
- package/src/types/loop-iteration-state.js.map +1 -0
package/package.json
CHANGED
package/src/index.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export * from './lib/handset-variable-helper';
|
|
|
14
14
|
export * from './lib/http-request-helper';
|
|
15
15
|
export * from './lib/integer-helper';
|
|
16
16
|
export * from './lib/json-pointer-helper';
|
|
17
|
+
export * from './lib/loops-iteration-state-helper';
|
|
17
18
|
export * from './lib/message-helper';
|
|
18
19
|
export * from './lib/parameter-helper';
|
|
19
20
|
export * from './lib/perfecto-execute-script-helper';
|
|
@@ -34,3 +35,4 @@ export * from './types/data-table';
|
|
|
34
35
|
export * from './types/user-defined-variables';
|
|
35
36
|
export * from './types/desired-device-capabilities';
|
|
36
37
|
export * from './types/perfecto-device-capabilities';
|
|
38
|
+
export * from './types/loop-iteration-state';
|
package/src/index.js
CHANGED
|
@@ -17,6 +17,7 @@ tslib_1.__exportStar(require("./lib/handset-variable-helper"), exports);
|
|
|
17
17
|
tslib_1.__exportStar(require("./lib/http-request-helper"), exports);
|
|
18
18
|
tslib_1.__exportStar(require("./lib/integer-helper"), exports);
|
|
19
19
|
tslib_1.__exportStar(require("./lib/json-pointer-helper"), exports);
|
|
20
|
+
tslib_1.__exportStar(require("./lib/loops-iteration-state-helper"), exports);
|
|
20
21
|
tslib_1.__exportStar(require("./lib/message-helper"), exports);
|
|
21
22
|
tslib_1.__exportStar(require("./lib/parameter-helper"), exports);
|
|
22
23
|
tslib_1.__exportStar(require("./lib/perfecto-execute-script-helper"), exports);
|
|
@@ -37,4 +38,5 @@ tslib_1.__exportStar(require("./types/data-table"), exports);
|
|
|
37
38
|
tslib_1.__exportStar(require("./types/user-defined-variables"), exports);
|
|
38
39
|
tslib_1.__exportStar(require("./types/desired-device-capabilities"), exports);
|
|
39
40
|
tslib_1.__exportStar(require("./types/perfecto-device-capabilities"), exports);
|
|
41
|
+
tslib_1.__exportStar(require("./types/loop-iteration-state"), exports);
|
|
40
42
|
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/execution-helpers-public/src/index.ts"],"names":[],"mappings":";;;AAAA,wEAA8C;AAC9C,qEAA2C;AAC3C,iEAAuC;AACvC,+DAAqC;AACrC,6DAAmC;AACnC,kEAAwC;AACxC,+DAAqC;AACrC,sEAA4C;AAC5C,qEAA2C;AAC3C,oEAA0C;AAC1C,sEAA4C;AAC5C,mEAAyC;AACzC,wEAA8C;AAC9C,oEAA0C;AAC1C,+DAAqC;AACrC,oEAA0C;AAC1C,+DAAqC;AACrC,iEAAuC;AACvC,+EAAqD;AACrD,kEAAwC;AACxC,8DAAoC;AACpC,mEAAyC;AACzC,wEAA8C;AAC9C,uEAA6C;AAC7C,4DAAkC;AAClC,6DAAmC;AACnC,kEAAwC;AACxC,qFAA2D;AAC3D,yEAA+C;AAE/C,8EAAoD;AACpD,oEAA0C;AAC1C,yDAA+B;AAC/B,6DAAmC;AACnC,yEAA+C;AAC/C,8EAAoD;AACpD,+EAAqD"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/execution-helpers-public/src/index.ts"],"names":[],"mappings":";;;AAAA,wEAA8C;AAC9C,qEAA2C;AAC3C,iEAAuC;AACvC,+DAAqC;AACrC,6DAAmC;AACnC,kEAAwC;AACxC,+DAAqC;AACrC,sEAA4C;AAC5C,qEAA2C;AAC3C,oEAA0C;AAC1C,sEAA4C;AAC5C,mEAAyC;AACzC,wEAA8C;AAC9C,oEAA0C;AAC1C,+DAAqC;AACrC,oEAA0C;AAC1C,6EAAmD;AACnD,+DAAqC;AACrC,iEAAuC;AACvC,+EAAqD;AACrD,kEAAwC;AACxC,8DAAoC;AACpC,mEAAyC;AACzC,wEAA8C;AAC9C,uEAA6C;AAC7C,4DAAkC;AAClC,6DAAmC;AACnC,kEAAwC;AACxC,qFAA2D;AAC3D,yEAA+C;AAE/C,8EAAoD;AACpD,oEAA0C;AAC1C,yDAA+B;AAC/B,6DAAmC;AACnC,yEAA+C;AAC/C,8EAAoD;AACpD,+EAAqD;AACrD,uEAA6C"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Logger } from '../types/logger';
|
|
2
|
+
import { LoopIterationState } from '../types/loop-iteration-state';
|
|
3
|
+
import { ScriptlessHelper } from '../types/scriptless-helper';
|
|
4
|
+
export declare class LoopsIterationStateHelper extends ScriptlessHelper {
|
|
5
|
+
private loopsIterationState;
|
|
6
|
+
constructor(logger?: Logger);
|
|
7
|
+
private getLoopIndex;
|
|
8
|
+
getLoopsIterationState(): LoopIterationState[];
|
|
9
|
+
initializeLoopIterationState(identifier: string): void;
|
|
10
|
+
setLoopIterationState(identifier: string, iteration: number): void;
|
|
11
|
+
removeLoopIterationState(identifier: string): void;
|
|
12
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LoopsIterationStateHelper = void 0;
|
|
4
|
+
const scriptless_helper_1 = require("../types/scriptless-helper");
|
|
5
|
+
class LoopsIterationStateHelper extends scriptless_helper_1.ScriptlessHelper {
|
|
6
|
+
constructor(logger) {
|
|
7
|
+
super(logger);
|
|
8
|
+
this.loopsIterationState = [];
|
|
9
|
+
}
|
|
10
|
+
getLoopIndex(identifier) {
|
|
11
|
+
return this.loopsIterationState.findIndex((loopIterationState) => loopIterationState.identifier === identifier);
|
|
12
|
+
}
|
|
13
|
+
getLoopsIterationState() {
|
|
14
|
+
return this.loopsIterationState;
|
|
15
|
+
}
|
|
16
|
+
initializeLoopIterationState(identifier) {
|
|
17
|
+
const existingLoopIndex = this.getLoopIndex(identifier);
|
|
18
|
+
if (existingLoopIndex === -1) {
|
|
19
|
+
this.loopsIterationState.push({
|
|
20
|
+
identifier,
|
|
21
|
+
iteration: 0
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
this.logger.warn(`Loop iteration state with identifier "${identifier}" already exists.`);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
setLoopIterationState(identifier, iteration) {
|
|
29
|
+
const loopIndex = this.getLoopIndex(identifier);
|
|
30
|
+
if (loopIndex !== -1) {
|
|
31
|
+
this.loopsIterationState[loopIndex].iteration = iteration;
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
this.logger.warn(`Loop iteration state with identifier "${identifier}" not found.`);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
removeLoopIterationState(identifier) {
|
|
38
|
+
const loopIndex = this.getLoopIndex(identifier);
|
|
39
|
+
if (loopIndex !== -1) {
|
|
40
|
+
this.loopsIterationState.splice(loopIndex, 1);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
this.logger.warn(`Loop iteration state with identifier "${identifier}" not found.`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
exports.LoopsIterationStateHelper = LoopsIterationStateHelper;
|
|
48
|
+
//# sourceMappingURL=loops-iteration-state-helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loops-iteration-state-helper.js","sourceRoot":"","sources":["../../../../../libs/execution-helpers-public/src/lib/loops-iteration-state-helper.ts"],"names":[],"mappings":";;;AAEA,kEAA8D;AAE9D,MAAa,yBAA0B,SAAQ,oCAAgB;IAG7D,YA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AE,CAAC,CAAC,CAAC;QAChD,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,MAAM,CAAC,IAAI,CACd,yCAAyC,UAAU,cAAc,CAClE,CAAC;QACJ,CAAC;IACH,CAAC;CACF;AApDD,8DAoDC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loop-iteration-state.js","sourceRoot":"","sources":["../../../../../libs/execution-helpers-public/src/types/loop-iteration-state.ts"],"names":[],"mappings":""}
|