@gogitcms/editor 0.34.1 → 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.
@@ -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 here means the
45
- // user cannot read that repository's content, which is worth saying plainly
46
- // rather than as "the preview service refused the session".
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
- ? "you do not have permission to preview this repository"
50
- : `the CMS refused to mint a preview token (${res.status})`,
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 };
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@gogitcms/editor",
3
- "version": "0.34.1",
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.34.1",
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.34.1",
51
- "@gogitcms/gitcms-local-darwin-x64": "0.34.1",
52
- "@gogitcms/gitcms-local-linux-arm64": "0.34.1",
53
- "@gogitcms/gitcms-local-linux-x64": "0.34.1",
54
- "@gogitcms/gitcms-local-win32-x64": "0.34.1"
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.34.1",
755
- "resolved": "https://registry.npmjs.org/@gogitcms/gitcms-local-darwin-arm64/-/gitcms-local-darwin-arm64-0.34.1.tgz",
756
- "integrity": "sha512-zphjPnMkZeuK5q8vQO3pJEbyH5ADAqhLwzLXxUlbrYfX9ivMZaq5pg/JxDhpccYr0bIAQJahRnjIcQuxwaPqvw==",
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.34.1",
768
- "resolved": "https://registry.npmjs.org/@gogitcms/gitcms-local-darwin-x64/-/gitcms-local-darwin-x64-0.34.1.tgz",
769
- "integrity": "sha512-E+Ll9Vo2YliKCPuVPzZrz/FJrVc6vabdBiBMSHYjbgREJ8fR38mmzftEmzebNG7KGzV1JoOEEk05x7xYprtXuA==",
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.1",
781
- "resolved": "https://registry.npmjs.org/@gogitcms/gitcms-local-linux-x64/-/gitcms-local-linux-x64-0.34.1.tgz",
782
- "integrity": "sha512-jGZmM79kjoQl7iuSudZlEoc2oA/Hy3ie5SU47BfDF89/3g5hHQpIKf8RcEy2oLGYaO1ghEGy1ekQ+4Cc9KHKdw==",
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.34.1",
794
- "resolved": "https://registry.npmjs.org/@gogitcms/gitcms-local-win32-x64/-/gitcms-local-win32-x64-0.34.1.tgz",
795
- "integrity": "sha512-VfJVJCZJgjU3TLfYCvwjfZFp9TDDMjtBtBAI4RMJevXyexxBsa9D1/0np8UaMS/kXGNqJPZZfFZxvnh5ABlprg==",
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
  ],
@@ -4058,9 +4045,9 @@
4058
4045
  "license": "MIT"
4059
4046
  },
4060
4047
  "node_modules/posthog-js": {
4061
- "version": "1.425.0",
4062
- "resolved": "https://registry.npmjs.org/posthog-js/-/posthog-js-1.425.0.tgz",
4063
- "integrity": "sha512-HwbWI1PPFsVQjuFSmRoZioruw2DuIinH37AV9xu8iT2dUIgeBJYOGSv7VQbPSGtH/DeyxCv04UnMAdNKeBSJWg==",
4048
+ "version": "1.425.1",
4049
+ "resolved": "https://registry.npmjs.org/posthog-js/-/posthog-js-1.425.1.tgz",
4050
+ "integrity": "sha512-GfdAUf402Prjt3ofkj4dh4k/m1SkYvgCeASyWj1xxcIVT7QnB9gGsslDwAZBZ6Wrtwxkq91gFbpSo/v633Q+1w==",
4064
4051
  "license": "(Apache-2.0 AND MIT)",
4065
4052
  "dependencies": {
4066
4053
  "@posthog/browser-common": "^0.7.1",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gogitcms/editor",
3
- "version": "0.34.1",
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.34.1",
69
- "@gogitcms/gitcms-local-darwin-x64": "0.34.1",
70
- "@gogitcms/gitcms-local-linux-arm64": "0.34.1",
71
- "@gogitcms/gitcms-local-linux-x64": "0.34.1",
72
- "@gogitcms/gitcms-local-win32-x64": "0.34.1"
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
  }