@kyro-cms/admin 0.2.1 → 0.2.4
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/package.json +3 -3
- package/src/components/AutoForm.tsx +2 -2
- package/src/lib/config.ts +6 -6
- package/src/lib/storage.ts +1 -1
- package/src/pages/api/[collection]/[id]/publish.ts +2 -2
- package/src/pages/api/[collection]/[id]/unpublish.ts +2 -2
- package/src/pages/api/[collection]/[id]/versions.ts +1 -1
- package/src/pages/api/[collection]/[id].ts +2 -2
- package/src/pages/api/[collection]/index.ts +2 -2
- package/src/pages/api/collections.ts +1 -1
- package/src/pages/api/globals/[slug]/test.ts +1 -2
- package/src/pages/api/globals/[slug].ts +2 -2
- package/src/pages/api/graphql.ts +3 -3
- package/src/pages/api/media/folders.ts +1 -1
- package/src/pages/api/media/index.ts +1 -1
- package/src/pages/api/media/resize.ts +1 -1
- package/src/pages/api/slug-availability.ts +2 -2
- package/src/pages/api/storage-config.ts +1 -1
- package/src/pages/api/storage-status.ts +1 -1
- package/src/pages/api/upload.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kyro-cms/admin",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"@dnd-kit/sortable": "^10.0.0",
|
|
48
48
|
"@dnd-kit/utilities": "^3.2.2",
|
|
49
49
|
"@graphiql/react": "^0.37.3",
|
|
50
|
-
"@kyro-cms/core": "^0.2.
|
|
51
|
-
"@kyro-cms/utils": "^0.2.
|
|
50
|
+
"@kyro-cms/core": "^0.2.4",
|
|
51
|
+
"@kyro-cms/utils": "^0.2.4",
|
|
52
52
|
"@platejs/dnd": "^53.0.0",
|
|
53
53
|
"@portabletext/editor": "^6.6.3",
|
|
54
54
|
"@portabletext/react": "^6.0.3",
|
|
@@ -12,8 +12,8 @@ import CheckboxField from "./fields/CheckboxField";
|
|
|
12
12
|
import SelectField from "./fields/SelectField";
|
|
13
13
|
import DateField from "./fields/DateField";
|
|
14
14
|
import { MarkdownField } from "./fields/MarkdownField";
|
|
15
|
-
import { globals, collections } from "
|
|
16
|
-
import { slugifyText } from "
|
|
15
|
+
import { globals, collections } from "../lib/config";
|
|
16
|
+
import { slugifyText } from "../lib/slugify";
|
|
17
17
|
|
|
18
18
|
import { BlocksField } from "./fields/BlocksField";
|
|
19
19
|
import PortableTextField from "./fields/PortableTextField";
|
package/src/lib/config.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import type { CollectionConfig, GlobalConfig } from "@kyro-cms/core/client";
|
|
2
|
-
import { blogCollections } from "../../../src/templates/blog";
|
|
3
|
-
import { ecommerceCollections } from "../../../src/templates/ecommerce";
|
|
4
|
-
import { minimalCollections } from "../../../src/templates/minimal";
|
|
5
|
-
import { kitchenSinkCollections } from "../../../src/templates/kitchen-sink";
|
|
6
|
-
import { mediaCollections } from "../../../src/templates/media";
|
|
7
2
|
import {
|
|
3
|
+
blogCollections,
|
|
4
|
+
ecommerceCollections,
|
|
5
|
+
minimalCollections,
|
|
6
|
+
kitchenSinkCollections,
|
|
7
|
+
mediaCollections,
|
|
8
8
|
allSettingsGlobals,
|
|
9
9
|
coreSettingsGlobals,
|
|
10
10
|
ecommerceSettingsGlobals,
|
|
11
|
-
} from "
|
|
11
|
+
} from "@kyro-cms/core";
|
|
12
12
|
import { authCollections } from "../collections/auth";
|
|
13
13
|
import { portfolioCollections } from "../collections/portfolio";
|
|
14
14
|
|
package/src/lib/storage.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { APIRoute } from "astro";
|
|
2
|
-
import { dataStore } from "
|
|
3
|
-
import { collections } from "
|
|
2
|
+
import { dataStore } from "../../../../../lib/dataStore";
|
|
3
|
+
import { collections } from "../../../../../lib/config";
|
|
4
4
|
|
|
5
5
|
dataStore.initialize(collections);
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { APIRoute } from "astro";
|
|
2
|
-
import { dataStore } from "
|
|
3
|
-
import { collections } from "
|
|
2
|
+
import { dataStore } from "../../../../../lib/dataStore";
|
|
3
|
+
import { collections } from "../../../../../lib/config";
|
|
4
4
|
|
|
5
5
|
dataStore.initialize(collections);
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { APIRoute } from "astro";
|
|
2
|
-
import { dataStore } from "
|
|
3
|
-
import { collections } from "
|
|
2
|
+
import { dataStore } from "../../../../lib/dataStore";
|
|
3
|
+
import { collections } from "../../../../lib/config";
|
|
4
4
|
import { getAuthAdapter } from "../../../lib/db";
|
|
5
5
|
|
|
6
6
|
dataStore.initialize(collections);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { APIRoute } from "astro";
|
|
2
|
-
import { dataStore } from "
|
|
3
|
-
import { collections } from "
|
|
2
|
+
import { dataStore } from "../../../../lib/dataStore";
|
|
3
|
+
import { collections } from "../../../../lib/config";
|
|
4
4
|
import { getAuthAdapter } from "../../../lib/db";
|
|
5
5
|
|
|
6
6
|
dataStore.initialize(collections);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { APIRoute } from "astro";
|
|
2
|
-
import { dataStore } from "
|
|
2
|
+
import { dataStore } from "../../../../../lib/dataStore";
|
|
3
3
|
import nodemailer, { createTransport } from "nodemailer";
|
|
4
4
|
|
|
5
5
|
export const POST: APIRoute = async ({ params, request }) => {
|
|
@@ -146,7 +146,6 @@ export const POST: APIRoute = async ({ params, request }) => {
|
|
|
146
146
|
}),
|
|
147
147
|
{ status: 200, headers: { "Content-Type": "application/json" } },
|
|
148
148
|
);
|
|
149
|
-
|
|
150
149
|
} catch (error: any) {
|
|
151
150
|
console.log(error);
|
|
152
151
|
let errorMessage = "Failed to send test email";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { APIRoute } from "astro";
|
|
2
|
-
import { dataStore } from "
|
|
3
|
-
import { globals } from "
|
|
2
|
+
import { dataStore } from "../../../../lib/dataStore";
|
|
3
|
+
import { globals } from "../../../../lib/config";
|
|
4
4
|
|
|
5
5
|
export const GET: APIRoute = async ({ params }) => {
|
|
6
6
|
const slug = params.slug as string;
|
package/src/pages/api/graphql.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { APIRoute } from "astro";
|
|
2
|
-
import { executeGraphQL } from "
|
|
3
|
-
import { dataStore } from "
|
|
4
|
-
import { collections } from "
|
|
2
|
+
import { executeGraphQL } from "../../../lib/graphql/schema";
|
|
3
|
+
import { dataStore } from "../../../lib/dataStore";
|
|
4
|
+
import { collections } from "../../../lib/config";
|
|
5
5
|
|
|
6
6
|
dataStore.initialize(collections);
|
|
7
7
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { APIRoute } from "astro";
|
|
2
2
|
import fs from "fs/promises";
|
|
3
|
-
import { getStorageConfig } from "
|
|
3
|
+
import { getStorageConfig } from "../../../../lib/storage";
|
|
4
4
|
import { S3Client, ListObjectsV2Command } from "@aws-sdk/client-s3";
|
|
5
5
|
|
|
6
6
|
function isCloudProvider(provider: string): boolean {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { APIRoute } from "astro";
|
|
2
2
|
import { getMediaService, type MediaItem } from "../../../lib/MediaService";
|
|
3
|
-
import { constructMediaUrl, getStorageConfig } from "
|
|
3
|
+
import { constructMediaUrl, getStorageConfig } from "../../../../lib/storage";
|
|
4
4
|
|
|
5
5
|
export const GET: APIRoute = async ({ url }) => {
|
|
6
6
|
let mediaService: any = null;
|
|
@@ -5,7 +5,7 @@ import fs from "fs/promises";
|
|
|
5
5
|
import fsSync from "fs";
|
|
6
6
|
import https from "https";
|
|
7
7
|
import { createHash } from "crypto";
|
|
8
|
-
import { getStorageConfig } from "
|
|
8
|
+
import { getStorageConfig } from "../../../../lib/storage";
|
|
9
9
|
|
|
10
10
|
// Cache configuration
|
|
11
11
|
const CACHE_BASE = path.join(process.cwd(), ".cache", "kyro-media", "resize");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { APIRoute } from "astro";
|
|
2
|
-
import { dataStore } from "
|
|
3
|
-
import { collections } from "
|
|
2
|
+
import { dataStore } from "../../../lib/dataStore";
|
|
3
|
+
import { collections } from "../../../lib/config";
|
|
4
4
|
|
|
5
5
|
dataStore.initialize(collections);
|
|
6
6
|
|
package/src/pages/api/upload.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { APIRoute } from "astro";
|
|
2
2
|
import { MediaService, type Dialect } from "@kyro-cms/core";
|
|
3
|
-
import { getDatabaseConfig, runMigrations } from "
|
|
3
|
+
import { getDatabaseConfig, runMigrations } from "../../../lib/db";
|
|
4
4
|
|
|
5
5
|
const MAX_FILE_SIZE = 50 * 1024 * 1024; // 50MB
|
|
6
6
|
|