@perforce-perfecto/scriptless-helpers 1.49.1 → 1.51.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@perforce-perfecto/scriptless-helpers",
3
- "version": "1.49.1",
3
+ "version": "1.51.0",
4
4
  "type": "commonjs",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
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"}
@@ -28,6 +28,7 @@ export type ActionArgument = ConstantActionArgument | VariableActionArgument | D
28
28
  export declare class ActionArgumentsHelper extends ScriptlessHelper {
29
29
  protected securedVariableHelper: SecuredVariableHelper;
30
30
  constructor(securedVariableHelper: SecuredVariableHelper, logger?: Logger);
31
+ shouldUseActionArgument(): boolean;
31
32
  extractAndValidateActionArgumentValue(actionArgument: ActionArgument): string | number | boolean | undefined;
32
33
  extractActionArgumentKeyOrValueAsFallback(actionArgument: ActionArgument): string | number | boolean | DesiredDeviceCapability | undefined;
33
34
  fetchActionArgumentForReporting(actionArgument: ActionArgument): string | number | boolean | DesiredDeviceCapability | undefined;
@@ -12,6 +12,9 @@ class ActionArgumentsHelper extends scriptless_helper_1.ScriptlessHelper {
12
12
  super(logger);
13
13
  this.securedVariableHelper = securedVariableHelper;
14
14
  }
15
+ shouldUseActionArgument() {
16
+ return true;
17
+ }
15
18
  extractAndValidateActionArgumentValue(actionArgument) {
16
19
  let argumentValue;
17
20
  if (actionArgument.dataSource === 'CONSTANT') {
@@ -1 +1 @@
1
- {"version":3,"file":"action-arguments-helper.js","sourceRoot":"","sources":["../../../../../libs/execution-helpers-public/src/lib/action-arguments-helper.ts"],"names":[],"mappings":";;;AAIA,kEAA8D;AAG9D,IAAK,yBAGJ;AAHD,WAAK,yBAAyB;IAC5B,oDAAuB,CAAA;IACvB,8CAAiB,CAAA;AACnB,CAAC,EAHI,yBAAyB,KAAzB,yBAAyB,QAG7B;AA0BD,MAAa,qBAAsB,SAAQ,oCAAgB;IACzD,YACY,qBAA4C,EACtD,MAAe;QAEf,KAAK,CAAC,MAAM,CAAC,CAAC;QAHJ,0BAAqB,GAArB,qBAAqB,CAAuB;IAIxD,CAAC;IAED,qCAAqC,CAAC,cAA8B;QA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Ac,CAAC,UAAU,KAAK,UAAU,IAAI,cAAc,CAAC,OAAO,CAAC;YACpE,CAAC,cAAc,CAAC,UAAU,KAAK,UAAU;gBACvC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC;YAC9B,CAAC,cAAc,CAAC,UAAU,KAAK,WAAW,IAAI,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,EAC1E,CAAC;YACD,OAAO,yBAAyB,CAAC,SAAS,CAAC;QAC7C,CAAC;QACD,OAAO;IACT,CAAC;CACF;AA3DD,sDA2DC"}
1
+ {"version":3,"file":"action-arguments-helper.js","sourceRoot":"","sources":["../../../../../libs/execution-helpers-public/src/lib/action-arguments-helper.ts"],"names":[],"mappings":";;;AAIA,kEAA8D;AAG9D,IAAK,yBAGJ;AAHD,WAAK,yBAAyB;IAC5B,oDAAuB,CAAA;IACvB,8CAAiB,CAAA;AACnB,CAAC,EAHI,yBAAyB,KAAzB,yBAAyB,QAG7B;AA0BD,MAAa,qBAAsB,SAAQ,oCAAgB;IACzD,YACY,qBAA4C,EACtD,MAAe;QAEf,KAAK,CAAC,MAAM,CAAC,CAAC;QAHJ,0BAAqB,GAArB,qBAAqB,CAAuB;IAIxD,CAAC;IAED,uBAAuB;QACrB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,qCAAqC,CAAC,cAA8B;QAClE,IAAI,aAAa,CAAC;QAClB,IAAI,cAAc,CAAC,UAAU,KAAK,UAAU,EAAE,CAAC;YAC7C,IAAI,cAAc,CAAC,OAAO,EAAE,CAAC;gBAC3B,aAAa,GAAG,IAAI,CAAC,qBAAqB,CAAC,oBAAoB,CAC7D,cAAc,CAAC,IAAc,CAC9B,CAAC;YACJ,CAAC;iBAAM,CAAC;gBACN,aAAa,GAAG,cAAc,CAAC,IAAI,CAAC;YACtC,CAAC;QACH,CAAC;aAAM,IACL,cAAc,CAAC,UAAU,KAAK,UAAU;YACxC,cAAc,CAAC,UAAU,KAAK,WAAW,EACzC,CAAC;YACD,aAAa,GAAG,cA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';
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,YAAY,MAAe;QACzB,KAAK,CAAC,MAAM,CAAC,CAAC;QAHR,wBAAmB,GAAyB,EAAE,CAAC;IAIvD,CAAC;IAEO,YAAY,CAAC,UAAkB;QACrC,OAAO,IAAI,CAAC,mBAAmB,CAAC,SAAS,CACvC,CAAC,kBAAkB,EAAE,EAAE,CAAC,kBAAkB,CAAC,UAAU,KAAK,UAAU,CACrE,CAAC;IACJ,CAAC;IAED,sBAAsB;QACpB,OAAO,IAAI,CAAC,mBAAmB,CAAC;IAClC,CAAC;IAED,4BAA4B,CAAC,UAAkB;QAC7C,MAAM,iBAAiB,GAAG,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;QACxD,IAAI,iBAAiB,KAAK,CAAC,CAAC,EAAE,CAAC;YAC7B,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC;gBAC5B,UAAU;gBACV,SAAS,EAAE,CAAC;aACb,CAAC,CAAC;QACL,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,MAAM,CAAC,IAAI,CACd,yCAAyC,UAAU,mBAAmB,CACvE,CAAC;QACJ,CAAC;IACH,CAAC;IAED,qBAAqB,CAAC,UAAkB,EAAE,SAAiB;QACzD,MAAM,SAAS,GAAG,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;QAChD,IAAI,SAAS,KAAK,CAAC,CAAC,EAAE,CAAC;YACrB,IAAI,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC,SAAS,GAAG,SAAS,CAAC;QAC5D,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,MAAM,CAAC,IAAI,CACd,yCAAyC,UAAU,cAAc,CAClE,CAAC;QACJ,CAAC;IACH,CAAC;IAED,wBAAwB,CAAC,UAAkB;QACzC,MAAM,SAAS,GAAG,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;QAChD,IAAI,SAAS,KAAK,CAAC,CAAC,EAAE,CAAC;YACrB,IAAI,CAAC,mBAAmB,CAAC,MAAM,CAAC,SAAS,EAAE,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,4 @@
1
+ export type LoopIterationState = {
2
+ identifier: string;
3
+ iteration: number;
4
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=loop-iteration-state.js.map
@@ -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":""}