@proconnect-gouv/proconnect.identite 13.0.0 → 14.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.
- package/CHANGELOG.md +16 -0
- package/dist/connectors/index.d.ts +0 -56
- package/dist/connectors/index.d.ts.map +1 -1
- package/dist/connectors/index.js +4 -11
- package/dist/repositories/franceconnect_userinfo/index.d.ts +0 -2
- package/dist/repositories/franceconnect_userinfo/index.d.ts.map +1 -1
- package/dist/repositories/franceconnect_userinfo/index.js +0 -2
- package/dist/repositories/moderation/index.d.ts +0 -1
- package/dist/repositories/moderation/index.d.ts.map +1 -1
- package/dist/repositories/moderation/index.js +0 -1
- package/dist/repositories/user/index.d.ts +0 -1
- package/dist/repositories/user/index.d.ts.map +1 -1
- package/dist/repositories/user/index.js +0 -1
- package/dist/repositories/user_organisation/index.d.ts +0 -3
- package/dist/repositories/user_organisation/index.d.ts.map +1 -1
- package/dist/repositories/user_organisation/index.js +0 -3
- package/package.json +3 -3
- package/src/connectors/index.ts +1 -17
- package/src/repositories/franceconnect_userinfo/index.ts +0 -2
- package/src/repositories/moderation/index.ts +0 -1
- package/src/repositories/user/index.ts +0 -1
- package/src/repositories/user_organisation/index.ts +0 -3
- package/dist/repositories/franceconnect_userinfo/delete-franceconnect-userinfo.d.ts +0 -4
- package/dist/repositories/franceconnect_userinfo/delete-franceconnect-userinfo.d.ts.map +0 -1
- package/dist/repositories/franceconnect_userinfo/delete-franceconnect-userinfo.js +0 -10
- package/dist/repositories/franceconnect_userinfo/upsert-franceconnect-userinfo.d.ts +0 -16
- package/dist/repositories/franceconnect_userinfo/upsert-franceconnect-userinfo.d.ts.map +0 -1
- package/dist/repositories/franceconnect_userinfo/upsert-franceconnect-userinfo.js +0 -23
- package/dist/repositories/moderation/create-moderation.d.ts +0 -22
- package/dist/repositories/moderation/create-moderation.d.ts.map +0 -1
- package/dist/repositories/moderation/create-moderation.js +0 -21
- package/dist/repositories/user/delete.d.ts +0 -3
- package/dist/repositories/user/delete.d.ts.map +0 -1
- package/dist/repositories/user/delete.js +0 -11
- package/dist/repositories/user_organisation/create-user-organization.d.ts +0 -12
- package/dist/repositories/user_organisation/create-user-organization.d.ts.map +0 -1
- package/dist/repositories/user_organisation/create-user-organization.js +0 -21
- package/dist/repositories/user_organisation/delete-user-organization.d.ts +0 -3
- package/dist/repositories/user_organisation/delete-user-organization.d.ts.map +0 -1
- package/dist/repositories/user_organisation/delete-user-organization.js +0 -12
- package/dist/repositories/user_organisation/update-user-organization.d.ts +0 -12
- package/dist/repositories/user_organisation/update-user-organization.d.ts.map +0 -1
- package/dist/repositories/user_organisation/update-user-organization.js +0 -20
- package/src/repositories/franceconnect_userinfo/delete-franceconnect-userinfo.test.ts +0 -47
- package/src/repositories/franceconnect_userinfo/delete-franceconnect-userinfo.ts +0 -21
- package/src/repositories/franceconnect_userinfo/upsert-franceconnect-userinfo.test.ts +0 -102
- package/src/repositories/franceconnect_userinfo/upsert-franceconnect-userinfo.ts +0 -41
- package/src/repositories/moderation/create-moderation.test.ts +0 -43
- package/src/repositories/moderation/create-moderation.ts +0 -45
- package/src/repositories/user/delete.test.ts +0 -35
- package/src/repositories/user/delete.ts +0 -19
- package/src/repositories/user_organisation/create-user-organization.test.ts +0 -66
- package/src/repositories/user_organisation/create-user-organization.test.ts.snapshot +0 -25
- package/src/repositories/user_organisation/create-user-organization.ts +0 -39
- package/src/repositories/user_organisation/delete-user-organization.test.ts +0 -55
- package/src/repositories/user_organisation/delete-user-organization.ts +0 -24
- package/src/repositories/user_organisation/update-user-organization.test.ts +0 -48
- package/src/repositories/user_organisation/update-user-organization.ts +0 -42
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @proconnect-gouv/proconnect.identite
|
|
2
2
|
|
|
3
|
+
## 14.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [#2387](https://github.com/proconnect-gouv/proconnect-identite/pull/2387) [`e4b4789`](https://github.com/proconnect-gouv/proconnect-identite/commit/e4b4789b5eb0ad01d9b4ce216fe81cce40a2c70b) Thanks [@douglasduteil](https://github.com/douglasduteil)! - Retire `createUserOrganizationFactory` (`repositories/user_organisation`), exposé aussi par `connectors`. L'application identite rattache maintenant un membre à une organisation avec `addMembership` du runtime, qui crée le rattachement et écrit la ligne `member.joined` dans la même transaction.
|
|
8
|
+
|
|
9
|
+
- [#2390](https://github.com/proconnect-gouv/proconnect-identite/pull/2390) [`03426c3`](https://github.com/proconnect-gouv/proconnect-identite/commit/03426c325f3439e0ee9587a2088d51e62589fe04) Thanks [@douglasduteil](https://github.com/douglasduteil)! - Retire `createModerationFactory` (`repositories/moderation`), exposé aussi par `connectors`. L'application identite ouvre maintenant une modération avec `openModeration` du runtime, qui crée la modération et écrit la ligne `moderation.opened` dans la même transaction.
|
|
10
|
+
|
|
11
|
+
- [#2389](https://github.com/proconnect-gouv/proconnect-identite/pull/2389) [`cc30f4f`](https://github.com/proconnect-gouv/proconnect-identite/commit/cc30f4f98277b7833b7ca5949f5617916be3b2e2) Thanks [@douglasduteil](https://github.com/douglasduteil)! - Retire `deleteUserFactory` (`repositories/user`), exposé aussi par `connectors`. L'application identite supprime maintenant un compte avec `deleteUser` du runtime, qui fait la suppression et écrit la ligne `user.deleted` dans la même transaction.
|
|
12
|
+
|
|
13
|
+
- [#2386](https://github.com/proconnect-gouv/proconnect-identite/pull/2386) [`0791585`](https://github.com/proconnect-gouv/proconnect-identite/commit/0791585ecd627035cb1a633dbc20956a08f58ad7) Thanks [@douglasduteil](https://github.com/douglasduteil)! - Retire `deleteFranceconnectUserinfoFactory` et `upsertFranceconnectUserinfoFactory` (`repositories/franceconnect_userinfo`), exposés aussi par `connectors`. L'application identite relie et délie maintenant une identité FranceConnect avec `connectFranceConnect` et `disconnectFranceConnect` du runtime, qui écrivent la ligne `franceconnect.connected` ou `franceconnect.disconnected` dans la même transaction que la modification.
|
|
14
|
+
|
|
15
|
+
- [#2384](https://github.com/proconnect-gouv/proconnect-identite/pull/2384) [`27b202a`](https://github.com/proconnect-gouv/proconnect-identite/commit/27b202a9a33f7143c9e62e4831e24341ce320749) Thanks [@douglasduteil](https://github.com/douglasduteil)! - Retire `deleteUserOrganizationFactory` (`repositories/user_organisation`), exposé aussi par `connectors`. L'application identite supprime maintenant un rattachement avec `removeMembership` du runtime, qui fait la suppression et écrit la ligne `member.removed` dans la même transaction.
|
|
16
|
+
|
|
17
|
+
- [#2391](https://github.com/proconnect-gouv/proconnect-identite/pull/2391) [`c8d53f1`](https://github.com/proconnect-gouv/proconnect-identite/commit/c8d53f17eeb1b0caff4b5e9031f7cee2b31dec1b) Thanks [@douglasduteil](https://github.com/douglasduteil)! - Retire `updateUserOrganizationFactory` (`repositories/user_organisation`), exposé aussi par `connectors`. L'application identite modifie maintenant un rattachement avec `updateMembership` du runtime, qui fait la modification et écrit la ligne `member.updated` dans la même transaction.
|
|
18
|
+
|
|
3
19
|
## 13.0.0
|
|
4
20
|
|
|
5
21
|
### Major Changes
|
|
@@ -402,26 +402,6 @@ export declare function createContext({ api_entreprise_client, api_insee_client,
|
|
|
402
402
|
}[]>;
|
|
403
403
|
};
|
|
404
404
|
moderations: {
|
|
405
|
-
create: ({ user_id, organization_id, sp_name, type, ticket_id, }: {
|
|
406
|
-
user_id: number;
|
|
407
|
-
organization_id: number;
|
|
408
|
-
sp_name?: string;
|
|
409
|
-
type: import("../types/moderation.js").ModerationType;
|
|
410
|
-
ticket_id: string | null;
|
|
411
|
-
}) => Promise<{
|
|
412
|
-
id: number;
|
|
413
|
-
user_id: number;
|
|
414
|
-
organization_id: number;
|
|
415
|
-
ticket_id: string | null;
|
|
416
|
-
type: "non_verified_domain" | "organization_join_block";
|
|
417
|
-
created_at: Date;
|
|
418
|
-
moderated_at: Date | null;
|
|
419
|
-
comment: string | null;
|
|
420
|
-
moderated_by: string | null;
|
|
421
|
-
status: "accepted" | "pending" | "rejected" | "reopened" | "unknown";
|
|
422
|
-
end_user_reason: string;
|
|
423
|
-
allow_editing: boolean;
|
|
424
|
-
}>;
|
|
425
405
|
delete: (id: number) => Promise<boolean>;
|
|
426
406
|
findById: (id: number) => Promise<{
|
|
427
407
|
id: number;
|
|
@@ -546,17 +526,6 @@ export declare function createContext({ api_entreprise_client, api_insee_client,
|
|
|
546
526
|
findByUserId: (user_id: number) => Promise<import("../types/recovery-words.js").RecoveryWords | undefined>;
|
|
547
527
|
};
|
|
548
528
|
users_organizations: {
|
|
549
|
-
create: ({ is_external, organization_id, user_id, verification_type, }: import("../types/user-organization-link.js").InsertUserOrganizationLink) => Promise<{
|
|
550
|
-
is_external: boolean;
|
|
551
|
-
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";
|
|
552
|
-
verified_at: Date | null;
|
|
553
|
-
has_been_greeted: boolean;
|
|
554
|
-
user_id: number;
|
|
555
|
-
organization_id: number;
|
|
556
|
-
created_at: Date;
|
|
557
|
-
updated_at: Date;
|
|
558
|
-
}>;
|
|
559
|
-
delete: ({ user_id, organization_id, }: import("../types/user-organization-link.js").FindUserOrganizationLink) => Promise<boolean>;
|
|
560
529
|
find: ({ organization_id, user_id, }: import("../types/user-organization-link.js").FindUserOrganizationLink) => Promise<{
|
|
561
530
|
is_external: boolean;
|
|
562
531
|
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";
|
|
@@ -577,16 +546,6 @@ export declare function createContext({ api_entreprise_client, api_insee_client,
|
|
|
577
546
|
created_at: Date;
|
|
578
547
|
updated_at: Date;
|
|
579
548
|
}>;
|
|
580
|
-
update: ({ organization_id, user_id }: import("../types/user-organization-link.js").FindUserOrganizationLink, fieldsToUpdate: Partial<import("../types/user-organization-link.js").UserOrganizationLink>) => Promise<{
|
|
581
|
-
is_external: boolean;
|
|
582
|
-
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";
|
|
583
|
-
verified_at: Date | null;
|
|
584
|
-
has_been_greeted: boolean;
|
|
585
|
-
user_id: number;
|
|
586
|
-
organization_id: number;
|
|
587
|
-
created_at: Date;
|
|
588
|
-
updated_at: Date;
|
|
589
|
-
}>;
|
|
590
549
|
};
|
|
591
550
|
users: {
|
|
592
551
|
create: ({ email, encrypted_password, }: {
|
|
@@ -619,7 +578,6 @@ export declare function createContext({ api_entreprise_client, api_insee_client,
|
|
|
619
578
|
verify_email_sent_at: Date | null;
|
|
620
579
|
verify_email_token: string | null;
|
|
621
580
|
}>;
|
|
622
|
-
delete: (id: number) => Promise<boolean>;
|
|
623
581
|
findByEmail: (email: string) => Promise<{
|
|
624
582
|
created_at: Date;
|
|
625
583
|
current_challenge: string | null;
|
|
@@ -784,7 +742,6 @@ export declare function createContext({ api_entreprise_client, api_insee_client,
|
|
|
784
742
|
}>;
|
|
785
743
|
};
|
|
786
744
|
franceconnect_userinfo: {
|
|
787
|
-
delete: (user_id: number) => Promise<import("pg").QueryResult<any>>;
|
|
788
745
|
find: (user_id: number) => Promise<{
|
|
789
746
|
birthcountry: string;
|
|
790
747
|
birthdate: Date;
|
|
@@ -798,19 +755,6 @@ export declare function createContext({ api_entreprise_client, api_insee_client,
|
|
|
798
755
|
user_id: number;
|
|
799
756
|
preferred_username?: string | undefined;
|
|
800
757
|
} | undefined>;
|
|
801
|
-
upsert: (value: Pick<import("../types/franceconnect.js").FranceConnectUserInfo, "user_id"> & Partial<import("../types/franceconnect.js").FranceConnectUserInfo>) => Promise<{
|
|
802
|
-
birthcountry: string;
|
|
803
|
-
birthdate: Date;
|
|
804
|
-
birthplace: string;
|
|
805
|
-
family_name: string;
|
|
806
|
-
gender: string;
|
|
807
|
-
given_name: string;
|
|
808
|
-
sub: string;
|
|
809
|
-
created_at: Date;
|
|
810
|
-
updated_at: Date;
|
|
811
|
-
user_id: number;
|
|
812
|
-
preferred_username?: string | undefined;
|
|
813
|
-
}>;
|
|
814
758
|
};
|
|
815
759
|
};
|
|
816
760
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/connectors/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/connectors/index.ts"],"names":[],"mappings":"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"}
|
package/dist/connectors/index.js
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
import { createAuthenticatorFactory, deleteAuthenticatorFactory, findAuthenticatorFactory, findAuthenticatorsByUserIdFactory, updateAuthenticatorFactory, } from "#src/repositories/authenticator";
|
|
3
3
|
import { findEmailInDeliverabilityWhiteListFactory } from "#src/repositories/email-deliverability-whitelist";
|
|
4
4
|
import { addDomainFactory, findEmailDomainsByOrganizationIdFactory, } from "#src/repositories/email-domain";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { findFranceconnectUserinfoFactory } from "#src/repositories/franceconnect_userinfo";
|
|
6
|
+
import { deleteModerationFactory, findModerationByIdFactory, findPendingModerationFactory, findRejectedModerationFactory, getModerationByIdFactory, reopenModerationFactory, } from "#src/repositories/moderation";
|
|
7
7
|
import { deleteOfficialContactEmailVerificationFactory, findOfficialContactEmailVerificationFactory, upsertOfficialContactEmailVerificationFactory, } from "#src/repositories/official-contact-email-verification";
|
|
8
8
|
import { findByClientIdFactory, upsertAuthorizationRequestFactory, } from "#src/repositories/oidc-client";
|
|
9
9
|
import { findBySiretFactory, findByUserIdFactory, findByVerifiedEmailDomainFactory, findOrganizationByIdFactory, findPendingByUserIdFactory, getOrganizationByIdFactory, upsertFactory, } from "#src/repositories/organization";
|
|
10
10
|
import { createRecoveryWordsFactory, deleteRecoveryWordsByUserIdFactory, findRecoveryWordsByUserIdFactory, } from "#src/repositories/recovery-words";
|
|
11
|
-
import { createUserFactory,
|
|
12
|
-
import {
|
|
11
|
+
import { createUserFactory, findByEmailFactory, findByMagicLinkTokenFactory, findByResetPasswordTokenFactory, findByIdFactory as findUserByIdFactory, getByIdFactory, updateUserFactory, } from "#src/repositories/user";
|
|
12
|
+
import { findUserOrganizationFactory, getUserOrganizationFactory, } from "#src/repositories/user_organisation";
|
|
13
13
|
import {} from "pg";
|
|
14
14
|
//
|
|
15
15
|
export function createContext({ api_entreprise_client, api_insee_client, api_registre_national_entreprises_client, pg, }) {
|
|
@@ -35,7 +35,6 @@ export function createContext({ api_entreprise_client, api_insee_client, api_reg
|
|
|
35
35
|
findEmailDomainsByOrganizationId: findEmailDomainsByOrganizationIdFactory({ pg }),
|
|
36
36
|
},
|
|
37
37
|
moderations: {
|
|
38
|
-
create: createModerationFactory({ pg }),
|
|
39
38
|
delete: deleteModerationFactory({ pg }),
|
|
40
39
|
findById: findModerationByIdFactory({ pg }),
|
|
41
40
|
findPending: findPendingModerationFactory({ pg }),
|
|
@@ -67,15 +66,11 @@ export function createContext({ api_entreprise_client, api_insee_client, api_reg
|
|
|
67
66
|
findByUserId: findRecoveryWordsByUserIdFactory({ pg }),
|
|
68
67
|
},
|
|
69
68
|
users_organizations: {
|
|
70
|
-
create: createUserOrganizationFactory({ pg }),
|
|
71
|
-
delete: deleteUserOrganizationFactory({ pg }),
|
|
72
69
|
find: findUserOrganizationFactory({ pg }),
|
|
73
70
|
get: getUserOrganizationFactory({ pg }),
|
|
74
|
-
update: updateUserOrganizationFactory({ pg }),
|
|
75
71
|
},
|
|
76
72
|
users: {
|
|
77
73
|
create: createUserFactory({ pg }),
|
|
78
|
-
delete: deleteUserFactory({ pg }),
|
|
79
74
|
findByEmail: findByEmailFactory({ pg }),
|
|
80
75
|
findById: findUserByIdFactory({ pg }),
|
|
81
76
|
findByMagicLinkToken: findByMagicLinkTokenFactory({ pg }),
|
|
@@ -84,9 +79,7 @@ export function createContext({ api_entreprise_client, api_insee_client, api_reg
|
|
|
84
79
|
update: updateUserFactory({ pg }),
|
|
85
80
|
},
|
|
86
81
|
franceconnect_userinfo: {
|
|
87
|
-
delete: deleteFranceconnectUserinfoFactory({ pg }),
|
|
88
82
|
find: findFranceconnectUserinfoFactory({ pg }),
|
|
89
|
-
upsert: upsertFranceconnectUserinfoFactory({ pg }),
|
|
90
83
|
},
|
|
91
84
|
},
|
|
92
85
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/repositories/franceconnect_userinfo/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/repositories/franceconnect_userinfo/index.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/repositories/moderation/index.ts"],"names":[],"mappings":"AAEA,cAAc,wBAAwB,CAAC;AACvC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/repositories/moderation/index.ts"],"names":[],"mappings":"AAEA,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,wBAAwB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/repositories/user/index.ts"],"names":[],"mappings":"AAEA,cAAc,aAAa,CAAC;AAC5B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/repositories/user/index.ts"],"names":[],"mappings":"AAEA,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,mCAAmC,CAAC;AAClD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC"}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
export * from "./create-user-organization.js";
|
|
2
|
-
export * from "./delete-user-organization.js";
|
|
3
1
|
export * from "./find-user-organization.js";
|
|
4
2
|
export * from "./get-user-organization.js";
|
|
5
|
-
export * from "./update-user-organization.js";
|
|
6
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/repositories/user_organisation/index.ts"],"names":[],"mappings":"AAAA,cAAc
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/repositories/user_organisation/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@proconnect-gouv/proconnect.identite",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "14.0.0",
|
|
4
4
|
"homepage": "https://github.com/proconnect-gouv/proconnect-identite/tree/main/packages/identite#readme",
|
|
5
5
|
"bugs": "https://github.com/proconnect-gouv/proconnect-identite/issues",
|
|
6
6
|
"repository": {
|
|
@@ -58,10 +58,10 @@
|
|
|
58
58
|
"@proconnect-gouv/proconnect.insee": "^2.0.0",
|
|
59
59
|
"@proconnect-gouv/proconnect.registre_national_entreprises": "^4.1.0",
|
|
60
60
|
"@types/node": "^22.18.6",
|
|
61
|
-
"@types/pg": "^8.
|
|
61
|
+
"@types/pg": "^8.23.1",
|
|
62
62
|
"await-to-js": "^3.0.0",
|
|
63
63
|
"node-pg-migrate": "^8.0.3",
|
|
64
|
-
"pg": "^8.
|
|
64
|
+
"pg": "^8.23.1",
|
|
65
65
|
"tsx": "^4.20.3"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
package/src/connectors/index.ts
CHANGED
|
@@ -12,13 +12,8 @@ import {
|
|
|
12
12
|
addDomainFactory,
|
|
13
13
|
findEmailDomainsByOrganizationIdFactory,
|
|
14
14
|
} from "#src/repositories/email-domain";
|
|
15
|
+
import { findFranceconnectUserinfoFactory } from "#src/repositories/franceconnect_userinfo";
|
|
15
16
|
import {
|
|
16
|
-
deleteFranceconnectUserinfoFactory,
|
|
17
|
-
findFranceconnectUserinfoFactory,
|
|
18
|
-
upsertFranceconnectUserinfoFactory,
|
|
19
|
-
} from "#src/repositories/franceconnect_userinfo";
|
|
20
|
-
import {
|
|
21
|
-
createModerationFactory,
|
|
22
17
|
deleteModerationFactory,
|
|
23
18
|
findModerationByIdFactory,
|
|
24
19
|
findPendingModerationFactory,
|
|
@@ -51,7 +46,6 @@ import {
|
|
|
51
46
|
} from "#src/repositories/recovery-words";
|
|
52
47
|
import {
|
|
53
48
|
createUserFactory,
|
|
54
|
-
deleteUserFactory,
|
|
55
49
|
findByEmailFactory,
|
|
56
50
|
findByMagicLinkTokenFactory,
|
|
57
51
|
findByResetPasswordTokenFactory,
|
|
@@ -60,11 +54,8 @@ import {
|
|
|
60
54
|
updateUserFactory,
|
|
61
55
|
} from "#src/repositories/user";
|
|
62
56
|
import {
|
|
63
|
-
createUserOrganizationFactory,
|
|
64
|
-
deleteUserOrganizationFactory,
|
|
65
57
|
findUserOrganizationFactory,
|
|
66
58
|
getUserOrganizationFactory,
|
|
67
|
-
updateUserOrganizationFactory,
|
|
68
59
|
} from "#src/repositories/user_organisation";
|
|
69
60
|
import type { ApiEntrepriseClient } from "@proconnect-gouv/proconnect.api_entreprise/api";
|
|
70
61
|
import type { ApiInseeClient } from "@proconnect-gouv/proconnect.insee/api";
|
|
@@ -108,7 +99,6 @@ export function createContext({
|
|
|
108
99
|
findEmailDomainsByOrganizationIdFactory({ pg }),
|
|
109
100
|
},
|
|
110
101
|
moderations: {
|
|
111
|
-
create: createModerationFactory({ pg }),
|
|
112
102
|
delete: deleteModerationFactory({ pg }),
|
|
113
103
|
findById: findModerationByIdFactory({ pg }),
|
|
114
104
|
findPending: findPendingModerationFactory({ pg }),
|
|
@@ -140,15 +130,11 @@ export function createContext({
|
|
|
140
130
|
findByUserId: findRecoveryWordsByUserIdFactory({ pg }),
|
|
141
131
|
},
|
|
142
132
|
users_organizations: {
|
|
143
|
-
create: createUserOrganizationFactory({ pg }),
|
|
144
|
-
delete: deleteUserOrganizationFactory({ pg }),
|
|
145
133
|
find: findUserOrganizationFactory({ pg }),
|
|
146
134
|
get: getUserOrganizationFactory({ pg }),
|
|
147
|
-
update: updateUserOrganizationFactory({ pg }),
|
|
148
135
|
},
|
|
149
136
|
users: {
|
|
150
137
|
create: createUserFactory({ pg }),
|
|
151
|
-
delete: deleteUserFactory({ pg }),
|
|
152
138
|
findByEmail: findByEmailFactory({ pg }),
|
|
153
139
|
findById: findUserByIdFactory({ pg }),
|
|
154
140
|
findByMagicLinkToken: findByMagicLinkTokenFactory({ pg }),
|
|
@@ -157,9 +143,7 @@ export function createContext({
|
|
|
157
143
|
update: updateUserFactory({ pg }),
|
|
158
144
|
},
|
|
159
145
|
franceconnect_userinfo: {
|
|
160
|
-
delete: deleteFranceconnectUserinfoFactory({ pg }),
|
|
161
146
|
find: findFranceconnectUserinfoFactory({ pg }),
|
|
162
|
-
upsert: upsertFranceconnectUserinfoFactory({ pg }),
|
|
163
147
|
},
|
|
164
148
|
},
|
|
165
149
|
};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { DatabaseContext } from "#src/types";
|
|
2
|
-
export declare function deleteFranceconnectUserinfoFactory({ pg }: DatabaseContext): (user_id: number) => Promise<import("pg").QueryResult<any>>;
|
|
3
|
-
export type DeleteFranceconnectUserinfoHandler = ReturnType<typeof deleteFranceconnectUserinfoFactory>;
|
|
4
|
-
//# sourceMappingURL=delete-franceconnect-userinfo.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"delete-franceconnect-userinfo.d.ts","sourceRoot":"","sources":["../../../src/repositories/franceconnect_userinfo/delete-franceconnect-userinfo.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAIlD,wBAAgB,kCAAkC,CAAC,EAAE,EAAE,EAAE,EAAE,eAAe,IACtB,SAAS,MAAM,4CASlE;AAED,MAAM,MAAM,kCAAkC,GAAG,UAAU,CACzD,OAAO,kCAAkC,CAC1C,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { DatabaseContext, FranceConnectUserInfo } from "#src/types";
|
|
2
|
-
export declare function upsertFranceconnectUserinfoFactory({ pg }: DatabaseContext): (value: Pick<FranceConnectUserInfo, "user_id"> & Partial<FranceConnectUserInfo>) => Promise<{
|
|
3
|
-
birthcountry: string;
|
|
4
|
-
birthdate: Date;
|
|
5
|
-
birthplace: string;
|
|
6
|
-
family_name: string;
|
|
7
|
-
gender: string;
|
|
8
|
-
given_name: string;
|
|
9
|
-
sub: string;
|
|
10
|
-
created_at: Date;
|
|
11
|
-
updated_at: Date;
|
|
12
|
-
user_id: number;
|
|
13
|
-
preferred_username?: string | undefined;
|
|
14
|
-
}>;
|
|
15
|
-
export type UpsetFranceconnectUserinfoHandler = ReturnType<typeof upsertFranceconnectUserinfoFactory>;
|
|
16
|
-
//# sourceMappingURL=upsert-franceconnect-userinfo.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"upsert-franceconnect-userinfo.d.ts","sourceRoot":"","sources":["../../../src/repositories/franceconnect_userinfo/upsert-franceconnect-userinfo.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAIzE,wBAAgB,kCAAkC,CAAC,EAAE,EAAE,EAAE,EAAE,eAAe,IAEtE,OAAO,IAAI,CAAC,qBAAqB,EAAE,SAAS,CAAC,GAC3C,OAAO,CAAC,qBAAqB,CAAC;;;;;;;;;;;;GA0BnC;AAED,MAAM,MAAM,iCAAiC,GAAG,UAAU,CACxD,OAAO,kCAAkC,CAC1C,CAAC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
import { hashToPostgresParams } from "#src/services/postgres";
|
|
3
|
-
//
|
|
4
|
-
export function upsertFranceconnectUserinfoFactory({ pg }) {
|
|
5
|
-
return async function upsertFranceconnectUserinfo(value) {
|
|
6
|
-
const fieldsWithTimestamps = {
|
|
7
|
-
...value,
|
|
8
|
-
updated_at: new Date(),
|
|
9
|
-
};
|
|
10
|
-
const { paramsString, valuesString, values } = hashToPostgresParams(fieldsWithTimestamps);
|
|
11
|
-
const { rows } = await pg.query(`
|
|
12
|
-
INSERT INTO franceconnect_userinfo
|
|
13
|
-
${paramsString}
|
|
14
|
-
VALUES
|
|
15
|
-
${valuesString}
|
|
16
|
-
ON CONFLICT (user_id)
|
|
17
|
-
DO UPDATE
|
|
18
|
-
SET ${paramsString} = ${valuesString}
|
|
19
|
-
RETURNING *
|
|
20
|
-
`, [...values]);
|
|
21
|
-
return rows.shift();
|
|
22
|
-
};
|
|
23
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { type DatabaseContext, type ModerationType } from "#src/types";
|
|
2
|
-
export declare function createModerationFactory({ pg }: DatabaseContext): ({ user_id, organization_id, sp_name, type, ticket_id, }: {
|
|
3
|
-
user_id: number;
|
|
4
|
-
organization_id: number;
|
|
5
|
-
sp_name?: string;
|
|
6
|
-
type: ModerationType;
|
|
7
|
-
ticket_id: string | null;
|
|
8
|
-
}) => Promise<{
|
|
9
|
-
id: number;
|
|
10
|
-
user_id: number;
|
|
11
|
-
organization_id: number;
|
|
12
|
-
ticket_id: string | null;
|
|
13
|
-
type: "non_verified_domain" | "organization_join_block";
|
|
14
|
-
created_at: Date;
|
|
15
|
-
moderated_at: Date | null;
|
|
16
|
-
comment: string | null;
|
|
17
|
-
moderated_by: string | null;
|
|
18
|
-
status: "accepted" | "pending" | "rejected" | "reopened" | "unknown";
|
|
19
|
-
end_user_reason: string;
|
|
20
|
-
allow_editing: boolean;
|
|
21
|
-
}>;
|
|
22
|
-
//# sourceMappingURL=create-moderation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-moderation.d.ts","sourceRoot":"","sources":["../../../src/repositories/moderation/create-moderation.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,eAAe,EAEpB,KAAK,cAAc,EACpB,MAAM,YAAY,CAAC;AAKpB,wBAAgB,uBAAuB,CAAC,EAAE,EAAE,EAAE,EAAE,eAAe,IACtB,yDAMpC;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,cAAc,CAAC;IACrB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;;;;;;;;;;;;;GAmBF"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
import { ModerationStatusSchema, } from "#src/types";
|
|
3
|
-
import {} from "pg";
|
|
4
|
-
//
|
|
5
|
-
export function createModerationFactory({ pg }) {
|
|
6
|
-
return async function createModeration({ user_id, organization_id, sp_name, type, ticket_id, }) {
|
|
7
|
-
const { rows } = await pg.query(`
|
|
8
|
-
INSERT INTO moderations (user_id, organization_id, status, type, ticket_id, sp_name, allow_editing)
|
|
9
|
-
VALUES ($1, $2, $3, $4, $5, $6, $7)
|
|
10
|
-
RETURNING *;`, [
|
|
11
|
-
user_id,
|
|
12
|
-
organization_id,
|
|
13
|
-
ModerationStatusSchema.enum.pending,
|
|
14
|
-
type,
|
|
15
|
-
ticket_id,
|
|
16
|
-
sp_name ?? null,
|
|
17
|
-
false,
|
|
18
|
-
]);
|
|
19
|
-
return rows.shift();
|
|
20
|
-
};
|
|
21
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../../src/repositories/user/delete.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAKlD,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,EAAE,EAAE,eAAe,IACtB,IAAI,MAAM,sBAU5C"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
import {} from "pg";
|
|
3
|
-
//
|
|
4
|
-
export function deleteUserFactory({ pg }) {
|
|
5
|
-
return async function deleteUser(id) {
|
|
6
|
-
const { rowCount, affectedRows } = (await pg.query(`
|
|
7
|
-
DELETE FROM users
|
|
8
|
-
WHERE id = $1`, [id]));
|
|
9
|
-
return (affectedRows ?? rowCount ?? 0) > 0;
|
|
10
|
-
};
|
|
11
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { DatabaseContext, InsertUserOrganizationLink } from "#src/types";
|
|
2
|
-
export declare function createUserOrganizationFactory({ pg }: DatabaseContext): ({ is_external, organization_id, user_id, verification_type, }: InsertUserOrganizationLink) => Promise<{
|
|
3
|
-
is_external: boolean;
|
|
4
|
-
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
|
-
verified_at: Date | null;
|
|
6
|
-
has_been_greeted: boolean;
|
|
7
|
-
user_id: number;
|
|
8
|
-
organization_id: number;
|
|
9
|
-
created_at: Date;
|
|
10
|
-
updated_at: Date;
|
|
11
|
-
}>;
|
|
12
|
-
//# sourceMappingURL=create-user-organization.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-user-organization.d.ts","sourceRoot":"","sources":["../../../src/repositories/user_organisation/create-user-organization.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,eAAe,EACf,0BAA0B,EAE3B,MAAM,YAAY,CAAC;AAGpB,wBAAgB,6BAA6B,CAAC,EAAE,EAAE,EAAE,EAAE,eAAe,IACtB,+DAK1C,0BAA0B;;;;;;;;;GAwB9B"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { hashToPostgresParams } from "#src/services/postgres";
|
|
2
|
-
export function createUserOrganizationFactory({ pg }) {
|
|
3
|
-
return async function linkUserToOrganization({ is_external = false, organization_id, user_id, verification_type, }) {
|
|
4
|
-
const { paramsString, valuesString, values } = hashToPostgresParams({
|
|
5
|
-
created_at: new Date(),
|
|
6
|
-
is_external,
|
|
7
|
-
organization_id,
|
|
8
|
-
updated_at: new Date(),
|
|
9
|
-
user_id,
|
|
10
|
-
verification_type,
|
|
11
|
-
verified_at: verification_type ? new Date() : undefined,
|
|
12
|
-
});
|
|
13
|
-
const { rows } = await pg.query(`
|
|
14
|
-
INSERT INTO users_organizations
|
|
15
|
-
${paramsString}
|
|
16
|
-
VALUES
|
|
17
|
-
${valuesString}
|
|
18
|
-
RETURNING *;`, values);
|
|
19
|
-
return rows.shift();
|
|
20
|
-
};
|
|
21
|
-
}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { DatabaseContext, FindUserOrganizationLink } from "#src/types";
|
|
2
|
-
export declare function deleteUserOrganizationFactory({ pg }: DatabaseContext): ({ user_id, organization_id, }: FindUserOrganizationLink) => Promise<boolean>;
|
|
3
|
-
//# sourceMappingURL=delete-user-organization.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"delete-user-organization.d.ts","sourceRoot":"","sources":["../../../src/repositories/user_organisation/delete-user-organization.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAK5E,wBAAgB,6BAA6B,CAAC,EAAE,EAAE,EAAE,EAAE,eAAe,IACtB,+BAG1C,wBAAwB,sBAY5B"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
export function deleteUserOrganizationFactory({ pg }) {
|
|
4
|
-
return async function deleteUserOrganization({ user_id, organization_id, }) {
|
|
5
|
-
const { rowCount, affectedRows } = (await pg.query(`
|
|
6
|
-
DELETE
|
|
7
|
-
FROM users_organizations
|
|
8
|
-
WHERE user_id = $1
|
|
9
|
-
AND organization_id = $2`, [user_id, organization_id]));
|
|
10
|
-
return (affectedRows ?? rowCount ?? 0) > 0;
|
|
11
|
-
};
|
|
12
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { DatabaseContext, FindUserOrganizationLink, UserOrganizationLink } from "#src/types";
|
|
2
|
-
export declare function updateUserOrganizationFactory({ pg }: DatabaseContext): ({ organization_id, user_id }: FindUserOrganizationLink, fieldsToUpdate: Partial<UserOrganizationLink>) => Promise<{
|
|
3
|
-
is_external: boolean;
|
|
4
|
-
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
|
-
verified_at: Date | null;
|
|
6
|
-
has_been_greeted: boolean;
|
|
7
|
-
user_id: number;
|
|
8
|
-
organization_id: number;
|
|
9
|
-
created_at: Date;
|
|
10
|
-
updated_at: Date;
|
|
11
|
-
}>;
|
|
12
|
-
//# sourceMappingURL=update-user-organization.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update-user-organization.d.ts","sourceRoot":"","sources":["../../../src/repositories/user_organisation/update-user-organization.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,eAAe,EACf,wBAAwB,EAExB,oBAAoB,EACrB,MAAM,YAAY,CAAC;AAKpB,wBAAgB,6BAA6B,CAAC,EAAE,EAAE,EAAE,EAAE,eAAe,IAEjE,8BAA8B,wBAAwB,EACtD,gBAAgB,OAAO,CAAC,oBAAoB,CAAC;;;;;;;;;GAyBhD"}
|