nuxtjs-drupal-ce
Advanced tools
| <template> | ||
| <div class="canvas-page"> | ||
| <slot name="components" /> | ||
| </div> | ||
| </template> | ||
| <script setup lang="ts"> | ||
| defineSlots<{ | ||
| components(): any | ||
| }>() | ||
| </script> |
+1
-1
@@ -7,3 +7,3 @@ { | ||
| }, | ||
| "version": "2.5.0", | ||
| "version": "2.5.1", | ||
| "builder": { | ||
@@ -10,0 +10,0 @@ "@nuxt/module-builder": "1.0.2", |
+1
-1
@@ -5,3 +5,3 @@ import { defineNuxtModule, createResolver, addServerPlugin, addImportsDir, addServerHandler, installModule, addImports } from '@nuxt/kit'; | ||
| function getCorsOrigin(nuxt) { | ||
| const drupalBaseUrl = nuxt.options.runtimeConfig.public.drupalCe.drupalBaseUrl; | ||
| const drupalBaseUrl = process.env.NUXT_PUBLIC_DRUPAL_CE_DRUPAL_BASE_URL || nuxt.options.runtimeConfig.public.drupalCe.drupalBaseUrl; | ||
| if (!drupalBaseUrl) { | ||
@@ -8,0 +8,0 @@ return null; |
@@ -16,7 +16,7 @@ import type { $Fetch, NitroFetchRequest } from 'nitropack'; | ||
| passThroughHeaders: (nuxtApp: any, pageHeaders: any) => void; | ||
| getCeApiEndpoint: (localize?: boolean) => any; | ||
| getDrupalBaseUrl: () => any; | ||
| getMenuBaseUrl: () => any; | ||
| getCeApiEndpoint: (localize?: boolean) => string; | ||
| getDrupalBaseUrl: () => string; | ||
| getMenuBaseUrl: () => string; | ||
| getPageLayout: (page?: Ref<any>) => ComputedRef<string>; | ||
| usePageHead: (page: Ref<any>, include?: Array<"title" | "meta" | "link" | "jsonld">) => void; | ||
| }; |
@@ -67,2 +67,11 @@ import { defu } from "defu"; | ||
| const computePageKey = (skipProxy, nuxtApp) => { | ||
| const buildKey = (path) => { | ||
| const sanitized = path.replace(/\/(\?|$)/, "$1"); | ||
| const proxyMode = skipProxy ? "-direct" : "-proxy"; | ||
| return `page-${sanitized}${proxyMode}`; | ||
| }; | ||
| if (import.meta.prerender) { | ||
| const route2 = useRoute(); | ||
| return buildKey(route2.path); | ||
| } | ||
| if (import.meta.server) { | ||
@@ -73,5 +82,3 @@ return "__ssr__"; | ||
| const pathWithQuery = route.fullPath.split("#")[0]; | ||
| const sanitized = pathWithQuery.replace(/\/(\?|$)/, "$1"); | ||
| const proxyMode = skipProxy ? "-direct" : "-proxy"; | ||
| const properKey = `page-${sanitized}${proxyMode}`; | ||
| const properKey = buildKey(pathWithQuery); | ||
| if (nuxtApp.payload.data["__ssr__"]) { | ||
@@ -78,0 +85,0 @@ nuxtApp.payload.data[properKey] = nuxtApp.payload.data["__ssr__"]; |
@@ -7,3 +7,3 @@ /** | ||
| */ | ||
| export declare const getDrupalBaseUrl: () => any; | ||
| export declare const getDrupalBaseUrl: () => string; | ||
| /** | ||
@@ -14,2 +14,2 @@ * Returns the menuBaseUrl if set, otherwise it returns the drupalBaseUrl + ceApiEndpoint. | ||
| */ | ||
| export declare const getMenuBaseUrl: () => any; | ||
| export declare const getMenuBaseUrl: () => string; |
@@ -7,6 +7,10 @@ import { defineEventHandler, readFormData } from "h3"; | ||
| const { ceApiEndpoint } = useRuntimeConfig().public.drupalCe; | ||
| const currentPath = event.node.req.url?.split("?")[0] || ""; | ||
| if (currentPath.startsWith("/api/drupal-ce/") || currentPath === "/api/drupal-ce") { | ||
| return; | ||
| } | ||
| if (event.node.req.method === "POST") { | ||
| const routesToBypass = Array.isArray(disableFormHandler) ? disableFormHandler : []; | ||
| if (routesToBypass.length) { | ||
| const currentPath = event.node.req.url?.split("?")[0] || ""; | ||
| const currentPath2 = event.node.req.url?.split("?")[0] || ""; | ||
| const shouldBypass = routesToBypass.some((route) => { | ||
@@ -18,3 +22,3 @@ const routeFormats = [ | ||
| ]; | ||
| return routeFormats.some((format) => format === currentPath); | ||
| return routeFormats.some((format) => format === currentPath2); | ||
| }); | ||
@@ -21,0 +25,0 @@ if (shouldBypass) { |
+1
-1
| { | ||
| "name": "nuxtjs-drupal-ce", | ||
| "version": "2.5.0", | ||
| "version": "2.5.1", | ||
| "license": "MIT", | ||
@@ -5,0 +5,0 @@ "bin": { |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
60563
0.97%42
2.44%711
1.57%2
100%