@proconnect-gouv/proconnect.identite 1.2.0 → 1.4.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/README.md +0 -2
- package/dist/data/certification/categories-juridiques-sources.d.ts +8 -0
- package/dist/data/certification/categories-juridiques-sources.d.ts.map +1 -0
- package/dist/data/certification/categories-juridiques-sources.js +743 -0
- package/dist/data/certification/index.d.ts +1 -0
- package/dist/data/certification/index.d.ts.map +1 -1
- package/dist/data/certification/index.js +1 -0
- package/dist/errors/index.d.ts +0 -9
- package/dist/errors/index.d.ts.map +1 -1
- package/dist/errors/index.js +0 -18
- package/dist/managers/certification/certification-score.d.ts +11 -1
- package/dist/managers/certification/certification-score.d.ts.map +1 -1
- package/dist/managers/certification/certification-score.js +17 -8
- package/dist/managers/certification/index.d.ts +1 -1
- package/dist/managers/certification/index.d.ts.map +1 -1
- package/dist/managers/certification/index.js +1 -1
- package/dist/managers/certification/process-certification-dirigeant.d.ts +80 -0
- package/dist/managers/certification/process-certification-dirigeant.d.ts.map +1 -0
- package/dist/managers/certification/process-certification-dirigeant.js +121 -0
- package/dist/managers/organization/adapters/api_entreprise.d.ts +2 -1
- package/dist/managers/organization/adapters/api_entreprise.d.ts.map +1 -1
- package/dist/managers/organization/adapters/api_entreprise.js +3 -1
- package/dist/managers/organization/force-join-organization.d.ts +1 -1
- package/dist/managers/organization/force-join-organization.d.ts.map +1 -1
- package/dist/managers/organization/force-join-organization.js +3 -4
- 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 +6 -6
- package/dist/repositories/organization/find-by-user-id.d.ts +1 -1
- package/dist/repositories/organization/get-users-by-organization.d.ts +1 -1
- package/dist/repositories/organization/link-user-to-organization.d.ts +1 -1
- package/dist/repositories/organization/upsert.d.ts.map +1 -1
- package/dist/repositories/organization/upsert.js +8 -3
- package/dist/repositories/user/update-user-organization-link.d.ts +1 -1
- package/dist/services/organization/index.d.ts +1 -0
- package/dist/services/organization/index.d.ts.map +1 -1
- package/dist/services/organization/index.js +1 -0
- package/dist/services/organization/is-entreprise-unipersonnelle.d.ts +3 -3
- package/dist/services/organization/is-entreprise-unipersonnelle.d.ts.map +1 -1
- package/dist/services/organization/is-entreprise-unipersonnelle.js +4 -4
- package/dist/services/organization/is-organization-covered-by-certification-dirigeant.d.ts +3 -0
- package/dist/services/organization/is-organization-covered-by-certification-dirigeant.d.ts.map +1 -0
- package/dist/services/organization/is-organization-covered-by-certification-dirigeant.js +2 -0
- package/dist/services/organization/is-public-service.d.ts.map +1 -1
- package/dist/services/organization/is-public-service.js +16 -6
- package/dist/services/organization/is-syndicat-communal.d.ts.map +1 -1
- package/dist/services/organization/is-syndicat-communal.js +1 -0
- package/dist/types/franceconnect.d.ts.map +1 -1
- package/dist/types/franceconnect.js +2 -2
- package/dist/types/{dirigeant.d.ts → identity-vector.d.ts} +2 -1
- package/dist/types/identity-vector.d.ts.map +1 -0
- package/dist/types/{dirigeant.js → identity-vector.js} +8 -0
- package/dist/types/index.d.ts +2 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +2 -1
- package/dist/types/moderation.d.ts +37 -0
- package/dist/types/moderation.d.ts.map +1 -0
- package/dist/types/moderation.js +26 -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 -0
- package/dist/types/organization.d.ts.map +1 -1
- package/dist/types/user-organization-link.d.ts +32 -25
- package/dist/types/user-organization-link.d.ts.map +1 -1
- package/dist/types/user-organization-link.js +15 -8
- package/package.json +2 -2
- package/src/data/certification/categories-juridiques-sources.ts +811 -0
- package/src/data/certification/index.ts +1 -0
- package/src/errors/index.ts +0 -21
- package/src/managers/certification/certification-score.test.ts +69 -33
- package/src/managers/certification/certification-score.ts +20 -9
- package/src/managers/certification/index.ts +1 -1
- package/src/managers/certification/{is-organization-dirigeant.test.ts → process-certification-dirigeant.test.ts} +62 -64
- package/src/managers/certification/{is-organization-dirigeant.ts → process-certification-dirigeant.ts} +115 -74
- package/src/managers/organization/adapters/api_entreprise.test.ts.snapshot +4 -0
- package/src/managers/organization/adapters/api_entreprise.ts +3 -0
- package/src/managers/organization/force-join-organization.ts +3 -6
- package/src/managers/organization/get-organization-info.test.ts.snapshot +3 -0
- package/src/managers/organization/mark-domain-as-verified.test.ts +1 -1
- package/src/managers/user/assign-user-verification-type-to-domain.ts +6 -6
- package/src/repositories/organization/find-by-id.test.ts +1 -0
- package/src/repositories/organization/find-by-user-id.test.ts.snapshot +3 -0
- package/src/repositories/organization/get-by-id.test.ts +1 -0
- package/src/repositories/organization/link-user-to-organization.test.ts +3 -2
- package/src/repositories/organization/link-user-to-organization.test.ts.snapshot +2 -2
- package/src/repositories/organization/upsert.ts +8 -1
- package/src/repositories/organization/upset.test.ts +2 -0
- package/src/services/organization/index.ts +1 -0
- package/src/services/organization/is-entreprise-unipersonnelle.ts +5 -5
- package/src/services/organization/is-organization-covered-by-certification-dirigeant.test.ts +43 -0
- package/src/services/organization/is-organization-covered-by-certification-dirigeant.ts +9 -0
- package/src/services/organization/is-public-service.test.ts +1 -1
- package/src/services/organization/is-public-service.ts +20 -7
- package/src/services/organization/is-syndicat-communal.ts +1 -0
- package/src/types/franceconnect.ts +6 -7
- package/src/types/{dirigeant.ts → identity-vector.ts} +9 -0
- package/src/types/index.ts +2 -1
- package/src/types/moderation.ts +35 -0
- package/src/types/organization-info.ts +1 -0
- package/src/types/organization.ts +1 -0
- package/src/types/user-organization-link.ts +17 -11
- package/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/managers/certification/is-organization-dirigeant.d.ts +0 -45
- package/dist/managers/certification/is-organization-dirigeant.d.ts.map +0 -1
- package/dist/managers/certification/is-organization-dirigeant.js +0 -97
- package/dist/types/dirigeant.d.ts.map +0 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
//
|
|
3
3
|
export function upsertFactory({ pg }) {
|
|
4
4
|
return async function upsert({ siret, organizationInfo, }) {
|
|
5
|
-
const { cached_libelle, cached_nom_complet, cached_enseigne, cached_tranche_effectifs, cached_tranche_effectifs_unite_legale, cached_libelle_tranche_effectif, cached_etat_administratif, cached_est_active, cached_statut_diffusion, cached_est_diffusible, cached_adresse, cached_code_postal, cached_code_officiel_geographique, cached_activite_principale, cached_libelle_activite_principale, cached_categorie_juridique, cached_libelle_categorie_juridique, } = toPartialOrganization(organizationInfo);
|
|
5
|
+
const { cached_libelle, cached_nom_complet, cached_enseigne, cached_tranche_effectifs, cached_tranche_effectifs_unite_legale, cached_libelle_tranche_effectif, cached_etat_administratif, cached_est_active, cached_statut_diffusion, cached_est_diffusible, cached_adresse, cached_code_postal, cached_code_officiel_geographique, cached_activite_principale, cached_libelle_activite_principale, cached_categorie_juridique, cached_libelle_categorie_juridique, cached_siege_social, } = toPartialOrganization(organizationInfo);
|
|
6
6
|
const { rows } = await pg.query(`
|
|
7
7
|
INSERT INTO organizations
|
|
8
8
|
(
|
|
@@ -24,12 +24,13 @@ export function upsertFactory({ pg }) {
|
|
|
24
24
|
cached_libelle_activite_principale,
|
|
25
25
|
cached_categorie_juridique,
|
|
26
26
|
cached_libelle_categorie_juridique,
|
|
27
|
+
cached_siege_social,
|
|
27
28
|
organization_info_fetched_at,
|
|
28
29
|
updated_at,
|
|
29
30
|
created_at
|
|
30
31
|
)
|
|
31
32
|
VALUES
|
|
32
|
-
($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21)
|
|
33
|
+
($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22)
|
|
33
34
|
ON CONFLICT (siret)
|
|
34
35
|
DO UPDATE
|
|
35
36
|
SET (
|
|
@@ -51,6 +52,7 @@ export function upsertFactory({ pg }) {
|
|
|
51
52
|
cached_libelle_activite_principale,
|
|
52
53
|
cached_categorie_juridique,
|
|
53
54
|
cached_libelle_categorie_juridique,
|
|
55
|
+
cached_siege_social,
|
|
54
56
|
organization_info_fetched_at,
|
|
55
57
|
updated_at
|
|
56
58
|
) = (
|
|
@@ -72,6 +74,7 @@ export function upsertFactory({ pg }) {
|
|
|
72
74
|
EXCLUDED.cached_libelle_activite_principale,
|
|
73
75
|
EXCLUDED.cached_categorie_juridique,
|
|
74
76
|
EXCLUDED.cached_libelle_categorie_juridique,
|
|
77
|
+
EXCLUDED.cached_siege_social,
|
|
75
78
|
EXCLUDED.organization_info_fetched_at,
|
|
76
79
|
EXCLUDED.updated_at
|
|
77
80
|
)
|
|
@@ -95,6 +98,7 @@ export function upsertFactory({ pg }) {
|
|
|
95
98
|
cached_libelle_activite_principale,
|
|
96
99
|
cached_categorie_juridique,
|
|
97
100
|
cached_libelle_categorie_juridique,
|
|
101
|
+
cached_siege_social,
|
|
98
102
|
new Date(),
|
|
99
103
|
new Date(),
|
|
100
104
|
new Date(),
|
|
@@ -104,7 +108,7 @@ export function upsertFactory({ pg }) {
|
|
|
104
108
|
}
|
|
105
109
|
//
|
|
106
110
|
function toPartialOrganization(organization_info) {
|
|
107
|
-
const { activitePrincipale: cached_activite_principale, adresse: cached_adresse, categorieJuridique: cached_categorie_juridique, codeOfficielGeographique: cached_code_officiel_geographique, codePostal: cached_code_postal, enseigne: cached_enseigne, estActive: cached_est_active, estDiffusible: cached_est_diffusible, etatAdministratif: cached_etat_administratif, libelle: cached_libelle, libelleActivitePrincipale: cached_libelle_activite_principale, libelleCategorieJuridique: cached_libelle_categorie_juridique, libelleTrancheEffectif: cached_libelle_tranche_effectif, nomComplet: cached_nom_complet, siret, statutDiffusion: cached_statut_diffusion, trancheEffectifs: cached_tranche_effectifs, trancheEffectifsUniteLegale: cached_tranche_effectifs_unite_legale, } = organization_info;
|
|
111
|
+
const { activitePrincipale: cached_activite_principale, adresse: cached_adresse, categorieJuridique: cached_categorie_juridique, codeOfficielGeographique: cached_code_officiel_geographique, codePostal: cached_code_postal, enseigne: cached_enseigne, estActive: cached_est_active, estDiffusible: cached_est_diffusible, etatAdministratif: cached_etat_administratif, libelle: cached_libelle, libelleActivitePrincipale: cached_libelle_activite_principale, libelleCategorieJuridique: cached_libelle_categorie_juridique, libelleTrancheEffectif: cached_libelle_tranche_effectif, nomComplet: cached_nom_complet, siegeSocial: cached_siege_social, siret, statutDiffusion: cached_statut_diffusion, trancheEffectifs: cached_tranche_effectifs, trancheEffectifsUniteLegale: cached_tranche_effectifs_unite_legale, } = organization_info;
|
|
108
112
|
return {
|
|
109
113
|
cached_activite_principale,
|
|
110
114
|
cached_adresse,
|
|
@@ -120,6 +124,7 @@ function toPartialOrganization(organization_info) {
|
|
|
120
124
|
cached_libelle_tranche_effectif,
|
|
121
125
|
cached_libelle,
|
|
122
126
|
cached_nom_complet,
|
|
127
|
+
cached_siege_social,
|
|
123
128
|
cached_statut_diffusion,
|
|
124
129
|
cached_tranche_effectifs_unite_legale,
|
|
125
130
|
cached_tranche_effectifs,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { DatabaseContext, UserOrganizationLink } from "#src/types";
|
|
2
2
|
export declare function updateUserOrganizationLinkFactory({ pg }: DatabaseContext): (organization_id: number, user_id: number, fieldsToUpdate: Partial<UserOrganizationLink>) => Promise<{
|
|
3
3
|
is_external: boolean;
|
|
4
|
-
verification_type: "code_sent_to_official_contact_email" | "domain" | "imported_from_coop_mediation_numerique" | "imported_from_inclusion_connect" | "in_liste_dirigeants_rna" | "in_liste_dirigeants_rne" | "
|
|
4
|
+
verification_type: "code_sent_to_official_contact_email" | "domain" | "imported_from_coop_mediation_numerique" | "imported_from_inclusion_connect" | "in_liste_dirigeants_rna" | "in_liste_dirigeants_rne" | "official_contact_email" | "proof_received" | "bypassed" | "organization_dirigeant" | "no_validation_means_available" | "no_verification_means_for_entreprise_unipersonnelle" | "no_verification_means_for_small_association" | "domain_not_verified_yet";
|
|
5
5
|
verified_at: Date | null;
|
|
6
6
|
has_been_greeted: boolean;
|
|
7
7
|
needs_official_contact_email_verification: boolean;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from "./is-domain-allowed-for-organization.js";
|
|
2
2
|
export * from "./is-entreprise-unipersonnelle.js";
|
|
3
|
+
export * from "./is-organization-covered-by-certification-dirigeant.js";
|
|
3
4
|
export * from "./is-public-service.js";
|
|
4
5
|
export * from "./is-syndicat-communal.js";
|
|
5
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/organization/index.ts"],"names":[],"mappings":"AAEA,cAAc,yCAAyC,CAAC;AACxD,cAAc,mCAAmC,CAAC;AAClD,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/organization/index.ts"],"names":[],"mappings":"AAEA,cAAc,yCAAyC,CAAC;AACxD,cAAc,mCAAmC,CAAC;AAClD,cAAc,yDAAyD,CAAC;AACxE,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
//
|
|
2
2
|
export * from "./is-domain-allowed-for-organization.js";
|
|
3
3
|
export * from "./is-entreprise-unipersonnelle.js";
|
|
4
|
+
export * from "./is-organization-covered-by-certification-dirigeant.js";
|
|
4
5
|
export * from "./is-public-service.js";
|
|
5
6
|
export * from "./is-syndicat-communal.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Organization } from "#src/types";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* This function returns approximate results. As the data tranche effectifs is
|
|
4
4
|
* two years old. Consequently, an organization that growths quickly within the
|
|
5
5
|
* first two years of his existence can be miss-identified as unipersonnelle by
|
|
6
|
-
* this
|
|
6
|
+
* this function.
|
|
7
7
|
*/
|
|
8
|
-
export declare function isEntrepriseUnipersonnelle({ cached_libelle_categorie_juridique,
|
|
8
|
+
export declare function isEntrepriseUnipersonnelle({ cached_libelle_categorie_juridique, cached_tranche_effectifs_unite_legale, }: Pick<Organization, "cached_libelle_categorie_juridique" | "cached_tranche_effectifs_unite_legale">): boolean;
|
|
9
9
|
//# sourceMappingURL=is-entreprise-unipersonnelle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-entreprise-unipersonnelle.d.ts","sourceRoot":"","sources":["../../../src/services/organization/is-entreprise-unipersonnelle.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,EACzC,kCAAkC,EAClC,
|
|
1
|
+
{"version":3,"file":"is-entreprise-unipersonnelle.d.ts","sourceRoot":"","sources":["../../../src/services/organization/is-entreprise-unipersonnelle.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,EACzC,kCAAkC,EAClC,qCAAqC,GACtC,EAAE,IAAI,CACL,YAAY,EACZ,oCAAoC,GAAG,uCAAuC,CAC/E,GAAG,OAAO,CAcV"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
//
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* This function returns approximate results. As the data tranche effectifs is
|
|
4
4
|
* two years old. Consequently, an organization that growths quickly within the
|
|
5
5
|
* first two years of his existence can be miss-identified as unipersonnelle by
|
|
6
|
-
* this
|
|
6
|
+
* this function.
|
|
7
7
|
*/
|
|
8
|
-
export function isEntrepriseUnipersonnelle({ cached_libelle_categorie_juridique,
|
|
8
|
+
export function isEntrepriseUnipersonnelle({ cached_libelle_categorie_juridique, cached_tranche_effectifs_unite_legale, }) {
|
|
9
9
|
// check that the organization has the right catégorie juridique
|
|
10
10
|
const cat_jur_ok = [
|
|
11
11
|
"Entrepreneur individuel",
|
|
@@ -13,6 +13,6 @@ export function isEntrepriseUnipersonnelle({ cached_libelle_categorie_juridique,
|
|
|
13
13
|
"SAS, société par actions simplifiée",
|
|
14
14
|
].includes(cached_libelle_categorie_juridique || "");
|
|
15
15
|
// check that the organization has the right tranche effectifs
|
|
16
|
-
const tra_eff_ok = [null, "NN", "00", "01"].includes(
|
|
16
|
+
const tra_eff_ok = [null, "NN", "00", "01"].includes(cached_tranche_effectifs_unite_legale);
|
|
17
17
|
return cat_jur_ok && tra_eff_ok;
|
|
18
18
|
}
|
package/dist/services/organization/is-organization-covered-by-certification-dirigeant.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-organization-covered-by-certification-dirigeant.d.ts","sourceRoot":"","sources":["../../../src/services/organization/is-organization-covered-by-certification-dirigeant.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,eAAO,MAAM,6CAA6C,GAAI,iCAE3D,YAAY,YAG+B,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { CATEGORIES_JURIDIQUES } from "#src/data/certification";
|
|
2
|
+
export const isOrganizationCoveredByCertificationDirigeant = ({ cached_categorie_juridique, }) => CATEGORIES_JURIDIQUES.map(({ categorie_juridique }) => categorie_juridique).includes(cached_categorie_juridique || "");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-public-service.d.ts","sourceRoot":"","sources":["../../../src/services/organization/is-public-service.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAG/E,eAAO,MAAM,eAAe,GAAI,mEAI7B,YAAY,KAAG,
|
|
1
|
+
{"version":3,"file":"is-public-service.d.ts","sourceRoot":"","sources":["../../../src/services/organization/is-public-service.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAG/E,eAAO,MAAM,eAAe,GAAI,mEAI7B,YAAY,KAAG,OAiCjB,CAAC"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
//
|
|
2
2
|
import { NATURE_JURIDIQUE_SERVICE_PUBLIC, SERVICE_PUBLIC_BLACKLIST, SERVICE_PUBLIC_WHITELIST, } from "@proconnect-gouv/proconnect.annuaire_entreprises";
|
|
3
|
-
// inspired from https://github.com/annuaire-entreprises-data-gouv-fr/search-infra/blob/
|
|
3
|
+
// inspired from https://github.com/annuaire-entreprises-data-gouv-fr/search-infra/blob/4ec29b1ef3370e0f840bd55dd6d38a4811faf18d/workflows/data_pipelines/elasticsearch/data_enrichment.py#L169-L209
|
|
4
4
|
export const isPublicService = ({ cached_categorie_juridique, cached_etat_administratif, siret, }) => {
|
|
5
|
+
// Check if nature juridique is undefined/null
|
|
6
|
+
if (!cached_categorie_juridique) {
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
5
9
|
const siren = (siret || "").substring(0, 9);
|
|
6
10
|
// Entities in the blacklist are never considered public services
|
|
7
11
|
if (SERVICE_PUBLIC_BLACKLIST.includes(siren)) {
|
|
@@ -11,9 +15,15 @@ export const isPublicService = ({ cached_categorie_juridique, cached_etat_admini
|
|
|
11
15
|
if (cached_etat_administratif === "C") {
|
|
12
16
|
return false;
|
|
13
17
|
}
|
|
14
|
-
// Check if entity is in whitelist
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
// Check if entity is in whitelist (takes priority)
|
|
19
|
+
if (SERVICE_PUBLIC_WHITELIST.includes(siren)) {
|
|
20
|
+
return true;
|
|
21
|
+
}
|
|
22
|
+
// Legal nature codes starting with 4 or 7 are public services
|
|
23
|
+
if (cached_categorie_juridique.startsWith("4") ||
|
|
24
|
+
cached_categorie_juridique.startsWith("7")) {
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
// Check if entity has a specific public service legal nature code
|
|
28
|
+
return NATURE_JURIDIQUE_SERVICE_PUBLIC.includes(cached_categorie_juridique);
|
|
19
29
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-syndicat-communal.d.ts","sourceRoot":"","sources":["../../../src/services/organization/is-syndicat-communal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"is-syndicat-communal.d.ts","sourceRoot":"","sources":["../../../src/services/organization/is-syndicat-communal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAW/C,eAAO,MAAM,kBAAkB,GAAI,yCAEhC,IAAI,CAAC,YAAY,EAAE,oCAAoC,CAAC,KAAG,OAK7D,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const cat_jur = [
|
|
2
2
|
"Centre communal d'action sociale",
|
|
3
3
|
"Établissement public local social et médico-social",
|
|
4
|
+
"Groupement de coopération sanitaire à gestion publique",
|
|
4
5
|
"Syndicat intercommunal à vocation multiple (SIVOM)",
|
|
5
6
|
"Syndicat intercommunal à vocation unique (SIVU)",
|
|
6
7
|
"Syndicat mixte fermé",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"franceconnect.d.ts","sourceRoot":"","sources":["../../src/types/franceconnect.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;GAEG;AACH,eAAO,MAAM,mCAAmC;;;;;;;;;iBAU9C,CAAC;AAEH,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,MAAM,CAClD,OAAO,mCAAmC,CAC3C,CAAC;AAIF,eAAO,MAAM,2BAA2B;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"franceconnect.d.ts","sourceRoot":"","sources":["../../src/types/franceconnect.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;GAEG;AACH,eAAO,MAAM,mCAAmC;;;;;;;;;iBAU9C,CAAC;AAEH,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,MAAM,CAClD,OAAO,mCAAmC,CAC3C,CAAC;AAIF,eAAO,MAAM,2BAA2B;;;;;;;;;;;;iBAKpC,CAAC;AAEL,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAC1C,OAAO,2BAA2B,CACnC,CAAC"}
|
|
@@ -16,8 +16,8 @@ export const FranceConnectUserInfoResponseSchema = z.object({
|
|
|
16
16
|
// NOTE(douglasduteil): the following ignore extra keys (aud, given_name_array)
|
|
17
17
|
});
|
|
18
18
|
//
|
|
19
|
-
export const FranceConnectUserInfoSchema = FranceConnectUserInfoResponseSchema.
|
|
19
|
+
export const FranceConnectUserInfoSchema = FranceConnectUserInfoResponseSchema.extend({
|
|
20
20
|
created_at: z.coerce.date(),
|
|
21
21
|
updated_at: z.coerce.date(),
|
|
22
22
|
user_id: z.number(),
|
|
23
|
-
})
|
|
23
|
+
});
|
|
@@ -11,4 +11,5 @@ export declare const IdentityVectorSchema: z.ZodObject<{
|
|
|
11
11
|
given_name: z.ZodNullable<z.ZodString>;
|
|
12
12
|
}, z.core.$strip>;
|
|
13
13
|
export type IdentityVector = z.output<typeof IdentityVectorSchema>;
|
|
14
|
-
|
|
14
|
+
export declare const NullIdentityVector: IdentityVector;
|
|
15
|
+
//# sourceMappingURL=identity-vector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity-vector.d.ts","sourceRoot":"","sources":["../../src/types/identity-vector.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,oBAAoB;;;;;;;;;;iBAO/B,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAEnE,eAAO,MAAM,kBAAkB,EAAE,cAO/B,CAAC"}
|
|
@@ -9,3 +9,11 @@ export const IdentityVectorSchema = z.object({
|
|
|
9
9
|
gender: z.enum(["male", "female"]).nullable(),
|
|
10
10
|
given_name: z.string().nullable(),
|
|
11
11
|
});
|
|
12
|
+
export const NullIdentityVector = IdentityVectorSchema.parse({
|
|
13
|
+
birthcountry: null,
|
|
14
|
+
birthdate: null,
|
|
15
|
+
birthplace: null,
|
|
16
|
+
family_name: null,
|
|
17
|
+
gender: null,
|
|
18
|
+
given_name: null,
|
|
19
|
+
});
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export * from "./claims.js";
|
|
2
2
|
export * from "./contexts.js";
|
|
3
|
-
export * from "./dirigeant.js";
|
|
4
3
|
export * from "./email-domain.js";
|
|
5
4
|
export * from "./franceconnect.js";
|
|
5
|
+
export * from "./identity-vector.js";
|
|
6
|
+
export * from "./moderation.js";
|
|
6
7
|
export * from "./organization-info.js";
|
|
7
8
|
export * from "./organization.js";
|
|
8
9
|
export * from "./user-organization-link.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAEA,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAEA,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,WAAW,CAAC"}
|
package/dist/types/index.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
//
|
|
2
2
|
export * from "./claims.js";
|
|
3
3
|
export * from "./contexts.js";
|
|
4
|
-
export * from "./dirigeant.js";
|
|
5
4
|
export * from "./email-domain.js";
|
|
6
5
|
export * from "./franceconnect.js";
|
|
6
|
+
export * from "./identity-vector.js";
|
|
7
|
+
export * from "./moderation.js";
|
|
7
8
|
export * from "./organization-info.js";
|
|
8
9
|
export * from "./organization.js";
|
|
9
10
|
export * from "./user-organization-link.js";
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
export declare const ModerationStatusSchema: z.ZodEnum<{
|
|
3
|
+
accepted: "accepted";
|
|
4
|
+
pending: "pending";
|
|
5
|
+
rejected: "rejected";
|
|
6
|
+
reopened: "reopened";
|
|
7
|
+
unknown: "unknown";
|
|
8
|
+
}>;
|
|
9
|
+
export type ModerationStatus = z.output<typeof ModerationStatusSchema>;
|
|
10
|
+
export declare const ModerationTypeSchema: z.ZodEnum<{
|
|
11
|
+
non_verified_domain: "non_verified_domain";
|
|
12
|
+
organization_join_block: "organization_join_block";
|
|
13
|
+
}>;
|
|
14
|
+
export type ModerationType = z.output<typeof ModerationTypeSchema>;
|
|
15
|
+
export declare const ModerationSchema: z.ZodObject<{
|
|
16
|
+
id: z.ZodNumber;
|
|
17
|
+
user_id: z.ZodNumber;
|
|
18
|
+
organization_id: z.ZodNumber;
|
|
19
|
+
ticket_id: z.ZodNullable<z.ZodString>;
|
|
20
|
+
type: z.ZodEnum<{
|
|
21
|
+
non_verified_domain: "non_verified_domain";
|
|
22
|
+
organization_join_block: "organization_join_block";
|
|
23
|
+
}>;
|
|
24
|
+
created_at: z.ZodDate;
|
|
25
|
+
moderated_at: z.ZodNullable<z.ZodDate>;
|
|
26
|
+
comment: z.ZodNullable<z.ZodString>;
|
|
27
|
+
moderated_by: z.ZodNullable<z.ZodString>;
|
|
28
|
+
status: z.ZodEnum<{
|
|
29
|
+
accepted: "accepted";
|
|
30
|
+
pending: "pending";
|
|
31
|
+
rejected: "rejected";
|
|
32
|
+
reopened: "reopened";
|
|
33
|
+
unknown: "unknown";
|
|
34
|
+
}>;
|
|
35
|
+
}, z.core.$strip>;
|
|
36
|
+
export type Moderation = z.output<typeof ModerationSchema>;
|
|
37
|
+
//# sourceMappingURL=moderation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"moderation.d.ts","sourceRoot":"","sources":["../../src/types/moderation.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAIzB,eAAO,MAAM,sBAAsB;;;;;;EAMjC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEvE,eAAO,MAAM,oBAAoB;;;EAG/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAEnE,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;iBAW3B,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//
|
|
2
|
+
import * as z from "zod";
|
|
3
|
+
//
|
|
4
|
+
export const ModerationStatusSchema = z.enum([
|
|
5
|
+
"accepted",
|
|
6
|
+
"pending",
|
|
7
|
+
"rejected",
|
|
8
|
+
"reopened",
|
|
9
|
+
"unknown",
|
|
10
|
+
]);
|
|
11
|
+
export const ModerationTypeSchema = z.enum([
|
|
12
|
+
"non_verified_domain",
|
|
13
|
+
"organization_join_block",
|
|
14
|
+
]);
|
|
15
|
+
export const ModerationSchema = z.object({
|
|
16
|
+
id: z.number(),
|
|
17
|
+
user_id: z.number(),
|
|
18
|
+
organization_id: z.number(),
|
|
19
|
+
ticket_id: z.string().nullable(),
|
|
20
|
+
type: ModerationTypeSchema,
|
|
21
|
+
created_at: z.date(),
|
|
22
|
+
moderated_at: z.date().nullable(),
|
|
23
|
+
comment: z.string().nullable(),
|
|
24
|
+
moderated_by: z.string().nullable(),
|
|
25
|
+
status: ModerationStatusSchema,
|
|
26
|
+
});
|
|
@@ -14,13 +14,14 @@ export declare const OrganizationInfoSchema: z.ZodObject<{
|
|
|
14
14
|
libelleCategorieJuridique: z.ZodString;
|
|
15
15
|
libelleTrancheEffectif: z.ZodString;
|
|
16
16
|
nomComplet: z.ZodString;
|
|
17
|
+
siegeSocial: z.ZodBoolean;
|
|
17
18
|
siret: z.ZodString;
|
|
18
19
|
statutDiffusion: z.ZodEnum<{
|
|
19
20
|
diffusible: "diffusible";
|
|
20
21
|
partiellement_diffusible: "partiellement_diffusible";
|
|
21
22
|
non_diffusible: "non_diffusible";
|
|
22
23
|
}>;
|
|
23
|
-
trancheEffectifs: z.ZodNullable<z.ZodCustom<"
|
|
24
|
+
trancheEffectifs: z.ZodNullable<z.ZodCustom<"11" | "12" | "21" | "22" | "31" | "32" | "41" | "42" | "51" | "52" | "53" | "NN" | "00" | "01" | "02" | "03" | null, "11" | "12" | "21" | "22" | "31" | "32" | "41" | "42" | "51" | "52" | "53" | "NN" | "00" | "01" | "02" | "03" | null>>;
|
|
24
25
|
trancheEffectifsUniteLegale: z.ZodNullable<z.ZodString>;
|
|
25
26
|
}, z.core.$strip>;
|
|
26
27
|
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":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,sBAAsB
|
|
1
|
+
{"version":3,"file":"organization-info.d.ts","sourceRoot":"","sources":["../../src/types/organization-info.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;iBAwBjC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
|
|
@@ -21,6 +21,7 @@ export interface Organization {
|
|
|
21
21
|
cached_libelle_activite_principale: string | null;
|
|
22
22
|
cached_categorie_juridique: string | null;
|
|
23
23
|
cached_libelle_categorie_juridique: string | null;
|
|
24
|
+
cached_siege_social: boolean | null;
|
|
24
25
|
organization_info_fetched_at: Date | null;
|
|
25
26
|
}
|
|
26
27
|
//# sourceMappingURL=organization.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization.d.ts","sourceRoot":"","sources":["../../src/types/organization.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kDAAkD,CAAC;AAIzF,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,4BAA4B,EAAE,IAAI,GAAG,IAAI,CAAC;CAC3C"}
|
|
1
|
+
{"version":3,"file":"organization.d.ts","sourceRoot":"","sources":["../../src/types/organization.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kDAAkD,CAAC;AAIzF,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"}
|
|
@@ -1,37 +1,42 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const WeakLinkTypes: readonly ["code_sent_to_official_contact_email", "domain", "imported_from_coop_mediation_numerique", "imported_from_inclusion_connect", "in_liste_dirigeants_rna", "in_liste_dirigeants_rne", "official_contact_email", "proof_received", "bypassed"];
|
|
3
|
+
export declare const StrongLinkTypes: readonly ["organization_dirigeant"];
|
|
4
|
+
export declare const VerifiedLinkTypes: readonly ["code_sent_to_official_contact_email", "domain", "imported_from_coop_mediation_numerique", "imported_from_inclusion_connect", "in_liste_dirigeants_rna", "in_liste_dirigeants_rne", "official_contact_email", "proof_received", "bypassed", "organization_dirigeant"];
|
|
5
|
+
export declare const UnverifiedLinkTypes: readonly ["no_validation_means_available", "no_verification_means_for_entreprise_unipersonnelle", "no_verification_means_for_small_association", "domain_not_verified_yet"];
|
|
6
|
+
export declare const LinkTypes: z.ZodEnum<{
|
|
3
7
|
code_sent_to_official_contact_email: "code_sent_to_official_contact_email";
|
|
4
8
|
domain: "domain";
|
|
5
9
|
imported_from_coop_mediation_numerique: "imported_from_coop_mediation_numerique";
|
|
6
10
|
imported_from_inclusion_connect: "imported_from_inclusion_connect";
|
|
7
11
|
in_liste_dirigeants_rna: "in_liste_dirigeants_rna";
|
|
8
12
|
in_liste_dirigeants_rne: "in_liste_dirigeants_rne";
|
|
9
|
-
no_validation_means_available: "no_validation_means_available";
|
|
10
|
-
no_verification_means_for_entreprise_unipersonnelle: "no_verification_means_for_entreprise_unipersonnelle";
|
|
11
|
-
no_verification_means_for_small_association: "no_verification_means_for_small_association";
|
|
12
13
|
official_contact_email: "official_contact_email";
|
|
13
|
-
organization_dirigeant: "organization_dirigeant";
|
|
14
14
|
proof_received: "proof_received";
|
|
15
15
|
bypassed: "bypassed";
|
|
16
|
+
organization_dirigeant: "organization_dirigeant";
|
|
17
|
+
no_validation_means_available: "no_validation_means_available";
|
|
18
|
+
no_verification_means_for_entreprise_unipersonnelle: "no_verification_means_for_entreprise_unipersonnelle";
|
|
19
|
+
no_verification_means_for_small_association: "no_verification_means_for_small_association";
|
|
20
|
+
domain_not_verified_yet: "domain_not_verified_yet";
|
|
16
21
|
}>;
|
|
17
|
-
export type UserOrganizationLinkVerificationType = z.output<typeof UserOrganizationLinkVerificationTypeSchema>;
|
|
18
22
|
export declare const BaseUserOrganizationLinkSchema: z.ZodObject<{
|
|
19
23
|
is_external: z.ZodBoolean;
|
|
20
|
-
verification_type: z.
|
|
24
|
+
verification_type: z.ZodEnum<{
|
|
21
25
|
code_sent_to_official_contact_email: "code_sent_to_official_contact_email";
|
|
22
26
|
domain: "domain";
|
|
23
27
|
imported_from_coop_mediation_numerique: "imported_from_coop_mediation_numerique";
|
|
24
28
|
imported_from_inclusion_connect: "imported_from_inclusion_connect";
|
|
25
29
|
in_liste_dirigeants_rna: "in_liste_dirigeants_rna";
|
|
26
30
|
in_liste_dirigeants_rne: "in_liste_dirigeants_rne";
|
|
27
|
-
no_validation_means_available: "no_validation_means_available";
|
|
28
|
-
no_verification_means_for_entreprise_unipersonnelle: "no_verification_means_for_entreprise_unipersonnelle";
|
|
29
|
-
no_verification_means_for_small_association: "no_verification_means_for_small_association";
|
|
30
31
|
official_contact_email: "official_contact_email";
|
|
31
|
-
organization_dirigeant: "organization_dirigeant";
|
|
32
32
|
proof_received: "proof_received";
|
|
33
33
|
bypassed: "bypassed";
|
|
34
|
-
|
|
34
|
+
organization_dirigeant: "organization_dirigeant";
|
|
35
|
+
no_validation_means_available: "no_validation_means_available";
|
|
36
|
+
no_verification_means_for_entreprise_unipersonnelle: "no_verification_means_for_entreprise_unipersonnelle";
|
|
37
|
+
no_verification_means_for_small_association: "no_verification_means_for_small_association";
|
|
38
|
+
domain_not_verified_yet: "domain_not_verified_yet";
|
|
39
|
+
}>;
|
|
35
40
|
verified_at: z.ZodUnion<[z.ZodDate, z.ZodLiteral<null>]>;
|
|
36
41
|
has_been_greeted: z.ZodBoolean;
|
|
37
42
|
needs_official_contact_email_verification: z.ZodBoolean;
|
|
@@ -41,21 +46,22 @@ export declare const BaseUserOrganizationLinkSchema: z.ZodObject<{
|
|
|
41
46
|
export type BaseUserOrganizationLink = z.output<typeof BaseUserOrganizationLinkSchema>;
|
|
42
47
|
export declare const UserOrganizationLinkSchema: z.ZodObject<{
|
|
43
48
|
is_external: z.ZodBoolean;
|
|
44
|
-
verification_type: z.
|
|
49
|
+
verification_type: z.ZodEnum<{
|
|
45
50
|
code_sent_to_official_contact_email: "code_sent_to_official_contact_email";
|
|
46
51
|
domain: "domain";
|
|
47
52
|
imported_from_coop_mediation_numerique: "imported_from_coop_mediation_numerique";
|
|
48
53
|
imported_from_inclusion_connect: "imported_from_inclusion_connect";
|
|
49
54
|
in_liste_dirigeants_rna: "in_liste_dirigeants_rna";
|
|
50
55
|
in_liste_dirigeants_rne: "in_liste_dirigeants_rne";
|
|
51
|
-
no_validation_means_available: "no_validation_means_available";
|
|
52
|
-
no_verification_means_for_entreprise_unipersonnelle: "no_verification_means_for_entreprise_unipersonnelle";
|
|
53
|
-
no_verification_means_for_small_association: "no_verification_means_for_small_association";
|
|
54
56
|
official_contact_email: "official_contact_email";
|
|
55
|
-
organization_dirigeant: "organization_dirigeant";
|
|
56
57
|
proof_received: "proof_received";
|
|
57
58
|
bypassed: "bypassed";
|
|
58
|
-
|
|
59
|
+
organization_dirigeant: "organization_dirigeant";
|
|
60
|
+
no_validation_means_available: "no_validation_means_available";
|
|
61
|
+
no_verification_means_for_entreprise_unipersonnelle: "no_verification_means_for_entreprise_unipersonnelle";
|
|
62
|
+
no_verification_means_for_small_association: "no_verification_means_for_small_association";
|
|
63
|
+
domain_not_verified_yet: "domain_not_verified_yet";
|
|
64
|
+
}>;
|
|
59
65
|
verified_at: z.ZodUnion<[z.ZodDate, z.ZodLiteral<null>]>;
|
|
60
66
|
has_been_greeted: z.ZodBoolean;
|
|
61
67
|
needs_official_contact_email_verification: z.ZodBoolean;
|
|
@@ -69,22 +75,23 @@ export declare const UserOrganizationLinkSchema: z.ZodObject<{
|
|
|
69
75
|
export type UserOrganizationLink = z.output<typeof UserOrganizationLinkSchema>;
|
|
70
76
|
export declare const InsertUserOrganizationLinkSchema: z.ZodObject<{
|
|
71
77
|
user_id: z.ZodNumber;
|
|
72
|
-
|
|
78
|
+
organization_id: z.ZodNumber;
|
|
79
|
+
verification_type: z.ZodEnum<{
|
|
73
80
|
code_sent_to_official_contact_email: "code_sent_to_official_contact_email";
|
|
74
81
|
domain: "domain";
|
|
75
82
|
imported_from_coop_mediation_numerique: "imported_from_coop_mediation_numerique";
|
|
76
83
|
imported_from_inclusion_connect: "imported_from_inclusion_connect";
|
|
77
84
|
in_liste_dirigeants_rna: "in_liste_dirigeants_rna";
|
|
78
85
|
in_liste_dirigeants_rne: "in_liste_dirigeants_rne";
|
|
79
|
-
no_validation_means_available: "no_validation_means_available";
|
|
80
|
-
no_verification_means_for_entreprise_unipersonnelle: "no_verification_means_for_entreprise_unipersonnelle";
|
|
81
|
-
no_verification_means_for_small_association: "no_verification_means_for_small_association";
|
|
82
86
|
official_contact_email: "official_contact_email";
|
|
83
|
-
organization_dirigeant: "organization_dirigeant";
|
|
84
87
|
proof_received: "proof_received";
|
|
85
88
|
bypassed: "bypassed";
|
|
86
|
-
|
|
87
|
-
|
|
89
|
+
organization_dirigeant: "organization_dirigeant";
|
|
90
|
+
no_validation_means_available: "no_validation_means_available";
|
|
91
|
+
no_verification_means_for_entreprise_unipersonnelle: "no_verification_means_for_entreprise_unipersonnelle";
|
|
92
|
+
no_verification_means_for_small_association: "no_verification_means_for_small_association";
|
|
93
|
+
domain_not_verified_yet: "domain_not_verified_yet";
|
|
94
|
+
}>;
|
|
88
95
|
is_external: z.ZodOptional<z.ZodBoolean>;
|
|
89
96
|
needs_official_contact_email_verification: z.ZodOptional<z.ZodBoolean>;
|
|
90
97
|
}, z.core.$strip>;
|
|
@@ -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,
|
|
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,aAAa,uPAWhB,CAAC;AAEX,eAAO,MAAM,eAAe,qCAAsC,CAAC;AAEnE,eAAO,MAAM,iBAAiB,iRAGpB,CAAC;AAEX,eAAO,MAAM,mBAAmB,6KAKtB,CAAC;AAEX,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;EAAyD,CAAC;AAEhF,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;iBASzC,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAC7C,OAAO,8BAA8B,CACtC,CAAC;AAIF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAOtC,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAI/E,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;iBAW5C,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAC/C,OAAO,gCAAgC,CACxC,CAAC"}
|
|
@@ -1,24 +1,31 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
export const
|
|
2
|
+
export const WeakLinkTypes = [
|
|
3
3
|
"code_sent_to_official_contact_email",
|
|
4
4
|
"domain",
|
|
5
5
|
"imported_from_coop_mediation_numerique",
|
|
6
6
|
"imported_from_inclusion_connect",
|
|
7
7
|
"in_liste_dirigeants_rna",
|
|
8
8
|
"in_liste_dirigeants_rne",
|
|
9
|
-
"no_validation_means_available",
|
|
10
|
-
"no_verification_means_for_entreprise_unipersonnelle",
|
|
11
|
-
"no_verification_means_for_small_association",
|
|
12
9
|
"official_contact_email",
|
|
13
|
-
"organization_dirigeant",
|
|
14
10
|
"proof_received",
|
|
15
11
|
// Used in the sandbox environment to bypass the verification process
|
|
16
12
|
"bypassed",
|
|
17
|
-
]
|
|
18
|
-
|
|
13
|
+
];
|
|
14
|
+
export const StrongLinkTypes = ["organization_dirigeant"];
|
|
15
|
+
export const VerifiedLinkTypes = [
|
|
16
|
+
...WeakLinkTypes,
|
|
17
|
+
...StrongLinkTypes,
|
|
18
|
+
];
|
|
19
|
+
export const UnverifiedLinkTypes = [
|
|
20
|
+
"no_validation_means_available",
|
|
21
|
+
"no_verification_means_for_entreprise_unipersonnelle",
|
|
22
|
+
"no_verification_means_for_small_association",
|
|
23
|
+
"domain_not_verified_yet",
|
|
24
|
+
];
|
|
25
|
+
export const LinkTypes = z.enum([...VerifiedLinkTypes, ...UnverifiedLinkTypes]);
|
|
19
26
|
export const BaseUserOrganizationLinkSchema = z.object({
|
|
20
27
|
is_external: z.boolean(),
|
|
21
|
-
verification_type:
|
|
28
|
+
verification_type: LinkTypes,
|
|
22
29
|
// updated when verification_type is changed
|
|
23
30
|
verified_at: z.date().or(z.literal(null)),
|
|
24
31
|
has_been_greeted: z.boolean(),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@proconnect-gouv/proconnect.identite",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.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": {
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"leven": "^4.0.0",
|
|
47
47
|
"openid-client": "^6.6.4",
|
|
48
48
|
"sql-template-tag": "^5.2.1",
|
|
49
|
-
"zod": "^4.
|
|
49
|
+
"zod": "^4.3.5"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@electric-sql/pglite": "^0.3.12",
|