najm-auth 4.0.5 → 4.0.6

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.
@@ -1 +1 @@
1
- export { M as MOROCCAN_CIN_TEMPORARY_CREDENTIAL_KIND, e as TemporaryCredential, T as TemporaryCredentialInput, i as isMoroccanCin, m as moroccanCinTemporaryCredential, j as moroccoIdentityPreset, n as normalizeMoroccanCin, k as normalizeMoroccanPhone } from '../ma-sNHnUGLO.js';
1
+ export { M as MOROCCAN_CIN_TEMPORARY_CREDENTIAL_KIND, e as TemporaryCredential, T as TemporaryCredentialInput, i as isMoroccanCin, m as moroccanCinTemporaryCredential, j as moroccoIdentityPreset, n as normalizeMoroccanCin, k as normalizeMoroccanPhone } from '../ma-Cu6xUMez.js';
@@ -31,7 +31,7 @@ var MOROCCAN_CIN_TEMPORARY_CREDENTIAL_KIND = "ma-cin";
31
31
  var MOROCCAN_CIN = /^[a-z]{1,3}\d{5,17}$/i;
32
32
  function isMoroccanCin(value) {
33
33
  const trimmed = value.trim();
34
- return trimmed.length >= 8 && trimmed.length <= 20 && MOROCCAN_CIN.test(trimmed);
34
+ return trimmed.length >= 7 && trimmed.length <= 20 && MOROCCAN_CIN.test(trimmed);
35
35
  }
36
36
  __name(isMoroccanCin, "isMoroccanCin");
37
37
  function normalizeMoroccanCin(value) {
package/dist/index.d.ts CHANGED
@@ -4,8 +4,8 @@ import { ValidationPluginConfig } from 'najm-validation';
4
4
  import { RateLimitPluginConfig, RateLimitKeyContext, TimeWindow } from 'najm-rate';
5
5
  import { CachePluginConfig, CacheService } from 'najm-cache';
6
6
  import { EmailPluginConfig, EmailService } from 'najm-email';
7
- import { R as ResolvedIdentityConfig, I as IdentityConfig, T as TemporaryCredentialInput } from './ma-sNHnUGLO.js';
8
- export { D as DEFAULT_IDENTITY_PRESET, E as EXACT_TEMPORARY_CREDENTIAL_KIND, a as IDENTITY_PRESETS, b as IdentityNormalizer, c as IdentityPreset, d as IdentityPresetName, M as MOROCCAN_CIN_TEMPORARY_CREDENTIAL_KIND, e as TemporaryCredential, f as TemporaryCredentialKind, g as compactPhone, i as isMoroccanCin, h as isTemporaryCredentialKind, m as moroccanCinTemporaryCredential, j as moroccoIdentityPreset, n as normalizeMoroccanCin, k as normalizeMoroccanPhone, l as normalizeTunisianPhone, r as resolveTemporaryCredentialKind, t as toTemporaryCredential, o as tunisiaIdentityPreset } from './ma-sNHnUGLO.js';
7
+ import { R as ResolvedIdentityConfig, I as IdentityConfig, T as TemporaryCredentialInput } from './ma-Cu6xUMez.js';
8
+ export { D as DEFAULT_IDENTITY_PRESET, E as EXACT_TEMPORARY_CREDENTIAL_KIND, a as IDENTITY_PRESETS, b as IdentityNormalizer, c as IdentityPreset, d as IdentityPresetName, M as MOROCCAN_CIN_TEMPORARY_CREDENTIAL_KIND, e as TemporaryCredential, f as TemporaryCredentialKind, g as compactPhone, i as isMoroccanCin, h as isTemporaryCredentialKind, m as moroccanCinTemporaryCredential, j as moroccoIdentityPreset, n as normalizeMoroccanCin, k as normalizeMoroccanPhone, l as normalizeTunisianPhone, r as resolveTemporaryCredentialKind, t as toTemporaryCredential, o as tunisiaIdentityPreset } from './ma-Cu6xUMez.js';
9
9
  import { ZodType, z } from 'zod';
10
10
  import { I18nService } from 'najm-i18n';
11
11
  import { TDb, SeedEntry } from 'najm-database';
package/dist/index.js CHANGED
@@ -2813,7 +2813,7 @@ var MOROCCAN_CIN_TEMPORARY_CREDENTIAL_KIND = "ma-cin";
2813
2813
  var MOROCCAN_CIN = /^[a-z]{1,3}\d{5,17}$/i;
2814
2814
  function isMoroccanCin(value) {
2815
2815
  const trimmed = value.trim();
2816
- return trimmed.length >= 8 && trimmed.length <= 20 && MOROCCAN_CIN.test(trimmed);
2816
+ return trimmed.length >= 7 && trimmed.length <= 20 && MOROCCAN_CIN.test(trimmed);
2817
2817
  }
2818
2818
  __name(isMoroccanCin, "isMoroccanCin");
2819
2819
  function normalizeMoroccanCin(value) {
@@ -66,7 +66,12 @@ interface TemporaryCredentialKind {
66
66
  /** Default kind: byte-for-byte, case-sensitive, no transformation. */
67
67
  declare const EXACT_TEMPORARY_CREDENTIAL_KIND = "exact";
68
68
  declare const MOROCCAN_CIN_TEMPORARY_CREDENTIAL_KIND = "ma-cin";
69
- /** A Moroccan CIN is 1–3 letters followed by digits, 8–20 characters overall. */
69
+ /**
70
+ * A Moroccan CIN is 1–3 letters followed by digits, 7–20 characters overall.
71
+ * The floor is 7, not 8: the issued formats are one or two letters followed
72
+ * by five or six digits, so `BB46123` and `A123456` are real cards that an
73
+ * 8 floor turned away.
74
+ */
70
75
  declare function isMoroccanCin(value: string): boolean;
71
76
  /**
72
77
  * People type their CIN in either case. Anything that is not a CIN is left
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "najm-auth",
3
- "version": "4.0.5",
3
+ "version": "4.0.6",
4
4
  "description": "Authentication and authorization library for najm framework",
5
5
  "type": "module",
6
6
  "files": [