@proconnect-gouv/proconnect.identite 10.4.0 → 11.0.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.
Files changed (72) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/connectors/index.d.ts +225 -9
  3. package/dist/connectors/index.d.ts.map +1 -1
  4. package/dist/connectors/index.js +8 -2
  5. package/dist/repositories/oidc-client/index.d.ts +1 -1
  6. package/dist/repositories/oidc-client/index.d.ts.map +1 -1
  7. package/dist/repositories/oidc-client/index.js +1 -1
  8. package/dist/repositories/oidc-client/upsert-authorization-request.d.ts +3 -0
  9. package/dist/repositories/oidc-client/upsert-authorization-request.d.ts.map +1 -0
  10. package/dist/repositories/oidc-client/upsert-authorization-request.js +30 -0
  11. package/dist/repositories/organization/find-users-by-organization.d.ts +28 -2
  12. package/dist/repositories/organization/find-users-by-organization.d.ts.map +1 -1
  13. package/dist/repositories/recovery-words/create.d.ts +6 -0
  14. package/dist/repositories/recovery-words/create.d.ts.map +1 -0
  15. package/dist/repositories/recovery-words/create.js +14 -0
  16. package/dist/repositories/recovery-words/delete-all-by-user-id.d.ts +3 -0
  17. package/dist/repositories/recovery-words/delete-all-by-user-id.d.ts.map +1 -0
  18. package/dist/repositories/recovery-words/delete-all-by-user-id.js +11 -0
  19. package/dist/repositories/recovery-words/find-by-user-id.d.ts +3 -0
  20. package/dist/repositories/recovery-words/find-by-user-id.d.ts.map +1 -0
  21. package/dist/repositories/recovery-words/find-by-user-id.js +12 -0
  22. package/dist/repositories/recovery-words/index.d.ts +4 -0
  23. package/dist/repositories/recovery-words/index.d.ts.map +1 -0
  24. package/dist/repositories/recovery-words/index.js +4 -0
  25. package/dist/repositories/user/create.d.ts +28 -2
  26. package/dist/repositories/user/create.d.ts.map +1 -1
  27. package/dist/repositories/user/find-by-email.d.ts +28 -2
  28. package/dist/repositories/user/find-by-email.d.ts.map +1 -1
  29. package/dist/repositories/user/find-by-id.d.ts +28 -2
  30. package/dist/repositories/user/find-by-id.d.ts.map +1 -1
  31. package/dist/repositories/user/find-by-magic-link-token.d.ts +28 -2
  32. package/dist/repositories/user/find-by-magic-link-token.d.ts.map +1 -1
  33. package/dist/repositories/user/find-by-reset-password-token.d.ts +28 -2
  34. package/dist/repositories/user/find-by-reset-password-token.d.ts.map +1 -1
  35. package/dist/repositories/user/get-by-id.d.ts +27 -1
  36. package/dist/repositories/user/get-by-id.d.ts.map +1 -1
  37. package/dist/repositories/user/update.d.ts +27 -1
  38. package/dist/repositories/user/update.d.ts.map +1 -1
  39. package/dist/types/authorization-request.d.ts +20 -0
  40. package/dist/types/authorization-request.d.ts.map +1 -0
  41. package/dist/types/authorization-request.js +2 -0
  42. package/dist/types/index.d.ts +2 -1
  43. package/dist/types/index.d.ts.map +1 -1
  44. package/dist/types/index.js +2 -1
  45. package/dist/types/recovery-words.d.ts +9 -0
  46. package/dist/types/recovery-words.d.ts.map +1 -0
  47. package/dist/types/{connection.js → recovery-words.js} +0 -1
  48. package/dist/types/user.d.ts +29 -27
  49. package/dist/types/user.d.ts.map +1 -1
  50. package/dist/types/user.js +29 -1
  51. package/package.json +3 -3
  52. package/src/connectors/index.ts +12 -2
  53. package/src/repositories/oidc-client/index.ts +1 -1
  54. package/src/repositories/oidc-client/upsert-authorization-request.test.ts +95 -0
  55. package/src/repositories/oidc-client/upsert-authorization-request.ts +50 -0
  56. package/src/repositories/recovery-words/create.ts +28 -0
  57. package/src/repositories/recovery-words/delete-all-by-user-id.ts +20 -0
  58. package/src/repositories/recovery-words/find-by-user-id.ts +20 -0
  59. package/src/repositories/recovery-words/index.ts +5 -0
  60. package/src/types/authorization-request.ts +23 -0
  61. package/src/types/index.ts +2 -1
  62. package/src/types/recovery-words.ts +9 -0
  63. package/src/types/user.ts +33 -27
  64. package/testing/index.ts +2 -0
  65. package/dist/repositories/oidc-client/add-connection.d.ts +0 -3
  66. package/dist/repositories/oidc-client/add-connection.d.ts.map +0 -1
  67. package/dist/repositories/oidc-client/add-connection.js +0 -22
  68. package/dist/types/connection.d.ts +0 -13
  69. package/dist/types/connection.d.ts.map +0 -1
  70. package/src/repositories/oidc-client/add-connection.test.ts +0 -43
  71. package/src/repositories/oidc-client/add-connection.ts +0 -36
  72. package/src/types/connection.ts +0 -15
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @proconnect-gouv/proconnect.identite
2
2
 
3
+ ## 11.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [#2345](https://github.com/proconnect-gouv/proconnect-identite/pull/2345) [`434653c`](https://github.com/proconnect-gouv/proconnect-identite/commit/434653cb36cc334edf2bdf81df47fe4904f4c6cc) Thanks [@douglasduteil](https://github.com/douglasduteil)! - ajout des colonnes interaction_cid et outcome à users_oidc_clients, avec un index unique partiel sur interaction_cid ; addConnection devient upsertAuthorizationRequest (met à jour la ligne d'une même interaction au lieu d'en ajouter une), les types Connection et BaseConnection deviennent AuthorizationRequest et BaseAuthorizationRequest avec interaction_cid et outcome obligatoires ; AuthorizationRequestOutcomeEnum (zod) partage les valeurs de outcome
8
+
9
+ ## 10.5.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [#2242](https://github.com/proconnect-gouv/proconnect-identite/pull/2242) [`31652e6`](https://github.com/proconnect-gouv/proconnect-identite/commit/31652e608dd645911f7cd5710fc5395c81bb8a5f) Thanks [@douglasduteil](https://github.com/douglasduteil)! - ajout du schéma zod UserSchema, le type User en est dérivé
14
+
3
15
  ## 10.4.0
4
16
 
5
17
  ### Minor Changes
@@ -518,8 +518,8 @@ export declare function createContext({ api_entreprise_client, api_insee_client,
518
518
  }>;
519
519
  };
520
520
  oidc_clients: {
521
- addConnection: ({ user_id, oidc_client_id, organization_id, sp_name, user_ip_address, }: import("../types/connection.js").BaseConnection) => Promise<import("../types/connection.js").Connection>;
522
521
  findByClientId: (client_id: string) => Promise<import("../types/oidc-client.js").OidcClient | undefined>;
522
+ upsertAuthorizationRequest: ({ user_id, oidc_client_id, organization_id, sp_name, user_ip_address, interaction_cid, outcome, }: import("../types/authorization-request.js").BaseAuthorizationRequest) => Promise<import("../types/authorization-request.js").AuthorizationRequest>;
523
523
  };
524
524
  organizations: {
525
525
  findById: (id: number) => Promise<import("../types/organization.js").Organization | undefined>;
@@ -536,7 +536,33 @@ export declare function createContext({ api_entreprise_client, api_insee_client,
536
536
  findPendingByUserId: (user_id: number) => Promise<(import("../types/organization.js").Organization & {
537
537
  moderation_id: number;
538
538
  })[]>;
539
- findUsers: (organization_id: number) => Promise<(import("../types/user.js").User & {
539
+ findUsers: (organization_id: number) => Promise<({
540
+ created_at: Date;
541
+ current_challenge: string | null;
542
+ email: string;
543
+ email_verified: boolean;
544
+ email_verified_at: Date | null;
545
+ encrypted_password: string | null;
546
+ encrypted_totp_key: string | null;
547
+ family_name: string | null;
548
+ force_2fa: boolean;
549
+ given_name: string | null;
550
+ id: number;
551
+ job: string | null;
552
+ last_sign_in_at: Date | null;
553
+ magic_link_sent_at: Date | null;
554
+ magic_link_token: string | null;
555
+ needs_inclusionconnect_onboarding_help: boolean;
556
+ needs_inclusionconnect_welcome_page: boolean;
557
+ phone_number: string | null;
558
+ reset_password_sent_at: Date | null;
559
+ reset_password_token: string | null;
560
+ sign_in_count: number;
561
+ totp_key_verified_at: Date | null;
562
+ updated_at: Date;
563
+ verify_email_sent_at: Date | null;
564
+ verify_email_token: string | null;
565
+ } & {
540
566
  is_external: boolean;
541
567
  verification_type: "domain" | "organization_dirigeant" | "code_sent_to_official_contact_email" | "imported_from_coop_mediation_numerique" | "imported_from_inclusion_connect" | "in_liste_dirigeants_rna" | "in_liste_dirigeants_rne" | "official_contact_email" | "ordre_professionnel_domain" | "proof_received" | "verified_by_coop_mediation_numerique" | "bypassed" | "domain_not_verified_yet" | "no_validation_means_available" | "no_verification_means_for_entreprise_unipersonnelle" | "no_verification_means_for_small_association" | "no_verification_means_for_small_organization";
542
568
  verified_at: Date | null;
@@ -548,6 +574,14 @@ export declare function createContext({ api_entreprise_client, api_insee_client,
548
574
  organizationInfo: import("../types/organization-info.js").OrganizationInfo;
549
575
  }) => Promise<import("../types/organization.js").Organization>;
550
576
  };
577
+ recovery_words: {
578
+ create: ({ user_id, hashed_words, }: {
579
+ user_id: number;
580
+ hashed_words: string;
581
+ }) => Promise<import("../types/recovery-words.js").RecoveryWords>;
582
+ deleteByUserId: (user_id: number) => Promise<boolean>;
583
+ findByUserId: (user_id: number) => Promise<import("../types/recovery-words.js").RecoveryWords | undefined>;
584
+ };
551
585
  users_organizations: {
552
586
  create: ({ is_external, organization_id, user_id, verification_type, }: import("../types/user-organization-link.js").InsertUserOrganizationLink) => Promise<{
553
587
  is_external: boolean;
@@ -595,14 +629,196 @@ export declare function createContext({ api_entreprise_client, api_insee_client,
595
629
  create: ({ email, encrypted_password, }: {
596
630
  email: string;
597
631
  encrypted_password?: string | null;
598
- }) => Promise<import("../types/user.js").User>;
632
+ }) => Promise<{
633
+ created_at: Date;
634
+ current_challenge: string | null;
635
+ email: string;
636
+ email_verified: boolean;
637
+ email_verified_at: Date | null;
638
+ encrypted_password: string | null;
639
+ encrypted_totp_key: string | null;
640
+ family_name: string | null;
641
+ force_2fa: boolean;
642
+ given_name: string | null;
643
+ id: number;
644
+ job: string | null;
645
+ last_sign_in_at: Date | null;
646
+ magic_link_sent_at: Date | null;
647
+ magic_link_token: string | null;
648
+ needs_inclusionconnect_onboarding_help: boolean;
649
+ needs_inclusionconnect_welcome_page: boolean;
650
+ phone_number: string | null;
651
+ reset_password_sent_at: Date | null;
652
+ reset_password_token: string | null;
653
+ sign_in_count: number;
654
+ totp_key_verified_at: Date | null;
655
+ updated_at: Date;
656
+ verify_email_sent_at: Date | null;
657
+ verify_email_token: string | null;
658
+ }>;
599
659
  delete: (id: number) => Promise<boolean>;
600
- findByEmail: (email: string) => Promise<import("../types/user.js").User | undefined>;
601
- findById: (id: number) => Promise<import("../types/user.js").User | undefined>;
602
- findByMagicLinkToken: (magic_link_token: string) => Promise<import("../types/user.js").User | undefined>;
603
- findByResetPasswordToken: (reset_password_token: string) => Promise<import("../types/user.js").User | undefined>;
604
- getById: (id: number) => Promise<import("../types/user.js").User>;
605
- update: (id: number, fieldsToUpdate: Partial<import("../types/user.js").User>) => Promise<import("../types/user.js").User>;
660
+ findByEmail: (email: string) => Promise<{
661
+ created_at: Date;
662
+ current_challenge: string | null;
663
+ email: string;
664
+ email_verified: boolean;
665
+ email_verified_at: Date | null;
666
+ encrypted_password: string | null;
667
+ encrypted_totp_key: string | null;
668
+ family_name: string | null;
669
+ force_2fa: boolean;
670
+ given_name: string | null;
671
+ id: number;
672
+ job: string | null;
673
+ last_sign_in_at: Date | null;
674
+ magic_link_sent_at: Date | null;
675
+ magic_link_token: string | null;
676
+ needs_inclusionconnect_onboarding_help: boolean;
677
+ needs_inclusionconnect_welcome_page: boolean;
678
+ phone_number: string | null;
679
+ reset_password_sent_at: Date | null;
680
+ reset_password_token: string | null;
681
+ sign_in_count: number;
682
+ totp_key_verified_at: Date | null;
683
+ updated_at: Date;
684
+ verify_email_sent_at: Date | null;
685
+ verify_email_token: string | null;
686
+ } | undefined>;
687
+ findById: (id: number) => Promise<{
688
+ created_at: Date;
689
+ current_challenge: string | null;
690
+ email: string;
691
+ email_verified: boolean;
692
+ email_verified_at: Date | null;
693
+ encrypted_password: string | null;
694
+ encrypted_totp_key: string | null;
695
+ family_name: string | null;
696
+ force_2fa: boolean;
697
+ given_name: string | null;
698
+ id: number;
699
+ job: string | null;
700
+ last_sign_in_at: Date | null;
701
+ magic_link_sent_at: Date | null;
702
+ magic_link_token: string | null;
703
+ needs_inclusionconnect_onboarding_help: boolean;
704
+ needs_inclusionconnect_welcome_page: boolean;
705
+ phone_number: string | null;
706
+ reset_password_sent_at: Date | null;
707
+ reset_password_token: string | null;
708
+ sign_in_count: number;
709
+ totp_key_verified_at: Date | null;
710
+ updated_at: Date;
711
+ verify_email_sent_at: Date | null;
712
+ verify_email_token: string | null;
713
+ } | undefined>;
714
+ findByMagicLinkToken: (magic_link_token: string) => Promise<{
715
+ created_at: Date;
716
+ current_challenge: string | null;
717
+ email: string;
718
+ email_verified: boolean;
719
+ email_verified_at: Date | null;
720
+ encrypted_password: string | null;
721
+ encrypted_totp_key: string | null;
722
+ family_name: string | null;
723
+ force_2fa: boolean;
724
+ given_name: string | null;
725
+ id: number;
726
+ job: string | null;
727
+ last_sign_in_at: Date | null;
728
+ magic_link_sent_at: Date | null;
729
+ magic_link_token: string | null;
730
+ needs_inclusionconnect_onboarding_help: boolean;
731
+ needs_inclusionconnect_welcome_page: boolean;
732
+ phone_number: string | null;
733
+ reset_password_sent_at: Date | null;
734
+ reset_password_token: string | null;
735
+ sign_in_count: number;
736
+ totp_key_verified_at: Date | null;
737
+ updated_at: Date;
738
+ verify_email_sent_at: Date | null;
739
+ verify_email_token: string | null;
740
+ } | undefined>;
741
+ findByResetPasswordToken: (reset_password_token: string) => Promise<{
742
+ created_at: Date;
743
+ current_challenge: string | null;
744
+ email: string;
745
+ email_verified: boolean;
746
+ email_verified_at: Date | null;
747
+ encrypted_password: string | null;
748
+ encrypted_totp_key: string | null;
749
+ family_name: string | null;
750
+ force_2fa: boolean;
751
+ given_name: string | null;
752
+ id: number;
753
+ job: string | null;
754
+ last_sign_in_at: Date | null;
755
+ magic_link_sent_at: Date | null;
756
+ magic_link_token: string | null;
757
+ needs_inclusionconnect_onboarding_help: boolean;
758
+ needs_inclusionconnect_welcome_page: boolean;
759
+ phone_number: string | null;
760
+ reset_password_sent_at: Date | null;
761
+ reset_password_token: string | null;
762
+ sign_in_count: number;
763
+ totp_key_verified_at: Date | null;
764
+ updated_at: Date;
765
+ verify_email_sent_at: Date | null;
766
+ verify_email_token: string | null;
767
+ } | undefined>;
768
+ getById: (id: number) => Promise<{
769
+ created_at: Date;
770
+ current_challenge: string | null;
771
+ email: string;
772
+ email_verified: boolean;
773
+ email_verified_at: Date | null;
774
+ encrypted_password: string | null;
775
+ encrypted_totp_key: string | null;
776
+ family_name: string | null;
777
+ force_2fa: boolean;
778
+ given_name: string | null;
779
+ id: number;
780
+ job: string | null;
781
+ last_sign_in_at: Date | null;
782
+ magic_link_sent_at: Date | null;
783
+ magic_link_token: string | null;
784
+ needs_inclusionconnect_onboarding_help: boolean;
785
+ needs_inclusionconnect_welcome_page: boolean;
786
+ phone_number: string | null;
787
+ reset_password_sent_at: Date | null;
788
+ reset_password_token: string | null;
789
+ sign_in_count: number;
790
+ totp_key_verified_at: Date | null;
791
+ updated_at: Date;
792
+ verify_email_sent_at: Date | null;
793
+ verify_email_token: string | null;
794
+ }>;
795
+ update: (id: number, fieldsToUpdate: Partial<import("../types/user.js").User>) => Promise<{
796
+ created_at: Date;
797
+ current_challenge: string | null;
798
+ email: string;
799
+ email_verified: boolean;
800
+ email_verified_at: Date | null;
801
+ encrypted_password: string | null;
802
+ encrypted_totp_key: string | null;
803
+ family_name: string | null;
804
+ force_2fa: boolean;
805
+ given_name: string | null;
806
+ id: number;
807
+ job: string | null;
808
+ last_sign_in_at: Date | null;
809
+ magic_link_sent_at: Date | null;
810
+ magic_link_token: string | null;
811
+ needs_inclusionconnect_onboarding_help: boolean;
812
+ needs_inclusionconnect_welcome_page: boolean;
813
+ phone_number: string | null;
814
+ reset_password_sent_at: Date | null;
815
+ reset_password_token: string | null;
816
+ sign_in_count: number;
817
+ totp_key_verified_at: Date | null;
818
+ updated_at: Date;
819
+ verify_email_sent_at: Date | null;
820
+ verify_email_token: string | null;
821
+ }>;
606
822
  };
607
823
  franceconnect_userinfo: {
608
824
  delete: (user_id: number) => Promise<import("pg").QueryResult<any>>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/connectors/index.ts"],"names":[],"mappings":"AAiEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gDAAgD,CAAC;AAC1F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,KAAK,EAAE,oCAAoC,EAAE,MAAM,+DAA+D,CAAC;AAC1H,OAAO,EA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AAa,CAAC,CAAC"}
@@ -5,8 +5,9 @@ import { addDomainFactory, deleteEmailDomainsByVerificationTypesFactory, findEma
5
5
  import { deleteFranceconnectUserinfoFactory, findFranceconnectUserinfoFactory, upsertFranceconnectUserinfoFactory, } from "#src/repositories/franceconnect_userinfo";
6
6
  import { createModerationFactory, deleteModerationFactory, findModerationByIdFactory, findPendingModerationFactory, findRejectedModerationFactory, getModerationByIdFactory, reopenModerationFactory, } from "#src/repositories/moderation";
7
7
  import { deleteOfficialContactEmailVerificationFactory, findOfficialContactEmailVerificationFactory, upsertOfficialContactEmailVerificationFactory, } from "#src/repositories/official-contact-email-verification";
8
- import { addConnectionFactory, findByClientIdFactory, } from "#src/repositories/oidc-client";
8
+ import { findByClientIdFactory, upsertAuthorizationRequestFactory, } from "#src/repositories/oidc-client";
9
9
  import { findBySiretFactory, findByUserIdFactory, findByVerifiedEmailDomainFactory, findOrganizationByIdFactory, findPendingByUserIdFactory, findUsersByOrganizationFactory, getOrganizationByIdFactory, upsertFactory, } from "#src/repositories/organization";
10
+ import { createRecoveryWordsFactory, deleteRecoveryWordsByUserIdFactory, findRecoveryWordsByUserIdFactory, } from "#src/repositories/recovery-words";
10
11
  import { createUserFactory, deleteUserFactory, findByEmailFactory, findByMagicLinkTokenFactory, findByResetPasswordTokenFactory, findByIdFactory as findUserByIdFactory, getByIdFactory, updateUserFactory, } from "#src/repositories/user";
11
12
  import { createUserOrganizationFactory, deleteUserOrganizationFactory, findUserOrganizationFactory, getUserOrganizationFactory, updateUserOrganizationFactory, } from "#src/repositories/user_organisation";
12
13
  import {} from "pg";
@@ -49,8 +50,8 @@ export function createContext({ api_entreprise_client, api_insee_client, api_reg
49
50
  upsert: upsertOfficialContactEmailVerificationFactory({ pg }),
50
51
  },
51
52
  oidc_clients: {
52
- addConnection: addConnectionFactory({ pg }),
53
53
  findByClientId: findByClientIdFactory({ pg }),
54
+ upsertAuthorizationRequest: upsertAuthorizationRequestFactory({ pg }),
54
55
  },
55
56
  organizations: {
56
57
  findById: findOrganizationByIdFactory({ pg }),
@@ -62,6 +63,11 @@ export function createContext({ api_entreprise_client, api_insee_client, api_reg
62
63
  getById: getOrganizationByIdFactory({ pg }),
63
64
  upsert: upsertFactory({ pg }),
64
65
  },
66
+ recovery_words: {
67
+ create: createRecoveryWordsFactory({ pg }),
68
+ deleteByUserId: deleteRecoveryWordsByUserIdFactory({ pg }),
69
+ findByUserId: findRecoveryWordsByUserIdFactory({ pg }),
70
+ },
65
71
  users_organizations: {
66
72
  create: createUserOrganizationFactory({ pg }),
67
73
  delete: deleteUserOrganizationFactory({ pg }),
@@ -1,3 +1,3 @@
1
- export * from "./add-connection.js";
2
1
  export * from "./find-by-client-id.js";
2
+ export * from "./upsert-authorization-request.js";
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/repositories/oidc-client/index.ts"],"names":[],"mappings":"AAEA,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/repositories/oidc-client/index.ts"],"names":[],"mappings":"AAEA,cAAc,wBAAwB,CAAC;AACvC,cAAc,mCAAmC,CAAC"}
@@ -1,3 +1,3 @@
1
1
  //
2
- export * from "./add-connection.js";
3
2
  export * from "./find-by-client-id.js";
3
+ export * from "./upsert-authorization-request.js";
@@ -0,0 +1,3 @@
1
+ import type { AuthorizationRequest, BaseAuthorizationRequest, DatabaseContext } from "#src/types";
2
+ export declare function upsertAuthorizationRequestFactory({ pg }: DatabaseContext): ({ user_id, oidc_client_id, organization_id, sp_name, user_ip_address, interaction_cid, outcome, }: BaseAuthorizationRequest) => Promise<AuthorizationRequest>;
3
+ //# sourceMappingURL=upsert-authorization-request.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upsert-authorization-request.d.ts","sourceRoot":"","sources":["../../../src/repositories/oidc-client/upsert-authorization-request.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,oBAAoB,EACpB,wBAAwB,EACxB,eAAe,EAChB,MAAM,YAAY,CAAC;AAKpB,wBAAgB,iCAAiC,CAAC,EAAE,EAAE,EAAE,EAAE,eAAe,IACtB,mGAQ9C,wBAAwB,mCA6B5B"}
@@ -0,0 +1,30 @@
1
+ //
2
+ import {} from "pg";
3
+ //
4
+ export function upsertAuthorizationRequestFactory({ pg }) {
5
+ return async function upsertAuthorizationRequest({ user_id, oidc_client_id, organization_id, sp_name, user_ip_address, interaction_cid, outcome, }) {
6
+ const { rows } = await pg.query(`
7
+ INSERT INTO users_oidc_clients
8
+ (user_id, oidc_client_id, organization_id, sp_name, user_ip_address, created_at, updated_at, interaction_cid, outcome)
9
+ VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9)
10
+ ON CONFLICT (interaction_cid) WHERE interaction_cid IS NOT NULL
11
+ DO UPDATE SET
12
+ organization_id = EXCLUDED.organization_id,
13
+ outcome = EXCLUDED.outcome,
14
+ updated_at = EXCLUDED.updated_at,
15
+ user_id = EXCLUDED.user_id
16
+ RETURNING user_id, oidc_client_id, organization_id, sp_name, user_ip_address, created_at, updated_at, id, interaction_cid, outcome;
17
+ `, [
18
+ user_id,
19
+ oidc_client_id,
20
+ organization_id,
21
+ sp_name,
22
+ user_ip_address,
23
+ new Date(),
24
+ new Date(),
25
+ interaction_cid,
26
+ outcome,
27
+ ]);
28
+ return rows.shift();
29
+ };
30
+ }
@@ -1,5 +1,31 @@
1
- import type { DatabaseContext, User } from "#src/types";
2
- export declare function findUsersByOrganizationFactory({ pg }: DatabaseContext): (organization_id: number) => Promise<(User & {
1
+ import type { DatabaseContext } from "#src/types";
2
+ export declare function findUsersByOrganizationFactory({ pg }: DatabaseContext): (organization_id: number) => Promise<({
3
+ created_at: Date;
4
+ current_challenge: string | null;
5
+ email: string;
6
+ email_verified: boolean;
7
+ email_verified_at: Date | null;
8
+ encrypted_password: string | null;
9
+ encrypted_totp_key: string | null;
10
+ family_name: string | null;
11
+ force_2fa: boolean;
12
+ given_name: string | null;
13
+ id: number;
14
+ job: string | null;
15
+ last_sign_in_at: Date | null;
16
+ magic_link_sent_at: Date | null;
17
+ magic_link_token: string | null;
18
+ needs_inclusionconnect_onboarding_help: boolean;
19
+ needs_inclusionconnect_welcome_page: boolean;
20
+ phone_number: string | null;
21
+ reset_password_sent_at: Date | null;
22
+ reset_password_token: string | null;
23
+ sign_in_count: number;
24
+ totp_key_verified_at: Date | null;
25
+ updated_at: Date;
26
+ verify_email_sent_at: Date | null;
27
+ verify_email_token: string | null;
28
+ } & {
3
29
  is_external: boolean;
4
30
  verification_type: "domain" | "organization_dirigeant" | "code_sent_to_official_contact_email" | "imported_from_coop_mediation_numerique" | "imported_from_inclusion_connect" | "in_liste_dirigeants_rna" | "in_liste_dirigeants_rne" | "official_contact_email" | "ordre_professionnel_domain" | "proof_received" | "verified_by_coop_mediation_numerique" | "bypassed" | "domain_not_verified_yet" | "no_validation_means_available" | "no_verification_means_for_entreprise_unipersonnelle" | "no_verification_means_for_small_association" | "no_verification_means_for_small_organization";
5
31
  verified_at: Date | null;
@@ -1 +1 @@
1
- {"version":3,"file":"find-users-by-organization.d.ts","sourceRoot":"","sources":["../../../src/repositories/organization/find-users-by-organization.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAEV,eAAe,EACf,IAAI,EACL,MAAM,YAAY,CAAC;AAKpB,wBAAgB,8BAA8B,CAAC,EAAE,EAAE,EAAE,EAAE,eAAe,IACtB,iBAAiB,MAAM;;;;;MAiBtE"}
1
+ {"version":3,"file":"find-users-by-organization.d.ts","sourceRoot":"","sources":["../../../src/repositories/organization/find-users-by-organization.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAEV,eAAe,EAEhB,MAAM,YAAY,CAAC;AAKpB,wBAAgB,8BAA8B,CAAC,EAAE,EAAE,EAAE,EAAE,eAAe,IACtB,iBAAiB,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAiBtE"}
@@ -0,0 +1,6 @@
1
+ import type { DatabaseContext, RecoveryWords } from "#src/types";
2
+ export declare function createRecoveryWordsFactory({ pg }: DatabaseContext): ({ user_id, hashed_words, }: {
3
+ user_id: number;
4
+ hashed_words: string;
5
+ }) => Promise<RecoveryWords>;
6
+ //# sourceMappingURL=create.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/repositories/recovery-words/create.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAKjE,wBAAgB,0BAA0B,CAAC,EAAE,EAAE,EAAE,EAAE,eAAe,IACtB,4BAGvC;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;CACtB,4BAaF"}
@@ -0,0 +1,14 @@
1
+ //
2
+ import {} from "pg";
3
+ //
4
+ export function createRecoveryWordsFactory({ pg }) {
5
+ return async function createRecoveryWords({ user_id, hashed_words, }) {
6
+ const { rows } = await pg.query(`
7
+ INSERT INTO recovery_words
8
+ (user_id, hashed_words)
9
+ VALUES
10
+ ($1, $2)
11
+ RETURNING *;`, [user_id, hashed_words]);
12
+ return rows.shift();
13
+ };
14
+ }
@@ -0,0 +1,3 @@
1
+ import type { DatabaseContext } from "#src/types";
2
+ export declare function deleteRecoveryWordsByUserIdFactory({ pg }: DatabaseContext): (user_id: number) => Promise<boolean>;
3
+ //# sourceMappingURL=delete-all-by-user-id.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete-all-by-user-id.d.ts","sourceRoot":"","sources":["../../../src/repositories/recovery-words/delete-all-by-user-id.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAKlD,wBAAgB,kCAAkC,CAAC,EAAE,EAAE,EAAE,EAAE,eAAe,IACtB,SAAS,MAAM,sBAWlE"}
@@ -0,0 +1,11 @@
1
+ //
2
+ //
3
+ export function deleteRecoveryWordsByUserIdFactory({ pg }) {
4
+ return async function deleteRecoveryWordsByUserId(user_id) {
5
+ const { rowCount, affectedRows } = (await pg.query(`
6
+ DELETE FROM recovery_words
7
+ WHERE user_id = $1
8
+ RETURNING *`, [user_id]));
9
+ return (affectedRows ?? rowCount ?? 0) > 0;
10
+ };
11
+ }
@@ -0,0 +1,3 @@
1
+ import type { DatabaseContext, RecoveryWords } from "#src/types";
2
+ export declare function findRecoveryWordsByUserIdFactory({ pg }: DatabaseContext): (user_id: number) => Promise<RecoveryWords | undefined>;
3
+ //# sourceMappingURL=find-by-user-id.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"find-by-user-id.d.ts","sourceRoot":"","sources":["../../../src/repositories/recovery-words/find-by-user-id.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAKjE,wBAAgB,gCAAgC,CAAC,EAAE,EAAE,EAAE,EAAE,eAAe,IACtB,SAAS,MAAM,wCAWhE"}
@@ -0,0 +1,12 @@
1
+ //
2
+ import {} from "pg";
3
+ //
4
+ export function findRecoveryWordsByUserIdFactory({ pg }) {
5
+ return async function findRecoveryWordsByUserId(user_id) {
6
+ const { rows } = await pg.query(`
7
+ SELECT *
8
+ FROM recovery_words
9
+ WHERE user_id = $1;`, [user_id]);
10
+ return rows.shift();
11
+ };
12
+ }
@@ -0,0 +1,4 @@
1
+ export * from "./create.js";
2
+ export * from "./delete-all-by-user-id.js";
3
+ export * from "./find-by-user-id.js";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/repositories/recovery-words/index.ts"],"names":[],"mappings":"AAEA,cAAc,aAAa,CAAC;AAC5B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC"}
@@ -0,0 +1,4 @@
1
+ //
2
+ export * from "./create.js";
3
+ export * from "./delete-all-by-user-id.js";
4
+ export * from "./find-by-user-id.js";
@@ -1,7 +1,33 @@
1
- import type { DatabaseContext, User } from "#src/types";
1
+ import type { DatabaseContext } from "#src/types";
2
2
  export declare function createUserFactory({ pg }: DatabaseContext): ({ email, encrypted_password, }: {
3
3
  email: string;
4
4
  encrypted_password?: string | null;
5
- }) => Promise<User>;
5
+ }) => Promise<{
6
+ created_at: Date;
7
+ current_challenge: string | null;
8
+ email: string;
9
+ email_verified: boolean;
10
+ email_verified_at: Date | null;
11
+ encrypted_password: string | null;
12
+ encrypted_totp_key: string | null;
13
+ family_name: string | null;
14
+ force_2fa: boolean;
15
+ given_name: string | null;
16
+ id: number;
17
+ job: string | null;
18
+ last_sign_in_at: Date | null;
19
+ magic_link_sent_at: Date | null;
20
+ magic_link_token: string | null;
21
+ needs_inclusionconnect_onboarding_help: boolean;
22
+ needs_inclusionconnect_welcome_page: boolean;
23
+ phone_number: string | null;
24
+ reset_password_sent_at: Date | null;
25
+ reset_password_token: string | null;
26
+ sign_in_count: number;
27
+ totp_key_verified_at: Date | null;
28
+ updated_at: Date;
29
+ verify_email_sent_at: Date | null;
30
+ verify_email_token: string | null;
31
+ }>;
6
32
  export type CreateUserHandler = ReturnType<typeof createUserFactory>;
7
33
  //# sourceMappingURL=create.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/repositories/user/create.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAKxD,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,EAAE,EAAE,eAAe,IACtB,gCAG9B;IACD,KAAK,EAAE,MAAM,CAAC;IACd,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACpC,mBA0BF;AAED,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
1
+ {"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../../src/repositories/user/create.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAQ,MAAM,YAAY,CAAC;AAKxD,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,EAAE,EAAE,eAAe,IACtB,gCAG9B;IACD,KAAK,EAAE,MAAM,CAAC;IACd,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACpC;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BF;AAED,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
@@ -1,4 +1,30 @@
1
- import type { DatabaseContext, User } from "#src/types";
2
- export declare function findByEmailFactory({ pg }: DatabaseContext): (email: string) => Promise<User | undefined>;
1
+ import type { DatabaseContext } from "#src/types";
2
+ export declare function findByEmailFactory({ pg }: DatabaseContext): (email: string) => Promise<{
3
+ created_at: Date;
4
+ current_challenge: string | null;
5
+ email: string;
6
+ email_verified: boolean;
7
+ email_verified_at: Date | null;
8
+ encrypted_password: string | null;
9
+ encrypted_totp_key: string | null;
10
+ family_name: string | null;
11
+ force_2fa: boolean;
12
+ given_name: string | null;
13
+ id: number;
14
+ job: string | null;
15
+ last_sign_in_at: Date | null;
16
+ magic_link_sent_at: Date | null;
17
+ magic_link_token: string | null;
18
+ needs_inclusionconnect_onboarding_help: boolean;
19
+ needs_inclusionconnect_welcome_page: boolean;
20
+ phone_number: string | null;
21
+ reset_password_sent_at: Date | null;
22
+ reset_password_token: string | null;
23
+ sign_in_count: number;
24
+ totp_key_verified_at: Date | null;
25
+ updated_at: Date;
26
+ verify_email_sent_at: Date | null;
27
+ verify_email_token: string | null;
28
+ } | undefined>;
3
29
  export type FindByEmailHandler = ReturnType<typeof findByEmailFactory>;
4
30
  //# sourceMappingURL=find-by-email.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"find-by-email.d.ts","sourceRoot":"","sources":["../../../src/repositories/user/find-by-email.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAKxD,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,EAAE,EAAE,eAAe,IACtB,OAAO,MAAM,+BAWhD;AAED,MAAM,MAAM,kBAAkB,GAAG,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
1
+ {"version":3,"file":"find-by-email.d.ts","sourceRoot":"","sources":["../../../src/repositories/user/find-by-email.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAQ,MAAM,YAAY,CAAC;AAKxD,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,EAAE,EAAE,eAAe,IACtB,OAAO,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;eAWhD;AAED,MAAM,MAAM,kBAAkB,GAAG,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
@@ -1,4 +1,30 @@
1
- import type { DatabaseContext, User } from "#src/types";
2
- export declare function findByIdFactory({ pg }: DatabaseContext): (id: number) => Promise<User | undefined>;
1
+ import type { DatabaseContext } from "#src/types";
2
+ export declare function findByIdFactory({ pg }: DatabaseContext): (id: number) => Promise<{
3
+ created_at: Date;
4
+ current_challenge: string | null;
5
+ email: string;
6
+ email_verified: boolean;
7
+ email_verified_at: Date | null;
8
+ encrypted_password: string | null;
9
+ encrypted_totp_key: string | null;
10
+ family_name: string | null;
11
+ force_2fa: boolean;
12
+ given_name: string | null;
13
+ id: number;
14
+ job: string | null;
15
+ last_sign_in_at: Date | null;
16
+ magic_link_sent_at: Date | null;
17
+ magic_link_token: string | null;
18
+ needs_inclusionconnect_onboarding_help: boolean;
19
+ needs_inclusionconnect_welcome_page: boolean;
20
+ phone_number: string | null;
21
+ reset_password_sent_at: Date | null;
22
+ reset_password_token: string | null;
23
+ sign_in_count: number;
24
+ totp_key_verified_at: Date | null;
25
+ updated_at: Date;
26
+ verify_email_sent_at: Date | null;
27
+ verify_email_token: string | null;
28
+ } | undefined>;
3
29
  export type FindByIdHandler = ReturnType<typeof findByIdFactory>;
4
30
  //# sourceMappingURL=find-by-id.d.ts.map