@gogitcms/editor 0.34.2 → 0.35.0
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/app/src/previewToken.ts +16 -6
- package/npm-shrinkwrap.json +16 -29
- package/package.json +6 -6
package/app/src/previewToken.ts
CHANGED
|
@@ -41,13 +41,23 @@ export async function getPreviewToken(repositoryId: string): Promise<string> {
|
|
|
41
41
|
},
|
|
42
42
|
});
|
|
43
43
|
if (!res.ok) {
|
|
44
|
-
// Surfaced to the plugin, which shows it in its own pane. 403
|
|
45
|
-
//
|
|
46
|
-
//
|
|
44
|
+
// Surfaced to the plugin, which shows it in its own pane. A 403 is one of
|
|
45
|
+
// two things worth telling apart: the workspace does not have previews
|
|
46
|
+
// (code preview_not_enabled — a plan or a staff grant fixes it), or the
|
|
47
|
+
// user cannot read that repository's content. Either is better said
|
|
48
|
+
// plainly than as "the preview service refused the session".
|
|
49
|
+
let code = "";
|
|
50
|
+
try {
|
|
51
|
+
code = String(((await res.json()) as { code?: string }).code ?? "");
|
|
52
|
+
} catch {
|
|
53
|
+
// Not JSON; the status is all there is.
|
|
54
|
+
}
|
|
47
55
|
throw new Error(
|
|
48
|
-
res.status === 403
|
|
49
|
-
? "
|
|
50
|
-
:
|
|
56
|
+
res.status === 403 && code === "preview_not_enabled"
|
|
57
|
+
? "previews are not enabled for this workspace — they come with a plan that includes them, or ask us to turn them on"
|
|
58
|
+
: res.status === 403
|
|
59
|
+
? "you do not have permission to preview this repository"
|
|
60
|
+
: `the CMS refused to mint a preview token (${res.status})`,
|
|
51
61
|
);
|
|
52
62
|
}
|
|
53
63
|
const body = (await res.json()) as { token: string; expiresAt: string };
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gogitcms/editor",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.35.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@gogitcms/editor",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.35.0",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@apollo/client": "^3.11.8",
|
|
12
12
|
"@handlewithcare/react-prosemirror": "^3.2.7",
|
|
@@ -47,11 +47,11 @@
|
|
|
47
47
|
"node": ">=20"
|
|
48
48
|
},
|
|
49
49
|
"optionalDependencies": {
|
|
50
|
-
"@gogitcms/gitcms-local-darwin-arm64": "0.
|
|
51
|
-
"@gogitcms/gitcms-local-darwin-x64": "0.
|
|
52
|
-
"@gogitcms/gitcms-local-linux-arm64": "0.
|
|
53
|
-
"@gogitcms/gitcms-local-linux-x64": "0.
|
|
54
|
-
"@gogitcms/gitcms-local-win32-x64": "0.
|
|
50
|
+
"@gogitcms/gitcms-local-darwin-arm64": "0.35.0",
|
|
51
|
+
"@gogitcms/gitcms-local-darwin-x64": "0.35.0",
|
|
52
|
+
"@gogitcms/gitcms-local-linux-arm64": "0.35.0",
|
|
53
|
+
"@gogitcms/gitcms-local-linux-x64": "0.35.0",
|
|
54
|
+
"@gogitcms/gitcms-local-win32-x64": "0.35.0"
|
|
55
55
|
}
|
|
56
56
|
},
|
|
57
57
|
"node_modules/@apollo/client": {
|
|
@@ -751,9 +751,9 @@
|
|
|
751
751
|
}
|
|
752
752
|
},
|
|
753
753
|
"node_modules/@gogitcms/gitcms-local-darwin-arm64": {
|
|
754
|
-
"version": "0.
|
|
755
|
-
"resolved": "https://registry.npmjs.org/@gogitcms/gitcms-local-darwin-arm64/-/gitcms-local-darwin-arm64-0.
|
|
756
|
-
"integrity": "sha512-
|
|
754
|
+
"version": "0.35.0",
|
|
755
|
+
"resolved": "https://registry.npmjs.org/@gogitcms/gitcms-local-darwin-arm64/-/gitcms-local-darwin-arm64-0.35.0.tgz",
|
|
756
|
+
"integrity": "sha512-UcOaZMKU5fp9Xao/O800heUnQJlZPLOClASP2Pftwp6mB4FALkh7X8QhlBhk8Tk/NfBJz1L//uVzaAsik2DrgA==",
|
|
757
757
|
"cpu": [
|
|
758
758
|
"arm64"
|
|
759
759
|
],
|
|
@@ -764,9 +764,9 @@
|
|
|
764
764
|
]
|
|
765
765
|
},
|
|
766
766
|
"node_modules/@gogitcms/gitcms-local-darwin-x64": {
|
|
767
|
-
"version": "0.
|
|
768
|
-
"resolved": "https://registry.npmjs.org/@gogitcms/gitcms-local-darwin-x64/-/gitcms-local-darwin-x64-0.
|
|
769
|
-
"integrity": "sha512-
|
|
767
|
+
"version": "0.35.0",
|
|
768
|
+
"resolved": "https://registry.npmjs.org/@gogitcms/gitcms-local-darwin-x64/-/gitcms-local-darwin-x64-0.35.0.tgz",
|
|
769
|
+
"integrity": "sha512-EQ5drrikotcPfxZ//adlre+nWW5NNbOGA53895yi5eXrPib/jvc2D/4IC9mW1dhVtpOYcdd3acJtgnKbpHC3Hg==",
|
|
770
770
|
"cpu": [
|
|
771
771
|
"x64"
|
|
772
772
|
],
|
|
@@ -776,23 +776,10 @@
|
|
|
776
776
|
"darwin"
|
|
777
777
|
]
|
|
778
778
|
},
|
|
779
|
-
"node_modules/@gogitcms/gitcms-local-linux-x64": {
|
|
780
|
-
"version": "0.34.2",
|
|
781
|
-
"resolved": "https://registry.npmjs.org/@gogitcms/gitcms-local-linux-x64/-/gitcms-local-linux-x64-0.34.2.tgz",
|
|
782
|
-
"integrity": "sha512-iZ9pGgyqRZXPkea3olqsvS6C9KxysOMTW1JrsHR9Y+9SOY/cQcUjdh1sgHcXrWnGnIrY9jL+NPl6SmtfPLsxTQ==",
|
|
783
|
-
"cpu": [
|
|
784
|
-
"x64"
|
|
785
|
-
],
|
|
786
|
-
"license": "UNLICENSED",
|
|
787
|
-
"optional": true,
|
|
788
|
-
"os": [
|
|
789
|
-
"linux"
|
|
790
|
-
]
|
|
791
|
-
},
|
|
792
779
|
"node_modules/@gogitcms/gitcms-local-win32-x64": {
|
|
793
|
-
"version": "0.
|
|
794
|
-
"resolved": "https://registry.npmjs.org/@gogitcms/gitcms-local-win32-x64/-/gitcms-local-win32-x64-0.
|
|
795
|
-
"integrity": "sha512-
|
|
780
|
+
"version": "0.35.0",
|
|
781
|
+
"resolved": "https://registry.npmjs.org/@gogitcms/gitcms-local-win32-x64/-/gitcms-local-win32-x64-0.35.0.tgz",
|
|
782
|
+
"integrity": "sha512-IPHznXDhuHTbTpIkgbmUirlOEIQp8VATBaC+nperMB7rJrkGCbi3Rv3yir0aV8ylAFoBJ18jIme0CIAYTT7ptQ==",
|
|
796
783
|
"cpu": [
|
|
797
784
|
"x64"
|
|
798
785
|
],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gogitcms/editor",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.35.0",
|
|
4
4
|
"description": "Terminal UI for setting up and running the Go·Git CMS content editor",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -65,10 +65,10 @@
|
|
|
65
65
|
"@gogitcms/frontend": "workspace:*"
|
|
66
66
|
},
|
|
67
67
|
"optionalDependencies": {
|
|
68
|
-
"@gogitcms/gitcms-local-darwin-arm64": "0.
|
|
69
|
-
"@gogitcms/gitcms-local-darwin-x64": "0.
|
|
70
|
-
"@gogitcms/gitcms-local-linux-arm64": "0.
|
|
71
|
-
"@gogitcms/gitcms-local-linux-x64": "0.
|
|
72
|
-
"@gogitcms/gitcms-local-win32-x64": "0.
|
|
68
|
+
"@gogitcms/gitcms-local-darwin-arm64": "0.35.0",
|
|
69
|
+
"@gogitcms/gitcms-local-darwin-x64": "0.35.0",
|
|
70
|
+
"@gogitcms/gitcms-local-linux-arm64": "0.35.0",
|
|
71
|
+
"@gogitcms/gitcms-local-linux-x64": "0.35.0",
|
|
72
|
+
"@gogitcms/gitcms-local-win32-x64": "0.35.0"
|
|
73
73
|
}
|
|
74
74
|
}
|