@perforce-perfecto/scriptless-helpers 1.76.5 → 1.76.7
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,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@perforce-perfecto/scriptless-helpers",
|
|
3
|
-
"version": "1.76.
|
|
3
|
+
"version": "1.76.7",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"types": "./src/index.d.ts",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@perforce-perfecto/scriptless-helpers-types": "1.76.
|
|
8
|
+
"@perforce-perfecto/scriptless-helpers-types": "1.76.7",
|
|
9
9
|
"tslib": "^2.3.0",
|
|
10
10
|
"webdriverio": "^9.27.0",
|
|
11
11
|
"axios": "^1.18.0",
|
|
@@ -81,7 +81,14 @@ class DataTableHelper extends scriptless_helpers_types_1.ScriptlessHelper {
|
|
|
81
81
|
return `${this.getNativeAutomationServiceBaseUrl(tenantName)}/datatable`;
|
|
82
82
|
}
|
|
83
83
|
getNativeAutomationServiceBaseUrl(tenantName) {
|
|
84
|
-
|
|
84
|
+
const urlTemplate = process.env['NATIVE_AUTOMATION_URL'];
|
|
85
|
+
if (!urlTemplate) {
|
|
86
|
+
throw new Error('NATIVE_AUTOMATION_URL is not set');
|
|
87
|
+
}
|
|
88
|
+
if (!urlTemplate.includes('{tenantId}')) {
|
|
89
|
+
throw new Error('NATIVE_AUTOMATION_URL must include the {tenantId} placeholder');
|
|
90
|
+
}
|
|
91
|
+
return urlTemplate.replace('{tenantId}', tenantName);
|
|
85
92
|
}
|
|
86
93
|
}
|
|
87
94
|
exports.DataTableHelper = DataTableHelper;
|
|
@@ -85,7 +85,14 @@ class HandsetSelectHelper extends scriptless_helpers_types_1.ScriptlessHelper {
|
|
|
85
85
|
getHandsets(deviceQuery) {
|
|
86
86
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
87
87
|
var _a, _b;
|
|
88
|
-
const
|
|
88
|
+
const deviceManagementUrl = process.env['DEVICE_MANAGEMENT_URL'];
|
|
89
|
+
if (!deviceManagementUrl) {
|
|
90
|
+
throw new Error('DEVICE_MANAGEMENT_URL is not set');
|
|
91
|
+
}
|
|
92
|
+
if (!deviceManagementUrl.includes('{tenantId}')) {
|
|
93
|
+
throw new Error('DEVICE_MANAGEMENT_URL must include the {tenantId} placeholder');
|
|
94
|
+
}
|
|
95
|
+
const response = yield axios_1.default.post(deviceManagementUrl.replace('{tenantId}', this.constantsHelperClass.getShortTenantId()), {
|
|
89
96
|
device: deviceQuery
|
|
90
97
|
}, {
|
|
91
98
|
headers: this.constantsHelperClass.getPerfectoAuthHeaders()
|