PageSourceSearch

https://entregassaopaulo.tec.br/enderecosServico/nodeApi/NodeApi.js?v=1632743053

js entregassaopaulo.tec.br collected 2026-10-02 01:19:24 UTC 1,834 bytes, 50 lines download raw bytes

1/**
2 * Função responsável por consumir a API do Node
3 * @param {string} token Token JWT para efetuar a requisição
4 * @param {bool} production Se `true` enviará para o subdomínio de produção
5 * @returns Retorna um `object` com os métodos necessários para consumir a API
6 */
7function NodeApi(token, production = false) {
8  // Este servidor está no email: [email protected], projeto: servidorrotinacurl
9  var urlBase = production ? `https://apinode.appmapp.com.br/api/v1`
10    : `https://apinodedev.appmapp.com.br/api/v1`;
11
12    /**
13     * Função responsável por enviar a requisição
14     * @param {string} uri URI que será enviada a requisição
15     * @param {object} options Opções para que seja efetuada a requisição
16     * @returns Retorna um `object` ou `false` caso haja erro
17     */
18  async function request(uri, options) {
19    const timeout = 2000;
20    const controller = new AbortController();
21    const id = setTimeout(() => controller.abort(), timeout);
22    const res = await fetch(urlBase + uri, {
23      ...options,
24      signal: controller.signal
25    }).then(res => res.ok ? res.json() : false)
26      .catch(err => console.log("Houve um erro ao enviar a requisição", err));
27
28    clearTimeout(id);
29    return res;
30  };
31
32  return {
33    /**
34     * Função responsável por consumir a rota de autocomplete da API do Node
35     * @param {object} params Parâmetros que serão enviados na requisição
36     * @returns Retorna um `object` ou `false` caso haja erro
37     */
38    autocomplete: async params => {
39      var uri = "/pelias/autocomplete?" + new URLSearchParams(params).toString();
40
41      return await request(uri, {
42        method: "GET",
43        headers: new Headers({
44          "Content-Type": "application/json",
45          "Authorization": `Bearer ${token}`
46        })
47      });
48    }
49  };
50}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.