cinqcinqdev-seo 0.1.16 → 0.1.17

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 CHANGED
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": "^3.0.0"
6
6
  },
7
- "version": "0.1.16",
7
+ "version": "0.1.17",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.2",
10
10
  "unbuild": "unknown"
@@ -1,5 +1,5 @@
1
1
  <script setup>
2
- import { computed, useHead, useRuntimeConfig, useSupabaseClient } from "#imports";
2
+ import { computed, useHead, useRuntimeConfig, useSupabaseClient, useAsyncData } from "#imports";
3
3
  import { useAdminBasePath } from "#imports";
4
4
  useHead({ title: "Tableau de bord \u2014 Admin" });
5
5
  const config = useRuntimeConfig().public.adminCms;
@@ -1,9 +1,10 @@
1
+ import { defineEventHandler, readBody, createError } from "h3";
1
2
  const isI18nField = (val) => val !== null && typeof val === "object" && !Array.isArray(val) && ("fr" in val || "ar" in val || "en" in val);
2
3
  export default defineEventHandler(async (event) => {
3
4
  const body = await readBody(event);
4
5
  const { sectionType, sectionLabel, fields, currentProps, prompt, itemFieldsConfig, aiContext } = body;
5
- const config = useRuntimeConfig();
6
- if (!config.openrouterApiKey) {
6
+ const openrouterApiKey = process.env.OPENROUTER_API_KEY || "";
7
+ if (!openrouterApiKey) {
7
8
  throw createError({ statusCode: 500, message: "OPENROUTER_API_KEY not configured" });
8
9
  }
9
10
  const skeleton = {};
@@ -82,7 +83,7 @@ Rules:
82
83
  const response = await $fetch("https://openrouter.ai/api/v1/chat/completions", {
83
84
  method: "POST",
84
85
  headers: {
85
- "Authorization": `Bearer ${config.openrouterApiKey}`,
86
+ "Authorization": `Bearer ${openrouterApiKey}`,
86
87
  "Content-Type": "application/json",
87
88
  "HTTP-Referer": "https://admin-cms.dev",
88
89
  "X-Title": "Admin CMS"
@@ -1,8 +1,9 @@
1
+ import { defineEventHandler, readBody, createError } from "h3";
1
2
  export default defineEventHandler(async (event) => {
2
3
  const body = await readBody(event);
3
4
  const { pageTitle, pageType, content, seoConfig, aiContext } = body;
4
- const config = useRuntimeConfig();
5
- if (!config.openrouterApiKey) {
5
+ const openrouterApiKey = process.env.OPENROUTER_API_KEY || "";
6
+ if (!openrouterApiKey) {
6
7
  throw createError({ statusCode: 500, message: "OPENROUTER_API_KEY not configured" });
7
8
  }
8
9
  const contentSummary = content.map((block) => {
@@ -66,7 +67,7 @@ Rules:
66
67
  const response = await $fetch("https://openrouter.ai/api/v1/chat/completions", {
67
68
  method: "POST",
68
69
  headers: {
69
- "Authorization": `Bearer ${config.openrouterApiKey}`,
70
+ "Authorization": `Bearer ${openrouterApiKey}`,
70
71
  "Content-Type": "application/json",
71
72
  "HTTP-Referer": "https://admin-cms.dev",
72
73
  "X-Title": "Admin CMS"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cinqcinqdev-seo",
3
- "version": "0.1.16",
3
+ "version": "0.1.17",
4
4
  "description": "A reusable Nuxt 3 admin CMS module with visual page editor powered by Supabase",
5
5
  "license": "MIT",
6
6
  "module": "./dist/module.mjs",
@@ -27,6 +27,9 @@
27
27
  "@pinia/nuxt": ">=0.5.0 || >=0.11.0",
28
28
  "nuxt": ">=3.0.0"
29
29
  },
30
+ "dependencies": {
31
+ "h3": ">=1.0.0"
32
+ },
30
33
  "devDependencies": {
31
34
  "@nuxt/icon": "^1.15.0",
32
35
  "@nuxt/kit": "^3.13.0",