@wervt/cms 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.
Files changed (72) hide show
  1. package/README.md +177 -18
  2. package/dist/editor/assets/Button-DrsXdow7.js +6 -0
  3. package/dist/editor/assets/RichTextInput-BrNTSUXL.js +271 -0
  4. package/dist/editor/assets/Toast-DsP3Sdxg.js +13 -0
  5. package/dist/editor/assets/index-CWQLsBfF.js +16 -0
  6. package/dist/editor/assets/index-esGfkiTV.css +2 -0
  7. package/dist/editor/index.html +3 -3
  8. package/dist/editor-theme.d.ts +3 -0
  9. package/dist/editor-theme.js +18 -1
  10. package/dist/module.d.ts +18 -1
  11. package/dist/module.js +95 -7
  12. package/dist/routes.js +16 -0
  13. package/dist/runtime/app/edit-button.d.ts +7 -0
  14. package/dist/runtime/app/edit-button.js +56 -0
  15. package/dist/runtime/app/preview.client.js +12 -5
  16. package/dist/runtime/app/useCmsCollection.d.ts +24 -0
  17. package/dist/runtime/app/useCmsCollection.js +74 -0
  18. package/dist/runtime/app/useCmsSeo.d.ts +7 -0
  19. package/dist/runtime/app/useCmsSeo.js +31 -0
  20. package/dist/runtime/collections.d.ts +25 -0
  21. package/dist/runtime/collections.js +81 -0
  22. package/dist/runtime/editor-link.d.ts +19 -0
  23. package/dist/runtime/editor-link.js +31 -0
  24. package/dist/runtime/fields.d.ts +33 -1
  25. package/dist/runtime/fields.js +143 -7
  26. package/dist/runtime/pages.d.ts +11 -2
  27. package/dist/runtime/pages.js +37 -7
  28. package/dist/runtime/preview.d.ts +5 -2
  29. package/dist/runtime/preview.js +2 -2
  30. package/dist/runtime/schema.d.ts +187 -13
  31. package/dist/runtime/schema.js +115 -1
  32. package/dist/runtime/seo.d.ts +22 -0
  33. package/dist/runtime/seo.js +33 -0
  34. package/dist/runtime/server/access.get.d.ts +4 -0
  35. package/dist/runtime/server/access.get.js +8 -0
  36. package/dist/runtime/server/access.js +1 -1
  37. package/dist/runtime/server/collection.get.d.ts +12 -0
  38. package/dist/runtime/server/collection.get.js +28 -0
  39. package/dist/runtime/server/dev-images.d.ts +4 -1
  40. package/dist/runtime/server/dev-images.js +28 -2
  41. package/dist/runtime/server/entries.d.ts +53 -0
  42. package/dist/runtime/server/entries.js +83 -1
  43. package/dist/runtime/server/entry.delete.d.ts +4 -0
  44. package/dist/runtime/server/entry.delete.js +31 -0
  45. package/dist/runtime/server/entry.get.js +6 -6
  46. package/dist/runtime/server/entry.put.d.ts +1 -0
  47. package/dist/runtime/server/entry.put.js +20 -8
  48. package/dist/runtime/server/file-store.d.ts +14 -3
  49. package/dist/runtime/server/file-store.js +44 -9
  50. package/dist/runtime/server/image.delete.d.ts +4 -0
  51. package/dist/runtime/server/image.delete.js +24 -0
  52. package/dist/runtime/server/images.get.d.ts +5 -0
  53. package/dist/runtime/server/images.get.js +11 -0
  54. package/dist/runtime/server/library.d.ts +14 -0
  55. package/dist/runtime/server/library.js +72 -0
  56. package/dist/runtime/server/links.get.d.ts +7 -0
  57. package/dist/runtime/server/links.get.js +35 -0
  58. package/dist/runtime/server/media.d.ts +74 -0
  59. package/dist/runtime/server/media.js +88 -0
  60. package/dist/runtime/server/schema.get.d.ts +8 -0
  61. package/dist/runtime/server/schema.get.js +17 -7
  62. package/dist/runtime/server/store.d.ts +11 -2
  63. package/dist/runtime/server/store.js +110 -20
  64. package/dist/runtime/server/upload.post.js +3 -2
  65. package/dist/runtime/server/versions.get.d.ts +20 -0
  66. package/dist/runtime/server/versions.get.js +36 -0
  67. package/package.json +3 -2
  68. package/dist/editor/assets/Button-Dai6Ph2c.js +0 -6
  69. package/dist/editor/assets/RichTextInput-CdL9ZFoP.js +0 -271
  70. package/dist/editor/assets/Toast-BaUcosq6.js +0 -13
  71. package/dist/editor/assets/index-CP6dGIyl.css +0 -2
  72. package/dist/editor/assets/index-Du-lvx2V.js +0 -16
@@ -0,0 +1,20 @@
1
+ declare const _default: import("nuxt/server").EventHandler<Promise<{
2
+ versions: {
3
+ updatedAt: string;
4
+ by: string | null;
5
+ changed: string[] | null;
6
+ }[];
7
+ key?: undefined;
8
+ value?: undefined;
9
+ updatedAt?: undefined;
10
+ by?: undefined;
11
+ } | {
12
+ versions?: undefined;
13
+ key: string;
14
+ value: {
15
+ [x: string]: unknown;
16
+ };
17
+ updatedAt: string;
18
+ by: string | null;
19
+ }>>;
20
+ export { _default as default };
@@ -0,0 +1,36 @@
1
+ import { changedFields, isEntryKey, sameInstant } from "./entries.js";
2
+ import { resolveValue } from "../fields.js";
3
+ import { fieldsOf } from "../pages.js";
4
+ import { requireEditor } from "./access.js";
5
+ import { serverImages } from "./images.js";
6
+ import { readVersions } from "./store.js";
7
+ import { createError, defineEventHandler, getQuery, getRouterParam } from "nuxt/server";
8
+ // src/runtime/server/versions.get.ts
9
+ var versions_get_default = defineEventHandler(async (event) => {
10
+ requireEditor(event);
11
+ const key = getRouterParam(event, "key");
12
+ if (!isEntryKey(key)) throw createError({
13
+ status: 400,
14
+ message: "Invalid key"
15
+ });
16
+ const versions = await readVersions(key);
17
+ const at = getQuery(event).at;
18
+ if (typeof at !== "string") return { versions: versions.map(({ updatedAt, by, value }, i) => ({
19
+ updatedAt,
20
+ by,
21
+ changed: changedFields(value, versions[i + 1]?.value)
22
+ })) };
23
+ const version = versions.find((v) => sameInstant(v.updatedAt, at));
24
+ if (!version) throw createError({
25
+ status: 404,
26
+ message: "No such version"
27
+ });
28
+ const fields = fieldsOf(key);
29
+ return {
30
+ key,
31
+ value: fields ? resolveValue(fields, version.value, serverImages) : version.value,
32
+ updatedAt: version.updatedAt,
33
+ by: version.by
34
+ };
35
+ });
36
+ export { versions_get_default as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wervt/cms",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "description": "Editable texts, images and lists for Nuxt sites on wervt: written to files in dev, to the app's database and bucket once deployed.",
5
5
  "keywords": [
6
6
  "cms",
@@ -33,7 +33,7 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@comark/vue": "^0.8.1",
36
- "@wervt/nuxt": "^0.3.24",
36
+ "@wervt/nuxt": "^0.3.26",
37
37
  "ablage": "^0.1.1",
38
38
  "comark": "^0.8.1"
39
39
  },
@@ -42,6 +42,7 @@
42
42
  "@golar/vue": "^0.1.11",
43
43
  "@iconify-json/lucide": "^1.2.157",
44
44
  "@iconify/vue": "^5.0.3",
45
+ "@internationalized/date": "^3.12.4",
45
46
  "@nuxt/ui": "^4.12.0",
46
47
  "@tiptap/core": "3.31.4",
47
48
  "@tiptap/extension-image": "3.31.4",