@proconnect-gouv/proconnect.identite 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +0 -2
  3. package/dist/data/certification/categories-juridiques-sources.d.ts +8 -0
  4. package/dist/data/certification/categories-juridiques-sources.d.ts.map +1 -0
  5. package/dist/data/certification/categories-juridiques-sources.js +743 -0
  6. package/dist/data/certification/index.d.ts +1 -0
  7. package/dist/data/certification/index.d.ts.map +1 -1
  8. package/dist/data/certification/index.js +1 -0
  9. package/dist/errors/index.d.ts +0 -9
  10. package/dist/errors/index.d.ts.map +1 -1
  11. package/dist/errors/index.js +0 -18
  12. package/dist/managers/certification/certification-score.d.ts +11 -1
  13. package/dist/managers/certification/certification-score.d.ts.map +1 -1
  14. package/dist/managers/certification/certification-score.js +17 -8
  15. package/dist/managers/certification/index.d.ts +1 -1
  16. package/dist/managers/certification/index.d.ts.map +1 -1
  17. package/dist/managers/certification/index.js +1 -1
  18. package/dist/managers/certification/process-certification-dirigeant.d.ts +80 -0
  19. package/dist/managers/certification/process-certification-dirigeant.d.ts.map +1 -0
  20. package/dist/managers/certification/process-certification-dirigeant.js +121 -0
  21. package/dist/managers/organization/adapters/api_entreprise.d.ts +2 -1
  22. package/dist/managers/organization/adapters/api_entreprise.d.ts.map +1 -1
  23. package/dist/managers/organization/adapters/api_entreprise.js +3 -1
  24. package/dist/managers/organization/force-join-organization.d.ts +1 -1
  25. package/dist/managers/organization/force-join-organization.d.ts.map +1 -1
  26. package/dist/managers/organization/force-join-organization.js +3 -4
  27. package/dist/managers/user/assign-user-verification-type-to-domain.d.ts.map +1 -1
  28. package/dist/managers/user/assign-user-verification-type-to-domain.js +6 -6
  29. package/dist/repositories/organization/find-by-user-id.d.ts +1 -1
  30. package/dist/repositories/organization/get-users-by-organization.d.ts +1 -1
  31. package/dist/repositories/organization/link-user-to-organization.d.ts +1 -1
  32. package/dist/repositories/organization/upsert.d.ts.map +1 -1
  33. package/dist/repositories/organization/upsert.js +8 -3
  34. package/dist/repositories/user/update-user-organization-link.d.ts +1 -1
  35. package/dist/services/organization/index.d.ts +1 -0
  36. package/dist/services/organization/index.d.ts.map +1 -1
  37. package/dist/services/organization/index.js +1 -0
  38. package/dist/services/organization/is-entreprise-unipersonnelle.d.ts +3 -3
  39. package/dist/services/organization/is-entreprise-unipersonnelle.d.ts.map +1 -1
  40. package/dist/services/organization/is-entreprise-unipersonnelle.js +4 -4
  41. package/dist/services/organization/is-organization-covered-by-certification-dirigeant.d.ts +3 -0
  42. package/dist/services/organization/is-organization-covered-by-certification-dirigeant.d.ts.map +1 -0
  43. package/dist/services/organization/is-organization-covered-by-certification-dirigeant.js +2 -0
  44. package/dist/services/organization/is-public-service.d.ts.map +1 -1
  45. package/dist/services/organization/is-public-service.js +16 -6
  46. package/dist/services/organization/is-syndicat-communal.d.ts.map +1 -1
  47. package/dist/services/organization/is-syndicat-communal.js +1 -0
  48. package/dist/types/franceconnect.d.ts.map +1 -1
  49. package/dist/types/franceconnect.js +2 -2
  50. package/dist/types/{dirigeant.d.ts → identity-vector.d.ts} +2 -1
  51. package/dist/types/identity-vector.d.ts.map +1 -0
  52. package/dist/types/{dirigeant.js → identity-vector.js} +8 -0
  53. package/dist/types/index.d.ts +1 -1
  54. package/dist/types/index.d.ts.map +1 -1
  55. package/dist/types/index.js +1 -1
  56. package/dist/types/organization-info.d.ts +2 -1
  57. package/dist/types/organization-info.d.ts.map +1 -1
  58. package/dist/types/organization-info.js +1 -0
  59. package/dist/types/organization.d.ts +1 -0
  60. package/dist/types/organization.d.ts.map +1 -1
  61. package/dist/types/user-organization-link.d.ts +31 -24
  62. package/dist/types/user-organization-link.d.ts.map +1 -1
  63. package/dist/types/user-organization-link.js +15 -8
  64. package/package.json +2 -2
  65. package/src/data/certification/categories-juridiques-sources.ts +811 -0
  66. package/src/data/certification/index.ts +1 -0
  67. package/src/errors/index.ts +0 -21
  68. package/src/managers/certification/certification-score.test.ts +69 -33
  69. package/src/managers/certification/certification-score.ts +20 -9
  70. package/src/managers/certification/index.ts +1 -1
  71. package/src/managers/certification/{is-organization-dirigeant.test.ts → process-certification-dirigeant.test.ts} +62 -64
  72. package/src/managers/certification/{is-organization-dirigeant.ts → process-certification-dirigeant.ts} +115 -74
  73. package/src/managers/organization/adapters/api_entreprise.test.ts.snapshot +4 -0
  74. package/src/managers/organization/adapters/api_entreprise.ts +3 -0
  75. package/src/managers/organization/force-join-organization.ts +3 -6
  76. package/src/managers/organization/get-organization-info.test.ts.snapshot +3 -0
  77. package/src/managers/organization/mark-domain-as-verified.test.ts +1 -1
  78. package/src/managers/user/assign-user-verification-type-to-domain.ts +6 -6
  79. package/src/repositories/organization/find-by-id.test.ts +1 -0
  80. package/src/repositories/organization/find-by-user-id.test.ts.snapshot +3 -0
  81. package/src/repositories/organization/get-by-id.test.ts +1 -0
  82. package/src/repositories/organization/link-user-to-organization.test.ts +3 -2
  83. package/src/repositories/organization/link-user-to-organization.test.ts.snapshot +2 -2
  84. package/src/repositories/organization/upsert.ts +8 -1
  85. package/src/repositories/organization/upset.test.ts +2 -0
  86. package/src/services/organization/index.ts +1 -0
  87. package/src/services/organization/is-entreprise-unipersonnelle.ts +5 -5
  88. package/src/services/organization/is-organization-covered-by-certification-dirigeant.test.ts +43 -0
  89. package/src/services/organization/is-organization-covered-by-certification-dirigeant.ts +9 -0
  90. package/src/services/organization/is-public-service.test.ts +1 -1
  91. package/src/services/organization/is-public-service.ts +20 -7
  92. package/src/services/organization/is-syndicat-communal.ts +1 -0
  93. package/src/types/franceconnect.ts +6 -7
  94. package/src/types/{dirigeant.ts → identity-vector.ts} +9 -0
  95. package/src/types/index.ts +1 -1
  96. package/src/types/organization-info.ts +1 -0
  97. package/src/types/organization.ts +1 -0
  98. package/src/types/user-organization-link.ts +17 -11
  99. package/tsconfig.lib.tsbuildinfo +1 -1
  100. package/dist/managers/certification/is-organization-dirigeant.d.ts +0 -45
  101. package/dist/managers/certification/is-organization-dirigeant.d.ts.map +0 -1
  102. package/dist/managers/certification/is-organization-dirigeant.js +0 -97
  103. 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" | "no_validation_means_available" | "no_verification_means_for_entreprise_unipersonnelle" | "no_verification_means_for_small_association" | "official_contact_email" | "organization_dirigeant" | "proof_received" | "bypassed" | null;
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
- * These fonctions return approximate results. As the data tranche effectifs is
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 fonction.
6
+ * this function.
7
7
  */
8
- export declare function isEntrepriseUnipersonnelle({ cached_libelle_categorie_juridique, cached_tranche_effectifs, }: Pick<Organization, "cached_libelle_categorie_juridique" | "cached_tranche_effectifs">): boolean;
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,wBAAwB,GACzB,EAAE,IAAI,CACL,YAAY,EACZ,oCAAoC,GAAG,0BAA0B,CAClE,GAAG,OAAO,CAcV"}
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
- * These fonctions return approximate results. As the data tranche effectifs is
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 fonction.
6
+ * this function.
7
7
  */
8
- export function isEntrepriseUnipersonnelle({ cached_libelle_categorie_juridique, cached_tranche_effectifs, }) {
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(cached_tranche_effectifs);
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
  }
@@ -0,0 +1,3 @@
1
+ import type { Organization } from "#src/types";
2
+ export declare const isOrganizationCoveredByCertificationDirigeant: ({ cached_categorie_juridique, }: Organization) => boolean;
3
+ //# sourceMappingURL=is-organization-covered-by-certification-dirigeant.d.ts.map
@@ -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,OAoBjB,CAAC"}
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/f1e56ac476b0b1730115f7b1f0667e8509ee5379/workflows/data_pipelines/elasticsearch/data_enrichment.py#L155-L189
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 or has a public service legal nature code
15
- const cat_jur_ok = cached_categorie_juridique &&
16
- NATURE_JURIDIQUE_SERVICE_PUBLIC.includes(cached_categorie_juridique);
17
- const whitelist_ok = SERVICE_PUBLIC_WHITELIST.includes(siren);
18
- return cat_jur_ok || whitelist_ok;
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;AAU/C,eAAO,MAAM,kBAAkB,GAAI,yCAEhC,IAAI,CAAC,YAAY,EAAE,oCAAoC,CAAC,KAAG,OAK7D,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;;;;;;;;;;;;iBAOrC,CAAC;AACJ,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAC1C,OAAO,2BAA2B,CACnC,CAAC"}
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.merge(z.object({
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
- //# sourceMappingURL=dirigeant.d.ts.map
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
+ });
@@ -1,8 +1,8 @@
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
6
  export * from "./organization-info.js";
7
7
  export * from "./organization.js";
8
8
  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,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,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,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,WAAW,CAAC"}
@@ -1,9 +1,9 @@
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
7
  export * from "./organization-info.js";
8
8
  export * from "./organization.js";
9
9
  export * from "./user-organization-link.js";
@@ -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<"NN" | "00" | "01" | "02" | "03" | "11" | "12" | "21" | "22" | "31" | "32" | "41" | "42" | "51" | "52" | "53" | null, "NN" | "00" | "01" | "02" | "03" | "11" | "12" | "21" | "22" | "31" | "32" | "41" | "42" | "51" | "52" | "53" | null>>;
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;;;;;;;;;;;;;;;;;;;;;;;iBAuBjC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
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"}
@@ -15,6 +15,7 @@ export const OrganizationInfoSchema = z.object({
15
15
  libelleCategorieJuridique: z.string(),
16
16
  libelleTrancheEffectif: z.string(),
17
17
  nomComplet: z.string(),
18
+ siegeSocial: z.boolean(),
18
19
  siret: z.string(),
19
20
  statutDiffusion: z.enum([
20
21
  "diffusible",
@@ -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 UserOrganizationLinkVerificationTypeSchema: z.ZodEnum<{
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.ZodNullable<z.ZodEnum<{
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.ZodNullable<z.ZodEnum<{
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,21 +75,22 @@ 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
- verification_type: z.ZodNullable<z.ZodEnum<{
78
+ verification_type: z.ZodEnum<{
73
79
  code_sent_to_official_contact_email: "code_sent_to_official_contact_email";
74
80
  domain: "domain";
75
81
  imported_from_coop_mediation_numerique: "imported_from_coop_mediation_numerique";
76
82
  imported_from_inclusion_connect: "imported_from_inclusion_connect";
77
83
  in_liste_dirigeants_rna: "in_liste_dirigeants_rna";
78
84
  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
85
  official_contact_email: "official_contact_email";
83
- organization_dirigeant: "organization_dirigeant";
84
86
  proof_received: "proof_received";
85
87
  bypassed: "bypassed";
86
- }>>;
88
+ organization_dirigeant: "organization_dirigeant";
89
+ no_validation_means_available: "no_validation_means_available";
90
+ no_verification_means_for_entreprise_unipersonnelle: "no_verification_means_for_entreprise_unipersonnelle";
91
+ no_verification_means_for_small_association: "no_verification_means_for_small_association";
92
+ domain_not_verified_yet: "domain_not_verified_yet";
93
+ }>;
87
94
  organization_id: z.ZodNumber;
88
95
  is_external: z.ZodOptional<z.ZodBoolean>;
89
96
  needs_official_contact_email_verification: z.ZodOptional<z.ZodBoolean>;
@@ -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,0CAA0C;;;;;;;;;;;;;;EAerD,CAAC;AAEH,MAAM,MAAM,oCAAoC,GAAG,CAAC,CAAC,MAAM,CACzD,OAAO,0CAA0C,CAClD,CAAC;AAIF,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
+ {"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 UserOrganizationLinkVerificationTypeSchema = z.enum([
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: UserOrganizationLinkVerificationTypeSchema.nullable(),
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.2.0",
3
+ "version": "1.3.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.0.17"
49
+ "zod": "^4.3.5"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@electric-sql/pglite": "^0.3.12",