@waitroom-io/sdk 0.0.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/dist/index.d.ts +114 -0
- package/dist/index.js +4411 -0
- package/package.json +37 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { CreateCheckInRequest, CheckIn, ApproveCheckInRequest, RejectCheckInRequest, ModifyCheckInRequest, Room, CreateRoomRequest, UpdateRoomRequest, UpdatePoliciesRequest, AuditEvent, CreateSignalRequest, Signal, CreateWatcherRequest, Watcher, Agent, RegisterAgentRequest, SelfRegisterAgentRequest, UpdateAgentRequest, TrustScore } from '@waitroom-io/shared';
|
|
2
|
+
|
|
3
|
+
declare class WaitroomError extends Error {
|
|
4
|
+
readonly statusCode: number;
|
|
5
|
+
readonly code: string;
|
|
6
|
+
readonly details?: Record<string, string[]> | undefined;
|
|
7
|
+
constructor(message: string, statusCode: number, code: string, details?: Record<string, string[]> | undefined);
|
|
8
|
+
}
|
|
9
|
+
interface ClientOptions {
|
|
10
|
+
apiKey: string;
|
|
11
|
+
baseUrl?: string;
|
|
12
|
+
}
|
|
13
|
+
declare class HttpClient {
|
|
14
|
+
private baseUrl;
|
|
15
|
+
private apiKey;
|
|
16
|
+
constructor(options: ClientOptions);
|
|
17
|
+
request<T>(method: string, path: string, body?: unknown): Promise<T>;
|
|
18
|
+
}
|
|
19
|
+
declare class CheckInsResource {
|
|
20
|
+
private http;
|
|
21
|
+
constructor(http: HttpClient);
|
|
22
|
+
create(roomId: string, input: CreateCheckInRequest): Promise<CheckIn>;
|
|
23
|
+
getStatus(id: string): Promise<CheckIn>;
|
|
24
|
+
approve(id: string, input?: ApproveCheckInRequest): Promise<CheckIn>;
|
|
25
|
+
reject(id: string, input: RejectCheckInRequest): Promise<CheckIn>;
|
|
26
|
+
modify(id: string, input: ModifyCheckInRequest): Promise<CheckIn>;
|
|
27
|
+
withdraw(id: string): Promise<CheckIn>;
|
|
28
|
+
listPending(roomId: string): Promise<CheckIn[]>;
|
|
29
|
+
checkInAndWait(roomId: string, input: CreateCheckInRequest, options?: {
|
|
30
|
+
maxWaitMs?: number;
|
|
31
|
+
}): Promise<CheckIn>;
|
|
32
|
+
}
|
|
33
|
+
declare class RoomsResource {
|
|
34
|
+
private http;
|
|
35
|
+
constructor(http: HttpClient);
|
|
36
|
+
list(): Promise<Room[]>;
|
|
37
|
+
get(roomId: string): Promise<Room>;
|
|
38
|
+
create(input: CreateRoomRequest): Promise<Room>;
|
|
39
|
+
update(roomId: string, input: UpdateRoomRequest): Promise<Room>;
|
|
40
|
+
delete(roomId: string): Promise<{
|
|
41
|
+
id: string;
|
|
42
|
+
deleted: boolean;
|
|
43
|
+
}>;
|
|
44
|
+
updatePolicies(roomId: string, input: UpdatePoliciesRequest): Promise<Room>;
|
|
45
|
+
getAudit(roomId: string): Promise<AuditEvent[]>;
|
|
46
|
+
getPending(roomId: string, filters?: {
|
|
47
|
+
status?: string;
|
|
48
|
+
risk_level?: string;
|
|
49
|
+
agent_id?: string;
|
|
50
|
+
}): Promise<CheckIn[]>;
|
|
51
|
+
}
|
|
52
|
+
declare class SignalsResource {
|
|
53
|
+
private http;
|
|
54
|
+
constructor(http: HttpClient);
|
|
55
|
+
broadcast(roomId: string, input: CreateSignalRequest): Promise<Signal>;
|
|
56
|
+
}
|
|
57
|
+
declare class WatchersResource {
|
|
58
|
+
private http;
|
|
59
|
+
constructor(http: HttpClient);
|
|
60
|
+
create(roomId: string, input: CreateWatcherRequest): Promise<Watcher>;
|
|
61
|
+
remove(watcherId: string): Promise<Watcher>;
|
|
62
|
+
}
|
|
63
|
+
declare class AgentsResource {
|
|
64
|
+
private http;
|
|
65
|
+
constructor(http: HttpClient);
|
|
66
|
+
list(): Promise<Agent[]>;
|
|
67
|
+
get(agentId: string): Promise<Agent>;
|
|
68
|
+
me(): Promise<Agent>;
|
|
69
|
+
register(input: RegisterAgentRequest): Promise<{
|
|
70
|
+
agent: Agent;
|
|
71
|
+
api_key: string;
|
|
72
|
+
}>;
|
|
73
|
+
selfRegister(input: SelfRegisterAgentRequest): Promise<{
|
|
74
|
+
agent: Agent;
|
|
75
|
+
api_key: string;
|
|
76
|
+
claim_token: string;
|
|
77
|
+
}>;
|
|
78
|
+
claim(claimToken: string): Promise<Agent>;
|
|
79
|
+
update(agentId: string, input: UpdateAgentRequest): Promise<Agent>;
|
|
80
|
+
delete(agentId: string): Promise<{
|
|
81
|
+
id: string;
|
|
82
|
+
deleted: boolean;
|
|
83
|
+
}>;
|
|
84
|
+
regenerateKey(agentId: string): Promise<{
|
|
85
|
+
api_key: string;
|
|
86
|
+
}>;
|
|
87
|
+
getTrust(agentId: string): Promise<TrustScore[]>;
|
|
88
|
+
getAudit(agentId: string): Promise<AuditEvent[]>;
|
|
89
|
+
}
|
|
90
|
+
declare class AuditResource {
|
|
91
|
+
private http;
|
|
92
|
+
constructor(http: HttpClient);
|
|
93
|
+
list(filters?: {
|
|
94
|
+
event_type?: string;
|
|
95
|
+
cursor?: string;
|
|
96
|
+
limit?: number;
|
|
97
|
+
}): Promise<{
|
|
98
|
+
events: AuditEvent[];
|
|
99
|
+
cursor?: string;
|
|
100
|
+
}>;
|
|
101
|
+
}
|
|
102
|
+
declare class WaitroomClient {
|
|
103
|
+
private http;
|
|
104
|
+
readonly checkIns: CheckInsResource;
|
|
105
|
+
readonly rooms: RoomsResource;
|
|
106
|
+
readonly signals: SignalsResource;
|
|
107
|
+
readonly watchers: WatchersResource;
|
|
108
|
+
readonly agents: AgentsResource;
|
|
109
|
+
readonly audit: AuditResource;
|
|
110
|
+
constructor(options: ClientOptions);
|
|
111
|
+
home(): Promise<Record<string, unknown>>;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export { type ClientOptions, WaitroomClient, WaitroomError, WaitroomClient as default };
|