@promte/app-upload 0.1.9 → 0.1.11
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 +6 -6
- package/bin/promte-app-upload.js +6 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,21 +4,21 @@ CLI for uploading Promte app bundles.
|
|
|
4
4
|
|
|
5
5
|
## Quick start
|
|
6
6
|
```
|
|
7
|
-
npx promte
|
|
8
|
-
npx promte
|
|
7
|
+
npx @promte/app-upload config
|
|
8
|
+
npx @promte/app-upload push
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
## Commands
|
|
12
12
|
```
|
|
13
|
-
promte
|
|
13
|
+
npx @promte/app-upload config
|
|
14
14
|
- interactive setup for host/workspaceId/dist (stored in ./promte-app-upload.config.json)
|
|
15
15
|
|
|
16
|
-
promte
|
|
16
|
+
npx @promte/app-upload push [--host ...] [--workspaceId ...] [--dist ...] [--zip ...] [--token ...]
|
|
17
17
|
- uploads ./dist by default
|
|
18
18
|
- host defaults to https://app.promte.dk
|
|
19
19
|
- use --zip <file> to upload an existing zip
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
Notes:
|
|
23
|
-
-
|
|
24
|
-
- If no
|
|
23
|
+
- Tokens are never stored in the config file.
|
|
24
|
+
- If no token is provided, the CLI will prompt for it.
|
package/bin/promte-app-upload.js
CHANGED
|
@@ -18,7 +18,7 @@ function usage() {
|
|
|
18
18
|
[
|
|
19
19
|
"Usage:",
|
|
20
20
|
" promte-app-upload config",
|
|
21
|
-
" promte-app-upload push [--host <url>] [--workspaceId <id>] [--dist <path>] [--zip <file>] [--
|
|
21
|
+
" promte-app-upload push [--host <url>] [--workspaceId <id>] [--dist <path>] [--zip <file>] [--token <token>]",
|
|
22
22
|
"",
|
|
23
23
|
"Defaults:",
|
|
24
24
|
` host: ${DEFAULT_HOST}`,
|
|
@@ -178,15 +178,15 @@ async function runPush(args) {
|
|
|
178
178
|
const workspaceId = args.workspaceId || config.workspaceId;
|
|
179
179
|
const dist = args.dist || config.dist || DEFAULT_DIST;
|
|
180
180
|
const zipPath = args.zip;
|
|
181
|
-
let
|
|
181
|
+
let token = args.token;
|
|
182
182
|
|
|
183
183
|
assert(workspaceId, "workspaceId is required (config or --workspaceId)");
|
|
184
184
|
const absDist = zipPath ? null : ensureDist(dist);
|
|
185
185
|
|
|
186
|
-
if (!
|
|
187
|
-
|
|
186
|
+
if (!token) {
|
|
187
|
+
token = await promptSecret("Workspace token");
|
|
188
188
|
}
|
|
189
|
-
assert(
|
|
189
|
+
assert(token, "token is required");
|
|
190
190
|
|
|
191
191
|
let zipBuffer;
|
|
192
192
|
let zipName = "dist.zip";
|
|
@@ -212,7 +212,7 @@ async function runPush(args) {
|
|
|
212
212
|
const res = await undiciFetch(url.toString(), {
|
|
213
213
|
method: "POST",
|
|
214
214
|
headers: {
|
|
215
|
-
|
|
215
|
+
Authorization: `Bearer ${token}`,
|
|
216
216
|
},
|
|
217
217
|
body: form,
|
|
218
218
|
});
|