@neta-art/cohub 1.9.0 → 1.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -105
- package/dist/chunks/environment.js +33 -0
- package/dist/chunks/http.d.ts +1615 -0
- package/dist/chunks/http.js +1919 -0
- package/dist/chunks/websocket.d.ts +266 -0
- package/dist/chunks/websocket.js +655 -0
- package/dist/debugger.d.ts +198 -0
- package/dist/debugger.js +1120 -0
- package/dist/http.d.ts +3 -32
- package/dist/http.js +2 -48
- package/dist/index.d.ts +35 -14
- package/dist/index.js +105 -8
- package/dist/websocket.d.ts +2 -141
- package/dist/websocket.js +2 -628
- package/package.json +11 -7
- package/dist/apis/channels.d.ts +0 -13
- package/dist/apis/channels.js +0 -24
- package/dist/apis/cron-jobs.d.ts +0 -18
- package/dist/apis/cron-jobs.js +0 -25
- package/dist/apis/explore.d.ts +0 -9
- package/dist/apis/explore.js +0 -9
- package/dist/apis/generations.d.ts +0 -7
- package/dist/apis/generations.js +0 -13
- package/dist/apis/invitations.d.ts +0 -20
- package/dist/apis/invitations.js +0 -36
- package/dist/apis/models.d.ts +0 -10
- package/dist/apis/models.js +0 -13
- package/dist/apis/prompts.d.ts +0 -9
- package/dist/apis/prompts.js +0 -16
- package/dist/apis/search.d.ts +0 -10
- package/dist/apis/search.js +0 -14
- package/dist/apis/session-access.d.ts +0 -13
- package/dist/apis/session-access.js +0 -19
- package/dist/apis/spaces.d.ts +0 -371
- package/dist/apis/spaces.js +0 -766
- package/dist/apis/tasks.d.ts +0 -13
- package/dist/apis/tasks.js +0 -18
- package/dist/apis/user.d.ts +0 -27
- package/dist/apis/user.js +0 -71
- package/dist/client.d.ts +0 -33
- package/dist/client.js +0 -103
- package/dist/environment.d.ts +0 -22
- package/dist/environment.js +0 -37
- package/dist/realtime.d.ts +0 -2
- package/dist/realtime.js +0 -8
- package/dist/session-generation-stream.d.ts +0 -114
- package/dist/session-generation-stream.js +0 -514
- package/dist/session-patch-reducer.d.ts +0 -61
- package/dist/session-patch-reducer.js +0 -432
- package/dist/transport.d.ts +0 -40
- package/dist/transport.js +0 -78
- package/dist/types.d.ts +0 -535
- package/dist/types.js +0 -1
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
//#region src/debugger.d.ts
|
|
2
|
+
type CohubConsoleLevel = "debug" | "error" | "info" | "log" | "trace" | "warn";
|
|
3
|
+
type CohubNetworkKind = "eventsource" | "fetch" | "resource" | "websocket" | "xhr";
|
|
4
|
+
type CohubNetworkPhase = "abort" | "close" | "error" | "line" | "message" | "open" | "request" | "response" | "timeout";
|
|
5
|
+
interface CohubDebuggerOptions {
|
|
6
|
+
enabled?: boolean;
|
|
7
|
+
maxConsoleEntries?: number;
|
|
8
|
+
maxNetworkEntries?: number;
|
|
9
|
+
maxPayloadBytes?: number;
|
|
10
|
+
maxLineBytes?: number;
|
|
11
|
+
captureHeaders?: boolean;
|
|
12
|
+
captureRequestBody?: boolean;
|
|
13
|
+
captureResponseBody?: boolean;
|
|
14
|
+
redactHeaders?: string[];
|
|
15
|
+
}
|
|
16
|
+
interface CohubDebuggerHandle {
|
|
17
|
+
exportLog: () => CohubDebugLogPackage;
|
|
18
|
+
exportHar: () => CohubDebugHar;
|
|
19
|
+
clear: () => void;
|
|
20
|
+
stop: () => void;
|
|
21
|
+
}
|
|
22
|
+
interface CohubDebugLogPackage {
|
|
23
|
+
version: 1;
|
|
24
|
+
exportedAt: string;
|
|
25
|
+
startedAt: string;
|
|
26
|
+
userAgent?: string;
|
|
27
|
+
url?: string;
|
|
28
|
+
options: Required<CohubDebuggerOptions>;
|
|
29
|
+
console: CohubConsoleEntry[];
|
|
30
|
+
network: CohubNetworkEntry[];
|
|
31
|
+
dropped: {
|
|
32
|
+
console: number;
|
|
33
|
+
network: number;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
interface CohubConsoleEntry {
|
|
37
|
+
id: number;
|
|
38
|
+
at: string;
|
|
39
|
+
elapsedMs: number;
|
|
40
|
+
level: CohubConsoleLevel;
|
|
41
|
+
args: SerializedValue[];
|
|
42
|
+
stack?: string;
|
|
43
|
+
}
|
|
44
|
+
interface CohubNetworkEntry {
|
|
45
|
+
id: number;
|
|
46
|
+
connectionId: string;
|
|
47
|
+
at: string;
|
|
48
|
+
elapsedMs: number;
|
|
49
|
+
kind: CohubNetworkKind;
|
|
50
|
+
phase: CohubNetworkPhase;
|
|
51
|
+
method?: string;
|
|
52
|
+
url: string;
|
|
53
|
+
status?: number;
|
|
54
|
+
statusText?: string;
|
|
55
|
+
durationMs?: number;
|
|
56
|
+
requestHeaders?: Record<string, string>;
|
|
57
|
+
responseHeaders?: Record<string, string>;
|
|
58
|
+
direction?: "incoming" | "outgoing";
|
|
59
|
+
source?: "instrumentation" | "performance";
|
|
60
|
+
initiatorType?: string;
|
|
61
|
+
lineNumber?: number;
|
|
62
|
+
sizeBytes?: number;
|
|
63
|
+
truncated?: boolean;
|
|
64
|
+
eventName?: string;
|
|
65
|
+
payload?: SerializedValue | string;
|
|
66
|
+
error?: string;
|
|
67
|
+
close?: {
|
|
68
|
+
code: number;
|
|
69
|
+
reason: string;
|
|
70
|
+
wasClean: boolean;
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
interface CohubDebugHar {
|
|
74
|
+
log: {
|
|
75
|
+
version: "1.2";
|
|
76
|
+
creator: {
|
|
77
|
+
name: "@neta-art/cohub/debugger";
|
|
78
|
+
version: string;
|
|
79
|
+
};
|
|
80
|
+
browser?: {
|
|
81
|
+
name: string;
|
|
82
|
+
version: string;
|
|
83
|
+
};
|
|
84
|
+
pages: HarPage[];
|
|
85
|
+
entries: HarEntry[];
|
|
86
|
+
_cohub?: {
|
|
87
|
+
exportedAt: string;
|
|
88
|
+
startedAt: string;
|
|
89
|
+
dropped: {
|
|
90
|
+
console: number;
|
|
91
|
+
network: number;
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
interface HarPage {
|
|
97
|
+
startedDateTime: string;
|
|
98
|
+
id: string;
|
|
99
|
+
title: string;
|
|
100
|
+
pageTimings: {
|
|
101
|
+
onContentLoad: number;
|
|
102
|
+
onLoad: number;
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
interface HarEntry {
|
|
106
|
+
pageref: string;
|
|
107
|
+
startedDateTime: string;
|
|
108
|
+
time: number;
|
|
109
|
+
request: HarRequest;
|
|
110
|
+
response: HarResponse;
|
|
111
|
+
cache: Record<string, never>;
|
|
112
|
+
timings: HarTimings;
|
|
113
|
+
serverIPAddress: string;
|
|
114
|
+
connection: string;
|
|
115
|
+
_resourceType: string;
|
|
116
|
+
_cohubConnectionId: string;
|
|
117
|
+
_cohubKind: CohubNetworkKind;
|
|
118
|
+
_cohubSource?: "instrumentation" | "performance";
|
|
119
|
+
_cohubEntries: CohubNetworkEntry[];
|
|
120
|
+
_cohubMessages?: HarCohubMessage[];
|
|
121
|
+
_webSocketMessages?: HarWebSocketMessage[];
|
|
122
|
+
}
|
|
123
|
+
interface HarRequest {
|
|
124
|
+
method: string;
|
|
125
|
+
url: string;
|
|
126
|
+
httpVersion: string;
|
|
127
|
+
cookies: HarCookie[];
|
|
128
|
+
headers: HarNameValuePair[];
|
|
129
|
+
queryString: HarNameValuePair[];
|
|
130
|
+
headersSize: number;
|
|
131
|
+
bodySize: number;
|
|
132
|
+
postData?: HarPostData;
|
|
133
|
+
}
|
|
134
|
+
interface HarResponse {
|
|
135
|
+
status: number;
|
|
136
|
+
statusText: string;
|
|
137
|
+
httpVersion: string;
|
|
138
|
+
cookies: HarCookie[];
|
|
139
|
+
headers: HarNameValuePair[];
|
|
140
|
+
content: HarContent;
|
|
141
|
+
redirectURL: string;
|
|
142
|
+
headersSize: number;
|
|
143
|
+
bodySize: number;
|
|
144
|
+
}
|
|
145
|
+
interface HarNameValuePair {
|
|
146
|
+
name: string;
|
|
147
|
+
value: string;
|
|
148
|
+
}
|
|
149
|
+
interface HarCookie extends HarNameValuePair {
|
|
150
|
+
path?: string;
|
|
151
|
+
domain?: string;
|
|
152
|
+
expires?: string | null;
|
|
153
|
+
httpOnly?: boolean;
|
|
154
|
+
secure?: boolean;
|
|
155
|
+
}
|
|
156
|
+
interface HarPostData {
|
|
157
|
+
mimeType: string;
|
|
158
|
+
text: string;
|
|
159
|
+
params: HarNameValuePair[];
|
|
160
|
+
}
|
|
161
|
+
interface HarContent {
|
|
162
|
+
size: number;
|
|
163
|
+
mimeType: string;
|
|
164
|
+
text?: string;
|
|
165
|
+
encoding?: string;
|
|
166
|
+
}
|
|
167
|
+
interface HarTimings {
|
|
168
|
+
blocked: number;
|
|
169
|
+
dns: number;
|
|
170
|
+
connect: number;
|
|
171
|
+
send: number;
|
|
172
|
+
wait: number;
|
|
173
|
+
receive: number;
|
|
174
|
+
ssl: number;
|
|
175
|
+
}
|
|
176
|
+
interface HarCohubMessage {
|
|
177
|
+
time: string;
|
|
178
|
+
direction?: "incoming" | "outgoing";
|
|
179
|
+
lineNumber?: number;
|
|
180
|
+
eventName?: string;
|
|
181
|
+
data: string;
|
|
182
|
+
}
|
|
183
|
+
interface HarWebSocketMessage {
|
|
184
|
+
type: "receive" | "send";
|
|
185
|
+
time: number;
|
|
186
|
+
opcode: number;
|
|
187
|
+
data: string;
|
|
188
|
+
}
|
|
189
|
+
type SerializedValue = null | boolean | number | string | SerializedValue[] | {
|
|
190
|
+
[key: string]: SerializedValue;
|
|
191
|
+
};
|
|
192
|
+
declare function startCohubDebugger(options?: CohubDebuggerOptions): CohubDebuggerHandle;
|
|
193
|
+
declare function exportCohubDebugLog(): CohubDebugLogPackage;
|
|
194
|
+
declare function exportCohubDebugHar(): CohubDebugHar;
|
|
195
|
+
declare function clearCohubDebugLog(): void;
|
|
196
|
+
declare function stopCohubDebugger(): void;
|
|
197
|
+
//#endregion
|
|
198
|
+
export { CohubConsoleEntry, CohubConsoleLevel, CohubDebugHar, CohubDebugLogPackage, CohubDebuggerHandle, CohubDebuggerOptions, CohubNetworkEntry, CohubNetworkKind, CohubNetworkPhase, HarCohubMessage, HarContent, HarCookie, HarEntry, HarNameValuePair, HarPage, HarPostData, HarRequest, HarResponse, HarTimings, HarWebSocketMessage, SerializedValue, clearCohubDebugLog, exportCohubDebugHar, exportCohubDebugLog, startCohubDebugger, stopCohubDebugger };
|