pwi-plata-type 0.3.5 → 0.3.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.
package/libs/model.ts CHANGED
@@ -442,7 +442,7 @@ export function Telefone(): ModelValicacaoPrimitivo {
442
442
  }
443
443
  }
444
444
 
445
- if (v[0].length !== 2 || v[1].length > 9) {
445
+ if (v[0].length !== 2 || (v[1].length !== 8 && v[1].length !== 9)) {
446
446
  return {
447
447
  error: {
448
448
  errorID: "BPVTEL002",
@@ -481,7 +481,7 @@ export function TelefoneDDI(): ModelValicacaoPrimitivo {
481
481
  }
482
482
  }
483
483
 
484
- if (telefone[0].length !== 2 || telefone[1].length > 9) {
484
+ if (telefone[0].length !== 2 || (telefone[1].length !== 8 && telefone[1].length !== 9)) {
485
485
  return {
486
486
  error: {
487
487
  errorID: "BPVTELD002",
package/libs/routes.ts CHANGED
@@ -239,7 +239,7 @@ export async function loadExpressRoutes(): Promise<PlataRequiredRoute[]> {
239
239
  export async function buildExpressRouter(): Promise<_Router> {
240
240
  const router = Router() as _Router
241
241
  router._routes = []
242
- router.use(express.json())
242
+ router.use(express.json({ limit: process.env._PLATA_API_JSON_SIZE ?? '100kb' }))
243
243
 
244
244
  const routes = await loadExpressRoutes()
245
245
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pwi-plata-type",
3
- "version": "0.3.5",
3
+ "version": "0.3.6",
4
4
  "main": "index.ts",
5
5
  "bin": {
6
6
  "plata": "bin/plata.ts",
@@ -7,4 +7,5 @@ ENV=debug
7
7
  PORT=3050
8
8
  _PLATA_API_ROOT=/api
9
9
  _PLATA_API_SSL_KEY=
10
- _PLATA_API_SSL_CERT=
10
+ _PLATA_API_SSL_CERT=
11
+ _PLATA_API_JSON_SIZE=100kb
@@ -8,4 +8,5 @@ ENV=homolog
8
8
  PORT=3050
9
9
  _PLATA_API_ROOT=/api
10
10
  _PLATA_API_SSL_KEY=
11
- _PLATA_API_SSL_CERT=
11
+ _PLATA_API_SSL_CERT=
12
+ _PLATA_API_JSON_SIZE=100kb
@@ -8,4 +8,5 @@ ENV=prod
8
8
  PORT=3050
9
9
  _PLATA_API_ROOT=/api
10
10
  _PLATA_API_SSL_KEY=
11
- _PLATA_API_SSL_CERT=
11
+ _PLATA_API_SSL_CERT=
12
+ _PLATA_API_JSON_SIZE=100kb