@promte/app-upload 0.1.10 → 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 CHANGED
@@ -13,12 +13,12 @@ npx @promte/app-upload push
13
13
  npx @promte/app-upload config
14
14
  - interactive setup for host/workspaceId/dist (stored in ./promte-app-upload.config.json)
15
15
 
16
- npx @promte/app-upload push [--host ...] [--workspaceId ...] [--dist ...] [--zip ...] [--serviceKey ...]
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
- - Service key is never stored in the config file.
24
- - If no service key is provided, the CLI will prompt for it.
23
+ - Tokens are never stored in the config file.
24
+ - If no token is provided, the CLI will prompt for it.
@@ -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>] [--serviceKey <key>]",
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 serviceKey = args.serviceKey;
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 (!serviceKey) {
187
- serviceKey = await promptSecret("Service key");
186
+ if (!token) {
187
+ token = await promptSecret("Workspace token");
188
188
  }
189
- assert(serviceKey, "serviceKey is required");
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
- "service-key": serviceKey,
215
+ Authorization: `Bearer ${token}`,
216
216
  },
217
217
  body: form,
218
218
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promte/app-upload",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "description": "CLI to upload Promte app bundles",
5
5
  "type": "module",
6
6
  "bin": {