@gitterm/cli 0.0.4 → 0.0.6
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/dist/index.js +6 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3510,6 +3510,10 @@ function errorCode(code) {
|
|
|
3510
3510
|
return code;
|
|
3511
3511
|
return "SERVER_ERROR";
|
|
3512
3512
|
}
|
|
3513
|
+
function toWorkspaceTrpcUrl(serverUrl) {
|
|
3514
|
+
const url = new URL(serverUrl);
|
|
3515
|
+
return url.pathname.endsWith("/trpc") ? serverUrl : new URL("/trpc", url).toString();
|
|
3516
|
+
}
|
|
3513
3517
|
function createGittermWorkspaceClient(options = {}) {
|
|
3514
3518
|
const detected = options.serverUrl && options.token && options.workspaceId ? null : getWorkspaceEnvironment();
|
|
3515
3519
|
const rawServerUrl = options.serverUrl ?? detected?.serverUrl;
|
|
@@ -3522,7 +3526,7 @@ function createGittermWorkspaceClient(options = {}) {
|
|
|
3522
3526
|
const trpc = createTRPCClient({
|
|
3523
3527
|
links: [
|
|
3524
3528
|
httpBatchLink({
|
|
3525
|
-
url:
|
|
3529
|
+
url: toWorkspaceTrpcUrl(serverUrl),
|
|
3526
3530
|
fetch: createNoRedirectFetch(options.fetch),
|
|
3527
3531
|
headers: () => ({ authorization: `Bearer ${token}` })
|
|
3528
3532
|
})
|
|
@@ -8843,7 +8847,7 @@ var yargs_default = Yargs;
|
|
|
8843
8847
|
// package.json
|
|
8844
8848
|
var package_default = {
|
|
8845
8849
|
name: "@gitterm/cli",
|
|
8846
|
-
version: "0.0.
|
|
8850
|
+
version: "0.0.6",
|
|
8847
8851
|
description: "Complete suit of gitterm tools in one CLI",
|
|
8848
8852
|
keywords: [
|
|
8849
8853
|
"gitterm",
|