-
Notifications
You must be signed in to change notification settings - Fork 0
/
mu.d.ts
73 lines (66 loc) · 2.04 KB
/
mu.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
declare module "mu" {
import { Application, Request, Response } from "express";
type SparqlClientResponse = {
head: { link: unknown[]; vars?: string[] };
boolean?: boolean;
results?: {
distinct: boolean;
ordered: boolean;
bindings: Record<
string,
{
type: "literal" | "typed-literal" | "uri";
"xml:lang"?: string;
datatype?:
| "http://www.w3.org/2001/XMLSchema#dateTime"
| "http://www.w3.org/2001/XMLSchema#integer";
value: SparqlClientValue;
}
>[];
};
} | null;
type SparqlClientValue = string | number | Date | boolean | undefined;
const app: Application;
function sparqlEscapeString(s: string): string;
function sparqlEscapeUri(s: string): string;
function sparqlEscapeDecimal(n: number): string;
function sparqlEscapeInt(n: number): string;
function sparqlEscapeFloat(n: number): string;
function sparqlEscapeDate(date: Date): string;
function sparqlEscapeDateTime(date: Date): string;
function sparqlEscapeBool(bool: boolean): string;
function sparqlEscape(
value: string | boolean | number | Date,
type: string
): string;
function query(queryString: string): Promise<SparqlClientResponse>;
function update(queryString: string): Promise<void>;
function uuid(): string;
function errorHandler(
err: Error,
req: Request,
res: Response,
next: () => void
): void;
}
declare module "@lblod/mu-auth-sudo" {
import { Application, Request, Response } from "express";
type SparqlClientResponse = {
head: { link: unknown[]; vars: string[] };
results: {
distinct: boolean;
ordered: boolean;
bindings: Record<
string,
{
type: "literal";
"xml:lang"?: string;
value: SparqlClientValue;
}
>[];
};
} | null;
type SparqlClientValue = string | number | Date | undefined;
function querySudo(queryString: string): Promise<SparqlClientResponse>;
function updateSudo(queryString: string): Promise<void>;
}