@absolutejs/auth 0.23.0 → 0.24.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/index.d.ts CHANGED
@@ -1,10 +1,14 @@
1
1
  import { Elysia } from 'elysia';
2
2
  import { AbsoluteAuthProps } from './types';
3
- export declare const absoluteAuth: <UserType>({ providersConfiguration, authorizeRoute, callbackRoute, profileRoute, signoutRoute, statusRoute, refreshRoute, revokeRoute, cleanupIntervalMs, maxSessions, sessionDurationMs, authSessionStore, resolveAuthIntent, onAuthorizeSuccess, onAuthorizeError, onProfileSuccess, onProfileError, onCallbackSuccess, onLinkIdentity, onLinkIdentityConflict, onLinkConnector, onCallbackError, onStatus, onRefreshSuccess, onRefreshError, onSignOut, onRevocationSuccess, onRevocationError, onSessionCleanup }: AbsoluteAuthProps<UserType>) => Promise<Elysia<"", {
3
+ import type { AuthHtmxUser } from './ui/types';
4
+ export declare const absoluteAuth: <UserType extends AuthHtmxUser>({ providersConfiguration, authorizeRoute, callbackRoute, profileRoute, signoutRoute, statusRoute, refreshRoute, revokeRoute, cleanupIntervalMs, maxSessions, sessionDurationMs, authSessionStore, htmx, resolveAuthIntent, onAuthorizeSuccess, onAuthorizeError, onProfileSuccess, onProfileError, onCallbackSuccess, onLinkIdentity, onLinkIdentityConflict, onLinkConnector, onCallbackError, onStatus, onRefreshSuccess, onRefreshError, onSignOut, onRevocationSuccess, onRevocationError, onSessionCleanup }: AbsoluteAuthProps<UserType>) => Promise<Elysia<"", {
4
5
  decorator: {};
5
6
  store: {
6
7
  session: import("./types").SessionRecord<UserType> & import("./types").SessionRecord<unknown>;
7
8
  unregisteredSession: import("./types").UnregisteredSessionRecord;
9
+ } | {
10
+ session: import("./types").SessionRecord<UserType> & import("./types").SessionRecord<unknown>;
11
+ unregisteredSession: import("./types").UnregisteredSessionRecord;
8
12
  };
9
13
  derive: {
10
14
  readonly cleanupSessions: () => Promise<void>;
@@ -56,7 +60,7 @@ export declare const absoluteAuth: <UserType>({ providersConfiguration, authoriz
56
60
  readonly message: "User is not authenticated";
57
61
  }) => AuthFailReturn) | undefined) => Promise<import("elysia").ElysiaCustomStatusResponse<"Bad Request", "Cookies are missing", 400> | import("elysia").ElysiaCustomStatusResponse<"Unauthorized", "User is not authenticated", 401> | AuthReturn | NonNullable<AuthFailReturn>>;
58
62
  }>;
59
- }, ((({
63
+ }, (((({
60
64
  [x: string]: {
61
65
  delete: {
62
66
  body: unknown;
@@ -255,7 +259,452 @@ export declare const absoluteAuth: <UserType>({ providersConfiguration, authoriz
255
259
  };
256
260
  };
257
261
  };
258
- }) & {}, {
262
+ }) & {}) & ({} | ({
263
+ htmx: {
264
+ login: {
265
+ get: {
266
+ body: unknown;
267
+ params: {};
268
+ query: unknown;
269
+ headers: unknown;
270
+ response: {
271
+ 200: Response;
272
+ 422: {
273
+ type: "validation";
274
+ on: string;
275
+ summary?: string;
276
+ message?: string;
277
+ found?: unknown;
278
+ property?: string;
279
+ expected?: string;
280
+ };
281
+ };
282
+ };
283
+ };
284
+ };
285
+ } & {
286
+ htmx: {
287
+ link: {
288
+ get: {
289
+ body: unknown;
290
+ params: {};
291
+ query: unknown;
292
+ headers: unknown;
293
+ response: {
294
+ 200: Response;
295
+ 422: {
296
+ type: "validation";
297
+ on: string;
298
+ summary?: string;
299
+ message?: string;
300
+ found?: unknown;
301
+ property?: string;
302
+ expected?: string;
303
+ };
304
+ };
305
+ };
306
+ };
307
+ };
308
+ } & {
309
+ htmx: {
310
+ "connector-links": {
311
+ get: {
312
+ body: unknown;
313
+ params: {};
314
+ query: unknown;
315
+ headers: unknown;
316
+ response: {
317
+ 200: Response;
318
+ 422: {
319
+ type: "validation";
320
+ on: string;
321
+ summary?: string;
322
+ message?: string;
323
+ found?: unknown;
324
+ property?: string;
325
+ expected?: string;
326
+ };
327
+ };
328
+ };
329
+ };
330
+ };
331
+ } & {
332
+ htmx: {
333
+ "auth-menu": {
334
+ get: {
335
+ body: unknown;
336
+ params: {};
337
+ query: unknown;
338
+ headers: unknown;
339
+ response: {
340
+ 200: Response;
341
+ 400: "Cookies are missing";
342
+ 401: "User is not authenticated";
343
+ 422: {
344
+ type: "validation";
345
+ on: string;
346
+ summary?: string;
347
+ message?: string;
348
+ found?: unknown;
349
+ property?: string;
350
+ expected?: string;
351
+ };
352
+ };
353
+ };
354
+ };
355
+ };
356
+ } & {
357
+ htmx: {
358
+ me: {
359
+ get: {
360
+ body: unknown;
361
+ params: {};
362
+ query: unknown;
363
+ headers: unknown;
364
+ response: {
365
+ 200: Response;
366
+ 400: "Cookies are missing";
367
+ 401: "User is not authenticated";
368
+ 422: {
369
+ type: "validation";
370
+ on: string;
371
+ summary?: string;
372
+ message?: string;
373
+ found?: unknown;
374
+ property?: string;
375
+ expected?: string;
376
+ };
377
+ };
378
+ };
379
+ };
380
+ };
381
+ } & {
382
+ htmx: {
383
+ account: {
384
+ get: {
385
+ body: unknown;
386
+ params: {};
387
+ query: unknown;
388
+ headers: unknown;
389
+ response: {
390
+ 200: Response;
391
+ 400: "Cookies are missing";
392
+ 401: "User is not authenticated";
393
+ 422: {
394
+ type: "validation";
395
+ on: string;
396
+ summary?: string;
397
+ message?: string;
398
+ found?: unknown;
399
+ property?: string;
400
+ expected?: string;
401
+ };
402
+ };
403
+ };
404
+ };
405
+ };
406
+ } & {
407
+ htmx: {
408
+ identities: {
409
+ get: {
410
+ body: unknown;
411
+ params: {};
412
+ query: unknown;
413
+ headers: unknown;
414
+ response: {
415
+ 200: {} | Response;
416
+ 400: "Cookies are missing";
417
+ 401: "User is not authenticated";
418
+ 422: {
419
+ type: "validation";
420
+ on: string;
421
+ summary?: string;
422
+ message?: string;
423
+ found?: unknown;
424
+ property?: string;
425
+ expected?: string;
426
+ };
427
+ };
428
+ };
429
+ };
430
+ };
431
+ } & {
432
+ htmx: {
433
+ identities: {
434
+ ":id": {
435
+ primary: {
436
+ post: {
437
+ body: unknown;
438
+ params: {
439
+ id: string;
440
+ } & {};
441
+ query: unknown;
442
+ headers: unknown;
443
+ response: {
444
+ 200: {} | Response;
445
+ 400: "Cookies are missing";
446
+ 401: "User is not authenticated";
447
+ 422: {
448
+ type: "validation";
449
+ on: string;
450
+ summary?: string;
451
+ message?: string;
452
+ found?: unknown;
453
+ property?: string;
454
+ expected?: string;
455
+ };
456
+ };
457
+ };
458
+ };
459
+ };
460
+ };
461
+ };
462
+ } & {
463
+ htmx: {
464
+ identities: {
465
+ ":id": {
466
+ delete: {
467
+ body: unknown;
468
+ params: {
469
+ id: string;
470
+ } & {};
471
+ query: unknown;
472
+ headers: unknown;
473
+ response: {
474
+ 200: {} | Response;
475
+ 400: "Cookies are missing";
476
+ 401: "User is not authenticated";
477
+ 422: {
478
+ type: "validation";
479
+ on: string;
480
+ summary?: string;
481
+ message?: string;
482
+ found?: unknown;
483
+ property?: string;
484
+ expected?: string;
485
+ };
486
+ };
487
+ };
488
+ };
489
+ };
490
+ };
491
+ } & {
492
+ htmx: {
493
+ merge: {
494
+ ":id": {
495
+ post: {
496
+ body: unknown;
497
+ params: {
498
+ id: string;
499
+ } & {};
500
+ query: unknown;
501
+ headers: unknown;
502
+ response: {
503
+ 200: {} | Response;
504
+ 400: "Cookies are missing";
505
+ 401: "User is not authenticated";
506
+ 422: {
507
+ type: "validation";
508
+ on: string;
509
+ summary?: string;
510
+ message?: string;
511
+ found?: unknown;
512
+ property?: string;
513
+ expected?: string;
514
+ };
515
+ };
516
+ };
517
+ };
518
+ };
519
+ };
520
+ } & {
521
+ htmx: {
522
+ merge: {
523
+ ":id": {
524
+ delete: {
525
+ body: unknown;
526
+ params: {
527
+ id: string;
528
+ } & {};
529
+ query: unknown;
530
+ headers: unknown;
531
+ response: {
532
+ 200: {} | Response;
533
+ 400: "Cookies are missing";
534
+ 401: "User is not authenticated";
535
+ 422: {
536
+ type: "validation";
537
+ on: string;
538
+ summary?: string;
539
+ message?: string;
540
+ found?: unknown;
541
+ property?: string;
542
+ expected?: string;
543
+ };
544
+ };
545
+ };
546
+ };
547
+ };
548
+ };
549
+ } & {
550
+ htmx: {
551
+ "connector-list": {
552
+ get: {
553
+ body: unknown;
554
+ params: {};
555
+ query: unknown;
556
+ headers: unknown;
557
+ response: {
558
+ 200: Response;
559
+ 400: "Cookies are missing";
560
+ 401: "User is not authenticated";
561
+ 422: {
562
+ type: "validation";
563
+ on: string;
564
+ summary?: string;
565
+ message?: string;
566
+ found?: unknown;
567
+ property?: string;
568
+ expected?: string;
569
+ };
570
+ };
571
+ };
572
+ };
573
+ };
574
+ } & {
575
+ htmx: {
576
+ connectors: {
577
+ grants: {
578
+ ":id": {
579
+ delete: {
580
+ body: unknown;
581
+ params: {
582
+ id: string;
583
+ } & {};
584
+ query: unknown;
585
+ headers: unknown;
586
+ response: {
587
+ 200: {} | Response;
588
+ 400: "Cookies are missing";
589
+ 401: "User is not authenticated";
590
+ 422: {
591
+ type: "validation";
592
+ on: string;
593
+ summary?: string;
594
+ message?: string;
595
+ found?: unknown;
596
+ property?: string;
597
+ expected?: string;
598
+ };
599
+ };
600
+ };
601
+ };
602
+ };
603
+ };
604
+ };
605
+ } & {
606
+ htmx: {
607
+ connectors: {
608
+ bindings: {
609
+ ":id": {
610
+ delete: {
611
+ body: unknown;
612
+ params: {
613
+ id: string;
614
+ } & {};
615
+ query: unknown;
616
+ headers: unknown;
617
+ response: {
618
+ 200: {} | Response;
619
+ 400: "Cookies are missing";
620
+ 401: "User is not authenticated";
621
+ 422: {
622
+ type: "validation";
623
+ on: string;
624
+ summary?: string;
625
+ message?: string;
626
+ found?: unknown;
627
+ property?: string;
628
+ expected?: string;
629
+ };
630
+ };
631
+ };
632
+ };
633
+ };
634
+ };
635
+ };
636
+ } & {
637
+ htmx: {
638
+ "login-redirect": {
639
+ get: {
640
+ body: unknown;
641
+ params: {};
642
+ query: unknown;
643
+ headers: unknown;
644
+ response: {
645
+ 200: Response;
646
+ 422: {
647
+ type: "validation";
648
+ on: string;
649
+ summary?: string;
650
+ message?: string;
651
+ found?: unknown;
652
+ property?: string;
653
+ expected?: string;
654
+ };
655
+ };
656
+ };
657
+ };
658
+ };
659
+ } & {
660
+ htmx: {
661
+ "delete-account": {
662
+ post: {
663
+ body: unknown;
664
+ params: {};
665
+ query: unknown;
666
+ headers: unknown;
667
+ response: {
668
+ 200: {} | Response;
669
+ 400: "Cookies are missing";
670
+ 401: "User is not authenticated";
671
+ 422: {
672
+ type: "validation";
673
+ on: string;
674
+ summary?: string;
675
+ message?: string;
676
+ found?: unknown;
677
+ property?: string;
678
+ expected?: string;
679
+ };
680
+ };
681
+ };
682
+ };
683
+ };
684
+ } & {
685
+ htmx: {
686
+ signout: {
687
+ get: {
688
+ body: unknown;
689
+ params: {};
690
+ query: unknown;
691
+ headers: unknown;
692
+ response: {
693
+ 200: Response;
694
+ 422: {
695
+ type: "validation";
696
+ on: string;
697
+ summary?: string;
698
+ message?: string;
699
+ found?: unknown;
700
+ property?: string;
701
+ expected?: string;
702
+ };
703
+ };
704
+ };
705
+ };
706
+ };
707
+ })), {
259
708
  derive: {};
260
709
  resolve: {};
261
710
  schema: {};
@@ -294,6 +743,9 @@ export { createNeonLinkedProviderStores, createNeonOAuthLinkedProviderCredential
294
743
  export { createInMemoryLinkedProviderStores } from './linkedProviderStores';
295
744
  export { protectRoutePlugin } from './protectRoute';
296
745
  export { sessionCleanup } from './sessionCleanup';
746
+ export { createAuthHtmxRoutes } from './htmxRoutes';
747
+ export { resolveAuthHtmxRenderers } from './ui/renderers';
748
+ export type { AuthHtmxConfig, AuthHtmxConnectorTarget, AuthHtmxProviderData, AuthHtmxProviderInfo, AuthHtmxRenderOverrides, AuthHtmxRenderersConfig, AuthHtmxUser, AuthIdentityPayload, LinkedProviderPayload } from './ui/types';
297
749
  export * from './utils';
298
750
  export { buildClientProviders, resolveClientProviderEntry, resolveProviderClientConfiguration } from './providerClients';
299
751
  export type { OAuth2TokenResponse, OAuth2Client, ProviderOption, PKCEProvider, OIDCProvider, RefreshableProvider, RevocableProvider, ScopeRequiredProvider, ProvidersMap, ProviderConfiguration, CredentialsFor } from 'citra';