@proconnect-gouv/proconnect.identite 10.0.1 → 10.1.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 +15 -0
- package/dist/connectors/index.d.ts +49 -45
- package/dist/connectors/index.d.ts.map +1 -1
- package/dist/connectors/index.js +31 -53
- package/dist/managers/organization/adapters/api_entreprise.d.ts +1 -1
- package/dist/managers/user/assign-user-verification-type-to-domain.d.ts.map +1 -1
- package/dist/managers/user/assign-user-verification-type-to-domain.js +3 -3
- package/dist/repositories/authenticator/find-authenticators-by-user-id.d.ts +3 -0
- package/dist/repositories/authenticator/find-authenticators-by-user-id.d.ts.map +1 -0
- package/dist/repositories/authenticator/{get-authenticators-by-user-id.js → find-authenticators-by-user-id.js} +2 -2
- package/dist/repositories/authenticator/index.d.ts +1 -1
- package/dist/repositories/authenticator/index.d.ts.map +1 -1
- package/dist/repositories/authenticator/index.js +1 -1
- package/dist/repositories/authenticator/update-authenticator.d.ts +1 -2
- package/dist/repositories/authenticator/update-authenticator.d.ts.map +1 -1
- package/dist/repositories/franceconnect_userinfo/delete-franceconnect-userinfo.d.ts +4 -0
- package/dist/repositories/franceconnect_userinfo/delete-franceconnect-userinfo.d.ts.map +1 -0
- package/dist/repositories/{user → franceconnect_userinfo}/delete-franceconnect-userinfo.js +2 -2
- package/dist/repositories/{user/get-franceconnect-user-info.d.ts → franceconnect_userinfo/find-franceconnect-userinfo.d.ts} +2 -3
- package/dist/repositories/franceconnect_userinfo/find-franceconnect-userinfo.d.ts.map +1 -0
- package/dist/repositories/{user/get-franceconnect-user-info.js → franceconnect_userinfo/find-franceconnect-userinfo.js} +2 -2
- package/dist/repositories/franceconnect_userinfo/index.d.ts +4 -0
- package/dist/repositories/franceconnect_userinfo/index.d.ts.map +1 -0
- package/dist/repositories/franceconnect_userinfo/index.js +3 -0
- package/dist/repositories/franceconnect_userinfo/upsert-franceconnect-userinfo.d.ts.map +1 -0
- package/dist/repositories/official-contact-email-verification/delete-official-contact-email-verification.d.ts +3 -0
- package/dist/repositories/official-contact-email-verification/delete-official-contact-email-verification.d.ts.map +1 -0
- package/dist/repositories/official-contact-email-verification/delete-official-contact-email-verification.js +12 -0
- package/dist/repositories/official-contact-email-verification/find-official-contact-email-verification.d.ts +10 -0
- package/dist/repositories/official-contact-email-verification/find-official-contact-email-verification.d.ts.map +1 -0
- package/dist/repositories/official-contact-email-verification/find-official-contact-email-verification.js +13 -0
- package/dist/repositories/official-contact-email-verification/index.d.ts +4 -0
- package/dist/repositories/official-contact-email-verification/index.d.ts.map +1 -0
- package/dist/repositories/official-contact-email-verification/index.js +4 -0
- package/dist/repositories/official-contact-email-verification/upsert-official-contact-email-verification.d.ts +10 -0
- package/dist/repositories/official-contact-email-verification/upsert-official-contact-email-verification.d.ts.map +1 -0
- package/dist/repositories/official-contact-email-verification/upsert-official-contact-email-verification.js +19 -0
- package/dist/repositories/organization/find-by-user-id.d.ts +0 -3
- package/dist/repositories/organization/find-by-user-id.d.ts.map +1 -1
- package/dist/repositories/organization/find-by-user-id.js +10 -14
- package/dist/repositories/organization/find-organization-by-id.d.ts +4 -0
- package/dist/repositories/organization/find-organization-by-id.d.ts.map +1 -0
- package/dist/repositories/organization/{find-by-id.js → find-organization-by-id.js} +2 -2
- package/dist/repositories/organization/{get-users-by-organization.d.ts → find-users-by-organization.d.ts} +2 -6
- package/dist/repositories/organization/find-users-by-organization.d.ts.map +1 -0
- package/dist/repositories/organization/find-users-by-organization.js +19 -0
- package/dist/repositories/organization/get-organization-by-id.d.ts +3 -0
- package/dist/repositories/organization/get-organization-by-id.d.ts.map +1 -0
- package/dist/repositories/organization/get-organization-by-id.js +15 -0
- package/dist/repositories/organization/index.d.ts +3 -5
- package/dist/repositories/organization/index.d.ts.map +1 -1
- package/dist/repositories/organization/index.js +3 -5
- package/dist/repositories/user/index.d.ts +0 -3
- package/dist/repositories/user/index.d.ts.map +1 -1
- package/dist/repositories/user/index.js +0 -3
- package/dist/repositories/{organization/link-user-to-organization.d.ts → user_organisation/create-user-organization.d.ts} +2 -6
- package/dist/repositories/user_organisation/create-user-organization.d.ts.map +1 -0
- package/dist/repositories/{organization/link-user-to-organization.js → user_organisation/create-user-organization.js} +2 -3
- package/dist/repositories/user_organisation/delete-user-organization.d.ts +3 -0
- package/dist/repositories/user_organisation/delete-user-organization.d.ts.map +1 -0
- package/dist/repositories/{organization → user_organisation}/delete-user-organization.js +4 -2
- package/dist/repositories/{organization/get-user-organization-link.d.ts → user_organisation/find-user-organization.d.ts} +3 -6
- package/dist/repositories/user_organisation/find-user-organization.d.ts.map +1 -0
- package/dist/repositories/user_organisation/find-user-organization.js +20 -0
- package/dist/repositories/user_organisation/index.d.ts +5 -0
- package/dist/repositories/user_organisation/index.d.ts.map +1 -0
- package/dist/repositories/user_organisation/index.js +4 -0
- package/dist/repositories/{user/update-user-organization-link.d.ts → user_organisation/update-user-organization.d.ts} +3 -7
- package/dist/repositories/user_organisation/update-user-organization.d.ts.map +1 -0
- package/dist/repositories/{user/update-user-organization-link.js → user_organisation/update-user-organization.js} +2 -2
- package/dist/services/organization/compute-service-public-info.d.ts.map +1 -1
- package/dist/services/organization/compute-service-public-info.js +7 -6
- package/dist/types/authenticator.d.ts +3 -1
- package/dist/types/authenticator.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +1 -0
- package/dist/types/official-contact-email-verification.d.ts +23 -0
- package/dist/types/official-contact-email-verification.d.ts.map +1 -0
- package/dist/types/official-contact-email-verification.js +15 -0
- package/dist/types/organization-info.d.ts +2 -1
- package/dist/types/organization-info.d.ts.map +1 -1
- package/dist/types/organization-info.js +1 -0
- package/dist/types/organization.d.ts +1 -1
- package/dist/types/organization.d.ts.map +1 -1
- package/dist/types/user-organization-link.d.ts +5 -7
- package/dist/types/user-organization-link.d.ts.map +1 -1
- package/dist/types/user-organization-link.js +4 -6
- package/package.json +3 -3
- package/src/connectors/index.ts +83 -53
- package/src/managers/organization/mark-domain-as-verified.test.ts +2 -3
- package/src/managers/user/assign-user-verification-type-to-domain.test.ts +7 -8
- package/src/managers/user/assign-user-verification-type-to-domain.ts +8 -5
- package/src/repositories/authenticator/{get-authenticators-by-user-id.test.ts → find-authenticators-by-user-id.test.ts} +5 -5
- package/src/repositories/authenticator/{get-authenticators-by-user-id.ts → find-authenticators-by-user-id.ts} +2 -2
- package/src/repositories/authenticator/index.ts +1 -1
- package/src/repositories/authenticator/update-authenticator.ts +1 -1
- package/src/repositories/{user → franceconnect_userinfo}/delete-franceconnect-userinfo.test.ts +7 -7
- package/src/repositories/franceconnect_userinfo/delete-franceconnect-userinfo.ts +21 -0
- package/src/repositories/{user/get-franceconnect-user-info.test.ts → franceconnect_userinfo/find-franceconnect-userinfo.test.ts} +5 -5
- package/src/repositories/{user/get-franceconnect-user-info.ts → franceconnect_userinfo/find-franceconnect-userinfo.ts} +2 -6
- package/src/repositories/franceconnect_userinfo/index.ts +3 -0
- package/src/repositories/official-contact-email-verification/delete-official-contact-email-verification.test.ts +106 -0
- package/src/repositories/official-contact-email-verification/delete-official-contact-email-verification.ts +29 -0
- package/src/repositories/official-contact-email-verification/find-official-contact-email-verification.test.ts +136 -0
- package/src/repositories/official-contact-email-verification/find-official-contact-email-verification.ts +31 -0
- package/src/repositories/official-contact-email-verification/index.ts +5 -0
- package/src/repositories/official-contact-email-verification/upsert-official-contact-email-verification.test.ts +170 -0
- package/src/repositories/official-contact-email-verification/upsert-official-contact-email-verification.ts +38 -0
- package/src/repositories/organization/find-by-user-id.test.ts +5 -6
- package/src/repositories/organization/find-by-user-id.test.ts.snapshot +3 -12
- package/src/repositories/organization/find-by-user-id.ts +10 -14
- package/src/repositories/organization/{find-by-id.test.ts → find-organization-by-id.test.ts} +4 -4
- package/src/repositories/organization/{find-by-id.ts → find-organization-by-id.ts} +3 -3
- package/src/repositories/organization/{get-users-by-organization.test.ts → find-users-by-organization.test.ts} +9 -8
- package/src/repositories/organization/{get-users-by-organization.test.ts.snapshot → find-users-by-organization.test.ts.snapshot} +2 -5
- package/src/repositories/organization/find-users-by-organization.ts +38 -0
- package/src/repositories/organization/get-organization-by-id.test.ts +37 -0
- package/src/repositories/organization/get-organization-by-id.ts +19 -0
- package/src/repositories/organization/index.ts +3 -5
- package/src/repositories/user/index.ts +0 -3
- package/src/repositories/{organization/link-user-to-organization.test.ts → user_organisation/create-user-organization.test.ts} +2 -2
- package/src/repositories/{organization/link-user-to-organization.test.ts.snapshot → user_organisation/create-user-organization.test.ts.snapshot} +0 -6
- package/src/repositories/{organization/link-user-to-organization.ts → user_organisation/create-user-organization.ts} +1 -7
- package/src/repositories/{organization → user_organisation}/delete-user-organization.ts +6 -7
- package/src/repositories/{organization/get-user-organization-link.test.ts → user_organisation/find-user-organization.test.ts} +5 -5
- package/src/repositories/user_organisation/find-user-organization.ts +35 -0
- package/src/repositories/user_organisation/index.ts +4 -0
- package/src/repositories/{user/update-user-organization-link.test.ts → user_organisation/update-user-organization.test.ts} +10 -8
- package/src/repositories/{user/update-user-organization-link.ts → user_organisation/update-user-organization.ts} +9 -9
- package/src/services/organization/compute-service-public-info.test.ts +10 -0
- package/src/services/organization/compute-service-public-info.ts +8 -7
- package/src/types/authenticator.ts +10 -5
- package/src/types/index.ts +1 -0
- package/src/types/official-contact-email-verification.ts +32 -0
- package/src/types/organization-info.ts +1 -1
- package/src/types/organization.ts +18 -1
- package/src/types/user-organization-link.ts +9 -8
- package/dist/repositories/authenticator/get-authenticators-by-user-id.d.ts +0 -3
- package/dist/repositories/authenticator/get-authenticators-by-user-id.d.ts.map +0 -1
- package/dist/repositories/organization/delete-user-organization.d.ts +0 -6
- package/dist/repositories/organization/delete-user-organization.d.ts.map +0 -1
- package/dist/repositories/organization/find-by-id.d.ts +0 -4
- package/dist/repositories/organization/find-by-id.d.ts.map +0 -1
- package/dist/repositories/organization/get-user-organization-link.d.ts.map +0 -1
- package/dist/repositories/organization/get-user-organization-link.js +0 -23
- package/dist/repositories/organization/get-users-by-organization.d.ts.map +0 -1
- package/dist/repositories/organization/get-users-by-organization.js +0 -23
- package/dist/repositories/organization/link-user-to-organization.d.ts.map +0 -1
- package/dist/repositories/user/delete-franceconnect-userinfo.d.ts +0 -4
- package/dist/repositories/user/delete-franceconnect-userinfo.d.ts.map +0 -1
- package/dist/repositories/user/get-franceconnect-user-info.d.ts.map +0 -1
- package/dist/repositories/user/update-user-organization-link.d.ts.map +0 -1
- package/dist/repositories/user/upsert-franceconnect-userinfo.d.ts.map +0 -1
- package/src/repositories/organization/get-user-organization-link.ts +0 -34
- package/src/repositories/organization/get-users-by-organization.ts +0 -46
- package/src/repositories/user/delete-franceconnect-userinfo.ts +0 -21
- package/tsconfig.lib.tsbuildinfo +0 -1
- /package/dist/repositories/{user → franceconnect_userinfo}/upsert-franceconnect-userinfo.d.ts +0 -0
- /package/dist/repositories/{user → franceconnect_userinfo}/upsert-franceconnect-userinfo.js +0 -0
- /package/src/repositories/{user → franceconnect_userinfo}/upsert-franceconnect-userinfo.test.ts +0 -0
- /package/src/repositories/{user → franceconnect_userinfo}/upsert-franceconnect-userinfo.ts +0 -0
- /package/src/repositories/{organization → user_organisation}/delete-user-organization.test.ts +0 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//
|
|
2
|
+
//
|
|
3
|
+
export function upsertOfficialContactEmailVerificationFactory({ pg, }) {
|
|
4
|
+
return async function upsertOfficialContactEmailVerification({ organization_id, user_id, token, sent_at, }) {
|
|
5
|
+
const { rows } = await pg.query(`
|
|
6
|
+
INSERT INTO official_contact_email_verifications(created_at, updated_at, organization_id, user_id, token, sent_at)
|
|
7
|
+
VALUES (CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, $1, $2, $3, $4)
|
|
8
|
+
ON CONFLICT (organization_id, user_id)
|
|
9
|
+
DO UPDATE
|
|
10
|
+
SET organization_id = EXCLUDED.organization_id,
|
|
11
|
+
user_id = EXCLUDED.user_id,
|
|
12
|
+
token = EXCLUDED.token,
|
|
13
|
+
sent_at = EXCLUDED.sent_at,
|
|
14
|
+
updated_at = CURRENT_TIMESTAMP
|
|
15
|
+
RETURNING *
|
|
16
|
+
`, [organization_id, user_id, token, sent_at]);
|
|
17
|
+
return rows.shift();
|
|
18
|
+
};
|
|
19
|
+
}
|
|
@@ -4,9 +4,6 @@ export declare function findByUserIdFactory({ pg }: DatabaseContext): (userId: n
|
|
|
4
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
5
|
verified_at: Date | null;
|
|
6
6
|
has_been_greeted: boolean;
|
|
7
|
-
needs_official_contact_email_verification: boolean;
|
|
8
|
-
official_contact_email_verification_token: string | null;
|
|
9
|
-
official_contact_email_verification_sent_at: Date | null;
|
|
10
7
|
})[]>;
|
|
11
8
|
export type FindByUserIdHandler = ReturnType<typeof findByUserIdFactory>;
|
|
12
9
|
//# sourceMappingURL=find-by-user-id.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find-by-user-id.d.ts","sourceRoot":"","sources":["../../../src/repositories/organization/find-by-user-id.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAEV,eAAe,EACf,YAAY,EACb,MAAM,YAAY,CAAC;AAKpB,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,EAAE,EAAE,eAAe,IACtB,QAAQ,MAAM
|
|
1
|
+
{"version":3,"file":"find-by-user-id.d.ts","sourceRoot":"","sources":["../../../src/repositories/organization/find-by-user-id.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAEV,eAAe,EACf,YAAY,EACb,MAAM,YAAY,CAAC;AAKpB,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,EAAE,EAAE,eAAe,IACtB,QAAQ,MAAM;;;;;MAmBlD;AAED,MAAM,MAAM,mBAAmB,GAAG,UAAU,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
|
|
@@ -3,20 +3,16 @@
|
|
|
3
3
|
export function findByUserIdFactory({ pg }) {
|
|
4
4
|
return async function findByUserId(userId) {
|
|
5
5
|
const { rows } = await pg.query(`
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
uo.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
INNER JOIN users_organizations uo ON uo.organization_id = o.id
|
|
17
|
-
WHERE uo.user_id = $1
|
|
18
|
-
ORDER BY o.created_at
|
|
19
|
-
`, [userId]);
|
|
6
|
+
SELECT o.*,
|
|
7
|
+
uo.is_external,
|
|
8
|
+
uo.verification_type,
|
|
9
|
+
uo.verified_at,
|
|
10
|
+
uo.has_been_greeted
|
|
11
|
+
FROM organizations o
|
|
12
|
+
INNER JOIN users_organizations uo ON uo.organization_id = o.id
|
|
13
|
+
WHERE uo.user_id = $1
|
|
14
|
+
ORDER BY o.created_at
|
|
15
|
+
`, [userId]);
|
|
20
16
|
return rows;
|
|
21
17
|
};
|
|
22
18
|
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { DatabaseContext, Organization } from "#src/types";
|
|
2
|
+
export declare function findOrganizationByIdFactory({ pg }: DatabaseContext): (id: number) => Promise<Organization | undefined>;
|
|
3
|
+
export type FindByIdHandler = ReturnType<typeof findOrganizationByIdFactory>;
|
|
4
|
+
//# sourceMappingURL=find-organization-by-id.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find-organization-by-id.d.ts","sourceRoot":"","sources":["../../../src/repositories/organization/find-organization-by-id.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAKhE,wBAAgB,2BAA2B,CAAC,EAAE,EAAE,EAAE,EAAE,eAAe,IACtB,IAAI,MAAM,uCAWtD;AAED,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,2BAA2B,CAAC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
//
|
|
2
2
|
//
|
|
3
|
-
export function
|
|
4
|
-
return async function
|
|
3
|
+
export function findOrganizationByIdFactory({ pg }) {
|
|
4
|
+
return async function findOrganizationById(id) {
|
|
5
5
|
const { rows } = await pg.query(`
|
|
6
6
|
SELECT *
|
|
7
7
|
FROM organizations
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import type { DatabaseContext, User } from "#src/types";
|
|
2
|
-
export declare function
|
|
2
|
+
export declare function findUsersByOrganizationFactory({ pg }: DatabaseContext): (organization_id: number, additionalWhereClause?: string, additionalParams?: any[]) => Promise<(User & {
|
|
3
3
|
is_external: boolean;
|
|
4
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
5
|
verified_at: Date | null;
|
|
6
6
|
has_been_greeted: boolean;
|
|
7
|
-
needs_official_contact_email_verification: boolean;
|
|
8
|
-
official_contact_email_verification_token: string | null;
|
|
9
|
-
official_contact_email_verification_sent_at: Date | null;
|
|
10
7
|
})[]>;
|
|
11
|
-
|
|
12
|
-
//# sourceMappingURL=get-users-by-organization.d.ts.map
|
|
8
|
+
//# sourceMappingURL=find-users-by-organization.d.ts.map
|
|
@@ -0,0 +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,IAElE,iBAAiB,MAAM,EACvB,wBAAuB,MAAW,EAClC,mBAAkB,GAAG,EAAO;;;;;MAsB/B"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//
|
|
2
|
+
//
|
|
3
|
+
export function findUsersByOrganizationFactory({ pg }) {
|
|
4
|
+
return async function findUsersByOrganization(organization_id, additionalWhereClause = "", additionalParams = []) {
|
|
5
|
+
const connection = pg;
|
|
6
|
+
const baseParams = [organization_id];
|
|
7
|
+
const { rows } = await connection.query(`
|
|
8
|
+
SELECT u.*,
|
|
9
|
+
uo.is_external,
|
|
10
|
+
uo.verification_type,
|
|
11
|
+
uo.verified_at,
|
|
12
|
+
uo.has_been_greeted
|
|
13
|
+
FROM users u
|
|
14
|
+
INNER JOIN users_organizations AS uo ON uo.user_id = u.id
|
|
15
|
+
WHERE uo.organization_id = $1
|
|
16
|
+
${additionalWhereClause}`, [...baseParams, ...additionalParams]);
|
|
17
|
+
return rows;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-organization-by-id.d.ts","sourceRoot":"","sources":["../../../src/repositories/organization/get-organization-by-id.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAMrE,wBAAgB,0BAA0B,CAAC,EAAE,EAAE,EAAE,EAAE,eAAe,IAGtB,IAAI,MAAM,KAAG,OAAO,CAAC,YAAY,CAAC,CAO7E"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//
|
|
2
|
+
import {} from "#src/types";
|
|
3
|
+
import { OrganizationNotFoundError } from "@proconnect-gouv/proconnect.identite/errors";
|
|
4
|
+
import { findOrganizationByIdFactory } from "./find-organization-by-id.js";
|
|
5
|
+
//
|
|
6
|
+
export function getOrganizationByIdFactory({ pg }) {
|
|
7
|
+
const findOrganizationById = findOrganizationByIdFactory({ pg });
|
|
8
|
+
return async function getOrganizationById(id) {
|
|
9
|
+
const organization = await findOrganizationById(id);
|
|
10
|
+
if (!organization) {
|
|
11
|
+
throw new OrganizationNotFoundError(`Organization ${id} not found`);
|
|
12
|
+
}
|
|
13
|
+
return organization;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
export * from "./delete-user-organization.js";
|
|
2
|
-
export * from "./find-by-id.js";
|
|
3
1
|
export * from "./find-by-siret.js";
|
|
4
2
|
export * from "./find-by-user-id.js";
|
|
5
3
|
export * from "./find-by-verified-email-domain.js";
|
|
4
|
+
export * from "./find-organization-by-id.js";
|
|
6
5
|
export * from "./find-pending-by-user-id.js";
|
|
7
|
-
export * from "./
|
|
8
|
-
export * from "./get-
|
|
9
|
-
export * from "./link-user-to-organization.js";
|
|
6
|
+
export * from "./find-users-by-organization.js";
|
|
7
|
+
export * from "./get-organization-by-id.js";
|
|
10
8
|
export * from "./upsert.js";
|
|
11
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/repositories/organization/index.ts"],"names":[],"mappings":"AAEA,cAAc
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/repositories/organization/index.ts"],"names":[],"mappings":"AAEA,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oCAAoC,CAAC;AACnD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,iCAAiC,CAAC;AAChD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,aAAa,CAAC"}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
//
|
|
2
|
-
export * from "./delete-user-organization.js";
|
|
3
|
-
export * from "./find-by-id.js";
|
|
4
2
|
export * from "./find-by-siret.js";
|
|
5
3
|
export * from "./find-by-user-id.js";
|
|
6
4
|
export * from "./find-by-verified-email-domain.js";
|
|
5
|
+
export * from "./find-organization-by-id.js";
|
|
7
6
|
export * from "./find-pending-by-user-id.js";
|
|
8
|
-
export * from "./
|
|
9
|
-
export * from "./get-
|
|
10
|
-
export * from "./link-user-to-organization.js";
|
|
7
|
+
export * from "./find-users-by-organization.js";
|
|
8
|
+
export * from "./get-organization-by-id.js";
|
|
11
9
|
export * from "./upsert.js";
|
|
@@ -5,8 +5,5 @@ export * from "./find-by-id.js";
|
|
|
5
5
|
export * from "./find-by-magic-link-token.js";
|
|
6
6
|
export * from "./find-by-reset-password-token.js";
|
|
7
7
|
export * from "./get-by-id.js";
|
|
8
|
-
export * from "./get-franceconnect-user-info.js";
|
|
9
|
-
export * from "./update-user-organization-link.js";
|
|
10
8
|
export * from "./update.js";
|
|
11
|
-
export * from "./upsert-franceconnect-userinfo.js";
|
|
12
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/repositories/user/index.ts"],"names":[],"mappings":"AAEA,cAAc,aAAa,CAAC;AAC5B,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,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/repositories/user/index.ts"],"names":[],"mappings":"AAEA,cAAc,aAAa,CAAC;AAC5B,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"}
|
|
@@ -6,7 +6,4 @@ export * from "./find-by-id.js";
|
|
|
6
6
|
export * from "./find-by-magic-link-token.js";
|
|
7
7
|
export * from "./find-by-reset-password-token.js";
|
|
8
8
|
export * from "./get-by-id.js";
|
|
9
|
-
export * from "./get-franceconnect-user-info.js";
|
|
10
|
-
export * from "./update-user-organization-link.js";
|
|
11
9
|
export * from "./update.js";
|
|
12
|
-
export * from "./upsert-franceconnect-userinfo.js";
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import type { DatabaseContext, InsertUserOrganizationLink } from "#src/types";
|
|
2
|
-
export declare function
|
|
2
|
+
export declare function createUserOrganizationFactory({ pg }: DatabaseContext): ({ is_external, organization_id, user_id, verification_type, }: InsertUserOrganizationLink) => Promise<{
|
|
3
3
|
is_external: boolean;
|
|
4
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
5
|
verified_at: Date | null;
|
|
6
6
|
has_been_greeted: boolean;
|
|
7
|
-
needs_official_contact_email_verification: boolean;
|
|
8
|
-
official_contact_email_verification_token: string | null;
|
|
9
|
-
official_contact_email_verification_sent_at: Date | null;
|
|
10
7
|
user_id: number;
|
|
11
8
|
organization_id: number;
|
|
12
9
|
created_at: Date;
|
|
13
10
|
updated_at: Date;
|
|
14
11
|
}>;
|
|
15
|
-
|
|
16
|
-
//# sourceMappingURL=link-user-to-organization.d.ts.map
|
|
12
|
+
//# sourceMappingURL=create-user-organization.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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,10 +1,9 @@
|
|
|
1
1
|
import { hashToPostgresParams } from "#src/services/postgres";
|
|
2
|
-
export function
|
|
3
|
-
return async function linkUserToOrganization({ is_external = false,
|
|
2
|
+
export function createUserOrganizationFactory({ pg }) {
|
|
3
|
+
return async function linkUserToOrganization({ is_external = false, organization_id, user_id, verification_type, }) {
|
|
4
4
|
const { paramsString, valuesString, values } = hashToPostgresParams({
|
|
5
5
|
created_at: new Date(),
|
|
6
6
|
is_external,
|
|
7
|
-
needs_official_contact_email_verification,
|
|
8
7
|
organization_id,
|
|
9
8
|
updated_at: new Date(),
|
|
10
9
|
user_id,
|
|
@@ -0,0 +1,3 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -3,8 +3,10 @@
|
|
|
3
3
|
export function deleteUserOrganizationFactory({ pg }) {
|
|
4
4
|
return async function deleteUserOrganization({ user_id, organization_id, }) {
|
|
5
5
|
const { rowCount, affectedRows } = (await pg.query(`
|
|
6
|
-
DELETE
|
|
7
|
-
|
|
6
|
+
DELETE
|
|
7
|
+
FROM users_organizations
|
|
8
|
+
WHERE user_id = $1
|
|
9
|
+
AND organization_id = $2`, [user_id, organization_id]));
|
|
8
10
|
return (affectedRows ?? rowCount ?? 0) > 0;
|
|
9
11
|
};
|
|
10
12
|
}
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import type { DatabaseContext } from "#src/types";
|
|
2
|
-
export declare function
|
|
1
|
+
import type { DatabaseContext, FindUserOrganizationLink } from "#src/types";
|
|
2
|
+
export declare function findUserOrganizationFactory({ pg }: DatabaseContext): ({ organization_id, user_id, }: FindUserOrganizationLink) => Promise<{
|
|
3
3
|
is_external: boolean;
|
|
4
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
5
|
verified_at: Date | null;
|
|
6
6
|
has_been_greeted: boolean;
|
|
7
|
-
needs_official_contact_email_verification: boolean;
|
|
8
|
-
official_contact_email_verification_token: string | null;
|
|
9
|
-
official_contact_email_verification_sent_at: Date | null;
|
|
10
7
|
user_id: number;
|
|
11
8
|
organization_id: number;
|
|
12
9
|
created_at: Date;
|
|
13
10
|
updated_at: Date;
|
|
14
11
|
} | undefined>;
|
|
15
|
-
//# sourceMappingURL=
|
|
12
|
+
//# sourceMappingURL=find-user-organization.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find-user-organization.d.ts","sourceRoot":"","sources":["../../../src/repositories/user_organisation/find-user-organization.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,eAAe,EACf,wBAAwB,EAEzB,MAAM,YAAY,CAAC;AAKpB,wBAAgB,2BAA2B,CAAC,EAAE,EAAE,EAAE,EAAE,eAAe,IACtB,+BAGxC,wBAAwB;;;;;;;;;eAmB5B"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//
|
|
2
|
+
import {} from "pg";
|
|
3
|
+
//
|
|
4
|
+
export function findUserOrganizationFactory({ pg }) {
|
|
5
|
+
return async function findUserOrganization({ organization_id, user_id, }) {
|
|
6
|
+
const { rows } = await pg.query(`
|
|
7
|
+
SELECT user_id,
|
|
8
|
+
organization_id,
|
|
9
|
+
is_external,
|
|
10
|
+
created_at,
|
|
11
|
+
updated_at,
|
|
12
|
+
verification_type,
|
|
13
|
+
verified_at,
|
|
14
|
+
has_been_greeted
|
|
15
|
+
FROM users_organizations
|
|
16
|
+
WHERE organization_id = $1
|
|
17
|
+
AND user_id = $2`, [organization_id, user_id]);
|
|
18
|
+
return rows.shift();
|
|
19
|
+
};
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/repositories/user_organisation/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAC"}
|
|
@@ -1,16 +1,12 @@
|
|
|
1
|
-
import type { DatabaseContext, UserOrganizationLink } from "#src/types";
|
|
2
|
-
export declare function
|
|
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
3
|
is_external: boolean;
|
|
4
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
5
|
verified_at: Date | null;
|
|
6
6
|
has_been_greeted: boolean;
|
|
7
|
-
needs_official_contact_email_verification: boolean;
|
|
8
|
-
official_contact_email_verification_token: string | null;
|
|
9
|
-
official_contact_email_verification_sent_at: Date | null;
|
|
10
7
|
user_id: number;
|
|
11
8
|
organization_id: number;
|
|
12
9
|
created_at: Date;
|
|
13
10
|
updated_at: Date;
|
|
14
11
|
}>;
|
|
15
|
-
|
|
16
|
-
//# sourceMappingURL=update-user-organization-link.d.ts.map
|
|
12
|
+
//# sourceMappingURL=update-user-organization.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
//
|
|
2
2
|
import { hashToPostgresParams } from "#src/services/postgres";
|
|
3
3
|
//
|
|
4
|
-
export function
|
|
5
|
-
return async function
|
|
4
|
+
export function updateUserOrganizationFactory({ pg }) {
|
|
5
|
+
return async function updateUserOrganization({ organization_id, user_id }, fieldsToUpdate) {
|
|
6
6
|
const connection = pg;
|
|
7
7
|
const fieldsToUpdateWithTimestamps = {
|
|
8
8
|
...fieldsToUpdate,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compute-service-public-info.d.ts","sourceRoot":"","sources":["../../../src/services/organization/compute-service-public-info.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"compute-service-public-info.d.ts","sourceRoot":"","sources":["../../../src/services/organization/compute-service-public-info.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAO/C,eAAO,MAAM,wBAAwB,GAAI,mEAItC,IAAI,CACL,YAAY,EACZ,4BAA4B,GAAG,2BAA2B,GAAG,OAAO,CACrE,KAAG;IACF,eAAe,EAAE,OAAO,CAAC;IACzB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,4BAA4B,CAAC,EAAE,OAAO,CAAC;CA8CxC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//
|
|
2
|
-
import { ADMINISTRATION_BLACKLIST,
|
|
2
|
+
import { ADMINISTRATION_BLACKLIST, ADMINISTRATION_WHITELIST, ADMINISTRATIONS, } from "@proconnect-gouv/proconnect.annuaire_entreprises";
|
|
3
3
|
export const computeServicePublicInfo = ({ cached_categorie_juridique, siret, cached_etat_administratif, }) => {
|
|
4
4
|
// Check if nature juridique is undefined/null
|
|
5
5
|
if (!cached_categorie_juridique) {
|
|
@@ -14,12 +14,13 @@ export const computeServicePublicInfo = ({ cached_categorie_juridique, siret, ca
|
|
|
14
14
|
if (cached_etat_administratif === "C") {
|
|
15
15
|
return { isServicePublic: false };
|
|
16
16
|
}
|
|
17
|
-
if (ADMINISTRATION_ETAT_WHITELIST.includes(siren)) {
|
|
18
|
-
return { isServicePublic: true, isAdministrationEtat: true };
|
|
19
|
-
}
|
|
20
17
|
// Check if entity is in whitelist (takes priority)
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
const administrationInWhitelist = ADMINISTRATION_WHITELIST.find((ADMINISTRATION) => ADMINISTRATION.siren === siren);
|
|
19
|
+
if (administrationInWhitelist) {
|
|
20
|
+
return {
|
|
21
|
+
isServicePublic: true,
|
|
22
|
+
isAdministrationEtat: administrationInWhitelist.isAdministrationEtat,
|
|
23
|
+
};
|
|
23
24
|
}
|
|
24
25
|
const ADMINISTRATION = ADMINISTRATIONS.find((ADMINISTRATION) => cached_categorie_juridique === `${ADMINISTRATION.codeJuridique}`);
|
|
25
26
|
if (!ADMINISTRATION) {
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
export type Base64URLString = string;
|
|
2
|
+
export type AuthenticatorTransportFuture = "ble" | "cable" | "hybrid" | "internal" | "nfc" | "smart-card" | "usb";
|
|
3
|
+
export type CredentialDeviceType = "singleDevice" | "multiDevice";
|
|
2
4
|
export interface BaseAuthenticator {
|
|
3
5
|
credential_id: Base64URLString;
|
|
4
6
|
credential_public_key: Uint8Array;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authenticator.d.ts","sourceRoot":"","sources":["../../src/types/authenticator.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"authenticator.d.ts","sourceRoot":"","sources":["../../src/types/authenticator.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC;AACrC,MAAM,MAAM,4BAA4B,GACpC,KAAK,GACL,OAAO,GACP,QAAQ,GACR,UAAU,GACV,KAAK,GACL,YAAY,GACZ,KAAK,CAAC;AACV,MAAM,MAAM,oBAAoB,GAAG,cAAc,GAAG,aAAa,CAAC;AAIlE,MAAM,WAAW,iBAAiB;IAChC,aAAa,EAAE,eAAe,CAAC;IAC/B,qBAAqB,EAAE,UAAU,CAAC;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,sBAAsB,EAAE,oBAAoB,CAAC;IAC7C,oBAAoB,EAAE,OAAO,CAAC;IAC9B,UAAU,CAAC,EAAE,4BAA4B,EAAE,CAAC;IAC5C,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,YAAY,EAAE,IAAI,GAAG,IAAI,CAAC;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,aAAc,SAAQ,iBAAiB;IACtD,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,IAAI,CAAC;CAClB"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export * from "./email-domain.js";
|
|
|
6
6
|
export * from "./franceconnect.js";
|
|
7
7
|
export * from "./identity-vector.js";
|
|
8
8
|
export * from "./moderation.js";
|
|
9
|
+
export * from "./official-contact-email-verification.js";
|
|
9
10
|
export * from "./oidc-client.js";
|
|
10
11
|
export * from "./organization-info.js";
|
|
11
12
|
export * from "./organization.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAEA,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAEA,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,0CAA0C,CAAC;AACzD,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,WAAW,CAAC"}
|
package/dist/types/index.js
CHANGED
|
@@ -7,6 +7,7 @@ export * from "./email-domain.js";
|
|
|
7
7
|
export * from "./franceconnect.js";
|
|
8
8
|
export * from "./identity-vector.js";
|
|
9
9
|
export * from "./moderation.js";
|
|
10
|
+
export * from "./official-contact-email-verification.js";
|
|
10
11
|
export * from "./oidc-client.js";
|
|
11
12
|
export * from "./organization-info.js";
|
|
12
13
|
export * from "./organization.js";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const BaseOfficialContactEmailVerificationSchema: z.ZodObject<{
|
|
3
|
+
organization_id: z.ZodNumber;
|
|
4
|
+
sent_at: z.ZodNullable<z.ZodDate>;
|
|
5
|
+
token: z.ZodNullable<z.ZodString>;
|
|
6
|
+
user_id: z.ZodNumber;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
export type BaseOfficialContactEmailVerification = z.output<typeof BaseOfficialContactEmailVerificationSchema>;
|
|
9
|
+
export declare const OfficialContactEmailVerificationSchema: z.ZodObject<{
|
|
10
|
+
organization_id: z.ZodNumber;
|
|
11
|
+
sent_at: z.ZodNullable<z.ZodDate>;
|
|
12
|
+
token: z.ZodNullable<z.ZodString>;
|
|
13
|
+
user_id: z.ZodNumber;
|
|
14
|
+
created_at: z.ZodDate;
|
|
15
|
+
updated_at: z.ZodDate;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
export type OfficialContactEmailVerification = z.output<typeof OfficialContactEmailVerificationSchema>;
|
|
18
|
+
export declare const FindOfficialContactEmailVerificationSchema: z.ZodObject<{
|
|
19
|
+
organization_id: z.ZodNumber;
|
|
20
|
+
user_id: z.ZodNumber;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
export type FindOfficialContactEmailVerification = z.output<typeof FindOfficialContactEmailVerificationSchema>;
|
|
23
|
+
//# sourceMappingURL=official-contact-email-verification.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"official-contact-email-verification.d.ts","sourceRoot":"","sources":["../../src/types/official-contact-email-verification.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,0CAA0C;;;;;iBAKrD,CAAC;AAEH,MAAM,MAAM,oCAAoC,GAAG,CAAC,CAAC,MAAM,CACzD,OAAO,0CAA0C,CAClD,CAAC;AAEF,eAAO,MAAM,sCAAsC;;;;;;;iBAI/C,CAAC;AAEL,MAAM,MAAM,gCAAgC,GAAG,CAAC,CAAC,MAAM,CACrD,OAAO,sCAAsC,CAC9C,CAAC;AAEF,eAAO,MAAM,0CAA0C;;;iBAInD,CAAC;AAEL,MAAM,MAAM,oCAAoC,GAAG,CAAC,CAAC,MAAM,CACzD,OAAO,0CAA0C,CAClD,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const BaseOfficialContactEmailVerificationSchema = z.object({
|
|
3
|
+
organization_id: z.number(),
|
|
4
|
+
sent_at: z.date().nullable(),
|
|
5
|
+
token: z.string().nullable(),
|
|
6
|
+
user_id: z.number(),
|
|
7
|
+
});
|
|
8
|
+
export const OfficialContactEmailVerificationSchema = BaseOfficialContactEmailVerificationSchema.extend({
|
|
9
|
+
created_at: z.date(),
|
|
10
|
+
updated_at: z.date(),
|
|
11
|
+
});
|
|
12
|
+
export const FindOfficialContactEmailVerificationSchema = OfficialContactEmailVerificationSchema.pick({
|
|
13
|
+
organization_id: true,
|
|
14
|
+
user_id: true,
|
|
15
|
+
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import type { TrancheEffectifs } from "./organization.js";
|
|
2
3
|
export declare const OrganizationInfoSchema: z.ZodObject<{
|
|
3
4
|
activitePrincipale: z.ZodString;
|
|
4
5
|
adresse: z.ZodString;
|
|
@@ -21,7 +22,7 @@ export declare const OrganizationInfoSchema: z.ZodObject<{
|
|
|
21
22
|
partiellement_diffusible: "partiellement_diffusible";
|
|
22
23
|
non_diffusible: "non_diffusible";
|
|
23
24
|
}>;
|
|
24
|
-
trancheEffectifs: z.ZodNullable<z.ZodCustom<
|
|
25
|
+
trancheEffectifs: z.ZodNullable<z.ZodCustom<TrancheEffectifs, TrancheEffectifs>>;
|
|
25
26
|
trancheEffectifsUniteLegale: z.ZodNullable<z.ZodString>;
|
|
26
27
|
}, z.core.$strip>;
|
|
27
28
|
export type OrganizationInfo = z.output<typeof OrganizationInfoSchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization-info.d.ts","sourceRoot":"","sources":["../../src/types/organization-info.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"organization-info.d.ts","sourceRoot":"","sources":["../../src/types/organization-info.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAI1D,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;iBAwBjC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
export type TrancheEffectifs = "NN" | "00" | "01" | "02" | "03" | "11" | "12" | "21" | "22" | "31" | "32" | "41" | "42" | "51" | "52" | "53" | null;
|
|
2
2
|
export interface Organization {
|
|
3
3
|
id: number;
|
|
4
4
|
siret: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization.d.ts","sourceRoot":"","sources":["../../src/types/organization.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"organization.d.ts","sourceRoot":"","sources":["../../src/types/organization.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,gBAAgB,GACxB,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,GACJ,IAAI,CAAC;AAIT,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,IAAI,CAAC;IACjB,UAAU,EAAE,IAAI,CAAC;IACjB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,wBAAwB,EAAE,gBAAgB,CAAC;IAC3C,qCAAqC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrD,+BAA+B,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/C,yBAAyB,EAAE,MAAM,GAAG,IAAI,CAAC;IACzC,iBAAiB,EAAE,OAAO,GAAG,IAAI,CAAC;IAClC,uBAAuB,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC,qBAAqB,EAAE,OAAO,GAAG,IAAI,CAAC;IACtC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,iCAAiC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjD,0BAA0B,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1C,kCAAkC,EAAE,MAAM,GAAG,IAAI,CAAC;IAClD,0BAA0B,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1C,kCAAkC,EAAE,MAAM,GAAG,IAAI,CAAC;IAClD,mBAAmB,EAAE,OAAO,GAAG,IAAI,CAAC;IACpC,4BAA4B,EAAE,IAAI,GAAG,IAAI,CAAC;CAC3C"}
|
|
@@ -71,9 +71,6 @@ export declare const BaseUserOrganizationLinkSchema: z.ZodObject<{
|
|
|
71
71
|
}>;
|
|
72
72
|
verified_at: z.ZodUnion<[z.ZodDate, z.ZodLiteral<null>]>;
|
|
73
73
|
has_been_greeted: z.ZodBoolean;
|
|
74
|
-
needs_official_contact_email_verification: z.ZodBoolean;
|
|
75
|
-
official_contact_email_verification_token: z.ZodNullable<z.ZodString>;
|
|
76
|
-
official_contact_email_verification_sent_at: z.ZodNullable<z.ZodDate>;
|
|
77
74
|
}, z.core.$strip>;
|
|
78
75
|
export type BaseUserOrganizationLink = z.output<typeof BaseUserOrganizationLinkSchema>;
|
|
79
76
|
export declare const UserOrganizationLinkSchema: z.ZodObject<{
|
|
@@ -99,9 +96,6 @@ export declare const UserOrganizationLinkSchema: z.ZodObject<{
|
|
|
99
96
|
}>;
|
|
100
97
|
verified_at: z.ZodUnion<[z.ZodDate, z.ZodLiteral<null>]>;
|
|
101
98
|
has_been_greeted: z.ZodBoolean;
|
|
102
|
-
needs_official_contact_email_verification: z.ZodBoolean;
|
|
103
|
-
official_contact_email_verification_token: z.ZodNullable<z.ZodString>;
|
|
104
|
-
official_contact_email_verification_sent_at: z.ZodNullable<z.ZodDate>;
|
|
105
99
|
user_id: z.ZodNumber;
|
|
106
100
|
organization_id: z.ZodNumber;
|
|
107
101
|
created_at: z.ZodDate;
|
|
@@ -131,7 +125,11 @@ export declare const InsertUserOrganizationLinkSchema: z.ZodObject<{
|
|
|
131
125
|
organization_id: z.ZodNumber;
|
|
132
126
|
user_id: z.ZodNumber;
|
|
133
127
|
is_external: z.ZodOptional<z.ZodBoolean>;
|
|
134
|
-
needs_official_contact_email_verification: z.ZodOptional<z.ZodBoolean>;
|
|
135
128
|
}, z.core.$strip>;
|
|
136
129
|
export type InsertUserOrganizationLink = z.output<typeof InsertUserOrganizationLinkSchema>;
|
|
130
|
+
export declare const FindUserOrganizationLinkSchema: z.ZodObject<{
|
|
131
|
+
organization_id: z.ZodNumber;
|
|
132
|
+
user_id: z.ZodNumber;
|
|
133
|
+
}, z.core.$strip>;
|
|
134
|
+
export type FindUserOrganizationLink = z.output<typeof FindUserOrganizationLinkSchema>;
|
|
137
135
|
//# sourceMappingURL=user-organization-link.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-organization-link.d.ts","sourceRoot":"","sources":["../../src/types/user-organization-link.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,gBAAgB,qCAAsC,CAAC;AAEpE,eAAO,MAAM,cAAc,6TAajB,CAAC;AAMX,eAAO,MAAM,mBAAmB,sCAAuC,CAAC;AAExE,eAAO,MAAM,iBAAiB;;EAA8B,CAAC;AAE7D,eAAO,MAAM,kBAAkB,kXAIrB,CAAC;AAEX,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;EAA6B,CAAC;AAE3D,eAAO,MAAM,oBAAoB,kMAKvB,CAAC;AAEX,eAAO,MAAM,kBAAkB;;;;;EAA+B,CAAC;AAE/D,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;EAGnB,CAAC;AAEH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,QAAQ,CAAC,CAAC;AAEjD,eAAO,MAAM,8BAA8B
|
|
1
|
+
{"version":3,"file":"user-organization-link.d.ts","sourceRoot":"","sources":["../../src/types/user-organization-link.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,gBAAgB,qCAAsC,CAAC;AAEpE,eAAO,MAAM,cAAc,6TAajB,CAAC;AAMX,eAAO,MAAM,mBAAmB,sCAAuC,CAAC;AAExE,eAAO,MAAM,iBAAiB;;EAA8B,CAAC;AAE7D,eAAO,MAAM,kBAAkB,kXAIrB,CAAC;AAEX,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;EAA6B,CAAC;AAE3D,eAAO,MAAM,oBAAoB,kMAKvB,CAAC;AAEX,eAAO,MAAM,kBAAkB;;;;;EAA+B,CAAC;AAE/D,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;EAGnB,CAAC;AAEH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,QAAQ,CAAC,CAAC;AAEjD,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;iBAMzC,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAC7C,OAAO,8BAA8B,CACtC,CAAC;AAEF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAOtC,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE/E,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;iBAU5C,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAC/C,OAAO,gCAAgC,CACxC,CAAC;AAEF,eAAO,MAAM,8BAA8B;;;iBAGzC,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAC7C,OAAO,8BAA8B,CACtC,CAAC"}
|