-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathevents.ts
More file actions
167 lines (135 loc) · 3.36 KB
/
Copy pathevents.ts
File metadata and controls
167 lines (135 loc) · 3.36 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
// SPDX-FileCopyrightText: 2026 Xquik contributors
//
// SPDX-License-Identifier: Apache-2.0
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../core/resource';
import * as Shared from './shared';
import { APIPromise } from '../core/api-promise';
import { RequestOptions } from '../internal/request-options';
import { path } from '../internal/utils/path';
/**
* Activity events from monitored accounts
*/
export class Events extends APIResource {
/**
* Get event
*/
retrieve(id: string, options?: RequestOptions): APIPromise<EventDetail> {
return this._client.get(path`/events/${id}`, options);
}
/**
* List events
*/
list(
query: EventListParams | null | undefined = {},
options?: RequestOptions,
): APIPromise<EventListResponse> {
return this._client.get('/events', { query, ...options });
}
}
/**
* Monitor event summary with source metadata and occurrence time.
*/
export interface Event {
id: string;
data: { [key: string]: unknown };
/**
* Account monitor ID for account events, or keyword monitor ID for keyword events.
*/
monitorId: string;
/**
* Source monitor type.
*/
monitorType: 'account' | 'keyword';
occurredAt: string;
/**
* Type of monitor event fired when account activity occurs.
*/
type: Shared.EventType;
/**
* Keyword monitor ID, present for keyword monitor events.
*/
keywordMonitorId?: string;
/**
* Keyword query, present for keyword monitor events.
*/
query?: string;
/**
* Account username, present for account monitor events.
*/
username?: string;
}
/**
* Full monitor event including payload data and optional X event ID.
*/
export interface EventDetail {
id: string;
/**
* Event payload - shape varies by event type (JSON)
*/
data: { [key: string]: unknown };
/**
* Monitor ID associated with this detailed event payload.
*/
monitorId: string;
/**
* Source monitor type for this detailed event.
*/
monitorType: 'account' | 'keyword';
occurredAt: string;
/**
* Type of monitor event fired when account activity occurs.
*/
type: Shared.EventType;
/**
* Keyword monitor ID included on detailed keyword events.
*/
keywordMonitorId?: string;
/**
* Keyword query for this detailed monitor event.
*/
query?: string;
/**
* Account username for this detailed monitor event.
*/
username?: string;
xEventId?: string;
}
export interface EventListResponse {
events: Array<Event>;
hasMore: boolean;
nextCursor?: string;
}
export interface EventListParams {
/**
* Previous nextCursor.
*/
cursor?: string;
/**
* Filter events by type
*/
eventType?: Shared.EventType;
/**
* Keyword monitor ID.
*/
keywordMonitorId?: string;
/**
* Maximum number of items to return (1-100, default 50). For paid per-result
* endpoints, the returned count may be lower when available usage balance cannot cover
* the requested page. If zero paid results are affordable, the endpoint returns
* 402 insufficient_credits.
*/
limit?: number;
/**
* Account monitor ID.
*/
monitorId?: string;
}
export declare namespace Events {
export {
type Event as Event,
type EventDetail as EventDetail,
type EventListResponse as EventListResponse,
type EventListParams as EventListParams,
};
}