|
| 1 | +# 🔐 @proconnect-gouv/proconnect.identite |
| 2 | + |
| 3 | +> Core identity management logic for ProConnect |
| 4 | +
|
| 5 | +## ⚙️ Installation |
| 6 | + |
| 7 | +```bash |
| 8 | +npm install @proconnect-gouv/proconnect.identite |
| 9 | +``` |
| 10 | + |
| 11 | +## 📖 Usage |
| 12 | + |
| 13 | +### Managers |
| 14 | + |
| 15 | +High-level business logic for certification, FranceConnect integration, organization, and user management. |
| 16 | + |
| 17 | +```typescript |
| 18 | +import { isOrganizationDirigeant } from "@proconnect-gouv/proconnect.identite/managers/certification"; |
| 19 | +import { getOrganizationInfo } from "@proconnect-gouv/proconnect.identite/managers/organization"; |
| 20 | +import { assignUserVerificationTypeToDomain } from "@proconnect-gouv/proconnect.identite/managers/user"; |
| 21 | +``` |
| 22 | + |
| 23 | +### Repositories |
| 24 | + |
| 25 | +Data access layer for email domains, organizations, and users. |
| 26 | + |
| 27 | +```typescript |
| 28 | +import { |
| 29 | + findByEmail, |
| 30 | + findById, |
| 31 | + getByIdFactory, |
| 32 | +} from "@proconnect-gouv/proconnect.identite/repositories/user"; |
| 33 | +import { |
| 34 | + findByUserId, |
| 35 | + linkUserToOrganization, |
| 36 | +} from "@proconnect-gouv/proconnect.identite/repositories/organization"; |
| 37 | +import { addDomain } from "@proconnect-gouv/proconnect.identite/repositories/email-domain"; |
| 38 | +``` |
| 39 | + |
| 40 | +### Services |
| 41 | + |
| 42 | +Stateless business logic for organization validation and PostgreSQL utilities. |
| 43 | + |
| 44 | +```typescript |
| 45 | +import { |
| 46 | + isEntrepriseUnipersonnelle, |
| 47 | + isPublicService, |
| 48 | +} from "@proconnect-gouv/proconnect.identite/services/organization"; |
| 49 | +import { hashToPostgresParams } from "@proconnect-gouv/proconnect.identite/services/postgres"; |
| 50 | +``` |
| 51 | + |
| 52 | +### Mappers |
| 53 | + |
| 54 | +Data transformation utilities for certification and organization data. |
| 55 | + |
| 56 | +```typescript |
| 57 | +import { fromSiret } from "@proconnect-gouv/proconnect.identite/mappers/organization"; |
| 58 | +``` |
| 59 | + |
| 60 | +### Types |
| 61 | + |
| 62 | +TypeScript type definitions for users, organizations, claims, and more. |
| 63 | + |
| 64 | +```typescript |
| 65 | +import type { |
| 66 | + User, |
| 67 | + Organization, |
| 68 | + UserOrganizationLink, |
| 69 | + EmailDomain, |
| 70 | + FranceConnectUserInfo, |
| 71 | +} from "@proconnect-gouv/proconnect.identite/types"; |
| 72 | +``` |
| 73 | + |
| 74 | +### Data |
| 75 | + |
| 76 | +Raw data arrays for organization domain whitelists. |
| 77 | + |
| 78 | +```typescript |
| 79 | +import { domainsWhitelist } from "@proconnect-gouv/proconnect.identite/data/organization"; |
| 80 | +``` |
| 81 | + |
| 82 | +### Errors |
| 83 | + |
| 84 | +Custom error types for identity management operations. |
| 85 | + |
| 86 | +```typescript |
| 87 | +import { |
| 88 | + InvalidCertificationError, |
| 89 | + InvalidSiretError, |
| 90 | + NotFoundError, |
| 91 | + OrganizationNotActiveError, |
| 92 | + OrganizationNotFoundError, |
| 93 | + UserNotFoundError, |
| 94 | + ModerationNotFoundError, |
| 95 | +} from "@proconnect-gouv/proconnect.identite/errors"; |
| 96 | +``` |
| 97 | + |
| 98 | +## 📊 Available Exports |
| 99 | + |
| 100 | +- **`/managers/certification`** - Organization certification and dirigeant validation |
| 101 | +- **`/managers/franceconnect`** - FranceConnect OIDC client integration |
| 102 | +- **`/managers/organization`** - Organization business logic |
| 103 | +- **`/managers/user`** - User business logic |
| 104 | +- **`/repositories/email-domain`** - Email domain data access |
| 105 | +- **`/repositories/organization`** - Organization data access |
| 106 | +- **`/repositories/user`** - User data access |
| 107 | +- **`/services/organization`** - Organization validation utilities |
| 108 | +- **`/services/postgres`** - PostgreSQL query utilities |
| 109 | +- **`/mappers/certification`** - Certification data transformation |
| 110 | +- **`/mappers/organization`** - Organization data transformation |
| 111 | +- **`/types`** - TypeScript type definitions |
| 112 | +- **`/data/organization`** - Organization reference data |
| 113 | +- **`/errors`** - Custom error types |
| 114 | + |
| 115 | +## 📖 License |
| 116 | + |
| 117 | +[MIT](./LICENSE) |
0 commit comments