build
This commit is contained in:
parent
5b1b6e3c25
commit
84880fff0c
7 changed files with 361 additions and 0 deletions
|
|
@ -33,7 +33,11 @@ __export(consulta_exports, {
|
|||
zOperadores: () => zOperadores
|
||||
});
|
||||
module.exports = __toCommonJS(consulta_exports);
|
||||
<<<<<<< HEAD
|
||||
var import_zod = __toESM(require("zod"));
|
||||
=======
|
||||
var import_zod = __toESM(require("zod"), 1);
|
||||
>>>>>>> 34d92fa (build)
|
||||
var operadores = /* @__PURE__ */ ((operadores2) => {
|
||||
operadores2["="] = "=";
|
||||
operadores2["!="] = "!=";
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ __export(dayjs_exports, {
|
|||
dayjsbr: () => dayjsbr
|
||||
});
|
||||
module.exports = __toCommonJS(dayjs_exports);
|
||||
<<<<<<< HEAD
|
||||
var import_dayjs = __toESM(require("dayjs"));
|
||||
var import_duration = __toESM(require("dayjs/plugin/duration.js"));
|
||||
var import_isSameOrAfter = __toESM(require("dayjs/plugin/isSameOrAfter.js"));
|
||||
|
|
@ -40,6 +41,17 @@ var import_relativeTime = __toESM(require("dayjs/plugin/relativeTime.js"));
|
|||
var import_timezone = __toESM(require("dayjs/plugin/timezone.js"));
|
||||
var import_utc = __toESM(require("dayjs/plugin/utc.js"));
|
||||
var import_weekOfYear = __toESM(require("dayjs/plugin/weekOfYear.js"));
|
||||
=======
|
||||
var import_dayjs = __toESM(require("dayjs"), 1);
|
||||
var import_duration = __toESM(require("dayjs/plugin/duration.js"), 1);
|
||||
var import_isSameOrAfter = __toESM(require("dayjs/plugin/isSameOrAfter.js"), 1);
|
||||
var import_isSameOrBefore = __toESM(require("dayjs/plugin/isSameOrBefore.js"), 1);
|
||||
var import_minMax = __toESM(require("dayjs/plugin/minMax.js"), 1);
|
||||
var import_relativeTime = __toESM(require("dayjs/plugin/relativeTime.js"), 1);
|
||||
var import_timezone = __toESM(require("dayjs/plugin/timezone.js"), 1);
|
||||
var import_utc = __toESM(require("dayjs/plugin/utc.js"), 1);
|
||||
var import_weekOfYear = __toESM(require("dayjs/plugin/weekOfYear.js"), 1);
|
||||
>>>>>>> 34d92fa (build)
|
||||
var import_pt_br = require("dayjs/locale/pt-br.js");
|
||||
import_dayjs.default.locale("pt-br");
|
||||
import_dayjs.default.extend(import_utc.default);
|
||||
|
|
|
|||
|
|
@ -22,16 +22,25 @@ __reExport(index_exports, require("./consulta"), module.exports);
|
|||
__reExport(index_exports, require("./dayjs"), module.exports);
|
||||
__reExport(index_exports, require("./ecosistema"), module.exports);
|
||||
__reExport(index_exports, require("./extensoes"), module.exports);
|
||||
<<<<<<< HEAD
|
||||
__reExport(index_exports, require("./extensoes"), module.exports);
|
||||
__reExport(index_exports, require("./graficosPilao"), module.exports);
|
||||
__reExport(index_exports, require("./local"), module.exports);
|
||||
__reExport(index_exports, require("./logger"), module.exports);
|
||||
__reExport(index_exports, require("./logger"), module.exports);
|
||||
=======
|
||||
__reExport(index_exports, require("./graficosPilao"), module.exports);
|
||||
__reExport(index_exports, require("./local"), module.exports);
|
||||
__reExport(index_exports, require("./logger"), module.exports);
|
||||
>>>>>>> 34d92fa (build)
|
||||
__reExport(index_exports, require("./postgres"), module.exports);
|
||||
__reExport(index_exports, require("./testes-de-variaveis"), module.exports);
|
||||
__reExport(index_exports, require("./texto_busca"), module.exports);
|
||||
__reExport(index_exports, require("./tipagemRotas"), module.exports);
|
||||
<<<<<<< HEAD
|
||||
__reExport(index_exports, require("./tipagemRotas"), module.exports);
|
||||
=======
|
||||
>>>>>>> 34d92fa (build)
|
||||
__reExport(index_exports, require("./unidades_medida"), module.exports);
|
||||
__reExport(index_exports, require("./uuid"), module.exports);
|
||||
__reExport(index_exports, require("./variaveisComuns"), module.exports);
|
||||
|
|
@ -44,16 +53,25 @@ __reExport(index_exports, require("./variaveisComuns"), module.exports);
|
|||
...require("./dayjs"),
|
||||
...require("./ecosistema"),
|
||||
...require("./extensoes"),
|
||||
<<<<<<< HEAD
|
||||
...require("./extensoes"),
|
||||
...require("./graficosPilao"),
|
||||
...require("./local"),
|
||||
...require("./logger"),
|
||||
...require("./logger"),
|
||||
=======
|
||||
...require("./graficosPilao"),
|
||||
...require("./local"),
|
||||
...require("./logger"),
|
||||
>>>>>>> 34d92fa (build)
|
||||
...require("./postgres"),
|
||||
...require("./testes-de-variaveis"),
|
||||
...require("./texto_busca"),
|
||||
...require("./tipagemRotas"),
|
||||
<<<<<<< HEAD
|
||||
...require("./tipagemRotas"),
|
||||
=======
|
||||
>>>>>>> 34d92fa (build)
|
||||
...require("./unidades_medida"),
|
||||
...require("./uuid"),
|
||||
...require("./variaveisComuns")
|
||||
|
|
|
|||
|
|
@ -21,8 +21,13 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||||
mod
|
||||
));
|
||||
<<<<<<< HEAD
|
||||
var import_node_fs = __toESM(require("node:fs"));
|
||||
var import_node_path = __toESM(require("node:path"));
|
||||
=======
|
||||
var import_node_fs = __toESM(require("node:fs"), 1);
|
||||
var import_node_path = __toESM(require("node:path"), 1);
|
||||
>>>>>>> 34d92fa (build)
|
||||
const mesclar = (entrada, novo) => {
|
||||
const saida = { ...entrada || {} };
|
||||
for (const [k, v] of Object.entries(novo)) {
|
||||
|
|
|
|||
|
|
@ -33,7 +33,11 @@ __export(logger_exports, {
|
|||
postLogger: () => postLogger
|
||||
});
|
||||
module.exports = __toCommonJS(logger_exports);
|
||||
<<<<<<< HEAD
|
||||
var import_cross_fetch = __toESM(require("cross-fetch"));
|
||||
=======
|
||||
var import_cross_fetch = __toESM(require("cross-fetch"), 1);
|
||||
>>>>>>> 34d92fa (build)
|
||||
var import_variaveisComuns = require("./variaveisComuns");
|
||||
const LOKI_BASE_URL = "https://log.idz.one";
|
||||
const LOKI_ENDPOINT = "/loki/api/v1/push";
|
||||
|
|
|
|||
314
dist-front/index.d.ts
vendored
Normal file
314
dist-front/index.d.ts
vendored
Normal file
|
|
@ -0,0 +1,314 @@
|
|||
import z from 'zod';
|
||||
import dayjs from 'dayjs';
|
||||
export { Dayjs, ManipulateType } from 'dayjs';
|
||||
import { v4 } from 'uuid';
|
||||
|
||||
declare const aleatorio: (tamanho?: number) => string;
|
||||
|
||||
/** gerar uma função de cache para uso em memoria */
|
||||
declare const cacheM: <T>(chave: any, valor?: T, validadeSeg?: number) => T | undefined;
|
||||
declare const verCacheM: () => {
|
||||
[k: string]: {
|
||||
/** new Date().getTime() */
|
||||
validade?: number | undefined;
|
||||
valor: any;
|
||||
} | undefined;
|
||||
};
|
||||
declare const cacheMemoria: <T>(chave: any, valor?: T, validadeSeg?: number) => T | undefined;
|
||||
/** para uso fixo dentro de uma função, trava a chave */
|
||||
declare const cacheMFixo: (chave: any) => <T>(valor?: T) => T | undefined;
|
||||
|
||||
declare const uuid_null = "00000000-0000-0000-0000-000000000000";
|
||||
/** Colunas Presentes n maioria das tabelas */
|
||||
declare enum camposComuns {
|
||||
codigo = "codigo",
|
||||
excluido = "excluido",
|
||||
data_hora_criacao = "data_hora_criacao",
|
||||
data_hora_atualizacao = "data_hora_atualizacao",
|
||||
codigo_usuario_criacao = "codigo_usuario_criacao",
|
||||
codigo_usuario_atualizacao = "codigo_usuario_atualizacao",
|
||||
versao = "versao"
|
||||
}
|
||||
/** Palavras comumente usadas */
|
||||
declare enum tx {
|
||||
token = "token"
|
||||
}
|
||||
declare enum tipoUsuarioResiduos {
|
||||
Usuario = "usuario",
|
||||
Fornecedor = "fornecedor"
|
||||
}
|
||||
|
||||
declare enum operadores {
|
||||
"=" = "=",
|
||||
"!=" = "!=",
|
||||
">" = ">",
|
||||
">=" = ">=",
|
||||
"<" = "<",
|
||||
"<=" = "<=",
|
||||
like = "like",
|
||||
in = "in"
|
||||
}
|
||||
type tipoFiltro = {
|
||||
coluna: string;
|
||||
valor: any;
|
||||
operador: keyof typeof operadores | operadores;
|
||||
ou?: boolean;
|
||||
};
|
||||
type interfaceConsulta = {
|
||||
offset?: number;
|
||||
limit?: number;
|
||||
filtros?: tipoFiltro[];
|
||||
ordem?: string;
|
||||
ordemTipo?: "asc" | "desc";
|
||||
colunas?: string[];
|
||||
apenasConsulta?: boolean;
|
||||
apenasContagem?: boolean;
|
||||
};
|
||||
declare const zOperadores: z.ZodEnum<{
|
||||
"=": "=";
|
||||
"!=": "!=";
|
||||
">": ">";
|
||||
">=": ">=";
|
||||
"<": "<";
|
||||
"<=": "<=";
|
||||
like: "like";
|
||||
in: "in";
|
||||
}>;
|
||||
declare const zFiltro: z.ZodObject<{
|
||||
coluna: z.ZodString;
|
||||
valor: z.ZodAny;
|
||||
operador: z.ZodEnum<{
|
||||
"=": "=";
|
||||
"!=": "!=";
|
||||
">": ">";
|
||||
">=": ">=";
|
||||
"<": "<";
|
||||
"<=": "<=";
|
||||
like: "like";
|
||||
in: "in";
|
||||
}>;
|
||||
ou: z.ZodOptional<z.ZodBoolean>;
|
||||
}, z.core.$strip>;
|
||||
|
||||
declare const dayjsbr: typeof dayjs;
|
||||
|
||||
declare const cdn_carro_de_boi = "https://carro-de-boi-idz-one.b-cdn.net";
|
||||
|
||||
type tiposArquivo = "imagem" | "documento" | "vídeo" | "outros";
|
||||
declare const extensoes: {
|
||||
ext: string;
|
||||
tipo: tiposArquivo;
|
||||
mime: string;
|
||||
}[];
|
||||
/**
|
||||
* Função que retorna o tipo do arquivo
|
||||
* @param nomeArquivo
|
||||
* @returns
|
||||
*/
|
||||
declare const tipoArquivo: (nomeArquivo: string | null | undefined) => tiposArquivo;
|
||||
|
||||
declare const graficos_pilao: {
|
||||
[k: string]: {
|
||||
grafico: string;
|
||||
titulo: string;
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* LocalStorage Tipado
|
||||
* Lê ou grava um valor no localStorage, mantendo o tipo genérico <T>.
|
||||
*/
|
||||
declare const localValor: <T>(chave_: string | any, valor?: T | null) => T | null;
|
||||
|
||||
type tipoLokiObjeto = {
|
||||
streams: {
|
||||
stream: {
|
||||
[k: string]: string;
|
||||
};
|
||||
values: [string, string][];
|
||||
}[];
|
||||
};
|
||||
declare const postLogger: ({ objeto, }: {
|
||||
objeto: tipoLokiObjeto;
|
||||
}) => Promise<[objeto: tipoLokiObjeto, erro?: string]>;
|
||||
/** define a localização da pasta do projeto */
|
||||
declare const defineCwd: (novoCwd: string) => void;
|
||||
type tipoLevel = "info" | "warn" | "error";
|
||||
type tipoOpSessao = {
|
||||
inquilino: string;
|
||||
usuario: string;
|
||||
parametros?: {
|
||||
[k: string]: string;
|
||||
};
|
||||
};
|
||||
type tipoLog = {
|
||||
detalhes?: unknown[];
|
||||
__filename?: string;
|
||||
local?: string;
|
||||
parametros?: {
|
||||
[k: string]: string;
|
||||
};
|
||||
};
|
||||
type tipoLoggerLog = (level: tipoLevel, mensagem: string, op_tipoLog?: tipoLog) => Promise<[objeto: tipoLokiObjeto, erro?: string]>;
|
||||
type TipoLoggerSessao = (sess: tipoOpSessao) => tipoLoggerLog;
|
||||
type tipoLogger = (amb: {
|
||||
app: string;
|
||||
eProducao: boolean;
|
||||
parametros?: {
|
||||
[k: string]: string;
|
||||
};
|
||||
}) => TipoLoggerSessao;
|
||||
declare const logger: tipoLogger;
|
||||
|
||||
/**
|
||||
* Trata um objeto para ser imput para postgres
|
||||
* @param entrada
|
||||
* @returns
|
||||
*/
|
||||
declare const paraObjetoRegistroPg: (entrada: {
|
||||
[k: string]: any;
|
||||
}) => {
|
||||
[k: string]: string | boolean | null | undefined | number;
|
||||
};
|
||||
declare const pgObjeto: (entrada: {
|
||||
[k: string]: any;
|
||||
}) => {
|
||||
[k: string]: string | boolean | null | undefined | number;
|
||||
};
|
||||
declare const objetoPg: (entrada: {
|
||||
[k: string]: any;
|
||||
}) => {
|
||||
[k: string]: string | boolean | null | undefined | number;
|
||||
};
|
||||
|
||||
declare const umaFuncao: () => string;
|
||||
|
||||
declare const umaVariavel = "Ol\u00E1 Mundo! (vari\u00E1vel)";
|
||||
|
||||
/** gerar o texto de busca removendo caracteres especies e caixa alta */
|
||||
declare const texto_busca: (...texto: any[]) => string;
|
||||
|
||||
/** Gerar uma classe que facilita a gestão de rotas com a tipagem das querys
|
||||
*
|
||||
* Definições:
|
||||
*
|
||||
* caminho = "/aplicacao/funcionalidade"
|
||||
*
|
||||
* endereco = "http://localhost:3000/aplicacao/funcionalidade"
|
||||
*
|
||||
* parametros = {nome:"José"}
|
||||
*/
|
||||
declare class TipagemRotas<T extends {
|
||||
[q: string]: any;
|
||||
}> {
|
||||
_partesCaminho: string[];
|
||||
_acaoIr?: (endereco: string) => undefined;
|
||||
rotulo: string | undefined;
|
||||
/** Ao criar novo obijeto de tipagem de rota é necessário passar o caminho parcial
|
||||
** export const mCaminho = new TipagemRotas<{q:string}>("aplicacao","funcionalidade")
|
||||
*/
|
||||
constructor({ caminho, acaoIr, rotulo, }: {
|
||||
caminho: (string | null | undefined)[] | string;
|
||||
acaoIr?: undefined | ((endereco: string) => undefined);
|
||||
/** Rotulo da página
|
||||
* Inicio | Controle
|
||||
*/
|
||||
rotulo?: string;
|
||||
});
|
||||
/** Retorna o caminho completo da rota
|
||||
** console.log(mCaminho.caminho)
|
||||
** "/caminho"
|
||||
*/
|
||||
get caminho(): string;
|
||||
/** Define o caminho completo da rota
|
||||
** mCaminho.caminho = "/novoCaminho"
|
||||
** console.log(mCaminho.caminho)
|
||||
** "/novoCaminho"
|
||||
** */
|
||||
set caminho(caminhoParcial: string);
|
||||
/** Retorna o caminho completo da rota com a query
|
||||
** console.log(mCaminho.resolve({q:"query"}))
|
||||
** "http://localhost:3000/caminho?q=query"
|
||||
*/
|
||||
endereco(query: T, usarComoHash?: boolean): string;
|
||||
/** Vai para a url
|
||||
** mCaminho.ir({q:"query"})
|
||||
** window.location.href = "http://localhost:3000/caminho?q=query"
|
||||
*/
|
||||
ir(query: T): void;
|
||||
/** Retorna os parametros da url
|
||||
** console.log(mCaminho.parametros())
|
||||
** {q:"query"}
|
||||
*/
|
||||
parametros(urlEntrada?: string): Partial<T>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Essa variável se conecta a tabela_lidades
|
||||
*
|
||||
* onde sigla se conecta com sigla
|
||||
*
|
||||
* Usuário terá mais opções de unidades, quando fazer o envio para o mtr, usar a opção fornecida pelo usuarios, caso não tenha
|
||||
* usar a normalizada
|
||||
*/
|
||||
declare enum siglas_unidades_medida {
|
||||
UN = "UN",
|
||||
KG = "KG",
|
||||
TON = "TON",
|
||||
g = "g",
|
||||
"M³" = "M\u00B3",
|
||||
Lt = "Lt"
|
||||
}
|
||||
declare const unidades_medida: {
|
||||
sigla_unidade: keyof typeof siglas_unidades_medida;
|
||||
nome: string;
|
||||
sigla_normalizada: keyof typeof siglas_unidades_medida;
|
||||
normalizar: (valor: number) => number;
|
||||
tipo: "massa" | "volume" | "comprimento" | "unidade";
|
||||
}[];
|
||||
|
||||
/**
|
||||
* Valida se uma string é um UUID válido (qualquer versão).
|
||||
*
|
||||
* @param valor - A string que será validada.
|
||||
* @returns booleano indicando se é um UUID válido.
|
||||
*/
|
||||
declare const erUuid: RegExp;
|
||||
declare const validarUuid: (uuid: string | number | undefined | null) => boolean;
|
||||
/**
|
||||
* Gera um UUID determinístico (versão 3) com base em uma chave e um grupo (namespace).
|
||||
*
|
||||
* - Usa o algoritmo MD5 (RFC 4122).
|
||||
* - Sempre retorna o mesmo UUID para a mesma combinação chave + grupo.
|
||||
* - Caso o grupo não seja informado, usa o UUID "nil" como namespace.
|
||||
*
|
||||
* @param chave - Qualquer valor que será convertido em string para gerar o UUID (ex: número, string ou objeto).
|
||||
* @param grupo - Opcional. Namespace para separar domínios diferentes de UUIDs.
|
||||
* @returns UUID v3 (determinístico)
|
||||
*/
|
||||
declare const uuidV3: (chave: any, grupo?: any) => string;
|
||||
/**
|
||||
* Gera um UUID v4 (aleatório, não determinístico).
|
||||
*
|
||||
* - Usado quando unicidade é necessária, mas não se exige que seja previsível.
|
||||
*/
|
||||
declare const uuidV4: typeof v4;
|
||||
/**
|
||||
* @deprecated Esta variável será descontinuada em versões futuras.
|
||||
* Use a função `uuidV4()` diretamente.
|
||||
*/
|
||||
declare const uuid: typeof v4;
|
||||
|
||||
declare const esperar: (ms: number) => Promise<true>;
|
||||
/**
|
||||
* Usado para retronat o no de uma variável, deve ser usado dentro de um objeto
|
||||
* const nomex = {a: 1, b: 2}
|
||||
* nomeVariavel({nomex}) // retorna "nomex"
|
||||
* @param v
|
||||
* @returns
|
||||
*/
|
||||
declare const nomeVariavel: (v: {
|
||||
[key: string]: any;
|
||||
}) => string;
|
||||
|
||||
export { TipagemRotas, type TipoLoggerSessao, aleatorio, cacheM, cacheMFixo, cacheMemoria, camposComuns, cdn_carro_de_boi, dayjsbr, defineCwd, erUuid, esperar, extensoes, graficos_pilao, type interfaceConsulta, localValor, logger, nomeVariavel, objetoPg, operadores, paraObjetoRegistroPg, pgObjeto, postLogger, siglas_unidades_medida, texto_busca, tipoArquivo, type tipoFiltro, type tipoLogger, type tipoLoggerLog, type tipoLokiObjeto, tipoUsuarioResiduos, tx, umaFuncao, umaVariavel, unidades_medida, uuid, uuidV3, uuidV4, uuid_null, validarUuid, verCacheM, zFiltro, zOperadores };
|
||||
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue