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(): {
|
||||
rota: string;
|
||||
url: string;
|
||||
url: URL;
|
||||
};
|
||||
rotaDeletarRegistro(): {
|
||||
rota: string;
|
||||
url: string;
|
||||
url: URL;
|
||||
};
|
||||
rotaConsultarSerie(tipoVisao: nomesVisoes | ":tipoVisao"): {
|
||||
rotaConsultarSerie(): {
|
||||
rota: string;
|
||||
url: string;
|
||||
url: URL;
|
||||
};
|
||||
rotaIframeSerie(tipoVisao: nomesVisoes | ":tipoVisao"): {
|
||||
rota: string;
|
||||
|
|
@ -460,7 +460,7 @@ declare class ClassPilao {
|
|||
};
|
||||
rotaFuncaoApi(funcao: keyof tipo_pilao_api | ":funcao"): {
|
||||
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"]>>;
|
||||
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(): {
|
||||
rota: string;
|
||||
url: string;
|
||||
url: URL;
|
||||
};
|
||||
rotaDeletarRegistro(): {
|
||||
rota: string;
|
||||
url: string;
|
||||
url: URL;
|
||||
};
|
||||
rotaConsultarSerie(tipoVisao: nomesVisoes | ":tipoVisao"): {
|
||||
rotaConsultarSerie(): {
|
||||
rota: string;
|
||||
url: string;
|
||||
url: URL;
|
||||
};
|
||||
rotaIframeSerie(tipoVisao: nomesVisoes | ":tipoVisao"): {
|
||||
rota: string;
|
||||
|
|
@ -460,7 +460,7 @@ declare class ClassPilao {
|
|||
};
|
||||
rotaFuncaoApi(funcao: keyof tipo_pilao_api | ":funcao"): {
|
||||
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"]>>;
|
||||
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",
|
||||
"version": "0.207.0",
|
||||
"version": "0.208.0",
|
||||
"description": "",
|
||||
"main": "src/index.ts",
|
||||
"exports": {
|
||||
|
|
|
|||
|
|
@ -53,24 +53,22 @@ export class ClassPilao {
|
|||
this.#ver_log = ver_log
|
||||
}
|
||||
|
||||
#gerarUrl(acao: string, extraPath?: string): { rota: string; url: string } {
|
||||
const rota = `${PREFIXO_PILAO}/api/${acao}/${this.#produto}/${this.#conta}${
|
||||
extraPath ? `/${extraPath}` : ""
|
||||
}`
|
||||
const url = `${this.baseUrlApi}${rota}`
|
||||
#gerarUrlApi(acao: string): { rota: string; url: URL } {
|
||||
const rota = `${PREFIXO_PILAO}/api/${acao}/${this.#produto}/${this.#conta}`
|
||||
const url = new URL(`${this.baseUrlApi}${rota}`)
|
||||
return { rota, url }
|
||||
}
|
||||
|
||||
rotaEnviarRegistros() {
|
||||
return this.#gerarUrl(pilao_enderecos["enviar-registros"])
|
||||
return this.#gerarUrlApi(pilao_enderecos["enviar-registros"])
|
||||
}
|
||||
|
||||
rotaDeletarRegistro() {
|
||||
return this.#gerarUrl(pilao_enderecos["deletar-registros"])
|
||||
return this.#gerarUrlApi(pilao_enderecos["deletar-registros"])
|
||||
}
|
||||
|
||||
rotaConsultarSerie(tipoVisao: nomesVisoes | ":tipoVisao") {
|
||||
return this.#gerarUrl(pilao_enderecos["consultar-serie"], tipoVisao)
|
||||
rotaConsultarSerie() {
|
||||
return this.#gerarUrlApi(pilao_enderecos["consultar-serie"])
|
||||
}
|
||||
|
||||
rotaIframeSerie(tipoVisao: nomesVisoes | ":tipoVisao") {
|
||||
|
|
@ -80,7 +78,7 @@ export class ClassPilao {
|
|||
}
|
||||
|
||||
rotaFuncaoApi(funcao: keyof tipo_pilao_api | ":funcao") {
|
||||
return this.#gerarUrl("API", funcao)
|
||||
return this.#gerarUrlApi(funcao)
|
||||
}
|
||||
|
||||
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}".`,
|
||||
)
|
||||
const resp = await this.processarRegistros(
|
||||
url,
|
||||
url.href,
|
||||
registros,
|
||||
tabela,
|
||||
"enviar",
|
||||
|
|
@ -216,7 +214,7 @@ export class ClassPilao {
|
|||
const codigos = [...(this.#codigosParaDeletar[tabela] || [])]
|
||||
const url = this.rotaDeletarRegistro().url
|
||||
const resp = await this.processarRegistros(
|
||||
url,
|
||||
url.href,
|
||||
codigos,
|
||||
tabela,
|
||||
"deletar",
|
||||
|
|
@ -249,7 +247,8 @@ export class ClassPilao {
|
|||
const dados = async (): Promise<
|
||||
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(), {
|
||||
method: "POST",
|
||||
body: JSON.stringify(parametros),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue