nuxt-auto-crud 2.1.2 → 2.1.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/README.md CHANGED
@@ -56,13 +56,14 @@ export const users = sqliteTable('users', {
56
56
 
57
57
  ```
58
58
 
59
- ### Initialize and Run
59
+ ### Generate Migrations and Start Dev Server
60
60
 
61
61
  ```bash
62
- npx nuxi generate
63
- npx nuxi dev
62
+ nuxt db generate
63
+ nuxt dev
64
64
 
65
65
  ```
66
+ > If you encounter `Error: Cannot find module 'typescript'`, run `bun add -D typescript`.
66
67
 
67
68
  ---
68
69
 
@@ -72,7 +73,7 @@ Nb: Endpoints follow the pattern `/api/_nac/:model`.
72
73
 
73
74
  | Method | Endpoint | Action |
74
75
  | --- | --- | --- |
75
- | **GET** | `/:model` | List records (supports filtering & pagination) |
76
+ | **GET** | `/:model` | List records |
76
77
  | **POST** | `/:model` | Create record with Zod validation |
77
78
  | **GET** | `/:model/:id` | Fetch single record |
78
79
  | **PATCH** | `/:model/:id` | Partial update with validation |
@@ -82,7 +83,7 @@ Nb: Endpoints follow the pattern `/api/_nac/:model`.
82
83
 
83
84
  | Action | HTTP Method | Endpoint | Example Result |
84
85
  | --- | --- | --- | --- |
85
- | **Fetch All** | `GET` | `/api/_nac/users` | List of all users (paginated) |
86
+ | **Fetch All** | `GET` | `/api/_nac/users` | List of all users |
86
87
  | **Create** | `POST` | `/api/_nac/users` | New user record added |
87
88
  | **Fetch One** | `GET` | `/api/_nac/users/1` | Details of user with `id: 1` |
88
89
  | **Update** | `PATCH` | `/api/_nac/users/1` | Partial update to user `1` |
@@ -156,7 +157,7 @@ Enabling `authentication` in the `autoCrud` config protects all **nac** routes (
156
157
  | `realtime` | `false` | Enables/disables real-time capabilities. |
157
158
  | `auth.authentication` | `true` | Requires a valid session for all NAC routes. |
158
159
  | `auth.authorization` | `true` | Enables role/owner-based access checks. |
159
- | `auth.ownerKey` | `'ownerId'` | The column name used to identify the record creator. |
160
+ | `auth.ownerKey` | `'createdBy'` | The column name used to identify the record creator. |
160
161
  | `publicResources` | `{}` | Defines tables and specific columns accessible without auth. |
161
162
  | `nacEndpointPrefix` | `'/api/_nac'` | The base path for NAC routes. Access via `useRuntimeConfig().public.autoCrud`. |
162
163
  | `schemaPath` | `'server/db/schema'` | Location of your Drizzle schema files. |
@@ -169,7 +170,7 @@ autoCrud: {
169
170
  auth: {
170
171
  authentication: true,
171
172
  authorization: true,
172
- ownerKey: 'ownerId',
173
+ ownerKey: 'createdBy',
173
174
  },
174
175
  publicResources: {
175
176
  users: ['id', 'name', 'email'],
@@ -194,7 +195,7 @@ To align with standard application behavior, **nac** automatically filters recor
194
195
 
195
196
  ### Ownership & Permissions
196
197
 
197
- While the implementing app handles the authentication layer, **nac** provides a standardized way to enforce record ownership and granular access.
198
+ While the implementing app handles the authentication & authorization layer, **nac** provides a standardized way to enforce record ownership and granular access.
198
199
 
199
200
  If your middleware populates `event.context.nac` with `resourcePermissions`, **nac** automatically injects the necessary SQL filters.
200
201
 
package/dist/module.d.mts CHANGED
@@ -1,6 +1,7 @@
1
1
  import * as _nuxt_schema from '@nuxt/schema';
2
2
 
3
3
  interface ModuleOptions {
4
+ statusFiltering: boolean;
4
5
  realtime: boolean;
5
6
  schemaPath: string;
6
7
  auth: {
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nuxt-auto-crud",
3
3
  "configKey": "autoCrud",
4
- "version": "2.1.2",
4
+ "version": "2.1.4",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "unknown"
package/dist/module.mjs CHANGED
@@ -8,6 +8,7 @@ const module$1 = defineNuxtModule({
8
8
  },
9
9
  defaults: {
10
10
  // Private config
11
+ statusFiltering: true,
11
12
  realtime: false,
12
13
  auth: {
13
14
  authentication: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxt-auto-crud",
3
- "version": "2.1.2",
3
+ "version": "2.1.4",
4
4
  "description": "Dynamic RESTful CRUD APIs for Nuxt without code generation, fully schema-driven.",
5
5
  "author": "Cliford Pereira",
6
6
  "license": "MIT",