mktcms 0.1.21 → 0.1.23
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/module.json +1 -1
- package/dist/module.mjs +45 -15
- package/dist/runtime/app/components/admin.vue +1 -1
- package/dist/runtime/app/components/content/breadcrumb.d.vue.ts +1 -4
- package/dist/runtime/app/components/content/breadcrumb.vue +25 -9
- package/dist/runtime/app/components/content/breadcrumb.vue.d.ts +1 -4
- package/dist/runtime/app/components/content/delete.vue +69 -0
- package/dist/runtime/app/components/content/dirs.d.vue.ts +0 -1
- package/dist/runtime/app/components/content/dirs.vue +19 -3
- package/dist/runtime/app/components/content/dirs.vue.d.ts +0 -1
- package/dist/runtime/app/components/content/editor/csv.vue +310 -0
- package/dist/runtime/app/components/content/editor/{blob/image.d.vue.ts → frontmatter/form.d.vue.ts} +3 -3
- package/dist/runtime/app/components/content/editor/frontmatter/form.vue +17 -0
- package/dist/runtime/app/components/content/editor/{text/csv.d.vue.ts → frontmatter/form.vue.d.ts} +3 -3
- package/dist/runtime/app/components/content/editor/frontmatter/input.d.vue.ts +14 -0
- package/dist/runtime/app/components/content/editor/frontmatter/input.vue +53 -0
- package/dist/runtime/app/components/content/editor/frontmatter/input.vue.d.ts +14 -0
- package/dist/runtime/app/components/content/editor/image.vue +27 -0
- package/dist/runtime/app/components/content/editor/markdown.vue +114 -0
- package/dist/runtime/app/components/content/editor/pdf.d.vue.ts +3 -0
- package/dist/runtime/app/components/content/editor/pdf.vue +26 -0
- package/dist/runtime/app/components/content/editor/pdf.vue.d.ts +3 -0
- package/dist/runtime/app/components/content/editor/selectFile/breadcrumb.d.vue.ts +10 -0
- package/dist/runtime/app/components/content/editor/selectFile/breadcrumb.vue +51 -0
- package/dist/runtime/app/components/content/editor/selectFile/breadcrumb.vue.d.ts +10 -0
- package/dist/runtime/app/components/content/editor/selectFile/index.d.vue.ts +12 -0
- package/dist/runtime/app/components/content/editor/selectFile/index.vue +89 -0
- package/dist/runtime/app/components/content/editor/selectFile/index.vue.d.ts +12 -0
- package/dist/runtime/app/components/content/editor/txt.d.vue.ts +3 -0
- package/dist/runtime/app/components/content/editor/txt.vue +41 -0
- package/dist/runtime/app/components/content/editor/txt.vue.d.ts +3 -0
- package/dist/runtime/app/components/content/fileButtons.d.vue.ts +6 -0
- package/dist/runtime/app/components/content/fileButtons.vue +92 -0
- package/dist/runtime/app/components/content/fileButtons.vue.d.ts +6 -0
- package/dist/runtime/app/components/content/fileIcon.d.vue.ts +6 -0
- package/dist/runtime/app/components/content/fileIcon.vue +80 -0
- package/dist/runtime/app/components/content/fileIcon.vue.d.ts +6 -0
- package/dist/runtime/app/components/content/files.d.vue.ts +0 -1
- package/dist/runtime/app/components/content/files.vue +26 -92
- package/dist/runtime/app/components/content/files.vue.d.ts +0 -1
- package/dist/runtime/app/components/content/index.vue +8 -34
- package/dist/runtime/app/components/content/saved.d.vue.ts +3 -0
- package/dist/runtime/app/components/content/saved.vue +19 -0
- package/dist/runtime/app/components/content/saved.vue.d.ts +3 -0
- package/dist/runtime/app/components/content/upload.vue +40 -28
- package/dist/runtime/app/components/header.vue +55 -25
- package/dist/runtime/app/composables/useAdminUpload.d.ts +0 -1
- package/dist/runtime/app/composables/useAdminUpload.js +4 -15
- package/dist/runtime/app/composables/useFileType.d.ts +7 -0
- package/dist/runtime/app/composables/useFileType.js +14 -0
- package/dist/runtime/app/composables/usePathParam.d.ts +9 -0
- package/dist/runtime/app/composables/usePathParam.js +16 -0
- package/dist/runtime/app/pages/admin/delete/[path].d.vue.ts +3 -0
- package/dist/runtime/app/pages/admin/delete/[path].vue +14 -0
- package/dist/runtime/app/pages/admin/delete/[path].vue.d.ts +3 -0
- package/dist/runtime/app/pages/admin/edit/[path].d.vue.ts +3 -0
- package/dist/runtime/app/pages/admin/edit/[path].vue +27 -0
- package/dist/runtime/app/pages/admin/edit/[path].vue.d.ts +3 -0
- package/dist/runtime/app/pages/admin/index.vue +2 -0
- package/dist/runtime/app/pages/admin/login.vue +68 -21
- package/dist/runtime/app/styles/admin.css +1 -0
- package/dist/runtime/app/styles/admin.min.css +1 -0
- package/dist/runtime/server/api/admin/blob.js +37 -0
- package/dist/runtime/server/api/admin/csv.d.ts +5 -0
- package/dist/runtime/server/api/admin/csv.js +28 -0
- package/dist/runtime/server/api/admin/csv.post.d.ts +4 -0
- package/dist/runtime/server/api/admin/csv.post.js +28 -0
- package/dist/runtime/server/api/admin/delete.d.ts +4 -0
- package/dist/runtime/server/api/admin/delete.js +15 -0
- package/dist/runtime/server/api/admin/{content/[path].post.d.ts → download.d.ts} +1 -1
- package/dist/runtime/server/api/admin/download.js +29 -0
- package/dist/runtime/server/api/admin/list.d.ts +5 -0
- package/dist/runtime/server/api/admin/list.js +24 -0
- package/dist/runtime/server/api/admin/md.d.ts +5 -0
- package/dist/runtime/server/api/admin/md.js +22 -0
- package/dist/runtime/server/api/admin/md.post.d.ts +4 -0
- package/dist/runtime/server/api/admin/md.post.js +31 -0
- package/dist/runtime/server/api/admin/{content/list.d.ts → txt.d.ts} +1 -1
- package/dist/runtime/server/api/admin/txt.js +21 -0
- package/dist/runtime/server/api/admin/txt.post.d.ts +4 -0
- package/dist/runtime/server/api/admin/txt.post.js +19 -0
- package/dist/runtime/server/api/admin/{content/upload.js → upload.js} +1 -1
- package/dist/runtime/server/api/content/[path].js +15 -14
- package/dist/runtime/server/api/content/list.d.ts +11 -1
- package/dist/runtime/server/api/content/list.js +35 -10
- package/dist/runtime/server/plugins/storage.js +0 -3
- package/dist/runtime/server/utils/parseFrontmatter.d.ts +4 -0
- package/dist/runtime/server/utils/parseFrontmatter.js +24 -0
- package/package.json +10 -2
- package/dist/runtime/app/components/content/editor/blob/image.vue +0 -12
- package/dist/runtime/app/components/content/editor/blob/image.vue.d.ts +0 -10
- package/dist/runtime/app/components/content/editor/blob/index.vue +0 -41
- package/dist/runtime/app/components/content/editor/text/csv.vue +0 -235
- package/dist/runtime/app/components/content/editor/text/csv.vue.d.ts +0 -10
- package/dist/runtime/app/components/content/editor/text/index.vue +0 -58
- package/dist/runtime/app/components/content/editor/text/markdown.d.vue.ts +0 -10
- package/dist/runtime/app/components/content/editor/text/markdown.vue +0 -69
- package/dist/runtime/app/components/content/editor/text/markdown.vue.d.ts +0 -10
- package/dist/runtime/app/pages/admin/edit/blob/[path].vue +0 -12
- package/dist/runtime/app/pages/admin/edit/text/[path].vue +0 -12
- package/dist/runtime/server/api/admin/content/[path].js +0 -34
- package/dist/runtime/server/api/admin/content/[path].post.js +0 -18
- package/dist/runtime/server/api/admin/content/list.js +0 -20
- /package/dist/runtime/app/components/content/{editor/blob/index.d.vue.ts → delete.d.vue.ts} +0 -0
- /package/dist/runtime/app/components/content/{editor/blob/index.vue.d.ts → delete.vue.d.ts} +0 -0
- /package/dist/runtime/app/components/content/editor/{text/index.d.vue.ts → csv.d.vue.ts} +0 -0
- /package/dist/runtime/app/components/content/editor/{text/index.vue.d.ts → csv.vue.d.ts} +0 -0
- /package/dist/runtime/app/{pages/admin/edit/blob/[path].d.vue.ts → components/content/editor/image.d.vue.ts} +0 -0
- /package/dist/runtime/app/{pages/admin/edit/blob/[path].vue.d.ts → components/content/editor/image.vue.d.ts} +0 -0
- /package/dist/runtime/app/{pages/admin/edit/text/[path].d.vue.ts → components/content/editor/markdown.d.vue.ts} +0 -0
- /package/dist/runtime/app/{pages/admin/edit/text/[path].vue.d.ts → components/content/editor/markdown.vue.d.ts} +0 -0
- /package/dist/runtime/server/api/admin/{content/[path].d.ts → blob.d.ts} +0 -0
- /package/dist/runtime/server/api/admin/{content/upload.d.ts → upload.d.ts} +0 -0
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
type __VLS_ModelProps = {
|
|
2
|
-
'content'?: string;
|
|
3
|
-
};
|
|
4
|
-
declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
5
|
-
"update:content": (value: string) => any;
|
|
6
|
-
}, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
|
|
7
|
-
"onUpdate:content"?: ((value: string) => any) | undefined;
|
|
8
|
-
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
|
-
declare const _default: typeof __VLS_export;
|
|
10
|
-
export default _default;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import Admin from "../../../../components/admin.vue";
|
|
3
|
-
import Header from "../../../../components/header.vue";
|
|
4
|
-
import Editor from "../../../../components/content/editor/blob/index.vue";
|
|
5
|
-
</script>
|
|
6
|
-
|
|
7
|
-
<template>
|
|
8
|
-
<Admin>
|
|
9
|
-
<Header />
|
|
10
|
-
<Editor />
|
|
11
|
-
</Admin>
|
|
12
|
-
</template>
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import Admin from "../../../../components/admin.vue";
|
|
3
|
-
import Header from "../../../../components/header.vue";
|
|
4
|
-
import Editor from "../../../../components/content/editor/text/index.vue";
|
|
5
|
-
</script>
|
|
6
|
-
|
|
7
|
-
<template>
|
|
8
|
-
<Admin>
|
|
9
|
-
<Header />
|
|
10
|
-
<Editor />
|
|
11
|
-
</Admin>
|
|
12
|
-
</template>
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { createError, defineEventHandler, getValidatedRouterParams } from "h3";
|
|
3
|
-
import { useRuntimeConfig, useStorage } from "nitropack/runtime";
|
|
4
|
-
const paramsSchema = z.object({
|
|
5
|
-
path: z.string().min(1)
|
|
6
|
-
});
|
|
7
|
-
export default defineEventHandler(async (event) => {
|
|
8
|
-
const { path } = await getValidatedRouterParams(event, (params) => paramsSchema.parse(params));
|
|
9
|
-
const { mktcms: { s3Prefix } } = useRuntimeConfig();
|
|
10
|
-
const fullPath = s3Prefix + ":" + path;
|
|
11
|
-
const isImage = path.match(/\.(png|jpg|jpeg|gif|svg|webp)$/i);
|
|
12
|
-
const isPdf = path.endsWith(".pdf");
|
|
13
|
-
if (isImage) {
|
|
14
|
-
event.node.res.setHeader("Content-Type", "image/" + path.split(".").pop()?.toLowerCase());
|
|
15
|
-
} else if (isPdf) {
|
|
16
|
-
event.node.res.setHeader("Content-Type", "application/pdf");
|
|
17
|
-
} else {
|
|
18
|
-
event.node.res.setHeader("Content-Type", "text/plain; charset=utf-8");
|
|
19
|
-
}
|
|
20
|
-
const storage = useStorage("content");
|
|
21
|
-
const file = isImage || isPdf ? await storage.getItemRaw(fullPath) : await storage.getItem(fullPath);
|
|
22
|
-
if (!file) {
|
|
23
|
-
const fallbackStorage = useStorage("fallback");
|
|
24
|
-
const fallbackFile = isImage || isPdf ? await fallbackStorage.getItemRaw(fullPath) : await fallbackStorage.getItem(fullPath);
|
|
25
|
-
if (fallbackFile) {
|
|
26
|
-
return fallbackFile;
|
|
27
|
-
}
|
|
28
|
-
throw createError({
|
|
29
|
-
statusCode: 404,
|
|
30
|
-
statusMessage: "File not found"
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
return file;
|
|
34
|
-
});
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { defineEventHandler, getValidatedRouterParams, readValidatedBody } from "h3";
|
|
3
|
-
import { useRuntimeConfig, useStorage } from "nitropack/runtime";
|
|
4
|
-
const paramsSchema = z.object({
|
|
5
|
-
path: z.string().min(1)
|
|
6
|
-
});
|
|
7
|
-
const bodySchema = z.object({
|
|
8
|
-
content: z.string()
|
|
9
|
-
});
|
|
10
|
-
export default defineEventHandler(async (event) => {
|
|
11
|
-
const { path } = await getValidatedRouterParams(event, (params) => paramsSchema.parse(params));
|
|
12
|
-
const { content } = await readValidatedBody(event, (body) => bodySchema.parse(body));
|
|
13
|
-
const { mktcms: { s3Prefix } } = useRuntimeConfig();
|
|
14
|
-
const fullPath = s3Prefix + ":" + path;
|
|
15
|
-
const storage = useStorage("content");
|
|
16
|
-
const file = await storage.setItem(fullPath, content);
|
|
17
|
-
return file;
|
|
18
|
-
});
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import z from "zod";
|
|
2
|
-
import { useStorage, useRuntimeConfig } from "nitropack/runtime";
|
|
3
|
-
import { defineEventHandler, getValidatedQuery } from "h3";
|
|
4
|
-
const querySchema = z.object({
|
|
5
|
-
path: z.string().optional()
|
|
6
|
-
});
|
|
7
|
-
export default defineEventHandler(async (event) => {
|
|
8
|
-
const { path } = await getValidatedQuery(event, (query) => querySchema.parse(query));
|
|
9
|
-
const { mktcms: { s3Prefix } } = useRuntimeConfig();
|
|
10
|
-
const storage = useStorage("content");
|
|
11
|
-
const keys = await storage.getKeys(s3Prefix + (path ? ":" + path : ""));
|
|
12
|
-
const fallbackStorage = useStorage("fallback");
|
|
13
|
-
const fallbackKeys = await fallbackStorage.getKeys(s3Prefix + (path ? ":" + path : ""));
|
|
14
|
-
for (const key of fallbackKeys) {
|
|
15
|
-
if (!keys.includes(key)) {
|
|
16
|
-
keys.push(key);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
return keys.map((key) => key.replace(s3Prefix + ":", ""));
|
|
20
|
-
});
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|