@isardsat/editorial-server 6.1.2 → 6.3.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/dist/app.js +1 -1
- package/dist/lib/config.d.ts +9 -0
- package/dist/lib/schema.d.ts +9 -0
- package/dist/routes/admin.d.ts +2 -1
- package/dist/routes/admin.js +30 -1
- package/package.json +3 -4
package/dist/app.js
CHANGED
|
@@ -21,7 +21,7 @@ export async function createEditorialServer({ configDirectory = BASE_EDITORIAL_P
|
|
|
21
21
|
app.route("/api/v1", createDataRoutes(storage));
|
|
22
22
|
app.route("/api/v1", createFilesRoutes());
|
|
23
23
|
app.route("/api/v1", createActionRoutes(storage, hooks));
|
|
24
|
-
app.route("/", createAdminRoutes());
|
|
24
|
+
app.route("/", createAdminRoutes(config));
|
|
25
25
|
app.doc("/doc", {
|
|
26
26
|
openapi: "3.0.0",
|
|
27
27
|
info: {
|
package/dist/lib/config.d.ts
CHANGED
|
@@ -3,4 +3,13 @@ export declare function createConfig(configDirectory: string): Promise<{
|
|
|
3
3
|
publicUrl: string;
|
|
4
4
|
previewUrl?: string | undefined;
|
|
5
5
|
silent?: boolean | undefined;
|
|
6
|
+
firebase?: {
|
|
7
|
+
apiKey: string;
|
|
8
|
+
authDomain: string;
|
|
9
|
+
databaseURL: string;
|
|
10
|
+
projectId: string;
|
|
11
|
+
storageBucket: string;
|
|
12
|
+
messagingSenderId: string;
|
|
13
|
+
dbUsersPath: string;
|
|
14
|
+
} | undefined;
|
|
6
15
|
}>;
|
package/dist/lib/schema.d.ts
CHANGED
|
@@ -3,4 +3,13 @@ export declare function createSchema(configDirectory: string): Promise<{
|
|
|
3
3
|
publicUrl: string;
|
|
4
4
|
previewUrl?: string | undefined;
|
|
5
5
|
silent?: boolean | undefined;
|
|
6
|
+
firebase?: {
|
|
7
|
+
apiKey: string;
|
|
8
|
+
authDomain: string;
|
|
9
|
+
databaseURL: string;
|
|
10
|
+
projectId: string;
|
|
11
|
+
storageBucket: string;
|
|
12
|
+
messagingSenderId: string;
|
|
13
|
+
dbUsersPath: string;
|
|
14
|
+
} | undefined;
|
|
6
15
|
}>;
|
package/dist/routes/admin.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { OpenAPIHono } from "@hono/zod-openapi";
|
|
2
|
-
|
|
2
|
+
import type { EditorialConfig } from "@isardsat/editorial-common";
|
|
3
|
+
export declare function createAdminRoutes(config: EditorialConfig): OpenAPIHono<import("hono").Env, {}, "/">;
|
package/dist/routes/admin.js
CHANGED
|
@@ -2,13 +2,42 @@ import { serveStatic } from "@hono/node-server/serve-static";
|
|
|
2
2
|
import { OpenAPIHono } from "@hono/zod-openapi";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import path from "path";
|
|
5
|
-
|
|
5
|
+
import { z } from "@hono/zod-openapi";
|
|
6
|
+
export function createAdminRoutes(config) {
|
|
6
7
|
const app = new OpenAPIHono();
|
|
7
8
|
// TODO: This is package manager dependent
|
|
8
9
|
const require = createRequire(import.meta.url);
|
|
9
10
|
const adminPackagePath = require.resolve("@isardsat/editorial-admin/package.json");
|
|
10
11
|
const adminPath = path.join(path.dirname(adminPackagePath), "build", "client");
|
|
11
12
|
const relativeAdminPath = path.relative(process.cwd(), adminPath);
|
|
13
|
+
// Admin config endpoint
|
|
14
|
+
app.openapi({
|
|
15
|
+
method: "get",
|
|
16
|
+
path: "/admin/config",
|
|
17
|
+
summary: "Get Firebase configuration for admin",
|
|
18
|
+
responses: {
|
|
19
|
+
200: {
|
|
20
|
+
content: {
|
|
21
|
+
"application/json": {
|
|
22
|
+
schema: z.object({
|
|
23
|
+
firebase: z.object({
|
|
24
|
+
apiKey: z.string(),
|
|
25
|
+
authDomain: z.string(),
|
|
26
|
+
databaseURL: z.string(),
|
|
27
|
+
projectId: z.string(),
|
|
28
|
+
storageBucket: z.string(),
|
|
29
|
+
messagingSenderId: z.string(),
|
|
30
|
+
dbUsersPath: z.string(),
|
|
31
|
+
}).optional(),
|
|
32
|
+
}),
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
description: "Firebase configuration for admin",
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
}, (c) => {
|
|
39
|
+
return c.json({ firebase: config.firebase });
|
|
40
|
+
});
|
|
12
41
|
app.use("/admin/*", serveStatic({
|
|
13
42
|
root: relativeAdminPath,
|
|
14
43
|
rewriteRequestPath(path) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@isardsat/editorial-server",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.3.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -14,13 +14,12 @@
|
|
|
14
14
|
"hono": "^4.6.20",
|
|
15
15
|
"yaml": "^2.7.0",
|
|
16
16
|
"zod": "^3.24.1",
|
|
17
|
-
"@isardsat/editorial-
|
|
18
|
-
"@isardsat/editorial-
|
|
17
|
+
"@isardsat/editorial-common": "^6.3.0",
|
|
18
|
+
"@isardsat/editorial-admin": "^6.3.0"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@tsconfig/node22": "^22.0.0",
|
|
22
22
|
"@types/node": "22.13.1",
|
|
23
|
-
"esbuild": "^0.24.2",
|
|
24
23
|
"typescript": "5.7.3"
|
|
25
24
|
},
|
|
26
25
|
"volta": {
|