@devicecloud.dev/dcd 4.1.5 → 4.1.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/dist/commands/cloud.js +48 -44
- package/dist/commands/status.d.ts +0 -1
- package/dist/commands/status.js +10 -33
- package/dist/commands/upload.d.ts +1 -0
- package/dist/commands/upload.js +11 -9
- package/dist/config/flags/execution.flags.js +1 -1
- package/dist/gateways/api-gateway.d.ts +18 -2
- package/dist/gateways/api-gateway.js +18 -4
- package/dist/gateways/supabase-gateway.d.ts +1 -1
- package/dist/gateways/supabase-gateway.js +68 -9
- package/dist/methods.d.ts +1 -1
- package/dist/methods.js +467 -27
- package/dist/services/results-polling.service.d.ts +30 -0
- package/dist/services/results-polling.service.js +167 -71
- package/dist/services/test-submission.service.js +11 -0
- package/dist/types/generated/schema.types.d.ts +15 -0
- package/dist/types/schema.types.d.ts +1523 -0
- package/dist/types/schema.types.js +3 -0
- package/dist/utils/styling.d.ts +106 -0
- package/dist/utils/styling.js +166 -0
- package/oclif.manifest.json +8 -2
- package/package.json +16 -15
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import chalk = require('chalk');
|
|
2
|
+
/**
|
|
3
|
+
* Centralized styling utilities for CLI output
|
|
4
|
+
* Provides consistent, developer-friendly visual formatting
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Status symbols with associated colors
|
|
8
|
+
*/
|
|
9
|
+
export declare const symbols: {
|
|
10
|
+
readonly cancelled: string;
|
|
11
|
+
readonly error: string;
|
|
12
|
+
readonly info: string;
|
|
13
|
+
readonly pending: string;
|
|
14
|
+
readonly running: string;
|
|
15
|
+
readonly success: string;
|
|
16
|
+
readonly unknown: string;
|
|
17
|
+
readonly warning: string;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Color utility functions for semantic styling
|
|
21
|
+
*/
|
|
22
|
+
export declare const colors: {
|
|
23
|
+
readonly bold: chalk.Chalk;
|
|
24
|
+
readonly dim: chalk.Chalk;
|
|
25
|
+
readonly error: chalk.Chalk;
|
|
26
|
+
readonly highlight: chalk.Chalk;
|
|
27
|
+
readonly info: chalk.Chalk;
|
|
28
|
+
readonly success: chalk.Chalk;
|
|
29
|
+
readonly url: chalk.Chalk;
|
|
30
|
+
readonly warning: chalk.Chalk;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Dividers for visual separation
|
|
34
|
+
*/
|
|
35
|
+
export declare const dividers: {
|
|
36
|
+
readonly heavy: string;
|
|
37
|
+
readonly light: string;
|
|
38
|
+
readonly short: string;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Format a status with appropriate symbol and color
|
|
42
|
+
* @param status - The status string to format
|
|
43
|
+
* @returns Formatted status string with color and symbol
|
|
44
|
+
*/
|
|
45
|
+
export declare function formatStatus(status: string): string;
|
|
46
|
+
/**
|
|
47
|
+
* Format a section header
|
|
48
|
+
* @param title - The title of the section
|
|
49
|
+
* @returns Formatted section header
|
|
50
|
+
*/
|
|
51
|
+
export declare function sectionHeader(title: string): string;
|
|
52
|
+
/**
|
|
53
|
+
* Format a key-value pair with optional icon
|
|
54
|
+
* @param icon - Icon to display before the key
|
|
55
|
+
* @param key - The key name
|
|
56
|
+
* @param value - The value to display
|
|
57
|
+
* @returns Formatted key-value string
|
|
58
|
+
*/
|
|
59
|
+
export declare function keyValue(icon: string, key: string, value: string): string;
|
|
60
|
+
/**
|
|
61
|
+
* Format a list item
|
|
62
|
+
* @param text - The text of the list item
|
|
63
|
+
* @param prefix - The prefix character (default: '•')
|
|
64
|
+
* @returns Formatted list item
|
|
65
|
+
*/
|
|
66
|
+
export declare function listItem(text: string, prefix?: string): string;
|
|
67
|
+
/**
|
|
68
|
+
* Format a URL
|
|
69
|
+
* @param url - The URL to format
|
|
70
|
+
* @returns Formatted URL with styling
|
|
71
|
+
*/
|
|
72
|
+
export declare function formatUrl(url: string): string;
|
|
73
|
+
/**
|
|
74
|
+
* Format an ID or identifier
|
|
75
|
+
* @param id - The ID to format
|
|
76
|
+
* @returns Formatted ID with highlighting
|
|
77
|
+
*/
|
|
78
|
+
export declare function formatId(id: string): string;
|
|
79
|
+
/**
|
|
80
|
+
* Format a test summary line
|
|
81
|
+
* @param summary - Object containing test counts
|
|
82
|
+
* @returns Formatted summary string
|
|
83
|
+
*/
|
|
84
|
+
export declare function formatTestSummary(summary: {
|
|
85
|
+
completed: number;
|
|
86
|
+
failed: number;
|
|
87
|
+
passed: number;
|
|
88
|
+
pending: number;
|
|
89
|
+
running: number;
|
|
90
|
+
total: number;
|
|
91
|
+
}): string;
|
|
92
|
+
/**
|
|
93
|
+
* Format a box with content
|
|
94
|
+
* @param content - The content to display in the box
|
|
95
|
+
* @returns Formatted box with borders
|
|
96
|
+
*/
|
|
97
|
+
export declare function box(content: string): string;
|
|
98
|
+
/**
|
|
99
|
+
* Generate console URL based on API URL
|
|
100
|
+
* If a non-default API URL is used, prepends "dev." to the console subdomain
|
|
101
|
+
* @param apiUrl - The API URL being used
|
|
102
|
+
* @param uploadId - The upload ID
|
|
103
|
+
* @param resultId - The result ID
|
|
104
|
+
* @returns The appropriate console URL
|
|
105
|
+
*/
|
|
106
|
+
export declare function getConsoleUrl(apiUrl: string, uploadId: number | string, resultId: number | string): string;
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.dividers = exports.colors = exports.symbols = void 0;
|
|
4
|
+
exports.formatStatus = formatStatus;
|
|
5
|
+
exports.sectionHeader = sectionHeader;
|
|
6
|
+
exports.keyValue = keyValue;
|
|
7
|
+
exports.listItem = listItem;
|
|
8
|
+
exports.formatUrl = formatUrl;
|
|
9
|
+
exports.formatId = formatId;
|
|
10
|
+
exports.formatTestSummary = formatTestSummary;
|
|
11
|
+
exports.box = box;
|
|
12
|
+
exports.getConsoleUrl = getConsoleUrl;
|
|
13
|
+
const chalk = require("chalk");
|
|
14
|
+
/**
|
|
15
|
+
* Centralized styling utilities for CLI output
|
|
16
|
+
* Provides consistent, developer-friendly visual formatting
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* Status symbols with associated colors
|
|
20
|
+
*/
|
|
21
|
+
exports.symbols = {
|
|
22
|
+
cancelled: chalk.gray('⊘'),
|
|
23
|
+
error: chalk.red('✗'),
|
|
24
|
+
info: chalk.blue('ℹ'),
|
|
25
|
+
pending: chalk.yellow('⏸'),
|
|
26
|
+
running: chalk.blue('▶'),
|
|
27
|
+
success: chalk.green('✓'),
|
|
28
|
+
unknown: chalk.gray('?'),
|
|
29
|
+
warning: chalk.yellow('⚠'),
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Color utility functions for semantic styling
|
|
33
|
+
*/
|
|
34
|
+
exports.colors = {
|
|
35
|
+
bold: chalk.bold,
|
|
36
|
+
dim: chalk.gray,
|
|
37
|
+
error: chalk.red,
|
|
38
|
+
highlight: chalk.cyan,
|
|
39
|
+
info: chalk.blue,
|
|
40
|
+
success: chalk.green,
|
|
41
|
+
url: chalk.cyan.underline,
|
|
42
|
+
warning: chalk.yellow,
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Dividers for visual separation
|
|
46
|
+
*/
|
|
47
|
+
exports.dividers = {
|
|
48
|
+
heavy: chalk.gray('═'.repeat(80)),
|
|
49
|
+
light: chalk.gray('─'.repeat(80)),
|
|
50
|
+
short: chalk.gray('─'.repeat(40)),
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Format a status with appropriate symbol and color
|
|
54
|
+
* @param status - The status string to format
|
|
55
|
+
* @returns Formatted status string with color and symbol
|
|
56
|
+
*/
|
|
57
|
+
function formatStatus(status) {
|
|
58
|
+
const statusUpper = status.toUpperCase();
|
|
59
|
+
switch (statusUpper) {
|
|
60
|
+
case 'PASSED': {
|
|
61
|
+
return `${exports.symbols.success} ${exports.colors.success(status)}`;
|
|
62
|
+
}
|
|
63
|
+
case 'FAILED': {
|
|
64
|
+
return `${exports.symbols.error} ${exports.colors.error(status)}`;
|
|
65
|
+
}
|
|
66
|
+
case 'RUNNING': {
|
|
67
|
+
return `${exports.symbols.running} ${exports.colors.info(status)}`;
|
|
68
|
+
}
|
|
69
|
+
case 'PENDING': {
|
|
70
|
+
return `${exports.symbols.pending} ${exports.colors.warning(status)}`;
|
|
71
|
+
}
|
|
72
|
+
case 'CANCELLED': {
|
|
73
|
+
return `${exports.symbols.cancelled} ${exports.colors.dim(status)}`;
|
|
74
|
+
}
|
|
75
|
+
default: {
|
|
76
|
+
return `${exports.symbols.unknown} ${exports.colors.dim(status)}`;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Format a section header
|
|
82
|
+
* @param title - The title of the section
|
|
83
|
+
* @returns Formatted section header
|
|
84
|
+
*/
|
|
85
|
+
function sectionHeader(title) {
|
|
86
|
+
return `\n${exports.colors.bold(title)}\n${exports.dividers.light}`;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Format a key-value pair with optional icon
|
|
90
|
+
* @param icon - Icon to display before the key
|
|
91
|
+
* @param key - The key name
|
|
92
|
+
* @param value - The value to display
|
|
93
|
+
* @returns Formatted key-value string
|
|
94
|
+
*/
|
|
95
|
+
function keyValue(icon, key, value) {
|
|
96
|
+
return `${icon} ${exports.colors.dim(key + ':')} ${exports.colors.highlight(value)}`;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Format a list item
|
|
100
|
+
* @param text - The text of the list item
|
|
101
|
+
* @param prefix - The prefix character (default: '•')
|
|
102
|
+
* @returns Formatted list item
|
|
103
|
+
*/
|
|
104
|
+
function listItem(text, prefix = '•') {
|
|
105
|
+
return `${exports.colors.dim(prefix)} ${text}`;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Format a URL
|
|
109
|
+
* @param url - The URL to format
|
|
110
|
+
* @returns Formatted URL with styling
|
|
111
|
+
*/
|
|
112
|
+
function formatUrl(url) {
|
|
113
|
+
return exports.colors.url(url);
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Format an ID or identifier
|
|
117
|
+
* @param id - The ID to format
|
|
118
|
+
* @returns Formatted ID with highlighting
|
|
119
|
+
*/
|
|
120
|
+
function formatId(id) {
|
|
121
|
+
return exports.colors.highlight(id);
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Format a test summary line
|
|
125
|
+
* @param summary - Object containing test counts
|
|
126
|
+
* @returns Formatted summary string
|
|
127
|
+
*/
|
|
128
|
+
function formatTestSummary(summary) {
|
|
129
|
+
const parts = [
|
|
130
|
+
chalk.bold(`${summary.completed}/${summary.total}`),
|
|
131
|
+
exports.colors.success(`✓ ${summary.passed}`),
|
|
132
|
+
exports.colors.error(`✗ ${summary.failed}`),
|
|
133
|
+
exports.colors.info(`▶ ${summary.running}`),
|
|
134
|
+
exports.colors.warning(`⏸ ${summary.pending}`),
|
|
135
|
+
];
|
|
136
|
+
return parts.join(' │ ');
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Format a box with content
|
|
140
|
+
* @param content - The content to display in the box
|
|
141
|
+
* @returns Formatted box with borders
|
|
142
|
+
*/
|
|
143
|
+
function box(content) {
|
|
144
|
+
const lines = content.split('\n');
|
|
145
|
+
const maxLength = Math.max(...lines.map((l) => l.length));
|
|
146
|
+
const top = chalk.gray('┌' + '─'.repeat(maxLength + 2) + '┐');
|
|
147
|
+
const bottom = chalk.gray('└' + '─'.repeat(maxLength + 2) + '┘');
|
|
148
|
+
const middle = lines
|
|
149
|
+
.map((line) => chalk.gray('│ ') + line.padEnd(maxLength) + chalk.gray(' │'))
|
|
150
|
+
.join('\n');
|
|
151
|
+
return `${top}\n${middle}\n${bottom}`;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Generate console URL based on API URL
|
|
155
|
+
* If a non-default API URL is used, prepends "dev." to the console subdomain
|
|
156
|
+
* @param apiUrl - The API URL being used
|
|
157
|
+
* @param uploadId - The upload ID
|
|
158
|
+
* @param resultId - The result ID
|
|
159
|
+
* @returns The appropriate console URL
|
|
160
|
+
*/
|
|
161
|
+
function getConsoleUrl(apiUrl, uploadId, resultId) {
|
|
162
|
+
const DEFAULT_API_URL = 'https://api.devicecloud.dev';
|
|
163
|
+
const isDefaultApi = apiUrl === DEFAULT_API_URL;
|
|
164
|
+
const consoleSubdomain = isDefaultApi ? 'console' : 'dev.console';
|
|
165
|
+
return `https://${consoleSubdomain}.devicecloud.dev/results?upload=${uploadId}&result=${resultId}`;
|
|
166
|
+
}
|
package/oclif.manifest.json
CHANGED
|
@@ -286,7 +286,7 @@
|
|
|
286
286
|
"type": "option"
|
|
287
287
|
},
|
|
288
288
|
"runner-type": {
|
|
289
|
-
"description": "[experimental] The type of runner to use - note: anything other than default will incur premium pricing tiers, see https://docs.devicecloud.dev/reference/runner-type for more information.
|
|
289
|
+
"description": "[experimental] The type of runner to use - note: anything other than default or cpu1 will incur premium pricing tiers, see https://docs.devicecloud.dev/reference/runner-type for more information.",
|
|
290
290
|
"name": "runner-type",
|
|
291
291
|
"default": "default",
|
|
292
292
|
"hasDynamicHelp": false,
|
|
@@ -543,6 +543,12 @@
|
|
|
543
543
|
"multiple": false,
|
|
544
544
|
"type": "option"
|
|
545
545
|
},
|
|
546
|
+
"debug": {
|
|
547
|
+
"description": "Enable detailed debug logging for troubleshooting issues",
|
|
548
|
+
"name": "debug",
|
|
549
|
+
"allowNo": false,
|
|
550
|
+
"type": "boolean"
|
|
551
|
+
},
|
|
546
552
|
"ignore-sha-check": {
|
|
547
553
|
"description": "Ignore the sha hash check and upload the binary regardless of whether it already exists (not recommended)",
|
|
548
554
|
"name": "ignore-sha-check",
|
|
@@ -566,5 +572,5 @@
|
|
|
566
572
|
]
|
|
567
573
|
}
|
|
568
574
|
},
|
|
569
|
-
"version": "4.1.
|
|
575
|
+
"version": "4.1.7"
|
|
570
576
|
}
|
package/package.json
CHANGED
|
@@ -4,38 +4,39 @@
|
|
|
4
4
|
"dcd": "bin/run.js"
|
|
5
5
|
},
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@oclif/core": "^3",
|
|
8
|
-
"@oclif/plugin-help": "^6",
|
|
9
|
-
"@supabase/supabase-js": "^2.
|
|
7
|
+
"@oclif/core": "^3.27.0",
|
|
8
|
+
"@oclif/plugin-help": "^6.2.36",
|
|
9
|
+
"@supabase/supabase-js": "^2.81.1",
|
|
10
10
|
"app-info-parser": "^1.1.6",
|
|
11
11
|
"archiver": "^7.0.1",
|
|
12
12
|
"bplist-parser": "^0.3.2",
|
|
13
|
-
"
|
|
14
|
-
"
|
|
13
|
+
"chalk": "4.1.2",
|
|
14
|
+
"glob": "^11.1.0",
|
|
15
|
+
"js-yaml": "^4.1.1",
|
|
15
16
|
"node-stream-zip": "^1.15.0",
|
|
16
17
|
"plist": "^3.1.0"
|
|
17
18
|
},
|
|
18
19
|
"description": "Better cloud maestro testing",
|
|
19
20
|
"devDependencies": {
|
|
20
21
|
"@oclif/prettier-config": "^0.2.1",
|
|
21
|
-
"@oclif/test": "^4.1.
|
|
22
|
-
"@types/archiver": "^6.0.
|
|
23
|
-
"@types/chai": "^5.2.
|
|
22
|
+
"@oclif/test": "^4.1.15",
|
|
23
|
+
"@types/archiver": "^6.0.4",
|
|
24
|
+
"@types/chai": "^5.2.3",
|
|
24
25
|
"@types/glob-to-regexp": "^0.4.4",
|
|
25
26
|
"@types/js-yaml": "^4.0.9",
|
|
26
27
|
"@types/mocha": "^10.0.10",
|
|
27
|
-
"@types/node": "^24.1
|
|
28
|
+
"@types/node": "^24.10.1",
|
|
28
29
|
"@types/plist": "^3.0.5",
|
|
29
|
-
"chai": "^5.
|
|
30
|
+
"chai": "^5.3.3",
|
|
30
31
|
"eslint": "^8.57.1",
|
|
31
32
|
"eslint-config-oclif": "^5.2.2",
|
|
32
|
-
"eslint-config-oclif-typescript": "^3",
|
|
33
|
+
"eslint-config-oclif-typescript": "^3.1.14",
|
|
33
34
|
"eslint-config-prettier": "^10.1.8",
|
|
34
|
-
"mocha": "^11.7.
|
|
35
|
-
"oclif": "^4.22.
|
|
35
|
+
"mocha": "^11.7.5",
|
|
36
|
+
"oclif": "^4.22.47",
|
|
36
37
|
"shx": "^0.4.0",
|
|
37
38
|
"ts-node": "^10.9.2",
|
|
38
|
-
"typescript": "^5.9.
|
|
39
|
+
"typescript": "^5.9.3"
|
|
39
40
|
},
|
|
40
41
|
"engines": {
|
|
41
42
|
"node": ">=22.0.0"
|
|
@@ -65,7 +66,7 @@
|
|
|
65
66
|
"type": "git",
|
|
66
67
|
"url": "https://devicecloud.dev"
|
|
67
68
|
},
|
|
68
|
-
"version": "4.1.
|
|
69
|
+
"version": "4.1.7",
|
|
69
70
|
"bugs": {
|
|
70
71
|
"url": "https://discord.gg/gm3mJwcNw8"
|
|
71
72
|
},
|