• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

thoughtspot / rise / #363

28 May 2025 06:00AM UTC coverage: 0.0% (-85.8%) from 85.769%
#363

push

sagar1993
Add gqlVariables to gqlResolver

0 of 113 branches covered (0.0%)

Branch coverage included in aggregate %.

0 of 5 new or added lines in 2 files covered. (0.0%)

144 existing lines in 4 files now uncovered.

0 of 162 relevant lines covered (0.0%)

0.0 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/common.ts
UNCOV
1
import _ from 'lodash';
×
2

UNCOV
3
const FORWARD_RESPONSE_HEADERS = [
×
4
    'set-cookie',
5
    'x-callosum-incident-id',
6
    'x-callosum-ip',
7
    'x-callosum-request-time-us',
8
    'x-callosum-trace-id',
9
    'x-content-type-options',
10
    'x-nginx-localhost',
11
    'x-ua-compatible',
12
    'x-xss-protection',
13
];
14

UNCOV
15
export const commonDefs = `
×
16
    scalar JSON
17
    input RiseSetter {
18
        field: String
19
        path: String!
20
    }
21
`;
22

23
export interface RiseDirectiveOptions {
24
    name: string;
25
    baseURL: string;
26
    apiType: 'rest' | 'gql';
27
    headers: Record<string, string>;
28
    forwardheaders: string[];
29
    contenttype: string | undefined;
30
    ErrorClass: new (...args: any[]) => Error;
31
}
32

UNCOV
33
export function getReqHeaders(riseDirective: RiseDirectiveOptions, options, context) {
×
34
    let {
35
        headers = {},
×
36
        contenttype = options.contenttype || 'application/json',
×
37
        forwardheaders = [],
×
UNCOV
38
      } = riseDirective;
×
39

UNCOV
40
      headers = {
×
UNCOV
41
        'Content-Type': contenttype,
×
42
        ...options.headers,
43
        ...headers,
UNCOV
44
      };
×
45
      forwardheaders.push(...options.forwardheaders);
46
      forwardheaders = forwardheaders.map((h) => h.toLowerCase());
47
      return {
48
        ...headers,
×
49
        ..._.pickBy(context.req.headers, (v, h) => forwardheaders.includes(h.toLowerCase())),
UNCOV
50
      };
×
UNCOV
51
}
×
UNCOV
52

×
UNCOV
53
export function processResHeaders(response, context) {
×
54
    // Setting the headers returned from response
UNCOV
55
    const responseHeaders: any = response.headers.raw();
×
56
    FORWARD_RESPONSE_HEADERS.forEach((key) => {
57
    if (responseHeaders[key]) {
58
        context.res.setHeader(key, responseHeaders[key]);
UNCOV
59
    }
×
60
    });
UNCOV
61
}
×
UNCOV
62

×
UNCOV
63
export class RestError extends Error {
×
UNCOV
64
    public code: number;
×
65

66
    public errors: any;
67

68
    constructor(message = 'Error occured', code = 400, errors = null) {
UNCOV
69
        super(message);
×
70
        this.code = code;
71
        this.errors = errors;
72
    }
73
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc