@veloxts/auth 0.6.25 → 0.6.27

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.
Files changed (3) hide show
  1. package/CHANGELOG.md +565 -0
  2. package/GUIDE.md +79 -0
  3. package/package.json +9 -6
package/CHANGELOG.md ADDED
@@ -0,0 +1,565 @@
1
+ # @veloxts/auth
2
+
3
+ ## 0.6.27
4
+
5
+ ### Patch Changes
6
+
7
+ - chore: add GUIDE, LICENSE and CHANGELOG.md to npm files
8
+ - Updated dependencies
9
+ - @veloxts/core@0.6.27
10
+ - @veloxts/router@0.6.27
11
+
12
+ ## 0.6.26
13
+
14
+ ### Patch Changes
15
+
16
+ - docs(mcp): add README and GUIDE, docs(web): simplify README and create concise GUIDE
17
+ - Updated dependencies
18
+ - @veloxts/core@0.6.26
19
+ - @veloxts/router@0.6.26
20
+
21
+ ## 0.6.25
22
+
23
+ ### Patch Changes
24
+
25
+ - docs(create): add guide for React Server Components setup
26
+ - Updated dependencies
27
+ - @veloxts/core@0.6.25
28
+ - @veloxts/router@0.6.25
29
+
30
+ ## 0.6.24
31
+
32
+ ### Patch Changes
33
+
34
+ - clarify installation paths and package contents
35
+ - Updated dependencies
36
+ - @veloxts/core@0.6.24
37
+ - @veloxts/router@0.6.24
38
+
39
+ ## 0.6.23
40
+
41
+ ### Patch Changes
42
+
43
+ - add defineContract for improved type inference DX
44
+ - Updated dependencies
45
+ - @veloxts/core@0.6.23
46
+ - @veloxts/router@0.6.23
47
+
48
+ ## 0.6.22
49
+
50
+ ### Patch Changes
51
+
52
+ - support {method, path} route entry format
53
+ - Updated dependencies
54
+ - @veloxts/core@0.6.22
55
+ - @veloxts/router@0.6.22
56
+
57
+ ## 0.6.21
58
+
59
+ ### Patch Changes
60
+
61
+ - separate schemas from procedures for browser-safe import
62
+ - Updated dependencies
63
+ - @veloxts/core@0.6.21
64
+ - @veloxts/router@0.6.21
65
+
66
+ ## 0.6.20
67
+
68
+ ### Patch Changes
69
+
70
+ - add Fastify ecosystem stubs and debuglog to util
71
+ - Updated dependencies
72
+ - @veloxts/core@0.6.20
73
+ - @veloxts/router@0.6.20
74
+
75
+ ## 0.6.19
76
+
77
+ ### Patch Changes
78
+
79
+ - restore dotenv stub for browser compatibility
80
+ - Updated dependencies
81
+ - @veloxts/core@0.6.19
82
+ - @veloxts/router@0.6.19
83
+
84
+ ## 0.6.18
85
+
86
+ ### Patch Changes
87
+
88
+ - add node:fs/promises stub and fix esbuild plugin
89
+ - Updated dependencies
90
+ - @veloxts/core@0.6.18
91
+ - @veloxts/router@0.6.18
92
+
93
+ ## 0.6.17
94
+
95
+ ### Patch Changes
96
+
97
+ - remove optimizeDeps.exclude to fix CJS/ESM interop
98
+ - Updated dependencies
99
+ - @veloxts/core@0.6.17
100
+ - @veloxts/router@0.6.17
101
+
102
+ ## 0.6.16
103
+
104
+ ### Patch Changes
105
+
106
+ - add stubs for Fastify ecosystem packages
107
+ - Updated dependencies
108
+ - @veloxts/core@0.6.16
109
+ - @veloxts/router@0.6.16
110
+
111
+ ## 0.6.15
112
+
113
+ ### Patch Changes
114
+
115
+ - implement three-layer Node.js stubbing for Vite
116
+ - Updated dependencies
117
+ - @veloxts/core@0.6.15
118
+ - @veloxts/router@0.6.15
119
+
120
+ ## 0.6.14
121
+
122
+ ### Patch Changes
123
+
124
+ - stub dotenv as virtual module instead of process shims
125
+ - Updated dependencies
126
+ - @veloxts/core@0.6.14
127
+ - @veloxts/router@0.6.14
128
+
129
+ ## 0.6.13
130
+
131
+ ### Patch Changes
132
+
133
+ - add process.argv stub for dotenv browser compatibility
134
+ - Updated dependencies
135
+ - @veloxts/core@0.6.13
136
+ - @veloxts/router@0.6.13
137
+
138
+ ## 0.6.12
139
+
140
+ ### Patch Changes
141
+
142
+ - Fixes the "process is not defined" error from dotenv
143
+ - Updated dependencies
144
+ - @veloxts/core@0.6.12
145
+ - @veloxts/router@0.6.12
146
+
147
+ ## 0.6.11
148
+
149
+ ### Patch Changes
150
+
151
+ - add Vite plugin for Node.js module stubs
152
+ - Updated dependencies
153
+ - @veloxts/core@0.6.11
154
+ - @veloxts/router@0.6.11
155
+
156
+ ## 0.6.10
157
+
158
+ ### Patch Changes
159
+
160
+ - use import() type syntax for AppRouter
161
+ - Updated dependencies
162
+ - @veloxts/core@0.6.10
163
+ - @veloxts/router@0.6.10
164
+
165
+ ## 0.6.9
166
+
167
+ ### Patch Changes
168
+
169
+ - isolate auth procedures from database imports
170
+ - Updated dependencies
171
+ - @veloxts/core@0.6.9
172
+ - @veloxts/router@0.6.9
173
+
174
+ ## 0.6.8
175
+
176
+ ### Patch Changes
177
+
178
+ - prevent dotenv from leaking into browser bundle
179
+ - Updated dependencies
180
+ - @veloxts/core@0.6.8
181
+ - @veloxts/router@0.6.8
182
+
183
+ ## 0.6.7
184
+
185
+ ### Patch Changes
186
+
187
+ - better-sqlite3 versions mismatch fix
188
+ - Updated dependencies
189
+ - @veloxts/core@0.6.7
190
+ - @veloxts/router@0.6.7
191
+
192
+ ## 0.6.6
193
+
194
+ ### Patch Changes
195
+
196
+ - ensure the web app never imports server-side code paths
197
+ - Updated dependencies
198
+ - @veloxts/core@0.6.6
199
+ - @veloxts/router@0.6.6
200
+
201
+ ## 0.6.5
202
+
203
+ ### Patch Changes
204
+
205
+ - move @prisma/client-runtime-utils to root package.json
206
+ - Updated dependencies
207
+ - @veloxts/core@0.6.5
208
+ - @veloxts/router@0.6.5
209
+
210
+ ## 0.6.4
211
+
212
+ ### Patch Changes
213
+
214
+ - add @prisma/client-runtime-utils dependency
215
+ - Updated dependencies
216
+ - @veloxts/core@0.6.4
217
+ - @veloxts/router@0.6.4
218
+
219
+ ## 0.6.3
220
+
221
+ ### Patch Changes
222
+
223
+ - Add workspaces field to root package.json template + Fix Prisma ESM/CJS import for Node.js v24
224
+ - Updated dependencies
225
+ - @veloxts/core@0.6.3
226
+ - @veloxts/router@0.6.3
227
+
228
+ ## 0.6.2
229
+
230
+ ### Patch Changes
231
+
232
+ - add server actions, removed some deprecated and other chore
233
+ - Updated dependencies
234
+ - @veloxts/core@0.6.2
235
+ - @veloxts/router@0.6.2
236
+
237
+ ## 0.6.1
238
+
239
+ ### Patch Changes
240
+
241
+ - route groups for file-based routing; add dynamic route support with [param] segments
242
+ - Updated dependencies
243
+ - @veloxts/core@0.6.1
244
+ - @veloxts/router@0.6.1
245
+
246
+ ## 0.6.0
247
+
248
+ ### Minor Changes
249
+
250
+ - RSC streaming, dynamic routes, Vinxi integration
251
+
252
+ ### Patch Changes
253
+
254
+ - Updated dependencies
255
+ - @veloxts/core@0.6.0
256
+ - @veloxts/router@0.6.0
257
+
258
+ ## 0.5.0
259
+
260
+ ### Minor Changes
261
+
262
+ - Auto-register procedures + inject Prisma models feature
263
+
264
+ ### Patch Changes
265
+
266
+ - Updated dependencies
267
+ - @veloxts/core@0.5.0
268
+ - @veloxts/router@0.5.0
269
+
270
+ ## 0.4.21
271
+
272
+ ### Patch Changes
273
+
274
+ - format Prisma default values correctly by type
275
+ - Updated dependencies
276
+ - @veloxts/core@0.4.21
277
+ - @veloxts/router@0.4.21
278
+
279
+ ## 0.4.20
280
+
281
+ ### Patch Changes
282
+
283
+ - import consolidation: update import paths for `@veloxts/velox`
284
+ - Updated dependencies
285
+ - @veloxts/core@0.4.20
286
+ - @veloxts/router@0.4.20
287
+
288
+ ## 0.4.19
289
+
290
+ ### Patch Changes
291
+
292
+ - update default dev server port to 3030
293
+ - Updated dependencies
294
+ - @veloxts/core@0.4.19
295
+ - @veloxts/router@0.4.19
296
+
297
+ ## 0.4.18
298
+
299
+ ### Patch Changes
300
+
301
+ - introduce interactive field menu and templates for resource generation
302
+ - Updated dependencies
303
+ - @veloxts/core@0.4.18
304
+ - @veloxts/router@0.4.18
305
+
306
+ ## 0.4.17
307
+
308
+ ### Patch Changes
309
+
310
+ - add interactive field prompts for resource generation
311
+ - Updated dependencies
312
+ - @veloxts/core@0.4.17
313
+ - @veloxts/router@0.4.17
314
+
315
+ ## 0.4.16
316
+
317
+ ### Patch Changes
318
+
319
+ - fixed velox procedures list
320
+ - Updated dependencies
321
+ - @veloxts/core@0.4.16
322
+ - @veloxts/router@0.4.16
323
+
324
+ ## 0.4.15
325
+
326
+ ### Patch Changes
327
+
328
+ - chore lint fixes
329
+ - Updated dependencies
330
+ - @veloxts/core@0.4.15
331
+ - @veloxts/router@0.4.15
332
+
333
+ ## 0.4.14
334
+
335
+ ### Patch Changes
336
+
337
+ - fixed proxy-type inferance and update proxy hooks for optional input handling
338
+ - Updated dependencies
339
+ - @veloxts/core@0.4.14
340
+ - @veloxts/router@0.4.14
341
+
342
+ ## 0.4.13
343
+
344
+ ### Patch Changes
345
+
346
+ - add debug mode to dev server
347
+ - Updated dependencies
348
+ - @veloxts/core@0.4.13
349
+ - @veloxts/router@0.4.13
350
+
351
+ ## 0.4.12
352
+
353
+ ### Patch Changes
354
+
355
+ - preserve type info in trpc template AppRouter export
356
+ - Updated dependencies
357
+ - @veloxts/core@0.4.12
358
+ - @veloxts/router@0.4.12
359
+
360
+ ## 0.4.11
361
+
362
+ ### Patch Changes
363
+
364
+ - fixed api.health.check.useQuery is not a function issue
365
+ - Updated dependencies
366
+ - @veloxts/core@0.4.11
367
+ - @veloxts/router@0.4.11
368
+
369
+ ## 0.4.10
370
+
371
+ ### Patch Changes
372
+
373
+ - fixed ReferenceError: styles is not defined in rpc template
374
+ - Updated dependencies
375
+ - @veloxts/core@0.4.10
376
+ - @veloxts/router@0.4.10
377
+
378
+ ## 0.4.7
379
+
380
+ ### Patch Changes
381
+
382
+ - Add dynamic headers and routes config to client
383
+ - Updated dependencies
384
+ - @veloxts/core@0.4.7
385
+ - @veloxts/router@0.4.7
386
+
387
+ ## 0.4.6
388
+
389
+ ### Patch Changes
390
+
391
+ - Fix broken npm packages - republish with correct dependencies
392
+ - Updated dependencies
393
+ - @veloxts/core@0.4.6
394
+ - @veloxts/router@0.4.6
395
+
396
+ ## 0.4.5
397
+
398
+ ### Patch Changes
399
+
400
+ - b06631b: CI CD npm Trusted Publishing setup
401
+ - Updated dependencies [b06631b]
402
+ - @veloxts/core@0.4.5
403
+ - @veloxts/router@0.4.5
404
+
405
+ ## 0.4.4
406
+
407
+ ### Patch Changes
408
+
409
+ - 05ae1a5: Update to boilerplate, work in progress
410
+ - 9961b52: full-stack React frontend implementation
411
+ - Updated dependencies [05ae1a5]
412
+ - Updated dependencies [9961b52]
413
+ - @veloxts/core@0.4.4
414
+ - @veloxts/router@0.4.4
415
+
416
+ ## 0.4.3
417
+
418
+ ### Patch Changes
419
+
420
+ - ef8d5d0: Dynamically load VeloxTS version from `package.json` in shared template configuration
421
+ - Updated dependencies [ef8d5d0]
422
+ - @veloxts/core@0.4.3
423
+ - @veloxts/router@0.4.3
424
+
425
+ ## 0.4.2
426
+
427
+ ### Patch Changes
428
+
429
+ - 5b4f02c: Updated documentations
430
+ - 0d8d775: Updated guides and readme files
431
+ - Updated dependencies [5b4f02c]
432
+ - Updated dependencies [0d8d775]
433
+ - @veloxts/core@0.4.2
434
+ - @veloxts/router@0.4.2
435
+
436
+ ## 0.4.1
437
+
438
+ ### Patch Changes
439
+
440
+ - 0eea918: Completed CLI generators
441
+ - Updated dependencies [0eea918]
442
+ - @veloxts/core@0.4.1
443
+ - @veloxts/router@0.4.1
444
+
445
+ ## 0.4.0
446
+
447
+ ### Minor Changes
448
+
449
+ - b478fee: Performance Benchmarks | 34k req/s, <1ms p50 latency, 75MB memory, 530ms startup
450
+
451
+ ### Patch Changes
452
+
453
+ - Updated dependencies [b478fee]
454
+ - @veloxts/core@0.4.0
455
+ - @veloxts/router@0.4.0
456
+
457
+ ## 0.3.6
458
+
459
+ ### Patch Changes
460
+
461
+ - 929f2ab: Interactive CLI setup
462
+ - Updated dependencies [929f2ab]
463
+ - @veloxts/core@0.3.6
464
+ - @veloxts/router@0.3.6
465
+
466
+ ## 0.3.5
467
+
468
+ ### Patch Changes
469
+
470
+ - 658e83f: @veloxts/auth, Full REST Support, Better error messages, Type tests with tsd
471
+ - Updated dependencies [658e83f]
472
+ - @veloxts/core@0.3.5
473
+ - @veloxts/router@0.3.5
474
+
475
+ ## 0.3.4
476
+
477
+ ### Patch Changes
478
+
479
+ - 65ef3e7: DI container and Auth Guards
480
+ - Updated dependencies [65ef3e7]
481
+ - @veloxts/core@0.3.4
482
+ - @veloxts/router@0.3.4
483
+
484
+ ## 0.3.3
485
+
486
+ ### Patch Changes
487
+
488
+ - 4ee103b: Full REST support PUT, PATCH and DELETE
489
+ - Updated dependencies [4ee103b]
490
+ - @veloxts/core@0.3.3
491
+ - @veloxts/orm@0.3.3
492
+ - @veloxts/router@0.3.3
493
+
494
+ ## 0.3.2
495
+
496
+ ### Patch Changes
497
+
498
+ - abf270e: Dynamically set core `VELOX_VERSION` from package.json
499
+ - Updated dependencies [abf270e]
500
+ - @veloxts/core@0.3.2
501
+ - @veloxts/orm@0.3.2
502
+ - @veloxts/router@0.3.2
503
+
504
+ ## 0.3.1
505
+
506
+ ### Patch Changes
507
+
508
+ - cb9806e: Fixed the value for VELOXTS_VERSION in create app template
509
+ - Updated dependencies [cb9806e]
510
+ - @veloxts/core@0.3.1
511
+ - @veloxts/orm@0.3.1
512
+ - @veloxts/router@0.3.1
513
+
514
+ ## 0.3.0
515
+
516
+ ### Minor Changes
517
+
518
+ - 1adce10: Introduced an umbrella package for server side packages: @veloxts/velox
519
+
520
+ ### Patch Changes
521
+
522
+ - Updated dependencies [1adce10]
523
+ - @veloxts/core@0.3.0
524
+ - @veloxts/orm@0.3.0
525
+ - @veloxts/router@0.3.0
526
+
527
+ ## 0.2.2
528
+
529
+ ### Patch Changes
530
+
531
+ - Version bump to sync with create-velox-app native module fix
532
+ - Updated dependencies
533
+ - @veloxts/core@0.2.2
534
+ - @veloxts/orm@0.2.2
535
+ - @veloxts/router@0.2.2
536
+
537
+ ## 0.2.0
538
+
539
+ ### Minor Changes
540
+
541
+ - 9404976: fix Prisma client generation. README adjustments
542
+
543
+ ### Patch Changes
544
+
545
+ - Updated dependencies [9404976]
546
+ - @veloxts/router@0.2.0
547
+ - @veloxts/core@0.2.0
548
+ - @veloxts/orm@0.2.0
549
+
550
+ ## 0.1.1
551
+
552
+ ### Patch Changes
553
+
554
+ - Fix Prisma client generation in scaffolder
555
+
556
+ - Added automatic Prisma client generation after dependency installation in create-velox-app
557
+ - Fixed database template to validate DATABASE_URL environment variable
558
+ - Added alpha release warning to all package READMEs
559
+ - Fixed TypeScript type for registerTRPCPlugin to accept FastifyInstance
560
+ - Updated playground app to use Prisma 7.x custom output path
561
+
562
+ - Updated dependencies
563
+ - @veloxts/core@0.1.1
564
+ - @veloxts/router@0.1.1
565
+ - @veloxts/orm@0.1.1
package/GUIDE.md ADDED
@@ -0,0 +1,79 @@
1
+ # @veloxts/auth
2
+
3
+ Authentication and authorization for VeloxTS Framework.
4
+
5
+ ## Features
6
+
7
+ - Session management (cookie-based)
8
+ - JWT authentication (stateless tokens)
9
+ - Password hashing (bcrypt)
10
+ - CSRF protection
11
+ - Guards (role/permission-based)
12
+ - Rate limiting
13
+
14
+ ## Session Authentication
15
+
16
+ ```typescript
17
+ import { sessionMiddleware } from '@veloxts/auth';
18
+
19
+ const session = sessionMiddleware({
20
+ secret: process.env.SESSION_SECRET!,
21
+ expiration: { ttl: 86400, sliding: true },
22
+ });
23
+
24
+ const getProfile = procedure()
25
+ .use(session.requireAuth())
26
+ .query(({ ctx }) => ctx.user);
27
+
28
+ // Login/Logout
29
+ await ctx.session.login(user);
30
+ await ctx.session.logout();
31
+ ```
32
+
33
+ ## JWT Authentication
34
+
35
+ ```typescript
36
+ import { jwtManager, authMiddleware } from '@veloxts/auth';
37
+
38
+ const jwt = jwtManager({
39
+ secret: process.env.JWT_SECRET!,
40
+ accessTokenExpiry: '15m',
41
+ refreshTokenExpiry: '7d',
42
+ });
43
+
44
+ const auth = authMiddleware({
45
+ jwt: { secret: process.env.JWT_SECRET! },
46
+ userLoader: (userId) => db.user.findUnique({ where: { id: userId } }),
47
+ });
48
+
49
+ const getProfile = procedure()
50
+ .use(auth.requireAuth())
51
+ .query(({ ctx }) => ctx.user);
52
+ ```
53
+
54
+ ## Guards
55
+
56
+ ```typescript
57
+ import { hasRole, hasPermission } from '@veloxts/auth';
58
+
59
+ const adminOnly = procedure()
60
+ .use(auth.middleware({ guards: [hasRole('admin')] }))
61
+ .mutation(handler);
62
+
63
+ const canEdit = procedure()
64
+ .use(auth.middleware({ guards: [hasPermission('posts.write')] }))
65
+ .mutation(handler);
66
+ ```
67
+
68
+ ## Password Hashing
69
+
70
+ ```typescript
71
+ import { hashPassword, verifyPassword } from '@veloxts/auth';
72
+
73
+ const hash = await hashPassword('password', { cost: 12 });
74
+ const valid = await verifyPassword('password', hash);
75
+ ```
76
+
77
+ ## Learn More
78
+
79
+ See [@veloxts/velox](https://www.npmjs.com/package/@veloxts/velox) for complete documentation.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veloxts/auth",
3
- "version": "0.6.25",
3
+ "version": "0.6.27",
4
4
  "description": "Authentication and authorization system for VeloxTS framework",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -33,7 +33,10 @@
33
33
  },
34
34
  "files": [
35
35
  "dist",
36
- "README.md"
36
+ "README.md",
37
+ "GUIDE.md",
38
+ "LICENSE",
39
+ "CHANGELOG.md"
37
40
  ],
38
41
  "tsd": {
39
42
  "directory": "src/__type-tests__",
@@ -54,8 +57,8 @@
54
57
  "dependencies": {
55
58
  "@fastify/cookie": "11.0.2",
56
59
  "fastify": "5.6.2",
57
- "@veloxts/router": "0.6.25",
58
- "@veloxts/core": "0.6.25"
60
+ "@veloxts/core": "0.6.27",
61
+ "@veloxts/router": "0.6.27"
59
62
  },
60
63
  "peerDependencies": {
61
64
  "argon2": ">=0.30.0",
@@ -79,8 +82,8 @@
79
82
  "fastify-plugin": "5.1.0",
80
83
  "typescript": "5.9.3",
81
84
  "vitest": "4.0.16",
82
- "@veloxts/validation": "0.6.25",
83
- "@veloxts/testing": "0.6.25"
85
+ "@veloxts/testing": "0.6.27",
86
+ "@veloxts/validation": "0.6.27"
84
87
  },
85
88
  "keywords": [
86
89
  "velox",