diff --git a/dist-back/consulta.js b/dist-back/consulta.js index 5f4c424..32efd58 100644 --- a/dist-back/consulta.js +++ b/dist-back/consulta.js @@ -44,9 +44,21 @@ var operadores = /* @__PURE__ */ ((operadores2) => { operadores2["like"] = "like"; operadores2["in"] = "in"; operadores2["isNull"] = "isNull"; + operadores2["notIn"] = "notIn"; return operadores2; })(operadores || {}); -const zOperadores = import_zod.default.enum(["=", "!=", ">", ">=", "<", "<=", "like", "in", "isNull"]); +const zOperadores = import_zod.default.enum([ + "=", + "!=", + ">", + ">=", + "<", + "<=", + "like", + "in", + "isNull", + "notIn" +]); const zFiltro = import_zod.default.object({ coluna: import_zod.default.string(), valor: import_zod.default.any(), diff --git a/dist-front/index.d.mts b/dist-front/index.d.mts index 70c0eac..33dc188 100644 --- a/dist-front/index.d.mts +++ b/dist-front/index.d.mts @@ -78,7 +78,8 @@ declare enum operadores { "<=" = "<=", like = "like", in = "in", - isNull = "isNull" + isNull = "isNull", + notIn = "notIn" } type tipoFiltro = { coluna: string; @@ -106,6 +107,7 @@ declare const zOperadores: z.ZodEnum<{ like: "like"; in: "in"; isNull: "isNull"; + notIn: "notIn"; }>; declare const zFiltro: z.ZodObject<{ coluna: z.ZodString; @@ -120,6 +122,7 @@ declare const zFiltro: z.ZodObject<{ like: "like"; in: "in"; isNull: "isNull"; + notIn: "notIn"; }>; ou: z.ZodOptional; }, z.core.$strip>; @@ -688,8 +691,8 @@ declare const zDocumento: z.ZodUnion<[z.ZodString, z.ZodString]>; * - `1.000,1` → milhar com ponto + vírgula decimal (BR) * - `R$ 10,01` → prefixo monetário legado */ -declare const zNumero: z.ZodPipe, z.ZodNumber>; -declare const zNumeroPositivo: z.ZodPipe, z.ZodNumber>; -declare const zNumeroInteiro: z.ZodPipe, z.ZodNumber>; +declare const zNumero: z.ZodPreprocess; +declare const zNumeroPositivo: z.ZodPreprocess; +declare const zNumeroInteiro: z.ZodPreprocess; export { type ArquivamentoLog, type ELogger, type EntradaLog, NivelLog, NivelLogDetalhes, type OpoesELogger, Produtos, TipagemRotas, type TipoPayloadAuditoria, aleatorio, cacheM, cacheMFixo, cacheMemoria, camposComuns, criarFiltroDelta, defineDayjsBr, erUuid, esperar, extensoes, iniciarDayjsBr, iniciarELog, iniciarFiltroDelta, type interfaceConsulta, link_paiol, localValor, nomeVariavel, objetoPg, operadorFiltroDeltaDetalhes, operadores, paraObjetoRegistroPg, pgObjeto, siglas_unidades_medida, texto_busca, tipoArquivo, type tipoColunaFiltroDelta, type tipoCondicaoFiltroDelta, type tipoCondicaoFiltroDeltaTipado, type tipoFiltro, type tipoFiltroDelta, type tipoFiltroDeltaColunaTipada, type tipoOperadorFiltroDelta, tipoUsuarioResiduos, tiposSituacoesElicencie, tx, umaFuncao, umaVariavel, unidades_medida, uuid, uuidV3, uuidV4, uuid_null, validarUuid, verCacheM, zColunaFiltroDelta, zCondicaoFiltroDelta, zCoordenadas, zDocCnpj, zDocCpf, zDocumento, zFiltro, zFiltroDelta, zNumero, zNumeroInteiro, zNumeroPositivo, zOperadorFiltroDelta, zOperadores }; diff --git a/dist-front/index.mjs b/dist-front/index.mjs index 4a18f73..3b46c4c 100644 --- a/dist-front/index.mjs +++ b/dist-front/index.mjs @@ -1 +1 @@ -var c="ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),E=o=>`eli-${Array.from({length:o||8}).map(()=>c[(999*Math.random()|0)%c.length]).join("")}`;var g={};globalThis.cacheMemoria_cache=g;var x=(o,e,a)=>{let n=typeof o=="string"?o:typeof o=="number"?String(o):encodeURIComponent(JSON.stringify(o)),r=a&&new Date().getTime()+a*1e3;e!==void 0&&(g[n]={valor:e,validade:r});let i=g[n];if(!(i?.validade&&i.validadeg,ro=x,to=o=>e=>x(o,e);var no="00000000-0000-0000-0000-000000000000",h=(d=>(d.codigo="codigo",d.excluido="excluido",d.data_hora_criacao="data_hora_criacao",d.data_hora_atualizacao="data_hora_atualizacao",d.codigo_usuario_criacao="codigo_usuario_criacao",d.codigo_usuario_atualizacao="codigo_usuario_atualizacao",d.versao="versao",d))(h||{}),A=(e=>(e.token="token",e))(A||{}),T=(a=>(a.Usuario="usuario",a.Fornecedor="fornecedor",a))(T||{});import s from"zod";var N=(n=>(n["="]="=",n["!="]="!=",n[">"]=">",n[">="]=">=",n["<"]="<",n["<="]="<=",n.like="like",n.in="in",n.isNull="isNull",n))(N||{}),z=s.enum(["=","!=",">",">=","<","<=","like","in","isNull"]),lo=s.object({coluna:s.string(),valor:s.any(),operador:z,ou:s.boolean().optional()});var w=({dayjs:o,duration:e,isSameOrAfter:a,isSameOrBefore:n,minMax:r,relativeTime:i,timezone:m,utc:d,weekOfYear:O})=>(o.extend(d),o.extend(m),o.extend(O),o.extend(n),o.extend(a),o.extend(r),o.extend(i),o.extend(e),o.locale("pt-br"),o),so=w;var go="https://paiol.idz.one";var C=(m=>(m.RASTREAMENTO="RASTREAMENTO",m.DEPURACAO="DEPURACAO",m.INFORMACAO="INFORMACAO",m.AVISO="AVISO",m.ERRO="ERRO",m.CRITICO="CRITICO",m))(C||{}),v={RASTREAMENTO:{peso:1,rotulo:"Rastreamento",emoji:"\u{1F50D}",metodo:"debug"},DEPURACAO:{peso:2,rotulo:"Depura\xE7\xE3o",emoji:"\u{1F41B}",metodo:"debug"},INFORMACAO:{peso:3,rotulo:"Informa\xE7\xE3o",emoji:"\u2139\uFE0F",metodo:"info"},AVISO:{peso:4,rotulo:"Aviso",emoji:"\u26A0\uFE0F",metodo:"warn"},ERRO:{peso:5,rotulo:"Erro",emoji:"\u274C",metodo:"error"},CRITICO:{peso:6,rotulo:"Cr\xEDtico",emoji:"\u{1F525}",metodo:"error"}},D=o=>{let e=o.nivelMinimo??"INFORMACAO",a=v[e].peso,n=(r,i)=>{let m=v[r];if(m.peson("RASTREAMENTO",r),depuracao:r=>n("DEPURACAO",r),info:r=>n("INFORMACAO",r),aviso:r=>n("AVISO",r),erro:r=>n("ERRO",r),critico:r=>n("CRITICO",r)}},vo=D({app:"testando",nivelMinimo:"INFORMACAO",arquivamento:()=>{}});var j=[{ext:"gif",tipo:"imagem",mime:"image/gif"},{ext:"jpg",tipo:"imagem",mime:"image/jpeg"},{ext:"jpeg",tipo:"imagem",mime:"image/jpeg"},{ext:"png",tipo:"imagem",mime:"image/png"},{ext:"bmp",tipo:"imagem",mime:"image/bmp"},{ext:"webp",tipo:"imagem",mime:"image/webp"},{ext:"tiff",tipo:"imagem",mime:"image/tiff"},{ext:"svg",tipo:"imagem",mime:"image/svg+xml"},{ext:"ico",tipo:"imagem",mime:"image/x-icon"},{ext:"pdf",tipo:"documento",mime:"application/pdf"},{ext:"doc",tipo:"documento",mime:"application/msword"},{ext:"docx",tipo:"documento",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"},{ext:"xls",tipo:"documento",mime:"application/vnd.ms-excel"},{ext:"xlsx",tipo:"documento",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},{ext:"ppt",tipo:"documento",mime:"application/vnd.ms-powerpoint"},{ext:"pptx",tipo:"documento",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"},{ext:"txt",tipo:"documento",mime:"text/plain"},{ext:"odt",tipo:"documento",mime:"application/vnd.oasis.opendocument.text"},{ext:"ods",tipo:"documento",mime:"application/vnd.oasis.opendocument.spreadsheet"},{ext:"rtf",tipo:"documento",mime:"application/rtf"},{ext:"csv",tipo:"documento",mime:"text/csv"},{ext:"mp4",tipo:"v\xEDdeo",mime:"video/mp4"},{ext:"avi",tipo:"v\xEDdeo",mime:"video/x-msvideo"},{ext:"mkv",tipo:"v\xEDdeo",mime:"video/x-matroska"},{ext:"mov",tipo:"v\xEDdeo",mime:"video/quicktime"},{ext:"wmv",tipo:"v\xEDdeo",mime:"video/x-ms-wmv"},{ext:"flv",tipo:"v\xEDdeo",mime:"video/x-flv"},{ext:"webm",tipo:"v\xEDdeo",mime:"video/webm"},{ext:"3gp",tipo:"v\xEDdeo",mime:"video/3gpp"},{ext:"mpeg",tipo:"v\xEDdeo",mime:"video/mpeg"}],_o=o=>{let e=String(o||"").toLocaleLowerCase().split(".").pop();return j.find(n=>n.ext===e)?.tipo||"outros"};import l from"zod";var F=l.enum([">","<",">=","<=","=","!=","in","like","\u2229"]),ho={">":{rotulo:"Maior que",descricao:"O valor de A deve ser maior que o valor de B"},"<":{rotulo:"Menor que",descricao:"O valor de A deve ser menor que o valor de B"},">=":{rotulo:"Maior ou igual a",descricao:"O valor de A deve ser maior ou igual ao valor de B"},"<=":{rotulo:"Menor ou igual a",descricao:"O valor de A deve ser menor ou igual ao valor de B"},"=":{rotulo:"Igual a",descricao:"O valor de A deve ser igual ao valor de B"},"!=":{rotulo:"Diferente de",descricao:"O valor de A deve ser diferente do valor de B"},in:{rotulo:"Est\xE1 em",descricao:"O valor de A deve estar presente na cole\xE7\xE3o ou lista definida em B"},like:{rotulo:"Cont\xE9m",descricao:"O valor de A deve conter o texto informado em B"},"\u2229":{rotulo:"Interse\xE7\xE3o",descricao:"A e B devem possuir pelo menos um elemento em comum"}},k=/^\{[\w:]+\}$/,R=/^\w+(\.\w+)*$/,L=l.string().regex(R,"Coluna inv\xE1lida").describe("nome da coluna ou caminho aninhado do jsonb"),M=l.object({id:l.string().describe("id da condi\xE7\xE3o do filtro").regex(k,"O id deve seguir o formato {identificador}"),coluna:L,operador:F,valor:l.any().describe("valor de compara\xE7\xE3o")}),I=o=>{let a=(o.match(/\{[\w:]+\}|\bNAO\b|\bE\b|\bOU\b|\(|\)/g)||[]).join(""),n=o.replace(/\s+/g,""),r=a.replace(/\s+/g,"");if(n!==r)return!1;let i=o.replace(/\{[\w:]+\}/g,"true").replace(/\bNAO\b/g,"!").replace(/\bE\b/g,"&&").replace(/\bOU\b/g,"||");try{return new Function(`return (${i})`)(),!0}catch{return!1}},X=l.object({condicoes:l.array(M),formula:l.string().refine(I,{message:"F\xF3rmula inv\xE1lida. Use apenas refer\xEAncias de condi\xE7\xF5es {id} ou {id:sufixo}, operadores E/OU/NAO e par\xEAnteses."})}).superRefine((o,e)=>{let a=new Set(o.condicoes.map(r=>r.id)),n=o.formula.match(/\{[\w:]+\}/g)||[];for(let r of n)a.has(r)||e.addIssue({code:"custom",path:["formula"],message:`A refer\xEAncia ${r} n\xE3o existe em condicoes.`})}),q=o=>X.parse(o),Ao=()=>({criarFiltroDelta:q});var No=(o,e)=>{let a="localStorage"in globalThis?globalThis.localStorage:void 0;if(typeof a>"u")return null;let n=typeof o=="string"?o:encodeURIComponent(JSON.stringify(o));try{e!==void 0&&a.setItem(n,JSON.stringify(e));let r=a.getItem(n);if(r===null)return null;try{return JSON.parse(r)}catch{return r}}catch{return null}};var y=o=>{try{return Object.fromEntries(Object.entries(o).map(([e,a])=>[e,a===void 0||a==null||typeof a=="string"||typeof a=="number"||typeof a=="boolean"?a:JSON.stringify(a,null,2)]))}catch(e){throw new Error(`Erro na fun\xE7\xE3o paraObjetoRegistroPg: ${e.message} ${e.stack}`)}},wo=y,Co=y;var P=(o=>(o["e-licencie"]="e-licencie",o["gov.e-licencie"]="gov.e-licencie",o))(P||{});var U=(t=>(t.modelo="000_modelo",t.vencida="100_vencida",t.expirado="200_expirado",t.alerta="300_alerta",t.protocoladafora="350_protocoladafora",t.protocolada="400_protocolada",t.protocoladaApenas="430_protocolada",t.protocolada_alteracao="450_protocolada",t.prazo="500_prazo",t.emitida="515_emitida",t.valida="518_valida",t.novo="520_novo",t.recebido="521_recebido",t.em_andamento="530_em_andamento",t.aguardando="530_aguardando",t.aguardandoresposta="540_aguardandoresposta",t.suspensaotemporaria="540_suspensaotemporaria",t.cancelada="550_cancelada",t.execucao="560_execucao",t.pendente="570_pendente",t.executadafora="600_executadafora",t.executada="700_executada",t.naoexecutada="701_naoexecutada",t.concluida="730_concluida",t.respondido_negado="740_respondido_negado",t.respondido_aceito="741_respondido_aceito",t.atendidoparcial="742_atendidoparcial",t.naoatendido="743_naoatendido",t.atendido="744_atendido",t.renovada="760_renovada",t.finalizada="800_finalizada",t.emitirnota="101_emitirnota",t.faturaatrasada="301_faturaatrasada",t.pagarfatura="302_pagarfatura",t.aguardandoconfirmacao="531_aguardandoconfirmacao",t.agendado="701_agendado",t.faturapaga="801_faturapaga",t.excluida="999_excluida",t.requerida="401_requerida",t.vigente="516_vigente",t.emrenovacao="402_emrenovacao",t.arquivada="801_arquivada",t.aguardando_sincronizacao="999_aguardando_sincronizacao",t.nao_conforme="710_nao_conforme",t.conforme="720_conforme",t.nao_aplicavel="730_nao_aplicavel",t.parcial="715_parcial",t))(U||{});var ko=()=>"Ol\xE1 Mundo! (fun\xE7\xE3o)";var Lo="Ol\xE1 Mundo! (vari\xE1vel)";var Po=(...o)=>o.map(e=>e==null?"":String(e).normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g," ").toLowerCase()).join(" ");var _=class{constructor({caminho:e,acaoIr:a,rotulo:n}){this._partesCaminho=[];this._acaoIr=a,this._partesCaminho=(Array.isArray(e)?e:[e]).filter(Boolean).map(r=>String(r)).flatMap(r=>r.split("/")).filter(Boolean),this.rotulo=n}get caminho(){return`/${this._partesCaminho.join("/")}`}set caminho(e){this._partesCaminho=e.split("/").filter(a=>a)}endereco(e,a){let n=typeof globalThis<"u"&&globalThis.window||void 0,r=new URL(n?n.location.href:"http://localhost");r.pathname=this.caminho,r.search="";let i=Object.entries(e);for(let[m,d]of i)r.searchParams.set(String(m),JSON.stringify(d));return r.hash="",a&&(r.hash=`#${r.search}`,r.search=""),r.href}ir(e){if(this._acaoIr)this._acaoIr(this.endereco({...e}));else{let a=typeof globalThis<"u"&&globalThis.window||void 0;a&&(a.location.href=this.endereco({...e}))}}parametros(e){let a=e?new URL(e):new URL(typeof globalThis<"u"&&globalThis.window?globalThis.window.location.href:"http://localhost"),n=a.searchParams,r=Object.fromEntries(n.entries()),i=a.hash;if(i){let m=Object.fromEntries(new URLSearchParams(i.slice(1)).entries());r={...r,...m}}for(let m in r)try{r[m]=JSON.parse(r[m])}catch{console.log(`[${m}|${r[m]}] n\xE3o \xE9 um json v\xE1lido.`)}return r}};var $=(i=>(i.UN="UN",i.KG="KG",i.TON="TON",i.g="g",i["M\xB3"]="M\xB3",i.Lt="Lt",i))($||{}),Bo=[{sigla_unidade:"KG",nome:"Quilograma",sigla_normalizada:"KG",normalizar:o=>o,tipo:"massa"},{sigla_unidade:"g",nome:"Grama",sigla_normalizada:"KG",normalizar:o=>o/1e3,tipo:"massa"},{sigla_unidade:"TON",nome:"Tonelada",sigla_normalizada:"KG",normalizar:o=>o*1e3,tipo:"massa"},{sigla_unidade:"Lt",nome:"Litro",sigla_normalizada:"Lt",normalizar:o=>o,tipo:"volume"},{sigla_unidade:"M\xB3",nome:"Metro C\xFAbico",sigla_normalizada:"Lt",normalizar:o=>o*1e3,tipo:"volume"},{sigla_unidade:"UN",nome:"Unidade",sigla_normalizada:"UN",normalizar:o=>o,tipo:"unidade"}];import{NIL as B,v3 as J,v4 as V}from"uuid";var G=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,Go=o=>G.test(String(o||"")),K=(o,e)=>J(typeof o=="string"?o:typeof o=="number"?String(o):JSON.stringify(o),e?K(e):B),Y=V,Ko=Y;var Zo=o=>new Promise(e=>setTimeout(()=>e(!0),o)),Qo=o=>Object.keys(o).join("/");import u from"zod";var So=u.object({formato:u.literal("decimal").default("decimal"),datum:u.literal("EPSG:4326").default("EPSG:4326"),latitude:u.number(),longitude:u.number()});import b from"zod";var Z=/^\d{2}\.\d{3}\.\d{3}\/\d{4}-\d{2}$/,Q=/^[A-Z0-9]{2}\.[A-Z0-9]{3}\.[A-Z0-9]{3}\/[A-Z0-9]{4}-\d{2}$/i,H=Number(new Date().toISOString().slice(0,7).replace("-","")),W=b.string().regex(H<202407?Z:Q).describe("Documento (CNPJ) no formato XX.XXX.XXX/XXXX-XX"),S=b.string().regex(/^\d{3}\.\d{3}\.\d{3}-\d{2}$/).describe("Documento (CPF) no formato XXX.XXX.XXX-XX"),ee=S.or(W).describe("CPF ou CNPJ");import p from"zod";var f=o=>{if(typeof o=="number"||typeof o!="string")return o;let e=o;return e.includes(",")&&(e=e.replace(/\./g,"").replace(",",".")),e=e.replace(/[^0-9.]/g,""),e==""?null:Number(e)},ae=p.preprocess(f,p.number()),ne=p.preprocess(f,p.number().positive()),ie=p.preprocess(f,p.number().int());export{C as NivelLog,v as NivelLogDetalhes,P as Produtos,_ as TipagemRotas,E as aleatorio,x as cacheM,to as cacheMFixo,ro as cacheMemoria,h as camposComuns,q as criarFiltroDelta,so as defineDayjsBr,G as erUuid,Zo as esperar,j as extensoes,w as iniciarDayjsBr,D as iniciarELog,Ao as iniciarFiltroDelta,go as link_paiol,No as localValor,Qo as nomeVariavel,Co as objetoPg,ho as operadorFiltroDeltaDetalhes,N as operadores,y as paraObjetoRegistroPg,wo as pgObjeto,$ as siglas_unidades_medida,Po as texto_busca,_o as tipoArquivo,T as tipoUsuarioResiduos,U as tiposSituacoesElicencie,A as tx,ko as umaFuncao,Lo as umaVariavel,Bo as unidades_medida,Ko as uuid,K as uuidV3,Y as uuidV4,no as uuid_null,Go as validarUuid,eo as verCacheM,L as zColunaFiltroDelta,M as zCondicaoFiltroDelta,So as zCoordenadas,W as zDocCnpj,S as zDocCpf,ee as zDocumento,lo as zFiltro,X as zFiltroDelta,ae as zNumero,ie as zNumeroInteiro,ne as zNumeroPositivo,F as zOperadorFiltroDelta,z as zOperadores}; +var c="ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),E=o=>`eli-${Array.from({length:o||8}).map(()=>c[(999*Math.random()|0)%c.length]).join("")}`;var g={};globalThis.cacheMemoria_cache=g;var x=(o,r,a)=>{let i=typeof o=="string"?o:typeof o=="number"?String(o):encodeURIComponent(JSON.stringify(o)),e=a&&new Date().getTime()+a*1e3;r!==void 0&&(g[i]={valor:r,validade:e});let n=g[i];if(!(n?.validade&&n.validadeg,ro=x,to=o=>r=>x(o,r);var no="00000000-0000-0000-0000-000000000000",h=(d=>(d.codigo="codigo",d.excluido="excluido",d.data_hora_criacao="data_hora_criacao",d.data_hora_atualizacao="data_hora_atualizacao",d.codigo_usuario_criacao="codigo_usuario_criacao",d.codigo_usuario_atualizacao="codigo_usuario_atualizacao",d.versao="versao",d))(h||{}),A=(r=>(r.token="token",r))(A||{}),T=(a=>(a.Usuario="usuario",a.Fornecedor="fornecedor",a))(T||{});import s from"zod";var N=(e=>(e["="]="=",e["!="]="!=",e[">"]=">",e[">="]=">=",e["<"]="<",e["<="]="<=",e.like="like",e.in="in",e.isNull="isNull",e.notIn="notIn",e))(N||{}),z=s.enum(["=","!=",">",">=","<","<=","like","in","isNull","notIn"]),lo=s.object({coluna:s.string(),valor:s.any(),operador:z,ou:s.boolean().optional()});var w=({dayjs:o,duration:r,isSameOrAfter:a,isSameOrBefore:i,minMax:e,relativeTime:n,timezone:m,utc:d,weekOfYear:O})=>(o.extend(d),o.extend(m),o.extend(O),o.extend(i),o.extend(a),o.extend(e),o.extend(n),o.extend(r),o.locale("pt-br"),o),so=w;var go="https://paiol.idz.one";var C=(m=>(m.RASTREAMENTO="RASTREAMENTO",m.DEPURACAO="DEPURACAO",m.INFORMACAO="INFORMACAO",m.AVISO="AVISO",m.ERRO="ERRO",m.CRITICO="CRITICO",m))(C||{}),v={RASTREAMENTO:{peso:1,rotulo:"Rastreamento",emoji:"\u{1F50D}",metodo:"debug"},DEPURACAO:{peso:2,rotulo:"Depura\xE7\xE3o",emoji:"\u{1F41B}",metodo:"debug"},INFORMACAO:{peso:3,rotulo:"Informa\xE7\xE3o",emoji:"\u2139\uFE0F",metodo:"info"},AVISO:{peso:4,rotulo:"Aviso",emoji:"\u26A0\uFE0F",metodo:"warn"},ERRO:{peso:5,rotulo:"Erro",emoji:"\u274C",metodo:"error"},CRITICO:{peso:6,rotulo:"Cr\xEDtico",emoji:"\u{1F525}",metodo:"error"}},D=o=>{let r=o.nivelMinimo??"INFORMACAO",a=v[r].peso,i=(e,n)=>{let m=v[e];if(m.pesoi("RASTREAMENTO",e),depuracao:e=>i("DEPURACAO",e),info:e=>i("INFORMACAO",e),aviso:e=>i("AVISO",e),erro:e=>i("ERRO",e),critico:e=>i("CRITICO",e)}},vo=D({app:"testando",nivelMinimo:"INFORMACAO",arquivamento:()=>{}});var j=[{ext:"gif",tipo:"imagem",mime:"image/gif"},{ext:"jpg",tipo:"imagem",mime:"image/jpeg"},{ext:"jpeg",tipo:"imagem",mime:"image/jpeg"},{ext:"png",tipo:"imagem",mime:"image/png"},{ext:"bmp",tipo:"imagem",mime:"image/bmp"},{ext:"webp",tipo:"imagem",mime:"image/webp"},{ext:"tiff",tipo:"imagem",mime:"image/tiff"},{ext:"svg",tipo:"imagem",mime:"image/svg+xml"},{ext:"ico",tipo:"imagem",mime:"image/x-icon"},{ext:"pdf",tipo:"documento",mime:"application/pdf"},{ext:"doc",tipo:"documento",mime:"application/msword"},{ext:"docx",tipo:"documento",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"},{ext:"xls",tipo:"documento",mime:"application/vnd.ms-excel"},{ext:"xlsx",tipo:"documento",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},{ext:"ppt",tipo:"documento",mime:"application/vnd.ms-powerpoint"},{ext:"pptx",tipo:"documento",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"},{ext:"txt",tipo:"documento",mime:"text/plain"},{ext:"odt",tipo:"documento",mime:"application/vnd.oasis.opendocument.text"},{ext:"ods",tipo:"documento",mime:"application/vnd.oasis.opendocument.spreadsheet"},{ext:"rtf",tipo:"documento",mime:"application/rtf"},{ext:"csv",tipo:"documento",mime:"text/csv"},{ext:"mp4",tipo:"v\xEDdeo",mime:"video/mp4"},{ext:"avi",tipo:"v\xEDdeo",mime:"video/x-msvideo"},{ext:"mkv",tipo:"v\xEDdeo",mime:"video/x-matroska"},{ext:"mov",tipo:"v\xEDdeo",mime:"video/quicktime"},{ext:"wmv",tipo:"v\xEDdeo",mime:"video/x-ms-wmv"},{ext:"flv",tipo:"v\xEDdeo",mime:"video/x-flv"},{ext:"webm",tipo:"v\xEDdeo",mime:"video/webm"},{ext:"3gp",tipo:"v\xEDdeo",mime:"video/3gpp"},{ext:"mpeg",tipo:"v\xEDdeo",mime:"video/mpeg"}],_o=o=>{let r=String(o||"").toLocaleLowerCase().split(".").pop();return j.find(i=>i.ext===r)?.tipo||"outros"};import l from"zod";var F=l.enum([">","<",">=","<=","=","!=","in","like","\u2229"]),ho={">":{rotulo:"Maior que",descricao:"O valor de A deve ser maior que o valor de B"},"<":{rotulo:"Menor que",descricao:"O valor de A deve ser menor que o valor de B"},">=":{rotulo:"Maior ou igual a",descricao:"O valor de A deve ser maior ou igual ao valor de B"},"<=":{rotulo:"Menor ou igual a",descricao:"O valor de A deve ser menor ou igual ao valor de B"},"=":{rotulo:"Igual a",descricao:"O valor de A deve ser igual ao valor de B"},"!=":{rotulo:"Diferente de",descricao:"O valor de A deve ser diferente do valor de B"},in:{rotulo:"Est\xE1 em",descricao:"O valor de A deve estar presente na cole\xE7\xE3o ou lista definida em B"},like:{rotulo:"Cont\xE9m",descricao:"O valor de A deve conter o texto informado em B"},"\u2229":{rotulo:"Interse\xE7\xE3o",descricao:"A e B devem possuir pelo menos um elemento em comum"}},k=/^\{[\w:]+\}$/,R=/^\w+(\.\w+)*$/,I=l.string().regex(R,"Coluna inv\xE1lida").describe("nome da coluna ou caminho aninhado do jsonb"),L=l.object({id:l.string().describe("id da condi\xE7\xE3o do filtro").regex(k,"O id deve seguir o formato {identificador}"),coluna:I,operador:F,valor:l.any().describe("valor de compara\xE7\xE3o")}),M=o=>{let a=(o.match(/\{[\w:]+\}|\bNAO\b|\bE\b|\bOU\b|\(|\)/g)||[]).join(""),i=o.replace(/\s+/g,""),e=a.replace(/\s+/g,"");if(i!==e)return!1;let n=o.replace(/\{[\w:]+\}/g,"true").replace(/\bNAO\b/g,"!").replace(/\bE\b/g,"&&").replace(/\bOU\b/g,"||");try{return new Function(`return (${n})`)(),!0}catch{return!1}},X=l.object({condicoes:l.array(L),formula:l.string().refine(M,{message:"F\xF3rmula inv\xE1lida. Use apenas refer\xEAncias de condi\xE7\xF5es {id} ou {id:sufixo}, operadores E/OU/NAO e par\xEAnteses."})}).superRefine((o,r)=>{let a=new Set(o.condicoes.map(e=>e.id)),i=o.formula.match(/\{[\w:]+\}/g)||[];for(let e of i)a.has(e)||r.addIssue({code:"custom",path:["formula"],message:`A refer\xEAncia ${e} n\xE3o existe em condicoes.`})}),q=o=>X.parse(o),Ao=()=>({criarFiltroDelta:q});var No=(o,r)=>{let a="localStorage"in globalThis?globalThis.localStorage:void 0;if(typeof a>"u")return null;let i=typeof o=="string"?o:encodeURIComponent(JSON.stringify(o));try{r!==void 0&&a.setItem(i,JSON.stringify(r));let e=a.getItem(i);if(e===null)return null;try{return JSON.parse(e)}catch{return e}}catch{return null}};var y=o=>{try{return Object.fromEntries(Object.entries(o).map(([r,a])=>[r,a===void 0||a==null||typeof a=="string"||typeof a=="number"||typeof a=="boolean"?a:JSON.stringify(a,null,2)]))}catch(r){throw new Error(`Erro na fun\xE7\xE3o paraObjetoRegistroPg: ${r.message} ${r.stack}`)}},wo=y,Co=y;var P=(o=>(o["e-licencie"]="e-licencie",o["gov.e-licencie"]="gov.e-licencie",o))(P||{});var U=(t=>(t.modelo="000_modelo",t.vencida="100_vencida",t.expirado="200_expirado",t.alerta="300_alerta",t.protocoladafora="350_protocoladafora",t.protocolada="400_protocolada",t.protocoladaApenas="430_protocolada",t.protocolada_alteracao="450_protocolada",t.prazo="500_prazo",t.emitida="515_emitida",t.valida="518_valida",t.novo="520_novo",t.recebido="521_recebido",t.em_andamento="530_em_andamento",t.aguardando="530_aguardando",t.aguardandoresposta="540_aguardandoresposta",t.suspensaotemporaria="540_suspensaotemporaria",t.cancelada="550_cancelada",t.execucao="560_execucao",t.pendente="570_pendente",t.executadafora="600_executadafora",t.executada="700_executada",t.naoexecutada="701_naoexecutada",t.concluida="730_concluida",t.respondido_negado="740_respondido_negado",t.respondido_aceito="741_respondido_aceito",t.atendidoparcial="742_atendidoparcial",t.naoatendido="743_naoatendido",t.atendido="744_atendido",t.renovada="760_renovada",t.finalizada="800_finalizada",t.emitirnota="101_emitirnota",t.faturaatrasada="301_faturaatrasada",t.pagarfatura="302_pagarfatura",t.aguardandoconfirmacao="531_aguardandoconfirmacao",t.agendado="701_agendado",t.faturapaga="801_faturapaga",t.excluida="999_excluida",t.requerida="401_requerida",t.vigente="516_vigente",t.emrenovacao="402_emrenovacao",t.arquivada="801_arquivada",t.aguardando_sincronizacao="999_aguardando_sincronizacao",t.nao_conforme="710_nao_conforme",t.conforme="720_conforme",t.nao_aplicavel="730_nao_aplicavel",t.parcial="715_parcial",t))(U||{});var ko=()=>"Ol\xE1 Mundo! (fun\xE7\xE3o)";var Io="Ol\xE1 Mundo! (vari\xE1vel)";var Po=(...o)=>o.map(r=>r==null?"":String(r).normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g," ").toLowerCase()).join(" ");var _=class{constructor({caminho:r,acaoIr:a,rotulo:i}){this._partesCaminho=[];this._acaoIr=a,this._partesCaminho=(Array.isArray(r)?r:[r]).filter(Boolean).map(e=>String(e)).flatMap(e=>e.split("/")).filter(Boolean),this.rotulo=i}get caminho(){return`/${this._partesCaminho.join("/")}`}set caminho(r){this._partesCaminho=r.split("/").filter(a=>a)}endereco(r,a){let i=typeof globalThis<"u"&&globalThis.window||void 0,e=new URL(i?i.location.href:"http://localhost");e.pathname=this.caminho,e.search="";let n=Object.entries(r);for(let[m,d]of n)e.searchParams.set(String(m),JSON.stringify(d));return e.hash="",a&&(e.hash=`#${e.search}`,e.search=""),e.href}ir(r){if(this._acaoIr)this._acaoIr(this.endereco({...r}));else{let a=typeof globalThis<"u"&&globalThis.window||void 0;a&&(a.location.href=this.endereco({...r}))}}parametros(r){let a=r?new URL(r):new URL(typeof globalThis<"u"&&globalThis.window?globalThis.window.location.href:"http://localhost"),i=a.searchParams,e=Object.fromEntries(i.entries()),n=a.hash;if(n){let m=Object.fromEntries(new URLSearchParams(n.slice(1)).entries());e={...e,...m}}for(let m in e)try{e[m]=JSON.parse(e[m])}catch{console.log(`[${m}|${e[m]}] n\xE3o \xE9 um json v\xE1lido.`)}return e}};var $=(n=>(n.UN="UN",n.KG="KG",n.TON="TON",n.g="g",n["M\xB3"]="M\xB3",n.Lt="Lt",n))($||{}),Bo=[{sigla_unidade:"KG",nome:"Quilograma",sigla_normalizada:"KG",normalizar:o=>o,tipo:"massa"},{sigla_unidade:"g",nome:"Grama",sigla_normalizada:"KG",normalizar:o=>o/1e3,tipo:"massa"},{sigla_unidade:"TON",nome:"Tonelada",sigla_normalizada:"KG",normalizar:o=>o*1e3,tipo:"massa"},{sigla_unidade:"Lt",nome:"Litro",sigla_normalizada:"Lt",normalizar:o=>o,tipo:"volume"},{sigla_unidade:"M\xB3",nome:"Metro C\xFAbico",sigla_normalizada:"Lt",normalizar:o=>o*1e3,tipo:"volume"},{sigla_unidade:"UN",nome:"Unidade",sigla_normalizada:"UN",normalizar:o=>o,tipo:"unidade"}];import{NIL as B,v3 as J,v4 as V}from"uuid";var G=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,Go=o=>G.test(String(o||"")),K=(o,r)=>J(typeof o=="string"?o:typeof o=="number"?String(o):JSON.stringify(o),r?K(r):B),Y=V,Ko=Y;var Zo=o=>new Promise(r=>setTimeout(()=>r(!0),o)),Qo=o=>Object.keys(o).join("/");import u from"zod";var So=u.object({formato:u.literal("decimal").default("decimal"),datum:u.literal("EPSG:4326").default("EPSG:4326"),latitude:u.number(),longitude:u.number()});import b from"zod";var Z=/^\d{2}\.\d{3}\.\d{3}\/\d{4}-\d{2}$/,Q=/^[A-Z0-9]{2}\.[A-Z0-9]{3}\.[A-Z0-9]{3}\/[A-Z0-9]{4}-\d{2}$/i,H=Number(new Date().toISOString().slice(0,7).replace("-","")),W=b.string().regex(H<202407?Z:Q).describe("Documento (CNPJ) no formato XX.XXX.XXX/XXXX-XX"),S=b.string().regex(/^\d{3}\.\d{3}\.\d{3}-\d{2}$/).describe("Documento (CPF) no formato XXX.XXX.XXX-XX"),ee=S.or(W).describe("CPF ou CNPJ");import p from"zod";var f=o=>{if(typeof o=="number"||typeof o!="string")return o;let r=o;return r.includes(",")&&(r=r.replace(/\./g,"").replace(",",".")),r=r.replace(/[^0-9.]/g,""),r==""?null:Number(r)},ae=p.preprocess(f,p.number()),ne=p.preprocess(f,p.number().positive()),ie=p.preprocess(f,p.number().int());export{C as NivelLog,v as NivelLogDetalhes,P as Produtos,_ as TipagemRotas,E as aleatorio,x as cacheM,to as cacheMFixo,ro as cacheMemoria,h as camposComuns,q as criarFiltroDelta,so as defineDayjsBr,G as erUuid,Zo as esperar,j as extensoes,w as iniciarDayjsBr,D as iniciarELog,Ao as iniciarFiltroDelta,go as link_paiol,No as localValor,Qo as nomeVariavel,Co as objetoPg,ho as operadorFiltroDeltaDetalhes,N as operadores,y as paraObjetoRegistroPg,wo as pgObjeto,$ as siglas_unidades_medida,Po as texto_busca,_o as tipoArquivo,T as tipoUsuarioResiduos,U as tiposSituacoesElicencie,A as tx,ko as umaFuncao,Io as umaVariavel,Bo as unidades_medida,Ko as uuid,K as uuidV3,Y as uuidV4,no as uuid_null,Go as validarUuid,eo as verCacheM,I as zColunaFiltroDelta,L as zCondicaoFiltroDelta,So as zCoordenadas,W as zDocCnpj,S as zDocCpf,ee as zDocumento,lo as zFiltro,X as zFiltroDelta,ae as zNumero,ie as zNumeroInteiro,ne as zNumeroPositivo,F as zOperadorFiltroDelta,z as zOperadores}; diff --git a/package.json b/package.json index 8e77a9e..e9369e8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "p-comuns", - "version": "0.350.0", + "version": "0.352.0", "description": "", "main": "./dist-front/index.mjs", "module": "./dist-front/index.mjs", diff --git a/pacote.tgz b/pacote.tgz index 99a6bc7..9505f93 100644 Binary files a/pacote.tgz and b/pacote.tgz differ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1690a2b..f809977 100755 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -12,32 +12,29 @@ importers: specifier: 2.4.12 version: 2.4.12 '@types/node': - specifier: ^20.19.39 - version: 20.19.39 - cross-fetch: - specifier: 4.1.0 - version: 4.1.0 + specifier: ^22 + version: 22.20.1 dayjs: - specifier: ^1.11.20 + specifier: ^1.11.18 version: 1.11.20 tsup: - specifier: 8.5.0 - version: 8.5.0(jiti@2.6.1)(postcss@8.5.9)(typescript@5.9.3) + specifier: 8.5.1 + version: 8.5.1(jiti@2.6.1)(postcss@8.5.9)(typescript@6.0.3) typescript: - specifier: ~5.9.3 - version: 5.9.3 + specifier: ^6 + version: 6.0.3 unbuild: specifier: ^3.6.1 - version: 3.6.1(typescript@5.9.3) + version: 3.6.1(typescript@6.0.3) uuid: specifier: ^11.1.0 version: 11.1.0 vitest: specifier: ^3.2.4 - version: 3.2.4(@types/node@20.19.39)(jiti@2.6.1) + version: 3.2.4(@types/node@22.20.1)(jiti@2.6.1) zod: - specifier: 4.1.4 - version: 4.1.4 + specifier: 4.4.3 + version: 4.4.3 packages: @@ -621,8 +618,8 @@ packages: '@types/estree@1.0.8': resolution: {integrity: sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==} - '@types/node@20.19.39': - resolution: {integrity: sha512-orrrD74MBUyK8jOAD/r0+lfa1I2MO6I+vAkmAWzMYbCcgrN4lCrmK52gRFQq/JRxfYPfonkr4b0jcY7Olqdqbw==} + '@types/node@22.20.1': + resolution: {integrity: sha512-EANqOCF9QFyra+4pfxUcX9STKJpCLjMbObVzljIJomAWSnuSIEAvyzEU53GaajbXJEgdh0iEcPL+DGvpUd4k1Q==} '@types/resolve@1.20.2': resolution: {integrity: sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==} @@ -743,9 +740,6 @@ packages: convert-source-map@2.0.0: resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} - cross-fetch@4.1.0: - resolution: {integrity: sha512-uKm5PU+MHTootlWEY+mZ4vvXoCn4fLQxT9dSc1sXVMSFkINTJVN8cAQROpwcKm8bJ/c7rgZVIBWzH5T78sNZZw==} - css-declaration-sorter@7.4.0: resolution: {integrity: sha512-LTuzjPoyA2vMGKKcaOqKSp7Ub2eGrNfKiZH4LpezxpNrsICGCSFvsQOI29psISxNZtaXibkC2CXzrQ5enMeGGw==} engines: {node: ^14 || ^16 || >=18} @@ -946,9 +940,6 @@ packages: lodash.memoize@4.1.2: resolution: {integrity: sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==} - lodash.sortby@4.7.0: - resolution: {integrity: sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==} - lodash.uniq@4.5.0: resolution: {integrity: sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ==} @@ -999,15 +990,6 @@ packages: engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true - node-fetch@2.7.0: - resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} - engines: {node: 4.x || >=6.0.0} - peerDependencies: - encoding: ^0.1.0 - peerDependenciesMeta: - encoding: - optional: true - node-releases@2.0.37: resolution: {integrity: sha512-1h5gKZCF+pO/o3Iqt5Jp7wc9rH3eJJ0+nh/CIoiRwjRxde/hAHyLPXYN4V3CqKAbiZPSeJFSWHmJsbkicta0Eg==} @@ -1246,10 +1228,6 @@ packages: resolution: {integrity: sha512-nODzvTiYVRGRqAOvE84Vk5JDPyyxsVk0/fbA/bq7RqlnhksGpset09XTxbpvLTIjoaF7K8Z8DG8yHtKGTPSYRw==} engines: {node: '>=20'} - punycode@2.3.1: - resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} - engines: {node: '>=6'} - readdirp@4.1.2: resolution: {integrity: sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==} engines: {node: '>= 14.18.0'} @@ -1294,10 +1272,9 @@ packages: resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} engines: {node: '>=0.10.0'} - source-map@0.8.0-beta.0: - resolution: {integrity: sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA==} - engines: {node: '>= 8'} - deprecated: The work that was done in this beta branch won't be included in future versions + source-map@0.7.6: + resolution: {integrity: sha512-i5uvt8C3ikiWeNZSVZNWcfZPItFQOsYTUAOkcUPGd8DqDy1uOUikjt5dG+uRlwyvR108Fb9DOd4GvXfT0N2/uQ==} + engines: {node: '>= 12'} stackback@0.0.2: resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} @@ -1357,12 +1334,6 @@ packages: resolution: {integrity: sha512-azl+t0z7pw/z958Gy9svOTuzqIk6xq+NSheJzn5MMWtWTFywIacg2wUlzKFGtt3cthx0r2SxMK0yzJOR0IES7Q==} engines: {node: '>=14.0.0'} - tr46@0.0.3: - resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} - - tr46@1.0.1: - resolution: {integrity: sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA==} - tree-kill@1.2.2: resolution: {integrity: sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==} hasBin: true @@ -1370,8 +1341,8 @@ packages: ts-interface-checker@0.1.13: resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} - tsup@8.5.0: - resolution: {integrity: sha512-VmBp77lWNQq6PfuMqCHD3xWl22vEoWsKajkF8t+yMBawlUS8JzEI+vOVMeuNZIuMML8qXRizFKi9oD5glKQVcQ==} + tsup@8.5.1: + resolution: {integrity: sha512-xtgkqwdhpKWr3tKPmCkvYmS9xnQK3m3XgxZHwSUjvfTjp7YfXe5tT3GgWi0F2N+ZSMsOeWeZFh7ZZFg5iPhing==} engines: {node: '>=18'} hasBin: true peerDependencies: @@ -1389,8 +1360,8 @@ packages: typescript: optional: true - typescript@5.9.3: - resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==} + typescript@6.0.3: + resolution: {integrity: sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==} engines: {node: '>=14.17'} hasBin: true @@ -1499,25 +1470,13 @@ packages: jsdom: optional: true - webidl-conversions@3.0.1: - resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} - - webidl-conversions@4.0.2: - resolution: {integrity: sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==} - - whatwg-url@5.0.0: - resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} - - whatwg-url@7.1.0: - resolution: {integrity: sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==} - why-is-node-running@2.3.0: resolution: {integrity: sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==} engines: {node: '>=8'} hasBin: true - zod@4.1.4: - resolution: {integrity: sha512-2YqJuWkU6IIK9qcE4k1lLLhyZ6zFw7XVRdQGpV97jEIZwTrscUw+DY31Xczd8nwaoksyJUIxCojZXwckJovWxA==} + zod@4.4.3: + resolution: {integrity: sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==} snapshots: @@ -1874,7 +1833,7 @@ snapshots: '@types/estree@1.0.8': {} - '@types/node@20.19.39': + '@types/node@22.20.1': dependencies: undici-types: 6.21.0 @@ -1888,13 +1847,13 @@ snapshots: chai: 5.3.3 tinyrainbow: 2.0.0 - '@vitest/mocker@3.2.4(vite@7.3.2(@types/node@20.19.39)(jiti@2.6.1))': + '@vitest/mocker@3.2.4(vite@7.3.2(@types/node@22.20.1)(jiti@2.6.1))': dependencies: '@vitest/spy': 3.2.4 estree-walker: 3.0.3 magic-string: 0.30.21 optionalDependencies: - vite: 7.3.2(@types/node@20.19.39)(jiti@2.6.1) + vite: 7.3.2(@types/node@22.20.1)(jiti@2.6.1) '@vitest/pretty-format@3.2.4': dependencies: @@ -1949,9 +1908,9 @@ snapshots: node-releases: 2.0.37 update-browserslist-db: 1.2.3(browserslist@4.28.2) - bundle-require@5.1.0(esbuild@0.25.12): + bundle-require@5.1.0(esbuild@0.27.7): dependencies: - esbuild: 0.25.12 + esbuild: 0.27.7 load-tsconfig: 0.2.5 cac@6.7.14: {} @@ -1997,12 +1956,6 @@ snapshots: convert-source-map@2.0.0: {} - cross-fetch@4.1.0: - dependencies: - node-fetch: 2.7.0 - transitivePeerDependencies: - - encoding - css-declaration-sorter@7.4.0(postcss@8.5.9): dependencies: postcss: 8.5.9 @@ -2239,8 +2192,6 @@ snapshots: lodash.memoize@4.1.2: {} - lodash.sortby@4.7.0: {} - lodash.uniq@4.5.0: {} loupe@3.2.1: {} @@ -2253,7 +2204,7 @@ snapshots: mdn-data@2.27.1: {} - mkdist@2.4.1(typescript@5.9.3): + mkdist@2.4.1(typescript@6.0.3): dependencies: autoprefixer: 10.5.0(postcss@8.5.9) citty: 0.1.6 @@ -2269,7 +2220,7 @@ snapshots: semver: 7.7.4 tinyglobby: 0.2.16 optionalDependencies: - typescript: 5.9.3 + typescript: 6.0.3 mlly@1.8.2: dependencies: @@ -2288,10 +2239,6 @@ snapshots: nanoid@3.3.11: {} - node-fetch@2.7.0: - dependencies: - whatwg-url: 5.0.0 - node-releases@2.0.37: {} nth-check@2.1.1: @@ -2500,8 +2447,6 @@ snapshots: pretty-bytes@7.1.0: {} - punycode@2.3.1: {} - readdirp@4.1.2: {} resolve-from@5.0.0: {} @@ -2513,14 +2458,14 @@ snapshots: path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 - rollup-plugin-dts@6.4.1(rollup@4.60.1)(typescript@5.9.3): + rollup-plugin-dts@6.4.1(rollup@4.60.1)(typescript@6.0.3): dependencies: '@jridgewell/remapping': 2.3.5 '@jridgewell/sourcemap-codec': 1.5.5 convert-source-map: 2.0.0 magic-string: 0.30.21 rollup: 4.60.1 - typescript: 5.9.3 + typescript: 6.0.3 optionalDependencies: '@babel/code-frame': 7.29.0 @@ -2565,9 +2510,7 @@ snapshots: source-map-js@1.2.1: {} - source-map@0.8.0-beta.0: - dependencies: - whatwg-url: 7.1.0 + source-map@0.7.6: {} stackback@0.0.2: {} @@ -2628,49 +2571,43 @@ snapshots: tinyspy@4.0.4: {} - tr46@0.0.3: {} - - tr46@1.0.1: - dependencies: - punycode: 2.3.1 - tree-kill@1.2.2: {} ts-interface-checker@0.1.13: {} - tsup@8.5.0(jiti@2.6.1)(postcss@8.5.9)(typescript@5.9.3): + tsup@8.5.1(jiti@2.6.1)(postcss@8.5.9)(typescript@6.0.3): dependencies: - bundle-require: 5.1.0(esbuild@0.25.12) + bundle-require: 5.1.0(esbuild@0.27.7) cac: 6.7.14 chokidar: 4.0.3 consola: 3.4.2 debug: 4.4.3 - esbuild: 0.25.12 + esbuild: 0.27.7 fix-dts-default-cjs-exports: 1.0.1 joycon: 3.1.1 picocolors: 1.1.1 postcss-load-config: 6.0.1(jiti@2.6.1)(postcss@8.5.9) resolve-from: 5.0.0 rollup: 4.60.1 - source-map: 0.8.0-beta.0 + source-map: 0.7.6 sucrase: 3.35.1 tinyexec: 0.3.2 tinyglobby: 0.2.16 tree-kill: 1.2.2 optionalDependencies: postcss: 8.5.9 - typescript: 5.9.3 + typescript: 6.0.3 transitivePeerDependencies: - jiti - supports-color - tsx - yaml - typescript@5.9.3: {} + typescript@6.0.3: {} ufo@1.6.3: {} - unbuild@3.6.1(typescript@5.9.3): + unbuild@3.6.1(typescript@6.0.3): dependencies: '@rollup/plugin-alias': 5.1.1(rollup@4.60.1) '@rollup/plugin-commonjs': 28.0.9(rollup@4.60.1) @@ -2686,18 +2623,18 @@ snapshots: hookable: 5.5.3 jiti: 2.6.1 magic-string: 0.30.21 - mkdist: 2.4.1(typescript@5.9.3) + mkdist: 2.4.1(typescript@6.0.3) mlly: 1.8.2 pathe: 2.0.3 pkg-types: 2.3.0 pretty-bytes: 7.1.0 rollup: 4.60.1 - rollup-plugin-dts: 6.4.1(rollup@4.60.1)(typescript@5.9.3) + rollup-plugin-dts: 6.4.1(rollup@4.60.1)(typescript@6.0.3) scule: 1.3.0 tinyglobby: 0.2.16 untyped: 2.0.0 optionalDependencies: - typescript: 5.9.3 + typescript: 6.0.3 transitivePeerDependencies: - sass - vue @@ -2724,13 +2661,13 @@ snapshots: uuid@11.1.0: {} - vite-node@3.2.4(@types/node@20.19.39)(jiti@2.6.1): + vite-node@3.2.4(@types/node@22.20.1)(jiti@2.6.1): dependencies: cac: 6.7.14 debug: 4.4.3 es-module-lexer: 1.7.0 pathe: 2.0.3 - vite: 7.3.2(@types/node@20.19.39)(jiti@2.6.1) + vite: 7.3.2(@types/node@22.20.1)(jiti@2.6.1) transitivePeerDependencies: - '@types/node' - jiti @@ -2745,7 +2682,7 @@ snapshots: - tsx - yaml - vite@7.3.2(@types/node@20.19.39)(jiti@2.6.1): + vite@7.3.2(@types/node@22.20.1)(jiti@2.6.1): dependencies: esbuild: 0.27.7 fdir: 6.5.0(picomatch@4.0.4) @@ -2754,15 +2691,15 @@ snapshots: rollup: 4.60.1 tinyglobby: 0.2.16 optionalDependencies: - '@types/node': 20.19.39 + '@types/node': 22.20.1 fsevents: 2.3.3 jiti: 2.6.1 - vitest@3.2.4(@types/node@20.19.39)(jiti@2.6.1): + vitest@3.2.4(@types/node@22.20.1)(jiti@2.6.1): dependencies: '@types/chai': 5.2.3 '@vitest/expect': 3.2.4 - '@vitest/mocker': 3.2.4(vite@7.3.2(@types/node@20.19.39)(jiti@2.6.1)) + '@vitest/mocker': 3.2.4(vite@7.3.2(@types/node@22.20.1)(jiti@2.6.1)) '@vitest/pretty-format': 3.2.4 '@vitest/runner': 3.2.4 '@vitest/snapshot': 3.2.4 @@ -2780,11 +2717,11 @@ snapshots: tinyglobby: 0.2.16 tinypool: 1.1.1 tinyrainbow: 2.0.0 - vite: 7.3.2(@types/node@20.19.39)(jiti@2.6.1) - vite-node: 3.2.4(@types/node@20.19.39)(jiti@2.6.1) + vite: 7.3.2(@types/node@22.20.1)(jiti@2.6.1) + vite-node: 3.2.4(@types/node@22.20.1)(jiti@2.6.1) why-is-node-running: 2.3.0 optionalDependencies: - '@types/node': 20.19.39 + '@types/node': 22.20.1 transitivePeerDependencies: - jiti - less @@ -2799,24 +2736,9 @@ snapshots: - tsx - yaml - webidl-conversions@3.0.1: {} - - webidl-conversions@4.0.2: {} - - whatwg-url@5.0.0: - dependencies: - tr46: 0.0.3 - webidl-conversions: 3.0.1 - - whatwg-url@7.1.0: - dependencies: - lodash.sortby: 4.7.0 - tr46: 1.0.1 - webidl-conversions: 4.0.2 - why-is-node-running@2.3.0: dependencies: siginfo: 2.0.0 stackback: 0.0.2 - zod@4.1.4: {} + zod@4.4.3: {} diff --git a/src/consulta.ts b/src/consulta.ts index 5faf5f8..6caa2f8 100755 --- a/src/consulta.ts +++ b/src/consulta.ts @@ -10,6 +10,7 @@ export enum operadores { like = "like", in = "in", isNull = "isNull", + notIn = "notIn", } export type tipoFiltro = { @@ -30,7 +31,18 @@ export type interfaceConsulta = { apenasContagem?: boolean } -export const zOperadores = z.enum(["=", "!=", ">", ">=", "<", "<=", "like", "in", "isNull"]) +export const zOperadores = z.enum([ + "=", + "!=", + ">", + ">=", + "<", + "<=", + "like", + "in", + "isNull", + "notIn", +]) export const zFiltro = z.object({ coluna: z.string(),