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 +4 -4
- data/CHANGELOG.md +6 -2
- data/templates/base/RemoteCommand.ts +5 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 30a3b38f66be2984ac2e6db57d53fe9abf21def7569fc0472938a0166f83934c
|
4
|
+
data.tar.gz: afb81264f3fb218f0e596ad946c77ea509c8fa1e4c99816c2c77e64740892b22
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 469376f5e5e6f22706a954172b8e60610d1c390b74eb8a3f038c56229459cb292893b8ee6e29caa45b398d96f6fcc81e5165517a88c1f82df415fb94e63b1aaa
|
7
|
+
data.tar.gz: 0dd2303b15e531e72deed4a4d876d1e5e1dbe5d5cdb85f4577ebeb1fcaea0bc0c33be0fede4f5aededbd1c4c965cc07b565a789bad7fd56852ee675994972bac
|
data/CHANGELOG.md
CHANGED
@@ -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.
|
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
|
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 ${
|
142
|
+
throw new Error(`not sure how to handle ${text}`)
|
142
143
|
}
|
143
144
|
|
144
145
|
return this.outcome
|