@perforce-perfecto/scriptless-helpers-types 0.0.2
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/CLAUDE.md +50 -0
- package/README.md +5 -0
- package/package.json +13 -0
- package/src/index.d.ts +11 -0
- package/src/index.js +15 -0
- package/src/lib/active-script-function-data.d.ts +12 -0
- package/src/lib/active-script-function-data.js +3 -0
- package/src/lib/data-table.d.ts +30 -0
- package/src/lib/data-table.js +3 -0
- package/src/lib/desired-device-capabilities.d.ts +29 -0
- package/src/lib/desired-device-capabilities.js +3 -0
- package/src/lib/execution-cache.d.ts +6 -0
- package/src/lib/execution-cache.js +18 -0
- package/src/lib/file-transfer.d.ts +24 -0
- package/src/lib/file-transfer.js +8 -0
- package/src/lib/logger.d.ts +8 -0
- package/src/lib/logger.js +3 -0
- package/src/lib/loop-iteration-state.d.ts +4 -0
- package/src/lib/loop-iteration-state.js +3 -0
- package/src/lib/perfecto-device-capabilities.d.ts +127 -0
- package/src/lib/perfecto-device-capabilities.js +3 -0
- package/src/lib/scriptless-helper.d.ts +5 -0
- package/src/lib/scriptless-helper.js +10 -0
- package/src/lib/type-utils.d.ts +3 -0
- package/src/lib/type-utils.js +3 -0
- package/src/lib/user-defined-variables.d.ts +11 -0
- package/src/lib/user-defined-variables.js +3 -0
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# shared-types-public
|
|
2
|
+
|
|
3
|
+
Published to npm as `@perforce-perfecto/scriptless-helpers-types` (`scope:public`). This package is consumed by external users — everything in it is fully public.
|
|
4
|
+
|
|
5
|
+
## What belongs here
|
|
6
|
+
|
|
7
|
+
Shared TypeScript types, interfaces, and enums that must be understood by both internal services and external consumers of the public npm package. Examples: execution DTOs, device capability types, data-table structures.
|
|
8
|
+
|
|
9
|
+
## Rules
|
|
10
|
+
|
|
11
|
+
### No sensitive or proprietary content
|
|
12
|
+
Never add to this lib:
|
|
13
|
+
- Internal URLs, hostnames, environment variables, or infrastructure details
|
|
14
|
+
- Credentials, tokens, API keys, or secrets of any kind
|
|
15
|
+
- Business logic, algorithms, or implementation details that are proprietary
|
|
16
|
+
- Internal Perfecto/Perforce system identifiers or configurations
|
|
17
|
+
- Types that expose internal service architecture (e.g. RabbitMQ queue names, S3 bucket shapes, K8s job specs)
|
|
18
|
+
|
|
19
|
+
Only pure type definitions and enums with no runtime logic that reveals internal systems.
|
|
20
|
+
|
|
21
|
+
### Allowed imports only
|
|
22
|
+
This lib has `scope:public` tag. It may only import from other `scope:public` libs.
|
|
23
|
+
|
|
24
|
+
**Allowed:**
|
|
25
|
+
- `tslib`
|
|
26
|
+
- Other `@perforce-perfecto/*` public npm packages
|
|
27
|
+
- Standard TypeScript/Node built-in types
|
|
28
|
+
|
|
29
|
+
**Forbidden:**
|
|
30
|
+
- `@perfectomobiledev/*` — these are internal private packages and must never be imported here
|
|
31
|
+
- Any `scope:private` lib from this monorepo
|
|
32
|
+
- Internal service clients or infrastructure SDKs (AWS, K8s, RabbitMQ, etc.)
|
|
33
|
+
|
|
34
|
+
Nx enforces this via `@nx/enforce-module-boundaries` — a lint error will surface any violation.
|
|
35
|
+
|
|
36
|
+
### PRs touching this lib
|
|
37
|
+
All PRs require a review confirming no proprietary logic, internal URLs, credentials, or internal infrastructure details are exposed.
|
|
38
|
+
|
|
39
|
+
## Build & publish
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
# Build
|
|
43
|
+
npx nx build shared-types-public
|
|
44
|
+
|
|
45
|
+
# Publish (from dist)
|
|
46
|
+
cd dist/libs/shared-types-public
|
|
47
|
+
npm publish --access public
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
The `.npmignore` in this directory excludes `*.js.map` files from the published package.
|
package/README.md
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@perforce-perfecto/scriptless-helpers-types",
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"type": "commonjs",
|
|
5
|
+
"main": "./src/index.js",
|
|
6
|
+
"types": "./src/index.d.ts",
|
|
7
|
+
"dependencies": {
|
|
8
|
+
"tslib": "^2.3.0"
|
|
9
|
+
},
|
|
10
|
+
"publishConfig": {
|
|
11
|
+
"access": "public"
|
|
12
|
+
}
|
|
13
|
+
}
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from './lib/active-script-function-data';
|
|
2
|
+
export * from './lib/scriptless-helper';
|
|
3
|
+
export * from './lib/logger';
|
|
4
|
+
export * from './lib/data-table';
|
|
5
|
+
export * from './lib/type-utils';
|
|
6
|
+
export * from './lib/user-defined-variables';
|
|
7
|
+
export * from './lib/desired-device-capabilities';
|
|
8
|
+
export * from './lib/perfecto-device-capabilities';
|
|
9
|
+
export * from './lib/loop-iteration-state';
|
|
10
|
+
export * from './lib/file-transfer';
|
|
11
|
+
export * from './lib/execution-cache';
|
package/src/index.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./lib/active-script-function-data"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./lib/scriptless-helper"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./lib/logger"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./lib/data-table"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./lib/type-utils"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./lib/user-defined-variables"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./lib/desired-device-capabilities"), exports);
|
|
11
|
+
tslib_1.__exportStar(require("./lib/perfecto-device-capabilities"), exports);
|
|
12
|
+
tslib_1.__exportStar(require("./lib/loop-iteration-state"), exports);
|
|
13
|
+
tslib_1.__exportStar(require("./lib/file-transfer"), exports);
|
|
14
|
+
tslib_1.__exportStar(require("./lib/execution-cache"), exports);
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type ActiveScriptFunctionData = {
|
|
2
|
+
commandStartTime: number;
|
|
3
|
+
actionResult: string | boolean | undefined;
|
|
4
|
+
actionError?: Error;
|
|
5
|
+
errorType: string;
|
|
6
|
+
screenshotData?: unknown[];
|
|
7
|
+
reportResultData: unknown[];
|
|
8
|
+
reportExpectedData: unknown[];
|
|
9
|
+
reportExpectedImage: unknown[];
|
|
10
|
+
actionReportMessage: string;
|
|
11
|
+
reportUxTime: string;
|
|
12
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type DesiredDeviceCapability } from './desired-device-capabilities';
|
|
2
|
+
import { type Replace } from './type-utils';
|
|
3
|
+
type DataType = 'BOOLEAN' | 'INTEGER' | 'STRING' | 'HANDSET' | 'TABLE' | 'MULTIMEDIA' | 'PROPERTY' | 'OBJECT';
|
|
4
|
+
export type ServerDataTableDataType = Exclude<Exclude<DataType, 'TABLE'>, 'PROPERTY'>;
|
|
5
|
+
export type DataTableDataType = ServerDataTableDataType;
|
|
6
|
+
export type ServerTableColumn = {
|
|
7
|
+
name: string;
|
|
8
|
+
type: ServerDataTableDataType;
|
|
9
|
+
};
|
|
10
|
+
export type TableColumn = ServerTableColumn & {
|
|
11
|
+
duplicateName: boolean;
|
|
12
|
+
};
|
|
13
|
+
export type DataTableCellValue = string;
|
|
14
|
+
export type DataTableRow = DataTableCellValue[];
|
|
15
|
+
export type ServerDataTable = {
|
|
16
|
+
elementsData: DataTableRow[];
|
|
17
|
+
columns: ServerTableColumn[];
|
|
18
|
+
};
|
|
19
|
+
export type DataTable = Replace<ServerDataTable, 'columns', TableColumn[]>;
|
|
20
|
+
export type ProcessedDataTableCell = {
|
|
21
|
+
'@type': ServerDataTableDataType;
|
|
22
|
+
secured: boolean;
|
|
23
|
+
value?: string | number | boolean;
|
|
24
|
+
key?: string | DesiredDeviceCapability | null;
|
|
25
|
+
};
|
|
26
|
+
export type ProcessedDataTableRow = {
|
|
27
|
+
[key: string]: ProcessedDataTableCell;
|
|
28
|
+
};
|
|
29
|
+
export type ProcessedDataTable = Array<ProcessedDataTableRow>;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
type SharedDesiredDeviceCapability = {
|
|
2
|
+
deviceSessionId?: string;
|
|
3
|
+
deviceId?: string;
|
|
4
|
+
tunnelId?: string;
|
|
5
|
+
};
|
|
6
|
+
export type DesiredWebDeviceCapability = {
|
|
7
|
+
platformName: string;
|
|
8
|
+
platformVersion: string;
|
|
9
|
+
browserName: string;
|
|
10
|
+
browserVersion: string;
|
|
11
|
+
location: string;
|
|
12
|
+
resolution: string;
|
|
13
|
+
} & SharedDesiredDeviceCapability;
|
|
14
|
+
export type DesiredVirtualDeviceCapability = {
|
|
15
|
+
platformName: string;
|
|
16
|
+
platformVersion: string;
|
|
17
|
+
manufacturer: string;
|
|
18
|
+
model: string;
|
|
19
|
+
useVirtualDevice: boolean;
|
|
20
|
+
} & SharedDesiredDeviceCapability;
|
|
21
|
+
export type DesiredDesktopDeviceCapability = {
|
|
22
|
+
deviceName: string;
|
|
23
|
+
deviceType: 'desktop_app';
|
|
24
|
+
} & SharedDesiredDeviceCapability;
|
|
25
|
+
export type DesiredRealDeviceCapability = {
|
|
26
|
+
deviceName: string;
|
|
27
|
+
} & SharedDesiredDeviceCapability;
|
|
28
|
+
export type DesiredDeviceCapability = DesiredWebDeviceCapability | DesiredVirtualDeviceCapability | DesiredRealDeviceCapability | DesiredDesktopDeviceCapability;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExecutionCacheItemStatus = void 0;
|
|
4
|
+
var ExecutionCacheItemStatus;
|
|
5
|
+
(function (ExecutionCacheItemStatus) {
|
|
6
|
+
/*
|
|
7
|
+
* ExecutionCacheItemStatus values and their usage:
|
|
8
|
+
* Initializing - when the execution is created, i.e. before creating the execution container in ExecutionsService
|
|
9
|
+
* Running - upon receiving the ExecutionStartEvent in ReportingEventsService
|
|
10
|
+
* Terminating - when the execution is cancelled in ExecutionsService
|
|
11
|
+
* Completed - upon receiving the ExecutionProgressEndEvent in ProgressEventsService
|
|
12
|
+
*/
|
|
13
|
+
ExecutionCacheItemStatus["Initializing"] = "Initializing";
|
|
14
|
+
ExecutionCacheItemStatus["Running"] = "Running";
|
|
15
|
+
ExecutionCacheItemStatus["Terminating"] = "Terminating";
|
|
16
|
+
ExecutionCacheItemStatus["Completed"] = "Completed";
|
|
17
|
+
})(ExecutionCacheItemStatus || (exports.ExecutionCacheItemStatus = ExecutionCacheItemStatus = {}));
|
|
18
|
+
//# sourceMappingURL=execution-cache.js.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export type RepositoryArtifactUploadParams = {
|
|
2
|
+
contentType: string;
|
|
3
|
+
artifactType: string;
|
|
4
|
+
folderType: string;
|
|
5
|
+
keyDetails: {
|
|
6
|
+
version: string;
|
|
7
|
+
artifactId: string;
|
|
8
|
+
};
|
|
9
|
+
override: boolean;
|
|
10
|
+
userMetadata: {
|
|
11
|
+
tags: string[];
|
|
12
|
+
};
|
|
13
|
+
hidden: boolean;
|
|
14
|
+
temporary: boolean;
|
|
15
|
+
fileName: string;
|
|
16
|
+
};
|
|
17
|
+
export declare enum RepositoryArtifactType {
|
|
18
|
+
MEDIA = "MEDIA"
|
|
19
|
+
}
|
|
20
|
+
export type RepositoryArtifactDownloadParams = {
|
|
21
|
+
artifactId: string;
|
|
22
|
+
folderType: string;
|
|
23
|
+
repositoryType: RepositoryArtifactType;
|
|
24
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RepositoryArtifactType = void 0;
|
|
4
|
+
var RepositoryArtifactType;
|
|
5
|
+
(function (RepositoryArtifactType) {
|
|
6
|
+
RepositoryArtifactType["MEDIA"] = "MEDIA";
|
|
7
|
+
})(RepositoryArtifactType || (exports.RepositoryArtifactType = RepositoryArtifactType = {}));
|
|
8
|
+
//# sourceMappingURL=file-transfer.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface Logger {
|
|
2
|
+
log(message: unknown, ...optionalParams: unknown[]): void;
|
|
3
|
+
info(message: unknown, ...optionalParams: unknown[]): void;
|
|
4
|
+
warn(message: unknown, ...optionalParams: unknown[]): void;
|
|
5
|
+
debug(message: unknown, ...optionalParams: unknown[]): void;
|
|
6
|
+
profile(id: string, ...optionalParams: unknown[]): void;
|
|
7
|
+
error(message: unknown, errorData?: unknown): void;
|
|
8
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
type JsonString = string;
|
|
2
|
+
type UrlString = string;
|
|
3
|
+
type PerfectoDeviceCapabilityBase = {
|
|
4
|
+
webStorageEnabled: boolean;
|
|
5
|
+
locationContextEnabled: boolean;
|
|
6
|
+
browserName: string;
|
|
7
|
+
platform: JsonString;
|
|
8
|
+
javascriptEnabled: boolean;
|
|
9
|
+
databaseEnabled: boolean;
|
|
10
|
+
takesScreenshot: boolean;
|
|
11
|
+
networkConnectionEnabled: boolean;
|
|
12
|
+
platformName: string;
|
|
13
|
+
deviceName: string;
|
|
14
|
+
platformVersion: string;
|
|
15
|
+
stopUrl: UrlString;
|
|
16
|
+
streamInfo: JsonString;
|
|
17
|
+
userContextStack: JsonString;
|
|
18
|
+
securityToken: string;
|
|
19
|
+
sessionType: string;
|
|
20
|
+
testGridReportUrl: UrlString;
|
|
21
|
+
reportPdfUrl: UrlString;
|
|
22
|
+
executionId: string;
|
|
23
|
+
deviceSessionId: string;
|
|
24
|
+
};
|
|
25
|
+
export type PerfectoRealDeviceCapabilityOptions = {
|
|
26
|
+
deviceName: string;
|
|
27
|
+
securityToken: string;
|
|
28
|
+
'report.parentExecutionId': string;
|
|
29
|
+
sessionType: string;
|
|
30
|
+
cloud: string;
|
|
31
|
+
userContextStack: JsonString;
|
|
32
|
+
};
|
|
33
|
+
export type PerfectoRealDeviceCapability = PerfectoDeviceCapabilityBase & {
|
|
34
|
+
automationName: string;
|
|
35
|
+
xcuitestFindOptimizations: boolean;
|
|
36
|
+
udid: string;
|
|
37
|
+
simpleIsVisibleCheck: boolean;
|
|
38
|
+
bundleId: string;
|
|
39
|
+
assert_javascript_enabled: boolean;
|
|
40
|
+
audioStreamInfo: JsonString;
|
|
41
|
+
entityType: string;
|
|
42
|
+
host: string;
|
|
43
|
+
internalPureAppiumFlow: boolean;
|
|
44
|
+
options: PerfectoRealDeviceCapabilityOptions;
|
|
45
|
+
password: string;
|
|
46
|
+
scriptName: string;
|
|
47
|
+
securePureAppiumFlow: boolean;
|
|
48
|
+
serverConnector: string;
|
|
49
|
+
testRunWithPureAppiumFlow: boolean;
|
|
50
|
+
mcmExecutionId: string;
|
|
51
|
+
};
|
|
52
|
+
export type PerfectoVirtualDeviceCapabilityOptions = {
|
|
53
|
+
platformName: string;
|
|
54
|
+
manufacturer?: string;
|
|
55
|
+
model?: string;
|
|
56
|
+
platformVersion?: string;
|
|
57
|
+
useVirtualDevice?: boolean;
|
|
58
|
+
securityToken: string;
|
|
59
|
+
'report.parentExecutionId': string;
|
|
60
|
+
sessionType: string;
|
|
61
|
+
cloud: string;
|
|
62
|
+
userContextStack: JsonString;
|
|
63
|
+
};
|
|
64
|
+
export type PerfectoVirtualDeviceCapability = PerfectoDeviceCapabilityBase & {
|
|
65
|
+
mjpegServerPort: number;
|
|
66
|
+
simulatorStartupTimeout: number;
|
|
67
|
+
automationName: string;
|
|
68
|
+
udid: string;
|
|
69
|
+
usePrebuiltWDA: boolean;
|
|
70
|
+
'appium:mjpegServerPort': string;
|
|
71
|
+
'appium:simulatorStartupTimeout': number;
|
|
72
|
+
'appium:automationName': string;
|
|
73
|
+
'appium:platformVersion': string;
|
|
74
|
+
manufacturer: string;
|
|
75
|
+
'appium:udid': string;
|
|
76
|
+
'perfecto:options': PerfectoVirtualDeviceCapabilityOptions;
|
|
77
|
+
model: string;
|
|
78
|
+
'appium:deviceName': string;
|
|
79
|
+
useVirtualDevice: boolean;
|
|
80
|
+
'appium:usePrebuiltWDA': boolean;
|
|
81
|
+
};
|
|
82
|
+
export type PerfectoWebDeviceCapabilityChrome = {
|
|
83
|
+
chromedriverVersion: string;
|
|
84
|
+
userDataDir: string;
|
|
85
|
+
};
|
|
86
|
+
export type PerfectoWebDeviceCapabilityTimeouts = {
|
|
87
|
+
implicit: number;
|
|
88
|
+
pageLoad: number;
|
|
89
|
+
script: number;
|
|
90
|
+
};
|
|
91
|
+
export type PerfectoWebDeviceCapability = {
|
|
92
|
+
acceptInsecureCerts: boolean;
|
|
93
|
+
browserName: string;
|
|
94
|
+
browserVersion: string;
|
|
95
|
+
chrome: PerfectoWebDeviceCapabilityChrome;
|
|
96
|
+
'fedcm:accounts': boolean;
|
|
97
|
+
'goog:chromeOptions': {
|
|
98
|
+
debuggerAddress: string;
|
|
99
|
+
};
|
|
100
|
+
'goog:processID': number;
|
|
101
|
+
networkConnectionEnabled: boolean;
|
|
102
|
+
pageLoadStrategy: string;
|
|
103
|
+
platformName: string;
|
|
104
|
+
proxy: Record<string, unknown>;
|
|
105
|
+
'se:bidiEnabled': boolean;
|
|
106
|
+
setWindowRect: boolean;
|
|
107
|
+
strictFileInteractability: boolean;
|
|
108
|
+
timeouts: PerfectoWebDeviceCapabilityTimeouts;
|
|
109
|
+
unhandledPromptBehavior: string;
|
|
110
|
+
'webauthn:extension:credBlob': boolean;
|
|
111
|
+
'webauthn:extension:largeBlob': boolean;
|
|
112
|
+
'webauthn:extension:minPinLength': boolean;
|
|
113
|
+
'webauthn:extension:prf': boolean;
|
|
114
|
+
'webauthn:virtualAuthenticators': boolean;
|
|
115
|
+
stopUrl: UrlString;
|
|
116
|
+
platformVersion: string;
|
|
117
|
+
streamInfo: JsonString;
|
|
118
|
+
location: string;
|
|
119
|
+
resolution: string;
|
|
120
|
+
testGridReportUrl: UrlString;
|
|
121
|
+
reportPdfUrl: UrlString;
|
|
122
|
+
executionId: string;
|
|
123
|
+
platform: JsonString;
|
|
124
|
+
deviceSessionId: string;
|
|
125
|
+
};
|
|
126
|
+
export type PerfectoDeviceCapability = PerfectoRealDeviceCapability | PerfectoVirtualDeviceCapability | PerfectoWebDeviceCapability;
|
|
127
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ScriptlessHelper = void 0;
|
|
4
|
+
class ScriptlessHelper {
|
|
5
|
+
constructor(logger) {
|
|
6
|
+
this.logger = logger || console;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
exports.ScriptlessHelper = ScriptlessHelper;
|
|
10
|
+
//# sourceMappingURL=scriptless-helper.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DesiredDeviceCapability } from './desired-device-capabilities';
|
|
2
|
+
export type VariableDataType = 'BooleanData' | 'HandsetData' | 'IntegerData' | 'MediaData' | 'StringData' | 'TableData' | 'UrlData';
|
|
3
|
+
export type UserDefinedVariables = {
|
|
4
|
+
[variableName: string]: UserDefinedVariable;
|
|
5
|
+
};
|
|
6
|
+
export type UserDefinedVariable = {
|
|
7
|
+
value: string;
|
|
8
|
+
secured: boolean;
|
|
9
|
+
'@type': VariableDataType;
|
|
10
|
+
key?: DesiredDeviceCapability;
|
|
11
|
+
};
|