bitrise-api-cli 0.0.9 → 0.0.10
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/cli.js +102 -4
- package/dist/impl-KCO2VZ2R.js +1696 -0
- package/package.json +6 -6
- package/dist/bash-complete.js +0 -21
- package/dist/chunk-BL3ATQXK.js +0 -97
- package/dist/impl-BIHLRL5Y.js +0 -7603
package/dist/cli.js
CHANGED
|
@@ -1,10 +1,108 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
} from "./chunk-BL3ATQXK.js";
|
|
6
|
-
import "./chunk-CF25N4TY.js";
|
|
3
|
+
validArtifactTypes
|
|
4
|
+
} from "./chunk-CF25N4TY.js";
|
|
7
5
|
|
|
8
6
|
// src/cli/bin/cli.ts
|
|
9
7
|
import { run } from "@stricli/core";
|
|
8
|
+
|
|
9
|
+
// src/cli/commands/download/command.ts
|
|
10
|
+
import { buildCommand } from "@stricli/core";
|
|
11
|
+
var downloadCommand = buildCommand({
|
|
12
|
+
loader: async () => import("./impl-KCO2VZ2R.js"),
|
|
13
|
+
parameters: {
|
|
14
|
+
flags: {
|
|
15
|
+
artifact: {
|
|
16
|
+
kind: "enum",
|
|
17
|
+
brief: 'bitrise artifact type "ios-ipa" or "android-apk"',
|
|
18
|
+
default: "android-apk",
|
|
19
|
+
values: validArtifactTypes
|
|
20
|
+
},
|
|
21
|
+
debug: {
|
|
22
|
+
kind: "boolean",
|
|
23
|
+
brief: "Number of times to say hello",
|
|
24
|
+
default: false
|
|
25
|
+
},
|
|
26
|
+
slug: {
|
|
27
|
+
kind: "parsed",
|
|
28
|
+
brief: "bitrise app slug (or $BITRISE_APP_SLUG) see bitrise project url to get slug",
|
|
29
|
+
default: process.env["BITRISE_APP_SLUG"],
|
|
30
|
+
parse: String,
|
|
31
|
+
placeholder: "APP_SLUG"
|
|
32
|
+
},
|
|
33
|
+
token: {
|
|
34
|
+
kind: "parsed",
|
|
35
|
+
brief: "bitrise api token (or $BITRISE_API_CLI_TOKEN)",
|
|
36
|
+
default: process.env["BITRISE_API_CLI_TOKEN"],
|
|
37
|
+
parse: String,
|
|
38
|
+
placeholder: "API_TOKEN"
|
|
39
|
+
},
|
|
40
|
+
workflow: {
|
|
41
|
+
kind: "parsed",
|
|
42
|
+
brief: "workflow to get apk from (or $BITRISE_API_CLI_WORKFLOW)",
|
|
43
|
+
default: process.env["BITRISE_API_CLI_WORKFLOW"],
|
|
44
|
+
parse: String,
|
|
45
|
+
placeholder: "WORKFLOW_NAME"
|
|
46
|
+
},
|
|
47
|
+
install: {
|
|
48
|
+
kind: "boolean",
|
|
49
|
+
brief: "Install the downloaded apk/aab artifact [android only]",
|
|
50
|
+
default: false
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
aliases: {
|
|
54
|
+
a: "artifact",
|
|
55
|
+
d: "debug",
|
|
56
|
+
s: "slug",
|
|
57
|
+
t: "token",
|
|
58
|
+
w: "workflow",
|
|
59
|
+
i: "install"
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
docs: {
|
|
63
|
+
brief: "Download bitrise artifacts. Most parameters can be set via environment variables."
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
// src/cli/app.ts
|
|
68
|
+
import { buildApplication, buildRouteMap } from "@stricli/core";
|
|
69
|
+
|
|
70
|
+
// package.json
|
|
71
|
+
var name = "bitrise-api-cli";
|
|
72
|
+
var version = "0.0.10";
|
|
73
|
+
var description = "bitrise api CLI wrapper";
|
|
74
|
+
|
|
75
|
+
// src/cli/app.ts
|
|
76
|
+
var root = buildRouteMap({
|
|
77
|
+
routes: {
|
|
78
|
+
download: downloadCommand
|
|
79
|
+
},
|
|
80
|
+
docs: {
|
|
81
|
+
brief: description
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
var app = buildApplication(root, {
|
|
85
|
+
name,
|
|
86
|
+
versionInfo: {
|
|
87
|
+
currentVersion: version,
|
|
88
|
+
getLatestVersion: async () => {
|
|
89
|
+
const response = await fetch(`https://registry.npmjs.org/${name}/latest`);
|
|
90
|
+
if (!response.ok) return void 0;
|
|
91
|
+
const data = await response.json();
|
|
92
|
+
if (!data || typeof data !== "object" || !("version" in data) || typeof data.version !== "string")
|
|
93
|
+
return void 0;
|
|
94
|
+
return data.version;
|
|
95
|
+
},
|
|
96
|
+
upgradeCommand: `npx ${name}@latest`
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
// src/cli/context.ts
|
|
101
|
+
function buildContext(process2) {
|
|
102
|
+
return {
|
|
103
|
+
process: process2
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// src/cli/bin/cli.ts
|
|
10
108
|
await run(app, process.argv.slice(2), buildContext(process));
|