validation-br 2.0.0-next-11 → 2.0.0-next-13

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,3 +1,6 @@
1
+ import { PixKeys } from './pix-key';
2
+ import { CertidaoTipoLivro, CertidaoServico } from './certidao';
3
+ export { PixKeys, CertidaoTipoLivro, CertidaoServico };
1
4
  export declare function isCNH(value: string): boolean;
2
5
  export declare function isCNPJ(value: string): boolean;
3
6
  export declare function isCPF(value: string): boolean;
package/dist/cjs/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CertidaoServico = exports.CertidaoTipoLivro = exports.PixKeys = void 0;
3
4
  exports.isCNH = isCNH;
4
5
  exports.isCNPJ = isCNPJ;
5
6
  exports.isCPF = isCPF;
@@ -30,6 +31,7 @@ const renavam_1 = require("./renavam");
30
31
  const carplate_1 = require("./carplate");
31
32
  const phone_1 = require("./phone");
32
33
  const pix_key_1 = require("./pix-key");
34
+ Object.defineProperty(exports, "PixKeys", { enumerable: true, get: function () { return pix_key_1.PixKeys; } });
33
35
  const pix_copy_paste_1 = require("./pix-copy-paste");
34
36
  const judicial_process_1 = require("./judicial-process");
35
37
  const postal_track_code_1 = require("./postal-track-code");
@@ -40,6 +42,8 @@ const boleto_1 = require("./boleto");
40
42
  const caepf_1 = require("./caepf");
41
43
  const cep_1 = require("./cep");
42
44
  const certidao_1 = require("./certidao");
45
+ Object.defineProperty(exports, "CertidaoTipoLivro", { enumerable: true, get: function () { return certidao_1.CertidaoTipoLivro; } });
46
+ Object.defineProperty(exports, "CertidaoServico", { enumerable: true, get: function () { return certidao_1.CertidaoServico; } });
43
47
  const cbi_sinter_1 = require("./cbi_sinter");
44
48
  const uf_1 = require("./uf");
45
49
  function validate(fn) {
@@ -1,3 +1,6 @@
1
+ import { PixKeys } from './pix-key';
2
+ import { CertidaoTipoLivro, CertidaoServico } from './certidao';
3
+ export { PixKeys, CertidaoTipoLivro, CertidaoServico };
1
4
  export declare function isCNH(value: string): boolean;
2
5
  export declare function isCNPJ(value: string): boolean;
3
6
  export declare function isCPF(value: string): boolean;
package/dist/esm/index.js CHANGED
@@ -6,7 +6,7 @@ import { PIS } from './pis-pasep.js';
6
6
  import { Renavam } from './renavam.js';
7
7
  import { CarPlate } from './carplate.js';
8
8
  import { Phone } from './phone.js';
9
- import { PixKey } from './pix-key.js';
9
+ import { PixKey, PixKeys } from './pix-key.js';
10
10
  import { PixCopyPaste } from './pix-copy-paste.js';
11
11
  import { JudicialProcess } from './judicial-process.js';
12
12
  import { PostalTrackCode } from './postal-track-code.js';
@@ -16,9 +16,10 @@ import { Email } from './email.js';
16
16
  import { Boleto } from './boleto.js';
17
17
  import { CAEPF } from './caepf.js';
18
18
  import { CEP } from './cep.js';
19
- import { Certidao } from './certidao.js';
19
+ import { Certidao, CertidaoTipoLivro, CertidaoServico } from './certidao.js';
20
20
  import { CBISinter } from './cbi_sinter.js';
21
21
  import { UF } from './uf.js';
22
+ export { PixKeys, CertidaoTipoLivro, CertidaoServico };
22
23
  function validate(fn) {
23
24
  try {
24
25
  fn();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "validation-br",
3
3
  "description": "Brazilian personal documents validation - cpf, cnpj, titulo, pis/pasep, cnh, renavam, processos judiciais, protocolo federal, código de rastreamento dos correios",
4
- "version": "2.0.0-next-11",
4
+ "version": "2.0.0-next-13",
5
5
  "author": "Cláudio Medeiros <klawdyo@gmail.com>",
6
6
  "license": "MIT",
7
7
  "sideEffects": false,
@@ -29,9 +29,28 @@
29
29
  },
30
30
  "typesVersions": {
31
31
  "*": {
32
- "*": [
33
- "dist/cjs/*"
34
- ]
32
+ "base": ["dist/cjs/base.d.ts"],
33
+ "boleto": ["dist/cjs/boleto.d.ts"],
34
+ "caepf": ["dist/cjs/caepf.d.ts"],
35
+ "carplate": ["dist/cjs/carplate.d.ts"],
36
+ "cbi_sinter": ["dist/cjs/cbi_sinter.d.ts"],
37
+ "cep": ["dist/cjs/cep.d.ts"],
38
+ "certidao": ["dist/cjs/certidao.d.ts"],
39
+ "cnh": ["dist/cjs/cnh.d.ts"],
40
+ "cnpj": ["dist/cjs/cnpj.d.ts"],
41
+ "cpf": ["dist/cjs/cpf.d.ts"],
42
+ "email": ["dist/cjs/email.d.ts"],
43
+ "judicial-process": ["dist/cjs/judicial-process.d.ts"],
44
+ "nup17": ["dist/cjs/nup17.d.ts"],
45
+ "phone": ["dist/cjs/phone.d.ts"],
46
+ "pis-pasep": ["dist/cjs/pis-pasep.d.ts"],
47
+ "pix-copy-paste": ["dist/cjs/pix-copy-paste.d.ts"],
48
+ "pix-key": ["dist/cjs/pix-key.d.ts"],
49
+ "postal-track-code": ["dist/cjs/postal-track-code.d.ts"],
50
+ "renavam": ["dist/cjs/renavam.d.ts"],
51
+ "tituloEleitor": ["dist/cjs/tituloEleitor.d.ts"],
52
+ "uf": ["dist/cjs/uf.d.ts"],
53
+ "uuid": ["dist/cjs/uuid.d.ts"]
35
54
  }
36
55
  },
37
56
  "scripts": {
package/readme.md CHANGED
@@ -514,6 +514,14 @@ key.type // -> 'cpf'
514
514
  // Chave fake (aceita { type: 'cpf' | 'cnpj' | 'email' | 'phone' | 'evp' })
515
515
  PixKey.fake() // -> PixKey { value: '...' }
516
516
  PixKey.fake({ type: 'email' }).value // -> 'wqdbzdhkmp@hotmail.com'
517
+
518
+ // Enum com os tipos de chave Pix
519
+ import { PixKeys } from 'validation-br'
520
+ // ou
521
+ import { PixKeys } from 'validation-br/pix-key'
522
+
523
+ key.type === PixKeys.cpf // -> true
524
+ PixKey.fake({ type: PixKeys.email })
517
525
  ```
518
526
 
519
527
  ### isPixCopyPaste( `value` )
@@ -662,6 +670,13 @@ Certidao.fake() // -> Certidao { value: '...' }
662
670
 
663
671
  // Calcula o DV a partir dos 30 primeiros dígitos
664
672
  Certidao.checksum('827660015520261654035919727867') // -> '31'
673
+
674
+ // Enums com os tipos de livro e de serviço usados em Certidao.fake()
675
+ import { CertidaoTipoLivro, CertidaoServico } from 'validation-br'
676
+ // ou
677
+ import { CertidaoTipoLivro, CertidaoServico } from 'validation-br/certidao'
678
+
679
+ Certidao.fake({ tipoLivro: CertidaoTipoLivro.Nascimento, servico: CertidaoServico.RegistroCivilPessoasNaturais })
665
680
  ```
666
681
 
667
682
  ### isCBISinter( `value` )
@@ -817,14 +832,22 @@ UUID.fake() // -> UUID { value: '...' }
817
832
 
818
833
  Todos os testes passando com cobertura próxima de 100%.
819
834
 
820
- ![Testes passando](assets/1-test.png)![Cobertura de testes](assets/2-coverage.png)
835
+
836
+
837
+ <img width="800" alt="image" src="https://github.com/user-attachments/assets/0a458c8c-1c16-4e01-a98f-efa174dfec79" />
838
+
839
+ <img width="800" alt="image" src="https://github.com/user-attachments/assets/5e20f498-167e-4fb2-bb8b-1eb58afeb16c" />
840
+
841
+
842
+
821
843
 
822
844
 
823
845
  # Github Actions
824
846
 
825
847
  Github actions executados nas versões 18, 20, 22 e 24 do Node, buildando e validando os pacotes CommonJS e ESM em cada versão.
826
848
 
827
- ![Github actions executados nas versões 18, 20 e 22 e 24 do Node](assets/3-actions.png)
849
+
850
+ <img width="800" alt="image" src="https://github.com/user-attachments/assets/b4f89db9-33f2-435d-b563-ff694039c074" />
828
851
 
829
852
  # Changelog
830
853