nappup 1.8.2 → 1.8.3

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.
@@ -55,7 +55,7 @@ export async function confirmArgs (args) {
55
55
  return new Promise(resolve => rl.question(query, resolve))
56
56
  }
57
57
  const answer = await askQuestion(
58
- `Publish app from '${args.dir}' to the ${args.channel} release channel? (y/n) `
58
+ `Publish app from '${args.dir}' as '${args.dTag}' to the ${args.channel} release channel? (y/n) `
59
59
  )
60
60
  if (answer.toLowerCase() !== 'y') {
61
61
  console.log('Operation cancelled by user.')
@@ -11,10 +11,9 @@ import {
11
11
  import toApp from '#index.js'
12
12
 
13
13
  const args = parseArgs(process.argv.slice(2))
14
- await confirmArgs(args)
15
14
 
16
- const { dir, sk, channel, shouldReupload } = args
17
15
  let { dTag } = args
16
+ const { dir, sk, channel, shouldReupload } = args
18
17
 
19
18
  if (!dTag) {
20
19
  let folderName = path.basename(dir)
@@ -29,6 +28,9 @@ if (!dTag) {
29
28
  }
30
29
  dTag = folderName
31
30
  }
31
+ args.dTag = dTag
32
+
33
+ await confirmArgs(args)
32
34
 
33
35
  const fileList = await toFileList(getFiles(dir), dir)
34
36
 
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "url": "git+https://github.com/44billion/nappup.git"
7
7
  },
8
8
  "license": "MIT",
9
- "version": "1.8.2",
9
+ "version": "1.8.3",
10
10
  "description": "Nostr App Uploader",
11
11
  "type": "module",
12
12
  "scripts": {
@@ -105,7 +105,17 @@ async function uploadFileToServer (client, file, fileHash, mimeType, { shouldReu
105
105
  await new Promise(resolve => setTimeout(resolve, pause))
106
106
  pause += 2000
107
107
  }
108
- const descriptor = await client.uploadBlob(file, mimeType)
108
+ const descriptor = await client.httpCall(
109
+ 'PUT',
110
+ 'upload',
111
+ mimeType,
112
+ () => client.authorizationHeader((evt) => {
113
+ evt.tags.push(['t', 'upload'])
114
+ evt.tags.push(['x', fileHash])
115
+ }),
116
+ file.stream(),
117
+ {}
118
+ )
109
119
  return { success: true, descriptor }
110
120
  } catch (err) {
111
121
  if (attempt === maxRetries) {