foobara-typescript-remote-command-generator 0.0.14 → 0.0.15

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d21e54189d68b7b93ec70507e3b0fa433a4a8a380fbbd4e1df92031aea3310d2
4
- data.tar.gz: a465fae839c9f38e29908ef3145b9d4b4c0d1de4e37d004893e54653ee783c15
3
+ metadata.gz: 30a3b38f66be2984ac2e6db57d53fe9abf21def7569fc0472938a0166f83934c
4
+ data.tar.gz: afb81264f3fb218f0e596ad946c77ea509c8fa1e4c99816c2c77e64740892b22
5
5
  SHA512:
6
- metadata.gz: b4794d89263b06204d56d09a89ac110f5382e1f1d3fdc914e2fc9a2534c8b16dcec608205643f4fcd9c69ef9ec918610e3d803e3eef6663be3356dfd70b1baba
7
- data.tar.gz: d4d2cd4b56df9f690e074695b07bda3dd7f5eb0499bf4060c8854225fb233389f75938d65a1a3134c83255988d660c288bdc8785001a2cc79c598b4397a54b00
6
+ metadata.gz: 469376f5e5e6f22706a954172b8e60610d1c390b74eb8a3f038c56229459cb292893b8ee6e29caa45b398d96f6fcc81e5165517a88c1f82df415fb94e63b1aaa
7
+ data.tar.gz: 0dd2303b15e531e72deed4a4d876d1e5e1dbe5d5cdb85f4577ebeb1fcaea0bc0c33be0fede4f5aededbd1c4c965cc07b565a789bad7fd56852ee675994972bac
data/CHANGELOG.md CHANGED
@@ -1,6 +1,10 @@
1
- ## [0.0.14] - 2025-03-29
1
+ ## [0.0.15] - 2025-03-30
2
2
 
3
- - Send credentials: 'include'
3
+ - Better error handling in RemoteCommand
4
+
5
+ ## [0.0.14] - 2025-03-30
6
+
7
+ - Implement Auth domain support in RemoteCommand
4
8
 
5
9
  ## [0.0.13] - 2025-03-17
6
10
 
@@ -77,7 +77,7 @@ export default abstract class RemoteCommand<Inputs, Result, CommandError extends
77
77
  }
78
78
 
79
79
  get commandPath (): string {
80
- return this.fullCommandName.replace('::', '/')
80
+ return this.fullCommandName.replaceAll('::', '/')
81
81
  }
82
82
 
83
83
  async run (): Promise<Outcome<Result, CommandError>> {
@@ -122,7 +122,8 @@ export default abstract class RemoteCommand<Inputs, Result, CommandError extends
122
122
  }
123
123
  }
124
124
 
125
- const body = await response.json()
125
+ const text = await response.text()
126
+ const body = JSON.parse(text)
126
127
 
127
128
  if (response.ok) {
128
129
  const accessToken: string | null = response.headers.get('X-Access-Token')
@@ -133,12 +134,12 @@ export default abstract class RemoteCommand<Inputs, Result, CommandError extends
133
134
 
134
135
  this.commandState = 'succeeded'
135
136
  this.outcome = new SuccessfulOutcome<Result, CommandError>(body)
136
- } else if (response.status === 422) {
137
+ } else if (response.status === 422 || response.status === 401 || response.status === 403) {
137
138
  this.commandState = 'errored'
138
139
  this.outcome = new ErrorOutcome<Result, CommandError>(body)
139
140
  } else {
140
141
  this.commandState = 'failed'
141
- throw new Error(`not sure how to handle ${await response.text()}`)
142
+ throw new Error(`not sure how to handle ${text}`)
142
143
  }
143
144
 
144
145
  return this.outcome
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foobara-typescript-remote-command-generator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.14
4
+ version: 0.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Georgi