Repository navigation
Expand file tree
/
Copy pathcontext.ts
More file actions
116 lines (106 loc) · 2.89 KB
/
Copy pathcontext.ts
File metadata and controls
116 lines (106 loc) · 2.89 KB
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
import type { Primitive } from './misc';
import type { SpanOrigin } from './span';
export type Context = Record<string, unknown>;
export interface Contexts extends Record<string, Context | undefined> {
app?: AppContext;
device?: DeviceContext;
os?: OsContext;
culture?: CultureContext;
response?: ResponseContext;
trace?: TraceContext;
cloud_resource?: CloudResourceContext;
state?: StateContext;
}
export interface StateContext extends Record<string, unknown> {
state: {
type: string;
value: Record<string, unknown>;
};
}
export interface AppContext extends Record<string, unknown> {
app_name?: string;
app_start_time?: string;
app_version?: string;
app_identifier?: string;
build_type?: string;
app_memory?: number;
}
export interface DeviceContext extends Record<string, unknown> {
name?: string;
family?: string;
model?: string;
model_id?: string;
arch?: string;
battery_level?: number;
orientation?: 'portrait' | 'landscape';
manufacturer?: string;
brand?: string;
screen_resolution?: string;
screen_height_pixels?: number;
screen_width_pixels?: number;
screen_density?: number;
screen_dpi?: number;
online?: boolean;
charging?: boolean;
low_memory?: boolean;
simulator?: boolean;
memory_size?: number;
free_memory?: number;
usable_memory?: number;
storage_size?: number;
free_storage?: number;
external_storage_size?: number;
external_free_storage?: number;
boot_time?: string;
processor_count?: number;
cpu_description?: string;
processor_frequency?: number;
device_type?: string;
battery_status?: string;
device_unique_identifier?: string;
supports_vibration?: boolean;
supports_accelerometer?: boolean;
supports_gyroscope?: boolean;
supports_audio?: boolean;
supports_location_service?: boolean;
}
export interface OsContext extends Record<string, unknown> {
name?: string;
version?: string;
build?: string;
kernel_version?: string;
}
export interface CultureContext extends Record<string, unknown> {
calendar?: string;
display_name?: string;
locale?: string;
is_24_hour_format?: boolean;
timezone?: string;
}
export interface ResponseContext extends Record<string, unknown> {
type?: string;
cookies?: string[][] | Record<string, string>;
headers?: Record<string, string>;
status_code?: number;
body_size?: number; // in bytes
}
export interface TraceContext extends Record<string, unknown> {
data?: { [key: string]: any };
description?: string;
op?: string;
parent_span_id?: string;
span_id: string;
status?: string;
tags?: { [key: string]: Primitive };
trace_id: string;
origin?: SpanOrigin;
}
export interface CloudResourceContext extends Record<string, unknown> {
['cloud.provider']?: string;
['cloud.account.id']?: string;
['cloud.region']?: string;
['cloud.availability_zone']?: string;
['cloud.platform']?: string;
['host.id']?: string;
['host.type']?: string;
}