summaryrefslogtreecommitdiffstats
path: root/typescript/src/getAjaxSettings.ts
blob: 58996375ccf549e6f1593831c45d3be69482ee2b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* SPDX-License-Identifier: AGPL-3.0-or-later */

import AjaxSettings from "./AjaxSettings.js";
import EntrypointParameter from "./EntrypointParameter.js";
import getAppID from "./getAppID.js";

export default (EntrypointParameter: EntrypointParameter): AjaxSettings =>
  Object.freeze({
    url: "https://api.wolframalpha.com/v2/query",
    dataType: "jsonp",
    traditional: true,
    data: Object.freeze({
      ...EntrypointParameter,
      appid: getAppID(),
      output: "json",
      reinterpret: true,
      podtimeout: 30,
      scantimeout: 30,
      parsetimeout: 30,
      totaltimeout: 30,
      formattimeout: 30,
    }),
  });