build
This commit is contained in:
parent
e5bbcf11d3
commit
8d240bbee9
6 changed files with 25 additions and 26 deletions
|
|
@ -444,15 +444,15 @@ declare class ClassPilao {
|
||||||
});
|
});
|
||||||
rotaEnviarRegistros(): {
|
rotaEnviarRegistros(): {
|
||||||
rota: string;
|
rota: string;
|
||||||
url: string;
|
url: URL;
|
||||||
};
|
};
|
||||||
rotaDeletarRegistro(): {
|
rotaDeletarRegistro(): {
|
||||||
rota: string;
|
rota: string;
|
||||||
url: string;
|
url: URL;
|
||||||
};
|
};
|
||||||
rotaConsultarSerie(tipoVisao: nomesVisoes | ":tipoVisao"): {
|
rotaConsultarSerie(): {
|
||||||
rota: string;
|
rota: string;
|
||||||
url: string;
|
url: URL;
|
||||||
};
|
};
|
||||||
rotaIframeSerie(tipoVisao: nomesVisoes | ":tipoVisao"): {
|
rotaIframeSerie(tipoVisao: nomesVisoes | ":tipoVisao"): {
|
||||||
rota: string;
|
rota: string;
|
||||||
|
|
@ -460,7 +460,7 @@ declare class ClassPilao {
|
||||||
};
|
};
|
||||||
rotaFuncaoApi(funcao: keyof tipo_pilao_api | ":funcao"): {
|
rotaFuncaoApi(funcao: keyof tipo_pilao_api | ":funcao"): {
|
||||||
rota: string;
|
rota: string;
|
||||||
url: string;
|
url: URL;
|
||||||
};
|
};
|
||||||
consultarApi<T extends keyof tipo_pilao_api>(funcao: T, parametros: tipo_pilao_api[T]["pr"]): Promise<tipoResposta<tipo_pilao_api[T]["rs"]>>;
|
consultarApi<T extends keyof tipo_pilao_api>(funcao: T, parametros: tipo_pilao_api[T]["pr"]): Promise<tipoResposta<tipo_pilao_api[T]["rs"]>>;
|
||||||
get baseUrlApi(): "https://carro-de-boi.idz.one" | "http://localhost:5080";
|
get baseUrlApi(): "https://carro-de-boi.idz.one" | "http://localhost:5080";
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
10
dist-require/index.d.ts
vendored
10
dist-require/index.d.ts
vendored
|
|
@ -444,15 +444,15 @@ declare class ClassPilao {
|
||||||
});
|
});
|
||||||
rotaEnviarRegistros(): {
|
rotaEnviarRegistros(): {
|
||||||
rota: string;
|
rota: string;
|
||||||
url: string;
|
url: URL;
|
||||||
};
|
};
|
||||||
rotaDeletarRegistro(): {
|
rotaDeletarRegistro(): {
|
||||||
rota: string;
|
rota: string;
|
||||||
url: string;
|
url: URL;
|
||||||
};
|
};
|
||||||
rotaConsultarSerie(tipoVisao: nomesVisoes | ":tipoVisao"): {
|
rotaConsultarSerie(): {
|
||||||
rota: string;
|
rota: string;
|
||||||
url: string;
|
url: URL;
|
||||||
};
|
};
|
||||||
rotaIframeSerie(tipoVisao: nomesVisoes | ":tipoVisao"): {
|
rotaIframeSerie(tipoVisao: nomesVisoes | ":tipoVisao"): {
|
||||||
rota: string;
|
rota: string;
|
||||||
|
|
@ -460,7 +460,7 @@ declare class ClassPilao {
|
||||||
};
|
};
|
||||||
rotaFuncaoApi(funcao: keyof tipo_pilao_api | ":funcao"): {
|
rotaFuncaoApi(funcao: keyof tipo_pilao_api | ":funcao"): {
|
||||||
rota: string;
|
rota: string;
|
||||||
url: string;
|
url: URL;
|
||||||
};
|
};
|
||||||
consultarApi<T extends keyof tipo_pilao_api>(funcao: T, parametros: tipo_pilao_api[T]["pr"]): Promise<tipoResposta<tipo_pilao_api[T]["rs"]>>;
|
consultarApi<T extends keyof tipo_pilao_api>(funcao: T, parametros: tipo_pilao_api[T]["pr"]): Promise<tipoResposta<tipo_pilao_api[T]["rs"]>>;
|
||||||
get baseUrlApi(): "https://carro-de-boi.idz.one" | "http://localhost:5080";
|
get baseUrlApi(): "https://carro-de-boi.idz.one" | "http://localhost:5080";
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "p-drives",
|
"name": "p-drives",
|
||||||
"version": "0.207.0",
|
"version": "0.208.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "src/index.ts",
|
"main": "src/index.ts",
|
||||||
"exports": {
|
"exports": {
|
||||||
|
|
|
||||||
|
|
@ -53,24 +53,22 @@ export class ClassPilao {
|
||||||
this.#ver_log = ver_log
|
this.#ver_log = ver_log
|
||||||
}
|
}
|
||||||
|
|
||||||
#gerarUrl(acao: string, extraPath?: string): { rota: string; url: string } {
|
#gerarUrlApi(acao: string): { rota: string; url: URL } {
|
||||||
const rota = `${PREFIXO_PILAO}/api/${acao}/${this.#produto}/${this.#conta}${
|
const rota = `${PREFIXO_PILAO}/api/${acao}/${this.#produto}/${this.#conta}`
|
||||||
extraPath ? `/${extraPath}` : ""
|
const url = new URL(`${this.baseUrlApi}${rota}`)
|
||||||
}`
|
|
||||||
const url = `${this.baseUrlApi}${rota}`
|
|
||||||
return { rota, url }
|
return { rota, url }
|
||||||
}
|
}
|
||||||
|
|
||||||
rotaEnviarRegistros() {
|
rotaEnviarRegistros() {
|
||||||
return this.#gerarUrl(pilao_enderecos["enviar-registros"])
|
return this.#gerarUrlApi(pilao_enderecos["enviar-registros"])
|
||||||
}
|
}
|
||||||
|
|
||||||
rotaDeletarRegistro() {
|
rotaDeletarRegistro() {
|
||||||
return this.#gerarUrl(pilao_enderecos["deletar-registros"])
|
return this.#gerarUrlApi(pilao_enderecos["deletar-registros"])
|
||||||
}
|
}
|
||||||
|
|
||||||
rotaConsultarSerie(tipoVisao: nomesVisoes | ":tipoVisao") {
|
rotaConsultarSerie() {
|
||||||
return this.#gerarUrl(pilao_enderecos["consultar-serie"], tipoVisao)
|
return this.#gerarUrlApi(pilao_enderecos["consultar-serie"])
|
||||||
}
|
}
|
||||||
|
|
||||||
rotaIframeSerie(tipoVisao: nomesVisoes | ":tipoVisao") {
|
rotaIframeSerie(tipoVisao: nomesVisoes | ":tipoVisao") {
|
||||||
|
|
@ -80,7 +78,7 @@ export class ClassPilao {
|
||||||
}
|
}
|
||||||
|
|
||||||
rotaFuncaoApi(funcao: keyof tipo_pilao_api | ":funcao") {
|
rotaFuncaoApi(funcao: keyof tipo_pilao_api | ":funcao") {
|
||||||
return this.#gerarUrl("API", funcao)
|
return this.#gerarUrlApi(funcao)
|
||||||
}
|
}
|
||||||
|
|
||||||
async consultarApi<T extends keyof tipo_pilao_api>(
|
async consultarApi<T extends keyof tipo_pilao_api>(
|
||||||
|
|
@ -200,7 +198,7 @@ export class ClassPilao {
|
||||||
`[PILÃO]: Enviando ${registros.length} registros na tabela "${tabela}" para "${url}".`,
|
`[PILÃO]: Enviando ${registros.length} registros na tabela "${tabela}" para "${url}".`,
|
||||||
)
|
)
|
||||||
const resp = await this.processarRegistros(
|
const resp = await this.processarRegistros(
|
||||||
url,
|
url.href,
|
||||||
registros,
|
registros,
|
||||||
tabela,
|
tabela,
|
||||||
"enviar",
|
"enviar",
|
||||||
|
|
@ -216,7 +214,7 @@ export class ClassPilao {
|
||||||
const codigos = [...(this.#codigosParaDeletar[tabela] || [])]
|
const codigos = [...(this.#codigosParaDeletar[tabela] || [])]
|
||||||
const url = this.rotaDeletarRegistro().url
|
const url = this.rotaDeletarRegistro().url
|
||||||
const resp = await this.processarRegistros(
|
const resp = await this.processarRegistros(
|
||||||
url,
|
url.href,
|
||||||
codigos,
|
codigos,
|
||||||
tabela,
|
tabela,
|
||||||
"deletar",
|
"deletar",
|
||||||
|
|
@ -249,7 +247,8 @@ export class ClassPilao {
|
||||||
const dados = async (): Promise<
|
const dados = async (): Promise<
|
||||||
tipoResposta<tipoRetornoSerieconsulta<T>>
|
tipoResposta<tipoRetornoSerieconsulta<T>>
|
||||||
> => {
|
> => {
|
||||||
const url = this.rotaConsultarSerie(tipoVisao).url
|
const url = this.rotaConsultarSerie().url
|
||||||
|
url.searchParams.set("visao", tipoVisao)
|
||||||
const resp = await crossFetch(url.toString(), {
|
const resp = await crossFetch(url.toString(), {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: JSON.stringify(parametros),
|
body: JSON.stringify(parametros),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue