@devicecloud.dev/dcd 5.0.0-beta.0 → 5.0.0-beta.1
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/README.md +35 -0
- package/dist/commands/artifacts.d.ts +28 -28
- package/dist/commands/artifacts.js +20 -23
- package/dist/commands/cloud.d.ts +57 -57
- package/dist/commands/cloud.js +173 -186
- package/dist/commands/list.d.ts +22 -22
- package/dist/commands/list.js +36 -38
- package/dist/commands/live.js +134 -127
- package/dist/commands/login.d.ts +11 -11
- package/dist/commands/login.js +46 -44
- package/dist/commands/logout.js +16 -18
- package/dist/commands/status.d.ts +11 -11
- package/dist/commands/status.js +45 -43
- package/dist/commands/switch-org.d.ts +7 -7
- package/dist/commands/switch-org.js +19 -21
- package/dist/commands/upgrade.js +29 -31
- package/dist/commands/upload.d.ts +10 -10
- package/dist/commands/upload.js +42 -43
- package/dist/commands/whoami.js +17 -20
- package/dist/config/environments.js +6 -12
- package/dist/config/flags/api.flags.js +1 -4
- package/dist/config/flags/binary.flags.js +1 -4
- package/dist/config/flags/device.flags.js +6 -9
- package/dist/config/flags/environment.flags.js +1 -4
- package/dist/config/flags/execution.flags.js +1 -4
- package/dist/config/flags/github.flags.js +1 -4
- package/dist/config/flags/output.flags.js +1 -4
- package/dist/constants.js +15 -18
- package/dist/gateways/api-gateway.d.ts +31 -6
- package/dist/gateways/api-gateway.js +70 -16
- package/dist/gateways/cli-auth-gateway.d.ts +1 -1
- package/dist/gateways/cli-auth-gateway.js +3 -6
- package/dist/gateways/realtime-gateway.d.ts +32 -0
- package/dist/gateways/realtime-gateway.js +103 -0
- package/dist/gateways/supabase-gateway.d.ts +1 -1
- package/dist/gateways/supabase-gateway.js +10 -14
- package/dist/index.js +41 -38
- package/dist/mcp/context.d.ts +33 -0
- package/dist/mcp/context.js +33 -0
- package/dist/mcp/helpers.d.ts +16 -0
- package/dist/mcp/helpers.js +34 -0
- package/dist/mcp/index.d.ts +2 -0
- package/dist/mcp/index.js +24 -0
- package/dist/mcp/server.d.ts +7 -0
- package/dist/mcp/server.js +27 -0
- package/dist/mcp/tools/download-artifacts.d.ts +11 -0
- package/dist/mcp/tools/download-artifacts.js +84 -0
- package/dist/mcp/tools/get-status.d.ts +7 -0
- package/dist/mcp/tools/get-status.js +39 -0
- package/dist/mcp/tools/list-devices.d.ts +7 -0
- package/dist/mcp/tools/list-devices.js +27 -0
- package/dist/mcp/tools/list-runs.d.ts +3 -0
- package/dist/mcp/tools/list-runs.js +60 -0
- package/dist/mcp/tools/run-cloud-test.d.ts +14 -0
- package/dist/mcp/tools/run-cloud-test.js +233 -0
- package/dist/methods.d.ts +32 -1
- package/dist/methods.js +125 -66
- package/dist/services/device-validation.service.d.ts +1 -1
- package/dist/services/device-validation.service.js +1 -5
- package/dist/services/execution-plan.service.js +14 -17
- package/dist/services/execution-plan.utils.js +15 -23
- package/dist/services/flow-paths.d.ts +17 -0
- package/dist/services/flow-paths.js +52 -0
- package/dist/services/metadata-extractor.service.js +22 -25
- package/dist/services/moropo.service.js +18 -20
- package/dist/services/report-download.service.d.ts +1 -1
- package/dist/services/report-download.service.js +5 -9
- package/dist/services/results-polling.service.d.ts +18 -3
- package/dist/services/results-polling.service.js +195 -108
- package/dist/services/telemetry.service.d.ts +10 -1
- package/dist/services/telemetry.service.js +40 -18
- package/dist/services/test-submission.service.d.ts +21 -4
- package/dist/services/test-submission.service.js +51 -34
- package/dist/services/version.service.d.ts +1 -1
- package/dist/services/version.service.js +1 -5
- package/dist/types/domain/auth.types.d.ts +8 -0
- package/dist/types/domain/auth.types.js +1 -2
- package/dist/types/domain/device.types.js +8 -11
- package/dist/types/domain/live.types.js +1 -2
- package/dist/types/generated/schema.types.js +1 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.js +2 -18
- package/dist/types.js +1 -2
- package/dist/utils/auth.d.ts +1 -1
- package/dist/utils/auth.js +27 -28
- package/dist/utils/ci.d.ts +12 -0
- package/dist/utils/ci.js +39 -0
- package/dist/utils/cli.js +18 -27
- package/dist/utils/compatibility.d.ts +1 -1
- package/dist/utils/compatibility.js +5 -7
- package/dist/utils/config-store.js +33 -43
- package/dist/utils/connectivity.js +1 -4
- package/dist/utils/expo.js +15 -21
- package/dist/utils/orgs.js +8 -12
- package/dist/utils/paths.js +2 -5
- package/dist/utils/progress.js +2 -5
- package/dist/utils/styling.d.ts +35 -37
- package/dist/utils/styling.js +52 -86
- package/dist/utils/ui.d.ts +41 -0
- package/dist/utils/ui.js +95 -0
- package/package.json +27 -24
package/dist/commands/list.d.ts
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
export declare const listCommand: import("citty").CommandDef<{
|
|
2
|
-
from: {
|
|
3
|
-
type: "string";
|
|
4
|
-
description:
|
|
2
|
+
readonly from: {
|
|
3
|
+
readonly type: "string";
|
|
4
|
+
readonly description: "Filter uploads created on or after this date (ISO 8601 format, e.g., 2024-01-01)";
|
|
5
5
|
};
|
|
6
|
-
json: {
|
|
7
|
-
type: "boolean";
|
|
8
|
-
description:
|
|
6
|
+
readonly json: {
|
|
7
|
+
readonly type: "boolean";
|
|
8
|
+
readonly description: "Output in JSON format";
|
|
9
9
|
};
|
|
10
|
-
limit: {
|
|
11
|
-
type: "string";
|
|
12
|
-
default:
|
|
13
|
-
description:
|
|
10
|
+
readonly limit: {
|
|
11
|
+
readonly type: "string";
|
|
12
|
+
readonly default: "20";
|
|
13
|
+
readonly description: "Maximum number of uploads to return";
|
|
14
14
|
};
|
|
15
|
-
name: {
|
|
16
|
-
type: "string";
|
|
17
|
-
description:
|
|
15
|
+
readonly name: {
|
|
16
|
+
readonly type: "string";
|
|
17
|
+
readonly description: "Filter by upload name (supports * wildcard, e.g., \"nightly-*\"). IMPORTANT: Always quote wildcards to prevent shell expansion!";
|
|
18
18
|
};
|
|
19
|
-
offset: {
|
|
20
|
-
type: "string";
|
|
21
|
-
default:
|
|
22
|
-
description:
|
|
19
|
+
readonly offset: {
|
|
20
|
+
readonly type: "string";
|
|
21
|
+
readonly default: "0";
|
|
22
|
+
readonly description: "Number of uploads to skip (for pagination)";
|
|
23
23
|
};
|
|
24
|
-
to: {
|
|
25
|
-
type: "string";
|
|
26
|
-
description:
|
|
24
|
+
readonly to: {
|
|
25
|
+
readonly type: "string";
|
|
26
|
+
readonly description: "Filter uploads created on or before this date (ISO 8601 format, e.g., 2024-01-31)";
|
|
27
27
|
};
|
|
28
|
-
'api-key': {
|
|
28
|
+
readonly 'api-key': {
|
|
29
29
|
readonly type: "string";
|
|
30
30
|
readonly alias: ["apiKey"];
|
|
31
31
|
readonly description: "API key for devicecloud.dev (find this in the console UI). You can also set the DEVICE_CLOUD_API_KEY environment variable.";
|
|
32
32
|
};
|
|
33
|
-
'api-url': {
|
|
33
|
+
readonly 'api-url': {
|
|
34
34
|
readonly type: "string";
|
|
35
35
|
readonly alias: ["apiURL", "apiUrl"];
|
|
36
36
|
readonly description: "API base URL (defaults to the URL stored by `dcd login`, else prod)";
|
package/dist/commands/list.js
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const config_store_1 = require("../utils/config-store");
|
|
10
|
-
const styling_1 = require("../utils/styling");
|
|
1
|
+
import { defineCommand } from 'citty';
|
|
2
|
+
import { apiFlags } from '../config/flags/api.flags.js';
|
|
3
|
+
import { ApiGateway } from '../gateways/api-gateway.js';
|
|
4
|
+
import { resolveAuth } from '../utils/auth.js';
|
|
5
|
+
import { CliError, logger, parseIntFlag } from '../utils/cli.js';
|
|
6
|
+
import { resolveApiUrl } from '../utils/config-store.js';
|
|
7
|
+
import { colors, formatId, formatUrl } from '../utils/styling.js';
|
|
8
|
+
import { ui } from '../utils/ui.js';
|
|
11
9
|
function detectShellExpansion(name) {
|
|
12
10
|
const indicators = [
|
|
13
11
|
name.includes('/') || name.includes('\\'),
|
|
@@ -15,7 +13,7 @@ function detectShellExpansion(name) {
|
|
|
15
13
|
name.includes(' ') && !name.includes('*') && !name.includes('?'),
|
|
16
14
|
];
|
|
17
15
|
if (indicators.some(Boolean)) {
|
|
18
|
-
|
|
16
|
+
logger.warn(`\nThe --name parameter appears to have been expanded by your shell: "${name}"\n` +
|
|
19
17
|
'Wildcards like * should be quoted to prevent shell expansion.\n' +
|
|
20
18
|
'Examples:\n' +
|
|
21
19
|
' ✓ Correct: dcd list --name "nightly-*"\n' +
|
|
@@ -26,15 +24,12 @@ function detectShellExpansion(name) {
|
|
|
26
24
|
function displayResults(response) {
|
|
27
25
|
const { uploads, total, limit, offset } = response;
|
|
28
26
|
if (uploads.length === 0) {
|
|
29
|
-
|
|
27
|
+
logger.log(ui.info('No uploads found matching your criteria.'));
|
|
30
28
|
return;
|
|
31
29
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
cli_1.logger.log(` ${styling_1.colors.dim('(offset:')} ${offset}${styling_1.colors.dim(')')}`);
|
|
36
|
-
}
|
|
37
|
-
cli_1.logger.log('');
|
|
30
|
+
const offsetNote = offset > 0 ? colors.dim(`, offset ${offset}`) : '';
|
|
31
|
+
logger.log(ui.section('Recent Uploads'));
|
|
32
|
+
logger.log(ui.note(` showing ${uploads.length} of ${total}${offsetNote}`));
|
|
38
33
|
for (const upload of uploads) {
|
|
39
34
|
const date = new Date(upload.created_at);
|
|
40
35
|
const formattedDate = date.toLocaleDateString('en-US', {
|
|
@@ -44,26 +39,29 @@ function displayResults(response) {
|
|
|
44
39
|
month: 'short',
|
|
45
40
|
year: 'numeric',
|
|
46
41
|
});
|
|
47
|
-
const displayName = upload.name
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
42
|
+
const displayName = upload.name ? colors.bold(upload.name) : colors.dim('(unnamed)');
|
|
43
|
+
logger.log(ui.branch([
|
|
44
|
+
displayName,
|
|
45
|
+
...ui.fields([
|
|
46
|
+
['id', formatId(upload.id)],
|
|
47
|
+
['created', formattedDate],
|
|
48
|
+
['console', formatUrl(upload.consoleUrl)],
|
|
49
|
+
]),
|
|
50
|
+
]));
|
|
53
51
|
}
|
|
54
52
|
if (total > offset + uploads.length) {
|
|
55
53
|
const remaining = total - (offset + uploads.length);
|
|
56
|
-
|
|
54
|
+
logger.log(ui.note(`\nUse --offset ${offset + uploads.length} to see the next ${Math.min(remaining, limit)} uploads`));
|
|
57
55
|
}
|
|
58
|
-
|
|
56
|
+
logger.log(ui.info(colors.dim('Use dcd status --upload-id <id> for detailed test results')));
|
|
59
57
|
}
|
|
60
|
-
|
|
58
|
+
export const listCommand = defineCommand({
|
|
61
59
|
meta: {
|
|
62
60
|
name: 'list',
|
|
63
61
|
description: 'List recent flow uploads for your organization',
|
|
64
62
|
},
|
|
65
63
|
args: {
|
|
66
|
-
...
|
|
64
|
+
...apiFlags,
|
|
67
65
|
from: {
|
|
68
66
|
type: 'string',
|
|
69
67
|
description: 'Filter uploads created on or after this date (ISO 8601 format, e.g., 2024-01-01)',
|
|
@@ -93,26 +91,26 @@ exports.listCommand = (0, citty_1.defineCommand)({
|
|
|
93
91
|
},
|
|
94
92
|
async run({ args }) {
|
|
95
93
|
const apiKeyFlag = args['api-key'];
|
|
96
|
-
const apiUrl =
|
|
94
|
+
const apiUrl = resolveApiUrl(args['api-url']);
|
|
97
95
|
const from = args.from;
|
|
98
96
|
const to = args.to;
|
|
99
97
|
const name = args.name;
|
|
100
98
|
const json = Boolean(args.json);
|
|
101
|
-
const limit =
|
|
102
|
-
const offset =
|
|
99
|
+
const limit = parseIntFlag(args.limit, 'limit') ?? 20;
|
|
100
|
+
const offset = parseIntFlag(args.offset, 'offset') ?? 0;
|
|
103
101
|
try {
|
|
104
|
-
const auth = await
|
|
102
|
+
const auth = await resolveAuth({ apiKeyFlag });
|
|
105
103
|
if (from && Number.isNaN(Date.parse(from))) {
|
|
106
|
-
throw new
|
|
104
|
+
throw new CliError('Invalid --from date format. Please use ISO 8601 format (e.g., 2024-01-01).');
|
|
107
105
|
}
|
|
108
106
|
if (to && Number.isNaN(Date.parse(to))) {
|
|
109
|
-
throw new
|
|
107
|
+
throw new CliError('Invalid --to date format. Please use ISO 8601 format (e.g., 2024-01-31).');
|
|
110
108
|
}
|
|
111
109
|
if (name) {
|
|
112
110
|
detectShellExpansion(name);
|
|
113
111
|
}
|
|
114
112
|
try {
|
|
115
|
-
const response = (await
|
|
113
|
+
const response = (await ApiGateway.listUploads(apiUrl, auth, {
|
|
116
114
|
from,
|
|
117
115
|
limit,
|
|
118
116
|
name,
|
|
@@ -127,12 +125,12 @@ exports.listCommand = (0, citty_1.defineCommand)({
|
|
|
127
125
|
displayResults(response);
|
|
128
126
|
}
|
|
129
127
|
catch (error) {
|
|
130
|
-
throw new
|
|
128
|
+
throw new CliError(`Failed to list uploads: ${error.message}`);
|
|
131
129
|
}
|
|
132
130
|
}
|
|
133
131
|
catch (error) {
|
|
134
|
-
|
|
132
|
+
logger.error(error, { exit: 1, json });
|
|
135
133
|
}
|
|
136
134
|
},
|
|
137
135
|
});
|
|
138
|
-
|
|
136
|
+
export default listCommand;
|