nuxt-auto-crud 1.7.0 → 1.9.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/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nuxt-auto-crud",
3
3
  "configKey": "autoCrud",
4
- "version": "1.7.0",
4
+ "version": "1.9.0",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -1,4 +1,5 @@
1
1
  import { eventHandler, createError } from "h3";
2
+ import { requireUserSession } from "#imports";
2
3
  import { getRelations } from "../utils/schema.js";
3
4
  import { useAutoCrudConfig } from "../utils/config.js";
4
5
  import { verifyJwtToken } from "../utils/jwt.js";
@@ -1,4 +1,5 @@
1
1
  import { eventHandler, createError, getRouterParam } from "h3";
2
+ import { requireUserSession } from "#imports";
2
3
  import { getSchema } from "../../utils/schema.js";
3
4
  import { useAutoCrudConfig } from "../../utils/config.js";
4
5
  import { verifyJwtToken } from "../../utils/jwt.js";
@@ -1,4 +1,5 @@
1
1
  import { eventHandler, createError } from "h3";
2
+ import { requireUserSession } from "#imports";
2
3
  import { getAllSchemas } from "../../utils/schema.js";
3
4
  import { useAutoCrudConfig } from "../../utils/config.js";
4
5
  import { verifyJwtToken } from "../../utils/jwt.js";
@@ -2,7 +2,7 @@ import { eq } from "drizzle-orm";
2
2
  import { useDrizzle } from "#site/drizzle";
3
3
  import * as tables from "#site/schema";
4
4
  import { useAutoCrudConfig } from "../utils/config.js";
5
- import { defineNitroPlugin, hashPassword } from "#imports";
5
+ import { defineNitroPlugin, hashPassword, onHubReady } from "#imports";
6
6
  export default defineNitroPlugin(async () => {
7
7
  onHubReady(async () => {
8
8
  const { auth } = useAutoCrudConfig();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-auto-crud",
3
- "version": "1.7.0",
3
+ "version": "1.9.0",
4
4
  "description": "Exposes RESTful CRUD APIs for your Nuxt app based solely on your database migrations.",
5
5
  "author": "Cliford Pereira",
6
6
  "license": "MIT",
@@ -1,4 +1,6 @@
1
1
  import { eventHandler, createError } from 'h3'
2
+ // @ts-expect-error - #imports is available in runtime
3
+ import { requireUserSession } from '#imports'
2
4
  import { getRelations } from '../utils/schema'
3
5
  import { useAutoCrudConfig } from '../utils/config'
4
6
  import { verifyJwtToken } from '../utils/jwt'
@@ -13,7 +15,6 @@ export default eventHandler(async (event) => {
13
15
  }
14
16
  else {
15
17
  try {
16
- // @ts-expect-error - requireUserSession is auto-imported
17
18
  await requireUserSession(event)
18
19
  isAuthenticated = true
19
20
  }
@@ -1,4 +1,6 @@
1
1
  import { eventHandler, createError, getRouterParam } from 'h3'
2
+ // @ts-expect-error - #imports is available in runtime
3
+ import { requireUserSession } from '#imports'
2
4
  import { getSchema } from '../../utils/schema'
3
5
  import { useAutoCrudConfig } from '../../utils/config'
4
6
  import { verifyJwtToken } from '../../utils/jwt'
@@ -14,7 +16,6 @@ export default eventHandler(async (event) => {
14
16
  }
15
17
  else {
16
18
  try {
17
- // @ts-expect-error - requireUserSession is auto-imported
18
19
  await requireUserSession(event)
19
20
  isAuthenticated = true
20
21
  }
@@ -1,4 +1,6 @@
1
1
  import { eventHandler, createError } from 'h3'
2
+ // @ts-expect-error - #imports is available in runtime
3
+ import { requireUserSession } from '#imports'
2
4
  import { getAllSchemas } from '../../utils/schema'
3
5
  import { useAutoCrudConfig } from '../../utils/config'
4
6
  import { verifyJwtToken } from '../../utils/jwt'
@@ -13,7 +15,6 @@ export default eventHandler(async (event) => {
13
15
  }
14
16
  else {
15
17
  try {
16
- // @ts-expect-error - requireUserSession is auto-imported
17
18
  await requireUserSession(event)
18
19
  isAuthenticated = true
19
20
  }
@@ -5,10 +5,9 @@ import { useDrizzle } from '#site/drizzle'
5
5
  import * as tables from '#site/schema'
6
6
  import { useAutoCrudConfig } from '../utils/config'
7
7
  // @ts-expect-error - #imports is available in runtime
8
- import { defineNitroPlugin, hashPassword } from '#imports'
8
+ import { defineNitroPlugin, hashPassword, onHubReady } from '#imports'
9
9
 
10
10
  export default defineNitroPlugin(async () => {
11
- // @ts-expect-error - onHubReady is auto-imported from @nuxthub/core
12
11
  onHubReady(async () => {
13
12
  const { auth } = useAutoCrudConfig()
14
13