@devicecloud.dev/dcd 4.1.2 → 4.1.3
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/dist/commands/cloud.d.ts +26 -34
- package/dist/commands/cloud.js +117 -513
- package/dist/config/flags/api.flags.d.ts +7 -0
- package/dist/config/flags/api.flags.js +19 -0
- package/dist/config/flags/binary.flags.d.ts +8 -0
- package/dist/config/flags/binary.flags.js +20 -0
- package/dist/config/flags/device.flags.d.ts +14 -0
- package/dist/config/flags/device.flags.js +46 -0
- package/dist/config/flags/environment.flags.d.ts +11 -0
- package/dist/config/flags/environment.flags.js +37 -0
- package/dist/config/flags/execution.flags.d.ts +13 -0
- package/dist/config/flags/execution.flags.js +50 -0
- package/dist/config/flags/output.flags.d.ts +18 -0
- package/dist/config/flags/output.flags.js +61 -0
- package/dist/constants.d.ts +28 -24
- package/dist/constants.js +21 -206
- package/dist/gateways/api-gateway.d.ts +3 -3
- package/dist/methods.d.ts +0 -4
- package/dist/methods.js +15 -80
- package/dist/services/device-validation.service.d.ts +29 -0
- package/dist/services/device-validation.service.js +72 -0
- package/dist/{plan.d.ts → services/execution-plan.service.d.ts} +1 -1
- package/dist/{plan.js → services/execution-plan.service.js} +10 -10
- package/dist/{planMethods.js → services/execution-plan.utils.js} +0 -1
- package/dist/services/metadata-extractor.service.d.ts +46 -0
- package/dist/services/metadata-extractor.service.js +138 -0
- package/dist/services/moropo.service.d.ts +20 -0
- package/dist/services/moropo.service.js +113 -0
- package/dist/services/report-download.service.d.ts +40 -0
- package/dist/services/report-download.service.js +110 -0
- package/dist/services/results-polling.service.d.ts +45 -0
- package/dist/services/results-polling.service.js +210 -0
- package/dist/services/test-submission.service.d.ts +41 -0
- package/dist/services/test-submission.service.js +116 -0
- package/dist/services/version.service.d.ts +31 -0
- package/dist/services/version.service.js +81 -0
- package/dist/types/{schema.types.d.ts → generated/schema.types.d.ts} +349 -349
- package/dist/types/index.d.ts +6 -0
- package/dist/types/index.js +24 -0
- package/dist/utils/compatibility.d.ts +5 -0
- package/oclif.manifest.json +195 -209
- package/package.json +2 -9
- /package/dist/{planMethods.d.ts → services/execution-plan.utils.d.ts} +0 -0
- /package/dist/types/{device.types.d.ts → domain/device.types.d.ts} +0 -0
- /package/dist/types/{device.types.js → domain/device.types.js} +0 -0
- /package/dist/types/{schema.types.js → generated/schema.types.js} +0 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { CompatibilityData } from '../utils/compatibility';
|
|
2
|
+
/**
|
|
3
|
+
* Service for handling version validation and checking
|
|
4
|
+
*/
|
|
5
|
+
export declare class VersionService {
|
|
6
|
+
/**
|
|
7
|
+
* Check npm registry for the latest published version of the CLI
|
|
8
|
+
* @returns Latest version string or null if check fails
|
|
9
|
+
*/
|
|
10
|
+
checkLatestCliVersion(): Promise<null | string>;
|
|
11
|
+
/**
|
|
12
|
+
* Compare two semantic version strings
|
|
13
|
+
* @param current - Current version
|
|
14
|
+
* @param latest - Latest version
|
|
15
|
+
* @returns true if current is older than latest
|
|
16
|
+
*/
|
|
17
|
+
isOutdated(current: string, latest: string): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Resolve and validate Maestro version against API compatibility data
|
|
20
|
+
* @param requestedVersion - Version requested by user (or undefined for default)
|
|
21
|
+
* @param compatibilityData - API compatibility data
|
|
22
|
+
* @param debug - Enable debug logging
|
|
23
|
+
* @param logger - Optional logger function
|
|
24
|
+
* @returns Validated Maestro version string
|
|
25
|
+
* @throws Error if version is not supported
|
|
26
|
+
*/
|
|
27
|
+
resolveMaestroVersion(requestedVersion: string | undefined, compatibilityData: CompatibilityData, options?: {
|
|
28
|
+
debug?: boolean;
|
|
29
|
+
logger?: (message: string) => void;
|
|
30
|
+
}): string;
|
|
31
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VersionService = void 0;
|
|
4
|
+
const node_child_process_1 = require("node:child_process");
|
|
5
|
+
/**
|
|
6
|
+
* Service for handling version validation and checking
|
|
7
|
+
*/
|
|
8
|
+
class VersionService {
|
|
9
|
+
/**
|
|
10
|
+
* Check npm registry for the latest published version of the CLI
|
|
11
|
+
* @returns Latest version string or null if check fails
|
|
12
|
+
*/
|
|
13
|
+
async checkLatestCliVersion() {
|
|
14
|
+
try {
|
|
15
|
+
const latestVersion = (0, node_child_process_1.execSync)('npm view @devicecloud.dev/dcd version', {
|
|
16
|
+
encoding: 'utf8',
|
|
17
|
+
stdio: ['ignore', 'pipe', 'ignore'],
|
|
18
|
+
}).trim();
|
|
19
|
+
return latestVersion;
|
|
20
|
+
}
|
|
21
|
+
catch {
|
|
22
|
+
// Silently fail - version check is informational only
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Compare two semantic version strings
|
|
28
|
+
* @param current - Current version
|
|
29
|
+
* @param latest - Latest version
|
|
30
|
+
* @returns true if current is older than latest
|
|
31
|
+
*/
|
|
32
|
+
isOutdated(current, latest) {
|
|
33
|
+
const currentParts = current.split('.').map(Number);
|
|
34
|
+
const latestParts = latest.split('.').map(Number);
|
|
35
|
+
for (let i = 0; i < 3; i++) {
|
|
36
|
+
if (currentParts[i] < latestParts[i])
|
|
37
|
+
return true;
|
|
38
|
+
if (currentParts[i] > latestParts[i])
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Resolve and validate Maestro version against API compatibility data
|
|
45
|
+
* @param requestedVersion - Version requested by user (or undefined for default)
|
|
46
|
+
* @param compatibilityData - API compatibility data
|
|
47
|
+
* @param debug - Enable debug logging
|
|
48
|
+
* @param logger - Optional logger function
|
|
49
|
+
* @returns Validated Maestro version string
|
|
50
|
+
* @throws Error if version is not supported
|
|
51
|
+
*/
|
|
52
|
+
resolveMaestroVersion(requestedVersion, compatibilityData, options) {
|
|
53
|
+
const { debug = false, logger } = options || {};
|
|
54
|
+
const log = logger || console.log;
|
|
55
|
+
const { supportedVersions, defaultVersion, latestVersion } = compatibilityData.maestro;
|
|
56
|
+
// Resolve "latest" to actual latest version from API
|
|
57
|
+
let resolvedVersion = requestedVersion;
|
|
58
|
+
if (requestedVersion === 'latest') {
|
|
59
|
+
resolvedVersion = latestVersion;
|
|
60
|
+
if (debug) {
|
|
61
|
+
log(`DEBUG: Resolved "latest" to ${latestVersion}`);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
else if (!requestedVersion) {
|
|
65
|
+
resolvedVersion = defaultVersion;
|
|
66
|
+
if (debug) {
|
|
67
|
+
log(`DEBUG: Using default Maestro version ${defaultVersion}`);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
// Validate Maestro version
|
|
71
|
+
if (!supportedVersions.includes(resolvedVersion)) {
|
|
72
|
+
throw new Error(`Maestro version ${resolvedVersion} is not supported. Supported versions: ${supportedVersions.join(', ')}`);
|
|
73
|
+
}
|
|
74
|
+
if (debug) {
|
|
75
|
+
log(`DEBUG: Maestro version validated: ${resolvedVersion}`);
|
|
76
|
+
log(`DEBUG: Supported Maestro versions: ${supportedVersions.join(', ')}`);
|
|
77
|
+
}
|
|
78
|
+
return resolvedVersion;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
exports.VersionService = VersionService;
|