nuxt-auto-crud 2.1.3 → 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 +5 -5
- package/dist/module.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -73,7 +73,7 @@ Nb: Endpoints follow the pattern `/api/_nac/:model`.
|
|
|
73
73
|
|
|
74
74
|
| Method | Endpoint | Action |
|
|
75
75
|
| --- | --- | --- |
|
|
76
|
-
| **GET** | `/:model` | List records
|
|
76
|
+
| **GET** | `/:model` | List records |
|
|
77
77
|
| **POST** | `/:model` | Create record with Zod validation |
|
|
78
78
|
| **GET** | `/:model/:id` | Fetch single record |
|
|
79
79
|
| **PATCH** | `/:model/:id` | Partial update with validation |
|
|
@@ -83,7 +83,7 @@ Nb: Endpoints follow the pattern `/api/_nac/:model`.
|
|
|
83
83
|
|
|
84
84
|
| Action | HTTP Method | Endpoint | Example Result |
|
|
85
85
|
| --- | --- | --- | --- |
|
|
86
|
-
| **Fetch All** | `GET` | `/api/_nac/users` | List of all users
|
|
86
|
+
| **Fetch All** | `GET` | `/api/_nac/users` | List of all users |
|
|
87
87
|
| **Create** | `POST` | `/api/_nac/users` | New user record added |
|
|
88
88
|
| **Fetch One** | `GET` | `/api/_nac/users/1` | Details of user with `id: 1` |
|
|
89
89
|
| **Update** | `PATCH` | `/api/_nac/users/1` | Partial update to user `1` |
|
|
@@ -157,7 +157,7 @@ Enabling `authentication` in the `autoCrud` config protects all **nac** routes (
|
|
|
157
157
|
| `realtime` | `false` | Enables/disables real-time capabilities. |
|
|
158
158
|
| `auth.authentication` | `true` | Requires a valid session for all NAC routes. |
|
|
159
159
|
| `auth.authorization` | `true` | Enables role/owner-based access checks. |
|
|
160
|
-
| `auth.ownerKey` | `'
|
|
160
|
+
| `auth.ownerKey` | `'createdBy'` | The column name used to identify the record creator. |
|
|
161
161
|
| `publicResources` | `{}` | Defines tables and specific columns accessible without auth. |
|
|
162
162
|
| `nacEndpointPrefix` | `'/api/_nac'` | The base path for NAC routes. Access via `useRuntimeConfig().public.autoCrud`. |
|
|
163
163
|
| `schemaPath` | `'server/db/schema'` | Location of your Drizzle schema files. |
|
|
@@ -170,7 +170,7 @@ autoCrud: {
|
|
|
170
170
|
auth: {
|
|
171
171
|
authentication: true,
|
|
172
172
|
authorization: true,
|
|
173
|
-
ownerKey: '
|
|
173
|
+
ownerKey: 'createdBy',
|
|
174
174
|
},
|
|
175
175
|
publicResources: {
|
|
176
176
|
users: ['id', 'name', 'email'],
|
|
@@ -195,7 +195,7 @@ To align with standard application behavior, **nac** automatically filters recor
|
|
|
195
195
|
|
|
196
196
|
### Ownership & Permissions
|
|
197
197
|
|
|
198
|
-
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.
|
|
199
199
|
|
|
200
200
|
If your middleware populates `event.context.nac` with `resourcePermissions`, **nac** automatically injects the necessary SQL filters.
|
|
201
201
|
|
package/dist/module.json
CHANGED