@mentio-dev/sdk 0.1.0
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 +25 -0
- package/dist/index.d.ts +4550 -0
- package/dist/index.js +1190 -0
- package/dist/index.js.map +1 -0
- package/package.json +57 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,4550 @@
|
|
|
1
|
+
type AuthToken = string | undefined;
|
|
2
|
+
interface Auth {
|
|
3
|
+
/**
|
|
4
|
+
* Which part of the request do we use to send the auth?
|
|
5
|
+
*
|
|
6
|
+
* @default 'header'
|
|
7
|
+
*/
|
|
8
|
+
in?: 'header' | 'query' | 'cookie';
|
|
9
|
+
/**
|
|
10
|
+
* A unique identifier for the security scheme.
|
|
11
|
+
*
|
|
12
|
+
* Defined only when there are multiple security schemes whose `Auth`
|
|
13
|
+
* shape would otherwise be identical.
|
|
14
|
+
*/
|
|
15
|
+
key?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Header or query parameter name.
|
|
18
|
+
*
|
|
19
|
+
* @default 'Authorization'
|
|
20
|
+
*/
|
|
21
|
+
name?: string;
|
|
22
|
+
scheme?: 'basic' | 'bearer';
|
|
23
|
+
type: 'apiKey' | 'http';
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
interface SerializerOptions<T> {
|
|
27
|
+
/**
|
|
28
|
+
* @default true
|
|
29
|
+
*/
|
|
30
|
+
explode: boolean;
|
|
31
|
+
style: T;
|
|
32
|
+
}
|
|
33
|
+
type ArrayStyle = 'form' | 'spaceDelimited' | 'pipeDelimited';
|
|
34
|
+
type ObjectStyle = 'form' | 'deepObject';
|
|
35
|
+
|
|
36
|
+
type QuerySerializer = (query: Record<string, unknown>) => string;
|
|
37
|
+
type BodySerializer = (body: unknown) => unknown;
|
|
38
|
+
type QuerySerializerOptionsObject = {
|
|
39
|
+
allowReserved?: boolean;
|
|
40
|
+
array?: Partial<SerializerOptions<ArrayStyle>>;
|
|
41
|
+
object?: Partial<SerializerOptions<ObjectStyle>>;
|
|
42
|
+
};
|
|
43
|
+
type QuerySerializerOptions = QuerySerializerOptionsObject & {
|
|
44
|
+
/**
|
|
45
|
+
* Per-parameter serialization overrides. When provided, these settings
|
|
46
|
+
* override the global array/object settings for specific parameter names.
|
|
47
|
+
*/
|
|
48
|
+
parameters?: Record<string, QuerySerializerOptionsObject>;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
type HttpMethod = 'connect' | 'delete' | 'get' | 'head' | 'options' | 'patch' | 'post' | 'put' | 'trace';
|
|
52
|
+
type Client$1<RequestFn = never, Config = unknown, MethodFn = never, BuildUrlFn = never, SseFn = never> = {
|
|
53
|
+
/**
|
|
54
|
+
* Returns the final request URL.
|
|
55
|
+
*/
|
|
56
|
+
buildUrl: BuildUrlFn;
|
|
57
|
+
getConfig: () => Config;
|
|
58
|
+
request: RequestFn;
|
|
59
|
+
setConfig: (config: Config) => Config;
|
|
60
|
+
} & {
|
|
61
|
+
[K in HttpMethod]: MethodFn;
|
|
62
|
+
} & ([SseFn] extends [never] ? {
|
|
63
|
+
sse?: never;
|
|
64
|
+
} : {
|
|
65
|
+
sse: {
|
|
66
|
+
[K in HttpMethod]: SseFn;
|
|
67
|
+
};
|
|
68
|
+
});
|
|
69
|
+
interface Config$1 {
|
|
70
|
+
/**
|
|
71
|
+
* Auth token or a function returning auth token. The resolved value will be
|
|
72
|
+
* added to the request payload as defined by its `security` array.
|
|
73
|
+
*/
|
|
74
|
+
auth?: ((auth: Auth) => Promise<AuthToken> | AuthToken) | AuthToken;
|
|
75
|
+
/**
|
|
76
|
+
* A function for serializing request body parameter. By default,
|
|
77
|
+
* {@link JSON.stringify()} will be used.
|
|
78
|
+
*/
|
|
79
|
+
bodySerializer?: BodySerializer | null;
|
|
80
|
+
/**
|
|
81
|
+
* An object containing any HTTP headers that you want to pre-populate your
|
|
82
|
+
* `Headers` object with.
|
|
83
|
+
*
|
|
84
|
+
* {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more}
|
|
85
|
+
*/
|
|
86
|
+
headers?: RequestInit['headers'] | Record<string, string | number | boolean | (string | number | boolean)[] | null | undefined | unknown>;
|
|
87
|
+
/**
|
|
88
|
+
* The request method.
|
|
89
|
+
*
|
|
90
|
+
* {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more}
|
|
91
|
+
*/
|
|
92
|
+
method?: Uppercase<HttpMethod>;
|
|
93
|
+
/**
|
|
94
|
+
* A function for serializing request query parameters. By default, arrays
|
|
95
|
+
* will be exploded in form style, objects will be exploded in deepObject
|
|
96
|
+
* style, and reserved characters are percent-encoded.
|
|
97
|
+
*
|
|
98
|
+
* This method will have no effect if the native `paramsSerializer()` Axios
|
|
99
|
+
* API function is used.
|
|
100
|
+
*
|
|
101
|
+
* {@link https://swagger.io/docs/specification/serialization/#query View examples}
|
|
102
|
+
*/
|
|
103
|
+
querySerializer?: QuerySerializer | QuerySerializerOptions;
|
|
104
|
+
/**
|
|
105
|
+
* A function validating request data. This is useful if you want to ensure
|
|
106
|
+
* the request conforms to the desired shape, so it can be safely sent to
|
|
107
|
+
* the server.
|
|
108
|
+
*/
|
|
109
|
+
requestValidator?: (data: unknown) => Promise<unknown>;
|
|
110
|
+
/**
|
|
111
|
+
* A function transforming response data before it's returned. This is useful
|
|
112
|
+
* for post-processing data, e.g., converting ISO strings into Date objects.
|
|
113
|
+
*/
|
|
114
|
+
responseTransformer?: (data: unknown) => Promise<unknown>;
|
|
115
|
+
/**
|
|
116
|
+
* A function validating response data. This is useful if you want to ensure
|
|
117
|
+
* the response conforms to the desired shape, so it can be safely passed to
|
|
118
|
+
* the transformers and returned to the user.
|
|
119
|
+
*/
|
|
120
|
+
responseValidator?: (data: unknown) => Promise<unknown>;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Arbitrary metadata passed through the `meta` request option.
|
|
124
|
+
*/
|
|
125
|
+
interface ClientMeta {
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
type ServerSentEventsOptions<TData = unknown> = Omit<RequestInit, 'method'> & Pick<Config$1, 'method' | 'responseTransformer' | 'responseValidator'> & {
|
|
129
|
+
/**
|
|
130
|
+
* Fetch API implementation. You can use this option to provide a custom
|
|
131
|
+
* fetch instance.
|
|
132
|
+
*
|
|
133
|
+
* @default globalThis.fetch
|
|
134
|
+
*/
|
|
135
|
+
fetch?: typeof fetch;
|
|
136
|
+
/**
|
|
137
|
+
* Implementing clients can call request interceptors inside this hook.
|
|
138
|
+
*/
|
|
139
|
+
onRequest?: (url: string, init: RequestInit) => Promise<Request>;
|
|
140
|
+
/**
|
|
141
|
+
* Callback invoked when a network or parsing error occurs during streaming.
|
|
142
|
+
*
|
|
143
|
+
* This option applies only if the endpoint returns a stream of events.
|
|
144
|
+
*
|
|
145
|
+
* @param error The error that occurred.
|
|
146
|
+
*/
|
|
147
|
+
onSseError?: (error: unknown) => void;
|
|
148
|
+
/**
|
|
149
|
+
* Callback invoked when an event is streamed from the server.
|
|
150
|
+
*
|
|
151
|
+
* This option applies only if the endpoint returns a stream of events.
|
|
152
|
+
*
|
|
153
|
+
* @param event Event streamed from the server.
|
|
154
|
+
* @returns Nothing (void).
|
|
155
|
+
*/
|
|
156
|
+
onSseEvent?: (event: StreamEvent<TData>) => void;
|
|
157
|
+
serializedBody?: RequestInit['body'];
|
|
158
|
+
/**
|
|
159
|
+
* Default retry delay in milliseconds.
|
|
160
|
+
*
|
|
161
|
+
* This option applies only if the endpoint returns a stream of events.
|
|
162
|
+
*
|
|
163
|
+
* @default 3000
|
|
164
|
+
*/
|
|
165
|
+
sseDefaultRetryDelay?: number;
|
|
166
|
+
/**
|
|
167
|
+
* Maximum number of retry attempts before giving up.
|
|
168
|
+
*/
|
|
169
|
+
sseMaxRetryAttempts?: number;
|
|
170
|
+
/**
|
|
171
|
+
* Maximum retry delay in milliseconds.
|
|
172
|
+
*
|
|
173
|
+
* Applies only when exponential backoff is used.
|
|
174
|
+
*
|
|
175
|
+
* This option applies only if the endpoint returns a stream of events.
|
|
176
|
+
*
|
|
177
|
+
* @default 30000
|
|
178
|
+
*/
|
|
179
|
+
sseMaxRetryDelay?: number;
|
|
180
|
+
/**
|
|
181
|
+
* Optional sleep function for retry backoff.
|
|
182
|
+
*
|
|
183
|
+
* Defaults to using `setTimeout`.
|
|
184
|
+
*/
|
|
185
|
+
sseSleepFn?: (ms: number) => Promise<void>;
|
|
186
|
+
url: string;
|
|
187
|
+
};
|
|
188
|
+
interface StreamEvent<TData = unknown> {
|
|
189
|
+
data: TData;
|
|
190
|
+
event?: string;
|
|
191
|
+
id?: string;
|
|
192
|
+
retry?: number;
|
|
193
|
+
}
|
|
194
|
+
type ServerSentEventsResult<TData = unknown, TReturn = void, TNext = unknown> = {
|
|
195
|
+
stream: AsyncGenerator<TData extends Record<string, unknown> ? TData[keyof TData] : TData, TReturn, TNext>;
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
type ErrInterceptor<Err, Res, Req, Options> = (error: Err,
|
|
199
|
+
/** response may be undefined due to a network error where no response object is produced */
|
|
200
|
+
response: Res | undefined,
|
|
201
|
+
/** request may be undefined, because error may be from building the request object itself */
|
|
202
|
+
request: Req | undefined, options: Options) => Err | Promise<Err>;
|
|
203
|
+
type ReqInterceptor<Req, Options> = (request: Req, options: Options) => Req | Promise<Req>;
|
|
204
|
+
type ResInterceptor<Res, Req, Options> = (response: Res, request: Req, options: Options) => Res | Promise<Res>;
|
|
205
|
+
declare class Interceptors<Interceptor> {
|
|
206
|
+
fns: Array<Interceptor | null>;
|
|
207
|
+
clear(): void;
|
|
208
|
+
eject(id: number | Interceptor): void;
|
|
209
|
+
exists(id: number | Interceptor): boolean;
|
|
210
|
+
getInterceptorIndex(id: number | Interceptor): number;
|
|
211
|
+
update(id: number | Interceptor, fn: Interceptor): number | Interceptor | false;
|
|
212
|
+
use(fn: Interceptor): number;
|
|
213
|
+
}
|
|
214
|
+
interface Middleware<Req, Res, Err, Options> {
|
|
215
|
+
error: Interceptors<ErrInterceptor<Err, Res, Req, Options>>;
|
|
216
|
+
request: Interceptors<ReqInterceptor<Req, Options>>;
|
|
217
|
+
response: Interceptors<ResInterceptor<Res, Req, Options>>;
|
|
218
|
+
}
|
|
219
|
+
declare const createConfig: <T extends ClientOptions$1 = ClientOptions$1>(override?: Config<Omit<ClientOptions$1, keyof T> & T>) => Config<Omit<ClientOptions$1, keyof T> & T>;
|
|
220
|
+
|
|
221
|
+
type ResponseStyle = 'data' | 'fields';
|
|
222
|
+
interface Config<T extends ClientOptions$1 = ClientOptions$1> extends Omit<RequestInit, 'body' | 'headers' | 'method'>, Config$1 {
|
|
223
|
+
/**
|
|
224
|
+
* Base URL for all requests made by this client.
|
|
225
|
+
*/
|
|
226
|
+
baseUrl?: T['baseUrl'];
|
|
227
|
+
/**
|
|
228
|
+
* Fetch API implementation. You can use this option to provide a custom
|
|
229
|
+
* fetch instance.
|
|
230
|
+
*
|
|
231
|
+
* @default globalThis.fetch
|
|
232
|
+
*/
|
|
233
|
+
fetch?: typeof fetch;
|
|
234
|
+
/**
|
|
235
|
+
* Please don't use the Fetch client for Next.js applications. The `next`
|
|
236
|
+
* options won't have any effect.
|
|
237
|
+
*
|
|
238
|
+
* Install {@link https://www.npmjs.com/package/@hey-api/client-next `@hey-api/client-next`} instead.
|
|
239
|
+
*/
|
|
240
|
+
next?: never;
|
|
241
|
+
/**
|
|
242
|
+
* Return the response data parsed in a specified format. By default, `auto`
|
|
243
|
+
* will infer the appropriate method from the `Content-Type` response header.
|
|
244
|
+
* You can override this behavior with any of the {@link Body} methods.
|
|
245
|
+
* Select `stream` if you don't want to parse response data at all.
|
|
246
|
+
*
|
|
247
|
+
* @default 'auto'
|
|
248
|
+
*/
|
|
249
|
+
parseAs?: 'arrayBuffer' | 'auto' | 'blob' | 'formData' | 'json' | 'stream' | 'text';
|
|
250
|
+
/**
|
|
251
|
+
* Should we return only data or multiple fields (data, error, response, etc.)?
|
|
252
|
+
*
|
|
253
|
+
* @default 'fields'
|
|
254
|
+
*/
|
|
255
|
+
responseStyle?: ResponseStyle;
|
|
256
|
+
/**
|
|
257
|
+
* Throw an error instead of returning it in the response?
|
|
258
|
+
*
|
|
259
|
+
* @default false
|
|
260
|
+
*/
|
|
261
|
+
throwOnError?: T['throwOnError'];
|
|
262
|
+
}
|
|
263
|
+
interface RequestOptions<TData = unknown, TResponseStyle extends ResponseStyle = 'fields', ThrowOnError extends boolean = boolean, Url extends string = string> extends Config<{
|
|
264
|
+
responseStyle: TResponseStyle;
|
|
265
|
+
throwOnError: ThrowOnError;
|
|
266
|
+
}>, Pick<ServerSentEventsOptions<TData>, 'onRequest' | 'onSseError' | 'onSseEvent' | 'sseDefaultRetryDelay' | 'sseMaxRetryAttempts' | 'sseMaxRetryDelay'> {
|
|
267
|
+
/**
|
|
268
|
+
* Any body that you want to add to your request.
|
|
269
|
+
*
|
|
270
|
+
* {@link https://developer.mozilla.org/docs/Web/API/fetch#body}
|
|
271
|
+
*/
|
|
272
|
+
body?: unknown;
|
|
273
|
+
path?: Record<string, unknown>;
|
|
274
|
+
query?: Record<string, unknown>;
|
|
275
|
+
/**
|
|
276
|
+
* Security mechanism(s) to use for the request.
|
|
277
|
+
*/
|
|
278
|
+
security?: ReadonlyArray<Auth>;
|
|
279
|
+
url: Url;
|
|
280
|
+
}
|
|
281
|
+
interface ResolvedRequestOptions<TResponseStyle extends ResponseStyle = 'fields', ThrowOnError extends boolean = boolean, Url extends string = string> extends RequestOptions<unknown, TResponseStyle, ThrowOnError, Url> {
|
|
282
|
+
headers: Headers;
|
|
283
|
+
serializedBody?: string;
|
|
284
|
+
}
|
|
285
|
+
type RequestResult<TData = unknown, TError = unknown, ThrowOnError extends boolean = boolean, TResponseStyle extends ResponseStyle = 'fields'> = ThrowOnError extends true ? Promise<TResponseStyle extends 'data' ? TData extends Record<string, unknown> ? TData[keyof TData] : TData : {
|
|
286
|
+
data: TData extends Record<string, unknown> ? TData[keyof TData] : TData;
|
|
287
|
+
request: Request;
|
|
288
|
+
response: Response;
|
|
289
|
+
}> : Promise<TResponseStyle extends 'data' ? (TData extends Record<string, unknown> ? TData[keyof TData] : TData) | undefined : ({
|
|
290
|
+
data: TData extends Record<string, unknown> ? TData[keyof TData] : TData;
|
|
291
|
+
error: undefined;
|
|
292
|
+
} | {
|
|
293
|
+
data: undefined;
|
|
294
|
+
error: TError extends Record<string, unknown> ? TError[keyof TError] : TError;
|
|
295
|
+
}) & {
|
|
296
|
+
/** request may be undefined, because error may be from building the request object itself */
|
|
297
|
+
request?: Request;
|
|
298
|
+
/** response may be undefined, because error may be from building the request object itself or from a network error */
|
|
299
|
+
response?: Response;
|
|
300
|
+
}>;
|
|
301
|
+
interface ClientOptions$1 {
|
|
302
|
+
baseUrl?: string;
|
|
303
|
+
responseStyle?: ResponseStyle;
|
|
304
|
+
throwOnError?: boolean;
|
|
305
|
+
}
|
|
306
|
+
type MethodFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'fields'>(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, 'method'>) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
|
|
307
|
+
type SseFn = <TData = unknown, _TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'fields'>(options: Omit<RequestOptions<never, TResponseStyle, ThrowOnError>, 'method'>) => Promise<ServerSentEventsResult<TData>>;
|
|
308
|
+
type RequestFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = 'fields'>(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, 'method'> & Pick<Required<RequestOptions<TData, TResponseStyle, ThrowOnError>>, 'method'>) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
|
|
309
|
+
type BuildUrlFn = <TData extends {
|
|
310
|
+
body?: unknown;
|
|
311
|
+
path?: Record<string, unknown>;
|
|
312
|
+
query?: Record<string, unknown>;
|
|
313
|
+
url: string;
|
|
314
|
+
}>(options: TData & Options$1<TData>) => string;
|
|
315
|
+
type Client = Client$1<RequestFn, Config, MethodFn, BuildUrlFn, SseFn> & {
|
|
316
|
+
interceptors: Middleware<Request, Response, unknown, ResolvedRequestOptions>;
|
|
317
|
+
};
|
|
318
|
+
interface TDataShape {
|
|
319
|
+
body?: unknown;
|
|
320
|
+
headers?: unknown;
|
|
321
|
+
path?: unknown;
|
|
322
|
+
query?: unknown;
|
|
323
|
+
url: string;
|
|
324
|
+
}
|
|
325
|
+
type OmitKeys<T, K> = Pick<T, Exclude<keyof T, K>>;
|
|
326
|
+
type Options$1<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown, TResponseStyle extends ResponseStyle = 'fields'> = OmitKeys<RequestOptions<TResponse, TResponseStyle, ThrowOnError>, 'body' | 'path' | 'query' | 'url'> & ([TData] extends [never] ? unknown : Omit<TData, 'url'>);
|
|
327
|
+
|
|
328
|
+
declare const createClient: (config?: Config) => Client;
|
|
329
|
+
|
|
330
|
+
type ClientOptions = {
|
|
331
|
+
baseUrl: 'https://api.mentio.dev' | (string & {});
|
|
332
|
+
};
|
|
333
|
+
type Keyword = {
|
|
334
|
+
/**
|
|
335
|
+
* Keyword id (kw_...).
|
|
336
|
+
*/
|
|
337
|
+
id: string;
|
|
338
|
+
term: string;
|
|
339
|
+
kind: 'brand' | 'competitor' | 'topic';
|
|
340
|
+
muted: boolean;
|
|
341
|
+
/**
|
|
342
|
+
* Platforms this keyword is tracked on; null means every platform.
|
|
343
|
+
*/
|
|
344
|
+
platforms: Array<'bluesky' | 'hackernews' | 'github' | 'stackoverflow' | 'devto' | 'reddit' | 'x' | 'youtube' | 'news' | 'linkedin'> | null;
|
|
345
|
+
/**
|
|
346
|
+
* Computed over this workspace's matches.
|
|
347
|
+
*/
|
|
348
|
+
stats: {
|
|
349
|
+
/**
|
|
350
|
+
* Every match ever, relevant or not: the number billing counts.
|
|
351
|
+
*/
|
|
352
|
+
mentions: number;
|
|
353
|
+
/**
|
|
354
|
+
* Matches scored at or above the relevance threshold.
|
|
355
|
+
*/
|
|
356
|
+
relevant: number;
|
|
357
|
+
/**
|
|
358
|
+
* Matches published in the last 7 days.
|
|
359
|
+
*/
|
|
360
|
+
last7d: number;
|
|
361
|
+
/**
|
|
362
|
+
* Newest matched post; null until the first one.
|
|
363
|
+
*/
|
|
364
|
+
lastMentionAt: string | null;
|
|
365
|
+
};
|
|
366
|
+
/**
|
|
367
|
+
* Poll health per platform polled on a schedule. Live feeds (Bluesky) have no entry.
|
|
368
|
+
*/
|
|
369
|
+
polling: Array<{
|
|
370
|
+
/**
|
|
371
|
+
* Platform: bluesky, hackernews, github, stackoverflow, devto, reddit, x, youtube, news, linkedin.
|
|
372
|
+
*/
|
|
373
|
+
platform: 'bluesky' | 'hackernews' | 'github' | 'stackoverflow' | 'devto' | 'reddit' | 'x' | 'youtube' | 'news' | 'linkedin';
|
|
374
|
+
/**
|
|
375
|
+
* Newest poll of this platform for the term; null until the first one.
|
|
376
|
+
*/
|
|
377
|
+
lastPolledAt: string | null;
|
|
378
|
+
/**
|
|
379
|
+
* Consecutive polls that found nothing new; the scheduler slows down as it grows.
|
|
380
|
+
*/
|
|
381
|
+
emptyPolls: number;
|
|
382
|
+
}>;
|
|
383
|
+
/**
|
|
384
|
+
* ISO 8601 timestamp, UTC.
|
|
385
|
+
*/
|
|
386
|
+
createdAt: string;
|
|
387
|
+
};
|
|
388
|
+
type ErrorResponse = {
|
|
389
|
+
/**
|
|
390
|
+
* The error.
|
|
391
|
+
*/
|
|
392
|
+
error: {
|
|
393
|
+
/**
|
|
394
|
+
* Stable machine-readable code (not_found, validation_error, ...); branch on this.
|
|
395
|
+
*/
|
|
396
|
+
code: string;
|
|
397
|
+
/**
|
|
398
|
+
* Human-readable detail; may change between releases.
|
|
399
|
+
*/
|
|
400
|
+
message: string;
|
|
401
|
+
};
|
|
402
|
+
};
|
|
403
|
+
type Mention = {
|
|
404
|
+
/**
|
|
405
|
+
* Mention id (mm_...): one post matched to one of your keywords. A post matching two keywords has two ids.
|
|
406
|
+
*/
|
|
407
|
+
id: string;
|
|
408
|
+
/**
|
|
409
|
+
* open: nobody handled it yet. ignored: hidden from the feed and channels by you. done: handled.
|
|
410
|
+
*/
|
|
411
|
+
status: 'open' | 'ignored' | 'done';
|
|
412
|
+
/**
|
|
413
|
+
* The classifier scored it at or above the delivery threshold (40).
|
|
414
|
+
*/
|
|
415
|
+
relevant: boolean;
|
|
416
|
+
/**
|
|
417
|
+
* Reached at least one of your channels.
|
|
418
|
+
*/
|
|
419
|
+
delivered: boolean;
|
|
420
|
+
/**
|
|
421
|
+
* Attention score, one decimal, computed at read time: relevance halved, author reach on a follower ladder (unknown reach counts 8), the strongest intent (buy intent 20 down to praise 5), minus 2 per day of age floored at 20.
|
|
422
|
+
*/
|
|
423
|
+
priority: number;
|
|
424
|
+
/**
|
|
425
|
+
* The keyword this post matched.
|
|
426
|
+
*/
|
|
427
|
+
keyword: {
|
|
428
|
+
id: string;
|
|
429
|
+
term: string;
|
|
430
|
+
};
|
|
431
|
+
post: {
|
|
432
|
+
/**
|
|
433
|
+
* Platform: bluesky, hackernews, github, stackoverflow, devto, reddit, x, youtube, news, linkedin.
|
|
434
|
+
*/
|
|
435
|
+
platform: 'bluesky' | 'hackernews' | 'github' | 'stackoverflow' | 'devto' | 'reddit' | 'x' | 'youtube' | 'news' | 'linkedin';
|
|
436
|
+
/**
|
|
437
|
+
* Permalink of the post.
|
|
438
|
+
*/
|
|
439
|
+
url: string;
|
|
440
|
+
/**
|
|
441
|
+
* Title and body, truncated to 8 KB at ingest.
|
|
442
|
+
*/
|
|
443
|
+
text: string;
|
|
444
|
+
/**
|
|
445
|
+
* When the post was published.
|
|
446
|
+
*/
|
|
447
|
+
publishedAt: string;
|
|
448
|
+
/**
|
|
449
|
+
* The post this one replies to (X, Bluesky); null for top-level posts.
|
|
450
|
+
*/
|
|
451
|
+
replyTo: {
|
|
452
|
+
/**
|
|
453
|
+
* Parent post author as the platform names them.
|
|
454
|
+
*/
|
|
455
|
+
author: string | null;
|
|
456
|
+
/**
|
|
457
|
+
* Parent post URL.
|
|
458
|
+
*/
|
|
459
|
+
url: string | null;
|
|
460
|
+
/**
|
|
461
|
+
* Parent post text, when the platform gave it.
|
|
462
|
+
*/
|
|
463
|
+
text: string | null;
|
|
464
|
+
} | null;
|
|
465
|
+
};
|
|
466
|
+
/**
|
|
467
|
+
* Who posted it; null when the platform gave no author at all.
|
|
468
|
+
*/
|
|
469
|
+
author: {
|
|
470
|
+
/**
|
|
471
|
+
* Person id (aut_...) for GET /v1/people/{id}; null when the account is not in the audience yet.
|
|
472
|
+
*/
|
|
473
|
+
id: string | null;
|
|
474
|
+
/**
|
|
475
|
+
* Display name as the platform reports it.
|
|
476
|
+
*/
|
|
477
|
+
name: string | null;
|
|
478
|
+
/**
|
|
479
|
+
* Platform handle derived from the profile URL, formatted as the platform shows it (@name, u/name); null where the platform has none.
|
|
480
|
+
*/
|
|
481
|
+
handle: string | null;
|
|
482
|
+
/**
|
|
483
|
+
* Profile URL.
|
|
484
|
+
*/
|
|
485
|
+
url: string | null;
|
|
486
|
+
/**
|
|
487
|
+
* Profile picture; null where the platform has none.
|
|
488
|
+
*/
|
|
489
|
+
avatarUrl: string | null;
|
|
490
|
+
/**
|
|
491
|
+
* Follower count as of their newest post; null where the platform has none.
|
|
492
|
+
*/
|
|
493
|
+
followers: number | null;
|
|
494
|
+
/**
|
|
495
|
+
* Your workspace tags on this person.
|
|
496
|
+
*/
|
|
497
|
+
tags: Array<string>;
|
|
498
|
+
} | null;
|
|
499
|
+
/**
|
|
500
|
+
* The classifier verdict; null while the post is still queued for classification.
|
|
501
|
+
*/
|
|
502
|
+
classification: {
|
|
503
|
+
/**
|
|
504
|
+
* 0 to 100; null only when classification failed.
|
|
505
|
+
*/
|
|
506
|
+
relevance: number | null;
|
|
507
|
+
/**
|
|
508
|
+
* Classifier sentiment.
|
|
509
|
+
*/
|
|
510
|
+
sentiment: 'positive' | 'neutral' | 'negative';
|
|
511
|
+
/**
|
|
512
|
+
* Detected intents: buy_intent, question, complaint, praise, comparison.
|
|
513
|
+
*/
|
|
514
|
+
intents: Array<string>;
|
|
515
|
+
/**
|
|
516
|
+
* One sentence from the classifier explaining the score.
|
|
517
|
+
*/
|
|
518
|
+
note: string | null;
|
|
519
|
+
/**
|
|
520
|
+
* true when the model could not score this post; it stays in the feed and is not billed.
|
|
521
|
+
*/
|
|
522
|
+
failed: boolean;
|
|
523
|
+
} | null;
|
|
524
|
+
triage: {
|
|
525
|
+
/**
|
|
526
|
+
* Workspace member this mention is assigned to; null when unassigned.
|
|
527
|
+
*/
|
|
528
|
+
assignee: {
|
|
529
|
+
id: string;
|
|
530
|
+
name: string | null;
|
|
531
|
+
email: string | null;
|
|
532
|
+
} | null;
|
|
533
|
+
/**
|
|
534
|
+
* Until when the mention stays out of the feed; null when not snoozed.
|
|
535
|
+
*/
|
|
536
|
+
snoozedUntil: string | null;
|
|
537
|
+
/**
|
|
538
|
+
* Internal note; null when none.
|
|
539
|
+
*/
|
|
540
|
+
note: string | null;
|
|
541
|
+
};
|
|
542
|
+
/**
|
|
543
|
+
* When the match was recorded; the default feed order.
|
|
544
|
+
*/
|
|
545
|
+
createdAt: string;
|
|
546
|
+
};
|
|
547
|
+
type Person = {
|
|
548
|
+
/**
|
|
549
|
+
* Person id (aut_...): the canonical account. An account merged into someone resolves to that person.
|
|
550
|
+
*/
|
|
551
|
+
id: string;
|
|
552
|
+
/**
|
|
553
|
+
* Platform of the canonical account; `accounts` lists every account.
|
|
554
|
+
*/
|
|
555
|
+
platform: 'bluesky' | 'hackernews' | 'github' | 'stackoverflow' | 'devto' | 'reddit' | 'x' | 'youtube' | 'news' | 'linkedin';
|
|
556
|
+
/**
|
|
557
|
+
* Display name as of their newest post; null when the platform has none.
|
|
558
|
+
*/
|
|
559
|
+
name: string | null;
|
|
560
|
+
/**
|
|
561
|
+
* Platform handle of the canonical account, formatted as the platform shows it.
|
|
562
|
+
*/
|
|
563
|
+
handle: string | null;
|
|
564
|
+
/**
|
|
565
|
+
* Profile URL of the canonical account.
|
|
566
|
+
*/
|
|
567
|
+
url: string | null;
|
|
568
|
+
avatarUrl: string | null;
|
|
569
|
+
/**
|
|
570
|
+
* Every account this workspace treats as this person, the canonical one first.
|
|
571
|
+
*/
|
|
572
|
+
accounts: Array<{
|
|
573
|
+
/**
|
|
574
|
+
* The account id (aut_...); the canonical one equals the person id.
|
|
575
|
+
*/
|
|
576
|
+
id: string;
|
|
577
|
+
/**
|
|
578
|
+
* Platform: bluesky, hackernews, github, stackoverflow, devto, reddit, x, youtube, news, linkedin.
|
|
579
|
+
*/
|
|
580
|
+
platform: 'bluesky' | 'hackernews' | 'github' | 'stackoverflow' | 'devto' | 'reddit' | 'x' | 'youtube' | 'news' | 'linkedin';
|
|
581
|
+
/**
|
|
582
|
+
* Display name as the platform reports it.
|
|
583
|
+
*/
|
|
584
|
+
name: string | null;
|
|
585
|
+
/**
|
|
586
|
+
* Platform handle derived from the profile URL, formatted as the platform shows it.
|
|
587
|
+
*/
|
|
588
|
+
handle: string | null;
|
|
589
|
+
/**
|
|
590
|
+
* Profile URL.
|
|
591
|
+
*/
|
|
592
|
+
url: string | null;
|
|
593
|
+
}>;
|
|
594
|
+
/**
|
|
595
|
+
* Platform counts as of their newest post; null where the platform has no such number.
|
|
596
|
+
*/
|
|
597
|
+
reach: {
|
|
598
|
+
followers: number | null;
|
|
599
|
+
following: number | null;
|
|
600
|
+
posts: number | null;
|
|
601
|
+
};
|
|
602
|
+
/**
|
|
603
|
+
* Public profile facts; null until looked up.
|
|
604
|
+
*/
|
|
605
|
+
profile: {
|
|
606
|
+
bio: string | null;
|
|
607
|
+
company: string | null;
|
|
608
|
+
location: string | null;
|
|
609
|
+
website: string | null;
|
|
610
|
+
/**
|
|
611
|
+
* Only when the person made it public on the platform.
|
|
612
|
+
*/
|
|
613
|
+
email: string | null;
|
|
614
|
+
/**
|
|
615
|
+
* Other accounts the person lists on their profile.
|
|
616
|
+
*/
|
|
617
|
+
links: Array<{
|
|
618
|
+
provider: string;
|
|
619
|
+
url: string;
|
|
620
|
+
}>;
|
|
621
|
+
/**
|
|
622
|
+
* When the profile was read.
|
|
623
|
+
*/
|
|
624
|
+
fetchedAt: string;
|
|
625
|
+
} | null;
|
|
626
|
+
/**
|
|
627
|
+
* Computed over this workspace's matches.
|
|
628
|
+
*/
|
|
629
|
+
stats: {
|
|
630
|
+
/**
|
|
631
|
+
* Every match of theirs for this workspace, relevant or not.
|
|
632
|
+
*/
|
|
633
|
+
mentions: number;
|
|
634
|
+
/**
|
|
635
|
+
* Of those, scored relevant.
|
|
636
|
+
*/
|
|
637
|
+
relevant: number;
|
|
638
|
+
sentiment: {
|
|
639
|
+
positive: number;
|
|
640
|
+
neutral: number;
|
|
641
|
+
negative: number;
|
|
642
|
+
};
|
|
643
|
+
/**
|
|
644
|
+
* Their oldest matched post.
|
|
645
|
+
*/
|
|
646
|
+
firstSeenAt: string;
|
|
647
|
+
/**
|
|
648
|
+
* Their newest matched post.
|
|
649
|
+
*/
|
|
650
|
+
lastSeenAt: string;
|
|
651
|
+
};
|
|
652
|
+
/**
|
|
653
|
+
* What this workspace wrote about the person.
|
|
654
|
+
*/
|
|
655
|
+
annotations: {
|
|
656
|
+
tags: Array<string>;
|
|
657
|
+
notes: string;
|
|
658
|
+
/**
|
|
659
|
+
* Their posts stay out of the feed and every channel; ingest and billing are untouched.
|
|
660
|
+
*/
|
|
661
|
+
muted: boolean;
|
|
662
|
+
};
|
|
663
|
+
};
|
|
664
|
+
type Segment = {
|
|
665
|
+
/**
|
|
666
|
+
* Segment id (seg_...).
|
|
667
|
+
*/
|
|
668
|
+
id: string;
|
|
669
|
+
name: string;
|
|
670
|
+
description: string;
|
|
671
|
+
filter: {
|
|
672
|
+
/**
|
|
673
|
+
* People with an account on any of these platforms.
|
|
674
|
+
*/
|
|
675
|
+
platforms?: Array<'bluesky' | 'hackernews' | 'github' | 'stackoverflow' | 'devto' | 'reddit' | 'x' | 'youtube' | 'news' | 'linkedin'>;
|
|
676
|
+
/**
|
|
677
|
+
* People carrying any of these tags.
|
|
678
|
+
*/
|
|
679
|
+
tags?: Array<string>;
|
|
680
|
+
/**
|
|
681
|
+
* At least this many followers. Unknown reach never matches.
|
|
682
|
+
*/
|
|
683
|
+
minFollowers?: number;
|
|
684
|
+
/**
|
|
685
|
+
* At most this many followers. Unknown reach never matches.
|
|
686
|
+
*/
|
|
687
|
+
maxFollowers?: number;
|
|
688
|
+
/**
|
|
689
|
+
* At least this many matched mentions.
|
|
690
|
+
*/
|
|
691
|
+
minMentions?: number;
|
|
692
|
+
/**
|
|
693
|
+
* At least this many negative mentions.
|
|
694
|
+
*/
|
|
695
|
+
minNegative?: number;
|
|
696
|
+
/**
|
|
697
|
+
* At least one mention carrying any of these intents.
|
|
698
|
+
*/
|
|
699
|
+
intents?: Array<string>;
|
|
700
|
+
/**
|
|
701
|
+
* Mentioned a keyword of any of these kinds.
|
|
702
|
+
*/
|
|
703
|
+
keywordKinds?: Array<'brand' | 'competitor' | 'topic'>;
|
|
704
|
+
/**
|
|
705
|
+
* Never mentioned a keyword of these kinds.
|
|
706
|
+
*/
|
|
707
|
+
neverKeywordKinds?: Array<'brand' | 'competitor' | 'topic'>;
|
|
708
|
+
/**
|
|
709
|
+
* First seen within this many days.
|
|
710
|
+
*/
|
|
711
|
+
newSinceDays?: number;
|
|
712
|
+
/**
|
|
713
|
+
* true: only muted people; false: only unmuted.
|
|
714
|
+
*/
|
|
715
|
+
muted?: boolean;
|
|
716
|
+
};
|
|
717
|
+
/**
|
|
718
|
+
* People in the segment right now; it is evaluated on every read.
|
|
719
|
+
*/
|
|
720
|
+
count: number;
|
|
721
|
+
/**
|
|
722
|
+
* ISO 8601 timestamp, UTC.
|
|
723
|
+
*/
|
|
724
|
+
createdAt: string;
|
|
725
|
+
/**
|
|
726
|
+
* ISO 8601 timestamp, UTC.
|
|
727
|
+
*/
|
|
728
|
+
updatedAt: string;
|
|
729
|
+
};
|
|
730
|
+
type Company = {
|
|
731
|
+
/**
|
|
732
|
+
* Brand or company name, as the classifier should call it.
|
|
733
|
+
*/
|
|
734
|
+
name: string;
|
|
735
|
+
/**
|
|
736
|
+
* What the company does, one paragraph.
|
|
737
|
+
*/
|
|
738
|
+
description: string;
|
|
739
|
+
/**
|
|
740
|
+
* What people use the product for.
|
|
741
|
+
*/
|
|
742
|
+
useCases: Array<string>;
|
|
743
|
+
/**
|
|
744
|
+
* Your own accounts, so your own posts are recognized.
|
|
745
|
+
*/
|
|
746
|
+
accounts: {
|
|
747
|
+
/**
|
|
748
|
+
* X handle without the @.
|
|
749
|
+
*/
|
|
750
|
+
x: string | null;
|
|
751
|
+
/**
|
|
752
|
+
* LinkedIn page slug or URL.
|
|
753
|
+
*/
|
|
754
|
+
linkedin: string | null;
|
|
755
|
+
};
|
|
756
|
+
/**
|
|
757
|
+
* The text the classifier reads. Composed from the fields above unless you override it.
|
|
758
|
+
*/
|
|
759
|
+
context: string;
|
|
760
|
+
};
|
|
761
|
+
type Alert = {
|
|
762
|
+
/**
|
|
763
|
+
* Alert id (feed_...).
|
|
764
|
+
*/
|
|
765
|
+
id: string;
|
|
766
|
+
name: string;
|
|
767
|
+
enabled: boolean;
|
|
768
|
+
/**
|
|
769
|
+
* instant: each matching mention as it happens. daily: one digest at the scheduled local time.
|
|
770
|
+
*/
|
|
771
|
+
mode: 'instant' | 'daily';
|
|
772
|
+
filter: {
|
|
773
|
+
/**
|
|
774
|
+
* Only these keywords.
|
|
775
|
+
*/
|
|
776
|
+
keywordIds?: Array<string>;
|
|
777
|
+
/**
|
|
778
|
+
* Only posts from these platforms.
|
|
779
|
+
*/
|
|
780
|
+
platforms?: Array<'bluesky' | 'hackernews' | 'github' | 'stackoverflow' | 'devto' | 'reddit' | 'x' | 'youtube' | 'news' | 'linkedin'>;
|
|
781
|
+
/**
|
|
782
|
+
* Only mentions scored at least this; unclassified ones never pass.
|
|
783
|
+
*/
|
|
784
|
+
minRelevance?: number;
|
|
785
|
+
/**
|
|
786
|
+
* Only these sentiments.
|
|
787
|
+
*/
|
|
788
|
+
sentiments?: Array<'positive' | 'neutral' | 'negative'>;
|
|
789
|
+
/**
|
|
790
|
+
* At least one of these intents.
|
|
791
|
+
*/
|
|
792
|
+
intents?: Array<string>;
|
|
793
|
+
/**
|
|
794
|
+
* Never these authors: display names, handles or profile URLs.
|
|
795
|
+
*/
|
|
796
|
+
excludeAuthors?: Array<string>;
|
|
797
|
+
/**
|
|
798
|
+
* Only authors with at least this many followers. Unknown reach never passes.
|
|
799
|
+
*/
|
|
800
|
+
minFollowers?: number;
|
|
801
|
+
/**
|
|
802
|
+
* Only authors your workspace tagged with any of these.
|
|
803
|
+
*/
|
|
804
|
+
tags?: Array<string>;
|
|
805
|
+
};
|
|
806
|
+
/**
|
|
807
|
+
* Daily alerts only.
|
|
808
|
+
*/
|
|
809
|
+
schedule: {
|
|
810
|
+
hour: number;
|
|
811
|
+
minute?: number;
|
|
812
|
+
timezone: string;
|
|
813
|
+
skipEmpty?: boolean;
|
|
814
|
+
} | null;
|
|
815
|
+
/**
|
|
816
|
+
* Event name carried in webhook payloads; the mode default unless you set one.
|
|
817
|
+
*/
|
|
818
|
+
event: string;
|
|
819
|
+
/**
|
|
820
|
+
* Where it sends.
|
|
821
|
+
*/
|
|
822
|
+
channels: Array<{
|
|
823
|
+
id: string;
|
|
824
|
+
kind: 'slack' | 'email' | 'webhook' | 'telegram';
|
|
825
|
+
label: string;
|
|
826
|
+
}>;
|
|
827
|
+
/**
|
|
828
|
+
* Computed over this workspace's deliveries.
|
|
829
|
+
*/
|
|
830
|
+
stats: {
|
|
831
|
+
/**
|
|
832
|
+
* Deliveries in the last 7 days, across channels.
|
|
833
|
+
*/
|
|
834
|
+
sentLast7d: number;
|
|
835
|
+
/**
|
|
836
|
+
* ISO 8601 timestamp, UTC.
|
|
837
|
+
*/
|
|
838
|
+
lastSentAt: string | null;
|
|
839
|
+
/**
|
|
840
|
+
* Daily alerts: the next digest; null when disabled or instant.
|
|
841
|
+
*/
|
|
842
|
+
nextRunAt: string | null;
|
|
843
|
+
};
|
|
844
|
+
/**
|
|
845
|
+
* ISO 8601 timestamp, UTC.
|
|
846
|
+
*/
|
|
847
|
+
createdAt: string;
|
|
848
|
+
};
|
|
849
|
+
type AnalyticsSummary = {
|
|
850
|
+
/**
|
|
851
|
+
* The window the report covers.
|
|
852
|
+
*/
|
|
853
|
+
window: {
|
|
854
|
+
/**
|
|
855
|
+
* First day, inclusive.
|
|
856
|
+
*/
|
|
857
|
+
from: string;
|
|
858
|
+
/**
|
|
859
|
+
* Last day, inclusive.
|
|
860
|
+
*/
|
|
861
|
+
to: string;
|
|
862
|
+
/**
|
|
863
|
+
* Length of the window in days.
|
|
864
|
+
*/
|
|
865
|
+
days: number;
|
|
866
|
+
/**
|
|
867
|
+
* IANA zone the days were cut in.
|
|
868
|
+
*/
|
|
869
|
+
timezone: string;
|
|
870
|
+
};
|
|
871
|
+
/**
|
|
872
|
+
* Every match in the window, relevant or not: the number usage counts.
|
|
873
|
+
*/
|
|
874
|
+
matched: number;
|
|
875
|
+
/**
|
|
876
|
+
* Matches scored at or above the relevance threshold.
|
|
877
|
+
*/
|
|
878
|
+
relevant: number;
|
|
879
|
+
/**
|
|
880
|
+
* Distinct posts behind the matches: a post matching two keywords is two matches, one post.
|
|
881
|
+
*/
|
|
882
|
+
posts: number;
|
|
883
|
+
/**
|
|
884
|
+
* Distinct authors behind the matches.
|
|
885
|
+
*/
|
|
886
|
+
people: number;
|
|
887
|
+
/**
|
|
888
|
+
* Matched mentions by classifier sentiment.
|
|
889
|
+
*/
|
|
890
|
+
sentiment: {
|
|
891
|
+
/**
|
|
892
|
+
* Classified positive.
|
|
893
|
+
*/
|
|
894
|
+
positive: number;
|
|
895
|
+
/**
|
|
896
|
+
* Classified neutral.
|
|
897
|
+
*/
|
|
898
|
+
neutral: number;
|
|
899
|
+
/**
|
|
900
|
+
* Classified negative.
|
|
901
|
+
*/
|
|
902
|
+
negative: number;
|
|
903
|
+
/**
|
|
904
|
+
* Not scored: still queued, or the classifier failed on it.
|
|
905
|
+
*/
|
|
906
|
+
unclassified: number;
|
|
907
|
+
};
|
|
908
|
+
/**
|
|
909
|
+
* Matches carrying the buy_intent intent.
|
|
910
|
+
*/
|
|
911
|
+
buyIntent: number;
|
|
912
|
+
/**
|
|
913
|
+
* Matches carrying the question intent.
|
|
914
|
+
*/
|
|
915
|
+
questions: number;
|
|
916
|
+
/**
|
|
917
|
+
* Estimated reach.
|
|
918
|
+
*/
|
|
919
|
+
reach: {
|
|
920
|
+
/**
|
|
921
|
+
* Followers summed over the distinct authors whose count is known: an estimate of the feeds the posts landed in.
|
|
922
|
+
*/
|
|
923
|
+
followers: number;
|
|
924
|
+
/**
|
|
925
|
+
* How many of `people` have a known follower count.
|
|
926
|
+
*/
|
|
927
|
+
people: number;
|
|
928
|
+
};
|
|
929
|
+
/**
|
|
930
|
+
* Where the matches stand in your inbox.
|
|
931
|
+
*/
|
|
932
|
+
triage: {
|
|
933
|
+
/**
|
|
934
|
+
* Status open.
|
|
935
|
+
*/
|
|
936
|
+
open: number;
|
|
937
|
+
/**
|
|
938
|
+
* Status ignored.
|
|
939
|
+
*/
|
|
940
|
+
ignored: number;
|
|
941
|
+
/**
|
|
942
|
+
* Status done.
|
|
943
|
+
*/
|
|
944
|
+
done: number;
|
|
945
|
+
/**
|
|
946
|
+
* Relevant, still open, and matched more than 24 hours ago.
|
|
947
|
+
*/
|
|
948
|
+
waiting: number;
|
|
949
|
+
/**
|
|
950
|
+
* done divided by relevant, 0 to 1; null when nothing was relevant.
|
|
951
|
+
*/
|
|
952
|
+
handledRate: number | null;
|
|
953
|
+
/**
|
|
954
|
+
* Median milliseconds from match to done; null when nothing was done.
|
|
955
|
+
*/
|
|
956
|
+
medianTimeToDoneMs: number | null;
|
|
957
|
+
};
|
|
958
|
+
/**
|
|
959
|
+
* The same counts over the period of the same length right before the window; null unless compare=true.
|
|
960
|
+
*/
|
|
961
|
+
previous: {
|
|
962
|
+
/**
|
|
963
|
+
* Every match in the window, relevant or not: the number usage counts.
|
|
964
|
+
*/
|
|
965
|
+
matched: number;
|
|
966
|
+
/**
|
|
967
|
+
* Matches scored at or above the relevance threshold.
|
|
968
|
+
*/
|
|
969
|
+
relevant: number;
|
|
970
|
+
/**
|
|
971
|
+
* Distinct posts behind the matches: a post matching two keywords is two matches, one post.
|
|
972
|
+
*/
|
|
973
|
+
posts: number;
|
|
974
|
+
/**
|
|
975
|
+
* Distinct authors behind the matches.
|
|
976
|
+
*/
|
|
977
|
+
people: number;
|
|
978
|
+
/**
|
|
979
|
+
* Matched mentions by classifier sentiment.
|
|
980
|
+
*/
|
|
981
|
+
sentiment: {
|
|
982
|
+
/**
|
|
983
|
+
* Classified positive.
|
|
984
|
+
*/
|
|
985
|
+
positive: number;
|
|
986
|
+
/**
|
|
987
|
+
* Classified neutral.
|
|
988
|
+
*/
|
|
989
|
+
neutral: number;
|
|
990
|
+
/**
|
|
991
|
+
* Classified negative.
|
|
992
|
+
*/
|
|
993
|
+
negative: number;
|
|
994
|
+
/**
|
|
995
|
+
* Not scored: still queued, or the classifier failed on it.
|
|
996
|
+
*/
|
|
997
|
+
unclassified: number;
|
|
998
|
+
};
|
|
999
|
+
/**
|
|
1000
|
+
* Matches carrying the buy_intent intent.
|
|
1001
|
+
*/
|
|
1002
|
+
buyIntent: number;
|
|
1003
|
+
/**
|
|
1004
|
+
* Matches carrying the question intent.
|
|
1005
|
+
*/
|
|
1006
|
+
questions: number;
|
|
1007
|
+
/**
|
|
1008
|
+
* Estimated reach.
|
|
1009
|
+
*/
|
|
1010
|
+
reach: {
|
|
1011
|
+
/**
|
|
1012
|
+
* Followers summed over the distinct authors whose count is known: an estimate of the feeds the posts landed in.
|
|
1013
|
+
*/
|
|
1014
|
+
followers: number;
|
|
1015
|
+
/**
|
|
1016
|
+
* How many of `people` have a known follower count.
|
|
1017
|
+
*/
|
|
1018
|
+
people: number;
|
|
1019
|
+
};
|
|
1020
|
+
/**
|
|
1021
|
+
* Where the matches stand in your inbox.
|
|
1022
|
+
*/
|
|
1023
|
+
triage: {
|
|
1024
|
+
/**
|
|
1025
|
+
* Status open.
|
|
1026
|
+
*/
|
|
1027
|
+
open: number;
|
|
1028
|
+
/**
|
|
1029
|
+
* Status ignored.
|
|
1030
|
+
*/
|
|
1031
|
+
ignored: number;
|
|
1032
|
+
/**
|
|
1033
|
+
* Status done.
|
|
1034
|
+
*/
|
|
1035
|
+
done: number;
|
|
1036
|
+
/**
|
|
1037
|
+
* Relevant, still open, and matched more than 24 hours ago.
|
|
1038
|
+
*/
|
|
1039
|
+
waiting: number;
|
|
1040
|
+
/**
|
|
1041
|
+
* done divided by relevant, 0 to 1; null when nothing was relevant.
|
|
1042
|
+
*/
|
|
1043
|
+
handledRate: number | null;
|
|
1044
|
+
/**
|
|
1045
|
+
* Median milliseconds from match to done; null when nothing was done.
|
|
1046
|
+
*/
|
|
1047
|
+
medianTimeToDoneMs: number | null;
|
|
1048
|
+
};
|
|
1049
|
+
} | null;
|
|
1050
|
+
};
|
|
1051
|
+
type AnalyticsSeries = {
|
|
1052
|
+
/**
|
|
1053
|
+
* The window the report covers.
|
|
1054
|
+
*/
|
|
1055
|
+
window: {
|
|
1056
|
+
/**
|
|
1057
|
+
* First day, inclusive.
|
|
1058
|
+
*/
|
|
1059
|
+
from: string;
|
|
1060
|
+
/**
|
|
1061
|
+
* Last day, inclusive.
|
|
1062
|
+
*/
|
|
1063
|
+
to: string;
|
|
1064
|
+
/**
|
|
1065
|
+
* Length of the window in days.
|
|
1066
|
+
*/
|
|
1067
|
+
days: number;
|
|
1068
|
+
/**
|
|
1069
|
+
* IANA zone the days were cut in.
|
|
1070
|
+
*/
|
|
1071
|
+
timezone: string;
|
|
1072
|
+
/**
|
|
1073
|
+
* Point granularity: day, or week (Monday to Sunday).
|
|
1074
|
+
*/
|
|
1075
|
+
bucket: 'day' | 'week';
|
|
1076
|
+
};
|
|
1077
|
+
/**
|
|
1078
|
+
* One item per series, most matched first; a single "total" item when not split.
|
|
1079
|
+
*/
|
|
1080
|
+
data: Array<{
|
|
1081
|
+
/**
|
|
1082
|
+
* Platform name, keyword id, "total" for the unsplit series, or "other" for the keys beyond the top 20.
|
|
1083
|
+
*/
|
|
1084
|
+
key: string;
|
|
1085
|
+
/**
|
|
1086
|
+
* Readable name: the platform, the keyword term, "Total" or "Other".
|
|
1087
|
+
*/
|
|
1088
|
+
label: string;
|
|
1089
|
+
/**
|
|
1090
|
+
* Set when split by keyword; null otherwise.
|
|
1091
|
+
*/
|
|
1092
|
+
keyword: {
|
|
1093
|
+
/**
|
|
1094
|
+
* Keyword id (kw_...).
|
|
1095
|
+
*/
|
|
1096
|
+
id: string;
|
|
1097
|
+
/**
|
|
1098
|
+
* The tracked term.
|
|
1099
|
+
*/
|
|
1100
|
+
term: string;
|
|
1101
|
+
/**
|
|
1102
|
+
* brand, competitor or topic.
|
|
1103
|
+
*/
|
|
1104
|
+
kind: 'brand' | 'competitor' | 'topic';
|
|
1105
|
+
} | null;
|
|
1106
|
+
/**
|
|
1107
|
+
* One point per bucket across the window, oldest first, zero-filled.
|
|
1108
|
+
*/
|
|
1109
|
+
points: Array<{
|
|
1110
|
+
/**
|
|
1111
|
+
* The day, or the Monday of the week.
|
|
1112
|
+
*/
|
|
1113
|
+
date: string;
|
|
1114
|
+
/**
|
|
1115
|
+
* Every match published in the bucket.
|
|
1116
|
+
*/
|
|
1117
|
+
matched: number;
|
|
1118
|
+
/**
|
|
1119
|
+
* Of those, scored at or above the relevance threshold.
|
|
1120
|
+
*/
|
|
1121
|
+
relevant: number;
|
|
1122
|
+
/**
|
|
1123
|
+
* Classified positive.
|
|
1124
|
+
*/
|
|
1125
|
+
positive: number;
|
|
1126
|
+
/**
|
|
1127
|
+
* Classified neutral.
|
|
1128
|
+
*/
|
|
1129
|
+
neutral: number;
|
|
1130
|
+
/**
|
|
1131
|
+
* Classified negative.
|
|
1132
|
+
*/
|
|
1133
|
+
negative: number;
|
|
1134
|
+
/**
|
|
1135
|
+
* Not scored: still queued, or the classifier failed on it.
|
|
1136
|
+
*/
|
|
1137
|
+
unclassified: number;
|
|
1138
|
+
}>;
|
|
1139
|
+
}>;
|
|
1140
|
+
/**
|
|
1141
|
+
* The same items over the period right before the window, in the same order, points aligned by index with `data` (the last bucket may be missing when weeks split differently); null unless compare=true.
|
|
1142
|
+
*/
|
|
1143
|
+
previous: Array<{
|
|
1144
|
+
/**
|
|
1145
|
+
* Platform name, keyword id, "total" for the unsplit series, or "other" for the keys beyond the top 20.
|
|
1146
|
+
*/
|
|
1147
|
+
key: string;
|
|
1148
|
+
/**
|
|
1149
|
+
* Readable name: the platform, the keyword term, "Total" or "Other".
|
|
1150
|
+
*/
|
|
1151
|
+
label: string;
|
|
1152
|
+
/**
|
|
1153
|
+
* Set when split by keyword; null otherwise.
|
|
1154
|
+
*/
|
|
1155
|
+
keyword: {
|
|
1156
|
+
/**
|
|
1157
|
+
* Keyword id (kw_...).
|
|
1158
|
+
*/
|
|
1159
|
+
id: string;
|
|
1160
|
+
/**
|
|
1161
|
+
* The tracked term.
|
|
1162
|
+
*/
|
|
1163
|
+
term: string;
|
|
1164
|
+
/**
|
|
1165
|
+
* brand, competitor or topic.
|
|
1166
|
+
*/
|
|
1167
|
+
kind: 'brand' | 'competitor' | 'topic';
|
|
1168
|
+
} | null;
|
|
1169
|
+
/**
|
|
1170
|
+
* One point per bucket across the window, oldest first, zero-filled.
|
|
1171
|
+
*/
|
|
1172
|
+
points: Array<{
|
|
1173
|
+
/**
|
|
1174
|
+
* The day, or the Monday of the week.
|
|
1175
|
+
*/
|
|
1176
|
+
date: string;
|
|
1177
|
+
/**
|
|
1178
|
+
* Every match published in the bucket.
|
|
1179
|
+
*/
|
|
1180
|
+
matched: number;
|
|
1181
|
+
/**
|
|
1182
|
+
* Of those, scored at or above the relevance threshold.
|
|
1183
|
+
*/
|
|
1184
|
+
relevant: number;
|
|
1185
|
+
/**
|
|
1186
|
+
* Classified positive.
|
|
1187
|
+
*/
|
|
1188
|
+
positive: number;
|
|
1189
|
+
/**
|
|
1190
|
+
* Classified neutral.
|
|
1191
|
+
*/
|
|
1192
|
+
neutral: number;
|
|
1193
|
+
/**
|
|
1194
|
+
* Classified negative.
|
|
1195
|
+
*/
|
|
1196
|
+
negative: number;
|
|
1197
|
+
/**
|
|
1198
|
+
* Not scored: still queued, or the classifier failed on it.
|
|
1199
|
+
*/
|
|
1200
|
+
unclassified: number;
|
|
1201
|
+
}>;
|
|
1202
|
+
}> | null;
|
|
1203
|
+
};
|
|
1204
|
+
type AnalyticsBreakdown = {
|
|
1205
|
+
/**
|
|
1206
|
+
* The window the report covers.
|
|
1207
|
+
*/
|
|
1208
|
+
window: {
|
|
1209
|
+
/**
|
|
1210
|
+
* First day, inclusive.
|
|
1211
|
+
*/
|
|
1212
|
+
from: string;
|
|
1213
|
+
/**
|
|
1214
|
+
* Last day, inclusive.
|
|
1215
|
+
*/
|
|
1216
|
+
to: string;
|
|
1217
|
+
/**
|
|
1218
|
+
* Length of the window in days.
|
|
1219
|
+
*/
|
|
1220
|
+
days: number;
|
|
1221
|
+
/**
|
|
1222
|
+
* IANA zone the days were cut in.
|
|
1223
|
+
*/
|
|
1224
|
+
timezone: string;
|
|
1225
|
+
};
|
|
1226
|
+
/**
|
|
1227
|
+
* The dimension the rows are grouped by.
|
|
1228
|
+
*/
|
|
1229
|
+
by: 'platform' | 'keyword' | 'sentiment' | 'intent' | 'status' | 'hour' | 'person';
|
|
1230
|
+
/**
|
|
1231
|
+
* Most matched first, at most 50 groups. by=hour is chronological and unlimited (168 cells at most).
|
|
1232
|
+
*/
|
|
1233
|
+
data: Array<{
|
|
1234
|
+
/**
|
|
1235
|
+
* The group: platform name, keyword id, sentiment, intent, status, "weekday-hour" for by=hour, or an opaque person key.
|
|
1236
|
+
*/
|
|
1237
|
+
key: string;
|
|
1238
|
+
/**
|
|
1239
|
+
* Readable name: the keyword term, the person name, otherwise the key.
|
|
1240
|
+
*/
|
|
1241
|
+
label: string;
|
|
1242
|
+
/**
|
|
1243
|
+
* by=keyword only; null otherwise.
|
|
1244
|
+
*/
|
|
1245
|
+
keyword: {
|
|
1246
|
+
/**
|
|
1247
|
+
* Keyword id (kw_...).
|
|
1248
|
+
*/
|
|
1249
|
+
id: string;
|
|
1250
|
+
/**
|
|
1251
|
+
* The tracked term.
|
|
1252
|
+
*/
|
|
1253
|
+
term: string;
|
|
1254
|
+
/**
|
|
1255
|
+
* brand, competitor or topic.
|
|
1256
|
+
*/
|
|
1257
|
+
kind: 'brand' | 'competitor' | 'topic';
|
|
1258
|
+
} | null;
|
|
1259
|
+
/**
|
|
1260
|
+
* by=person only; null otherwise.
|
|
1261
|
+
*/
|
|
1262
|
+
person: {
|
|
1263
|
+
/**
|
|
1264
|
+
* Person id (aut_...); null for posts ingested before people were linked.
|
|
1265
|
+
*/
|
|
1266
|
+
id: string | null;
|
|
1267
|
+
/**
|
|
1268
|
+
* Display name as the platform shows it.
|
|
1269
|
+
*/
|
|
1270
|
+
name: string | null;
|
|
1271
|
+
/**
|
|
1272
|
+
* Platform: bluesky, hackernews, github, stackoverflow, devto, reddit, x, youtube, news, linkedin.
|
|
1273
|
+
*/
|
|
1274
|
+
platform: 'bluesky' | 'hackernews' | 'github' | 'stackoverflow' | 'devto' | 'reddit' | 'x' | 'youtube' | 'news' | 'linkedin';
|
|
1275
|
+
/**
|
|
1276
|
+
* Profile URL.
|
|
1277
|
+
*/
|
|
1278
|
+
url: string | null;
|
|
1279
|
+
/**
|
|
1280
|
+
* Avatar image URL, when the platform gave one.
|
|
1281
|
+
*/
|
|
1282
|
+
avatarUrl: string | null;
|
|
1283
|
+
/**
|
|
1284
|
+
* From the audience profile; null when unknown.
|
|
1285
|
+
*/
|
|
1286
|
+
followers: number | null;
|
|
1287
|
+
} | null;
|
|
1288
|
+
/**
|
|
1289
|
+
* by=hour only: the weekday and hour of day in `timezone`; null otherwise.
|
|
1290
|
+
*/
|
|
1291
|
+
slot: {
|
|
1292
|
+
/**
|
|
1293
|
+
* 0 = Sunday through 6 = Saturday.
|
|
1294
|
+
*/
|
|
1295
|
+
weekday: number;
|
|
1296
|
+
/**
|
|
1297
|
+
* Hour of day, 0 to 23.
|
|
1298
|
+
*/
|
|
1299
|
+
hour: number;
|
|
1300
|
+
} | null;
|
|
1301
|
+
/**
|
|
1302
|
+
* Matches in the group.
|
|
1303
|
+
*/
|
|
1304
|
+
matched: number;
|
|
1305
|
+
/**
|
|
1306
|
+
* Of those, scored at or above the relevance threshold.
|
|
1307
|
+
*/
|
|
1308
|
+
relevant: number;
|
|
1309
|
+
/**
|
|
1310
|
+
* Percent of the window's matched mentions in this group, one decimal. Intents overlap, so their shares can add up past 100.
|
|
1311
|
+
*/
|
|
1312
|
+
share: number;
|
|
1313
|
+
/**
|
|
1314
|
+
* Matched mentions by classifier sentiment.
|
|
1315
|
+
*/
|
|
1316
|
+
sentiment: {
|
|
1317
|
+
/**
|
|
1318
|
+
* Classified positive.
|
|
1319
|
+
*/
|
|
1320
|
+
positive: number;
|
|
1321
|
+
/**
|
|
1322
|
+
* Classified neutral.
|
|
1323
|
+
*/
|
|
1324
|
+
neutral: number;
|
|
1325
|
+
/**
|
|
1326
|
+
* Classified negative.
|
|
1327
|
+
*/
|
|
1328
|
+
negative: number;
|
|
1329
|
+
/**
|
|
1330
|
+
* Not scored: still queued, or the classifier failed on it.
|
|
1331
|
+
*/
|
|
1332
|
+
unclassified: number;
|
|
1333
|
+
};
|
|
1334
|
+
/**
|
|
1335
|
+
* The same group over the period right before the window; null unless compare=true.
|
|
1336
|
+
*/
|
|
1337
|
+
previous: {
|
|
1338
|
+
/**
|
|
1339
|
+
* Matches in the group then.
|
|
1340
|
+
*/
|
|
1341
|
+
matched: number;
|
|
1342
|
+
/**
|
|
1343
|
+
* Relevant matches in the group then.
|
|
1344
|
+
*/
|
|
1345
|
+
relevant: number;
|
|
1346
|
+
} | null;
|
|
1347
|
+
}>;
|
|
1348
|
+
};
|
|
1349
|
+
type ShareOfVoice = {
|
|
1350
|
+
/**
|
|
1351
|
+
* The window the report covers.
|
|
1352
|
+
*/
|
|
1353
|
+
window: {
|
|
1354
|
+
/**
|
|
1355
|
+
* First day, inclusive.
|
|
1356
|
+
*/
|
|
1357
|
+
from: string;
|
|
1358
|
+
/**
|
|
1359
|
+
* Last day, inclusive.
|
|
1360
|
+
*/
|
|
1361
|
+
to: string;
|
|
1362
|
+
/**
|
|
1363
|
+
* Length of the window in days.
|
|
1364
|
+
*/
|
|
1365
|
+
days: number;
|
|
1366
|
+
/**
|
|
1367
|
+
* IANA zone the days were cut in.
|
|
1368
|
+
*/
|
|
1369
|
+
timezone: string;
|
|
1370
|
+
};
|
|
1371
|
+
/**
|
|
1372
|
+
* Every keyword matched in the window, most matched first.
|
|
1373
|
+
*/
|
|
1374
|
+
data: Array<{
|
|
1375
|
+
/**
|
|
1376
|
+
* The keyword this row is about.
|
|
1377
|
+
*/
|
|
1378
|
+
keyword: {
|
|
1379
|
+
/**
|
|
1380
|
+
* Keyword id (kw_...).
|
|
1381
|
+
*/
|
|
1382
|
+
id: string;
|
|
1383
|
+
/**
|
|
1384
|
+
* The tracked term.
|
|
1385
|
+
*/
|
|
1386
|
+
term: string;
|
|
1387
|
+
/**
|
|
1388
|
+
* brand, competitor or topic.
|
|
1389
|
+
*/
|
|
1390
|
+
kind: 'brand' | 'competitor' | 'topic';
|
|
1391
|
+
};
|
|
1392
|
+
/**
|
|
1393
|
+
* Matches of this keyword in the window.
|
|
1394
|
+
*/
|
|
1395
|
+
matched: number;
|
|
1396
|
+
/**
|
|
1397
|
+
* Of those, scored at or above the relevance threshold.
|
|
1398
|
+
*/
|
|
1399
|
+
relevant: number;
|
|
1400
|
+
/**
|
|
1401
|
+
* Of those, classified negative.
|
|
1402
|
+
*/
|
|
1403
|
+
negative: number;
|
|
1404
|
+
/**
|
|
1405
|
+
* Of those, carrying the buy_intent intent.
|
|
1406
|
+
*/
|
|
1407
|
+
buyIntent: number;
|
|
1408
|
+
/**
|
|
1409
|
+
* Percent of brand plus competitor matches, one decimal; null for topics, which stay out of the split.
|
|
1410
|
+
*/
|
|
1411
|
+
share: number | null;
|
|
1412
|
+
/**
|
|
1413
|
+
* The same keyword over the period right before the window; null unless compare=true.
|
|
1414
|
+
*/
|
|
1415
|
+
previous: {
|
|
1416
|
+
/**
|
|
1417
|
+
* Matches of this keyword then.
|
|
1418
|
+
*/
|
|
1419
|
+
matched: number;
|
|
1420
|
+
} | null;
|
|
1421
|
+
}>;
|
|
1422
|
+
};
|
|
1423
|
+
type Channel = {
|
|
1424
|
+
/**
|
|
1425
|
+
* Channel id (dest_...).
|
|
1426
|
+
*/
|
|
1427
|
+
id: string;
|
|
1428
|
+
label: string;
|
|
1429
|
+
/**
|
|
1430
|
+
* Computed over this workspace's deliveries.
|
|
1431
|
+
*/
|
|
1432
|
+
stats: {
|
|
1433
|
+
/**
|
|
1434
|
+
* Alerts sending to this channel.
|
|
1435
|
+
*/
|
|
1436
|
+
alerts: number;
|
|
1437
|
+
/**
|
|
1438
|
+
* Of those, enabled ones; 0 means the channel receives nothing right now.
|
|
1439
|
+
*/
|
|
1440
|
+
activeAlerts: number;
|
|
1441
|
+
/**
|
|
1442
|
+
* Newest delivery attempt, successful or not.
|
|
1443
|
+
*/
|
|
1444
|
+
lastDeliveryAt: string | null;
|
|
1445
|
+
/**
|
|
1446
|
+
* Deliveries in the last 7 days.
|
|
1447
|
+
*/
|
|
1448
|
+
last7d: {
|
|
1449
|
+
total: number;
|
|
1450
|
+
failed: number;
|
|
1451
|
+
};
|
|
1452
|
+
};
|
|
1453
|
+
/**
|
|
1454
|
+
* ISO 8601 timestamp, UTC.
|
|
1455
|
+
*/
|
|
1456
|
+
createdAt: string;
|
|
1457
|
+
kind: 'slack';
|
|
1458
|
+
config: {
|
|
1459
|
+
channelId: string;
|
|
1460
|
+
channelName: string;
|
|
1461
|
+
};
|
|
1462
|
+
} | {
|
|
1463
|
+
/**
|
|
1464
|
+
* Channel id (dest_...).
|
|
1465
|
+
*/
|
|
1466
|
+
id: string;
|
|
1467
|
+
label: string;
|
|
1468
|
+
/**
|
|
1469
|
+
* Computed over this workspace's deliveries.
|
|
1470
|
+
*/
|
|
1471
|
+
stats: {
|
|
1472
|
+
/**
|
|
1473
|
+
* Alerts sending to this channel.
|
|
1474
|
+
*/
|
|
1475
|
+
alerts: number;
|
|
1476
|
+
/**
|
|
1477
|
+
* Of those, enabled ones; 0 means the channel receives nothing right now.
|
|
1478
|
+
*/
|
|
1479
|
+
activeAlerts: number;
|
|
1480
|
+
/**
|
|
1481
|
+
* Newest delivery attempt, successful or not.
|
|
1482
|
+
*/
|
|
1483
|
+
lastDeliveryAt: string | null;
|
|
1484
|
+
/**
|
|
1485
|
+
* Deliveries in the last 7 days.
|
|
1486
|
+
*/
|
|
1487
|
+
last7d: {
|
|
1488
|
+
total: number;
|
|
1489
|
+
failed: number;
|
|
1490
|
+
};
|
|
1491
|
+
};
|
|
1492
|
+
/**
|
|
1493
|
+
* ISO 8601 timestamp, UTC.
|
|
1494
|
+
*/
|
|
1495
|
+
createdAt: string;
|
|
1496
|
+
kind: 'email';
|
|
1497
|
+
config: {
|
|
1498
|
+
recipients: Array<{
|
|
1499
|
+
email: string;
|
|
1500
|
+
/**
|
|
1501
|
+
* Null until the address confirmed through its link; unconfirmed addresses receive nothing.
|
|
1502
|
+
*/
|
|
1503
|
+
confirmedAt: string | null;
|
|
1504
|
+
}>;
|
|
1505
|
+
};
|
|
1506
|
+
} | {
|
|
1507
|
+
/**
|
|
1508
|
+
* Channel id (dest_...).
|
|
1509
|
+
*/
|
|
1510
|
+
id: string;
|
|
1511
|
+
label: string;
|
|
1512
|
+
/**
|
|
1513
|
+
* Computed over this workspace's deliveries.
|
|
1514
|
+
*/
|
|
1515
|
+
stats: {
|
|
1516
|
+
/**
|
|
1517
|
+
* Alerts sending to this channel.
|
|
1518
|
+
*/
|
|
1519
|
+
alerts: number;
|
|
1520
|
+
/**
|
|
1521
|
+
* Of those, enabled ones; 0 means the channel receives nothing right now.
|
|
1522
|
+
*/
|
|
1523
|
+
activeAlerts: number;
|
|
1524
|
+
/**
|
|
1525
|
+
* Newest delivery attempt, successful or not.
|
|
1526
|
+
*/
|
|
1527
|
+
lastDeliveryAt: string | null;
|
|
1528
|
+
/**
|
|
1529
|
+
* Deliveries in the last 7 days.
|
|
1530
|
+
*/
|
|
1531
|
+
last7d: {
|
|
1532
|
+
total: number;
|
|
1533
|
+
failed: number;
|
|
1534
|
+
};
|
|
1535
|
+
};
|
|
1536
|
+
/**
|
|
1537
|
+
* ISO 8601 timestamp, UTC.
|
|
1538
|
+
*/
|
|
1539
|
+
createdAt: string;
|
|
1540
|
+
kind: 'webhook';
|
|
1541
|
+
config: {
|
|
1542
|
+
url: string;
|
|
1543
|
+
/**
|
|
1544
|
+
* Extra request headers you configured.
|
|
1545
|
+
*/
|
|
1546
|
+
headers: {
|
|
1547
|
+
[key: string]: string;
|
|
1548
|
+
};
|
|
1549
|
+
/**
|
|
1550
|
+
* Only on creation and rotation. Signs every body: X-Mentions-Signature is the hex HMAC-SHA256 of the raw bytes.
|
|
1551
|
+
*/
|
|
1552
|
+
secret?: string;
|
|
1553
|
+
};
|
|
1554
|
+
} | {
|
|
1555
|
+
/**
|
|
1556
|
+
* Channel id (dest_...).
|
|
1557
|
+
*/
|
|
1558
|
+
id: string;
|
|
1559
|
+
label: string;
|
|
1560
|
+
/**
|
|
1561
|
+
* Computed over this workspace's deliveries.
|
|
1562
|
+
*/
|
|
1563
|
+
stats: {
|
|
1564
|
+
/**
|
|
1565
|
+
* Alerts sending to this channel.
|
|
1566
|
+
*/
|
|
1567
|
+
alerts: number;
|
|
1568
|
+
/**
|
|
1569
|
+
* Of those, enabled ones; 0 means the channel receives nothing right now.
|
|
1570
|
+
*/
|
|
1571
|
+
activeAlerts: number;
|
|
1572
|
+
/**
|
|
1573
|
+
* Newest delivery attempt, successful or not.
|
|
1574
|
+
*/
|
|
1575
|
+
lastDeliveryAt: string | null;
|
|
1576
|
+
/**
|
|
1577
|
+
* Deliveries in the last 7 days.
|
|
1578
|
+
*/
|
|
1579
|
+
last7d: {
|
|
1580
|
+
total: number;
|
|
1581
|
+
failed: number;
|
|
1582
|
+
};
|
|
1583
|
+
};
|
|
1584
|
+
/**
|
|
1585
|
+
* ISO 8601 timestamp, UTC.
|
|
1586
|
+
*/
|
|
1587
|
+
createdAt: string;
|
|
1588
|
+
kind: 'telegram';
|
|
1589
|
+
config: {
|
|
1590
|
+
chatId: string;
|
|
1591
|
+
chatType: 'private' | 'group' | 'supergroup' | 'channel';
|
|
1592
|
+
};
|
|
1593
|
+
};
|
|
1594
|
+
type GetHealthData = {
|
|
1595
|
+
body?: never;
|
|
1596
|
+
path?: never;
|
|
1597
|
+
query?: never;
|
|
1598
|
+
url: '/v1/health';
|
|
1599
|
+
};
|
|
1600
|
+
type GetHealthResponses = {
|
|
1601
|
+
/**
|
|
1602
|
+
* API is up
|
|
1603
|
+
*/
|
|
1604
|
+
200: {
|
|
1605
|
+
ok: boolean;
|
|
1606
|
+
};
|
|
1607
|
+
};
|
|
1608
|
+
type GetHealthResponse = GetHealthResponses[keyof GetHealthResponses];
|
|
1609
|
+
type ListKeywordsData = {
|
|
1610
|
+
body?: never;
|
|
1611
|
+
path?: never;
|
|
1612
|
+
query?: never;
|
|
1613
|
+
url: '/v1/keywords';
|
|
1614
|
+
};
|
|
1615
|
+
type ListKeywordsErrors = {
|
|
1616
|
+
/**
|
|
1617
|
+
* Missing or invalid API key
|
|
1618
|
+
*/
|
|
1619
|
+
401: ErrorResponse;
|
|
1620
|
+
};
|
|
1621
|
+
type ListKeywordsError = ListKeywordsErrors[keyof ListKeywordsErrors];
|
|
1622
|
+
type ListKeywordsResponses = {
|
|
1623
|
+
/**
|
|
1624
|
+
* All keywords
|
|
1625
|
+
*/
|
|
1626
|
+
200: {
|
|
1627
|
+
data: Array<{
|
|
1628
|
+
/**
|
|
1629
|
+
* Keyword id (kw_...).
|
|
1630
|
+
*/
|
|
1631
|
+
id: string;
|
|
1632
|
+
term: string;
|
|
1633
|
+
kind: 'brand' | 'competitor' | 'topic';
|
|
1634
|
+
muted: boolean;
|
|
1635
|
+
/**
|
|
1636
|
+
* Platforms this keyword is tracked on; null means every platform.
|
|
1637
|
+
*/
|
|
1638
|
+
platforms: Array<'bluesky' | 'hackernews' | 'github' | 'stackoverflow' | 'devto' | 'reddit' | 'x' | 'youtube' | 'news' | 'linkedin'> | null;
|
|
1639
|
+
/**
|
|
1640
|
+
* Computed over this workspace's matches.
|
|
1641
|
+
*/
|
|
1642
|
+
stats: {
|
|
1643
|
+
/**
|
|
1644
|
+
* Every match ever, relevant or not: the number billing counts.
|
|
1645
|
+
*/
|
|
1646
|
+
mentions: number;
|
|
1647
|
+
/**
|
|
1648
|
+
* Matches scored at or above the relevance threshold.
|
|
1649
|
+
*/
|
|
1650
|
+
relevant: number;
|
|
1651
|
+
/**
|
|
1652
|
+
* Matches published in the last 7 days.
|
|
1653
|
+
*/
|
|
1654
|
+
last7d: number;
|
|
1655
|
+
/**
|
|
1656
|
+
* Newest matched post; null until the first one.
|
|
1657
|
+
*/
|
|
1658
|
+
lastMentionAt: string | null;
|
|
1659
|
+
};
|
|
1660
|
+
/**
|
|
1661
|
+
* Poll health per platform polled on a schedule. Live feeds (Bluesky) have no entry.
|
|
1662
|
+
*/
|
|
1663
|
+
polling: Array<{
|
|
1664
|
+
/**
|
|
1665
|
+
* Platform: bluesky, hackernews, github, stackoverflow, devto, reddit, x, youtube, news, linkedin.
|
|
1666
|
+
*/
|
|
1667
|
+
platform: 'bluesky' | 'hackernews' | 'github' | 'stackoverflow' | 'devto' | 'reddit' | 'x' | 'youtube' | 'news' | 'linkedin';
|
|
1668
|
+
/**
|
|
1669
|
+
* Newest poll of this platform for the term; null until the first one.
|
|
1670
|
+
*/
|
|
1671
|
+
lastPolledAt: string | null;
|
|
1672
|
+
/**
|
|
1673
|
+
* Consecutive polls that found nothing new; the scheduler slows down as it grows.
|
|
1674
|
+
*/
|
|
1675
|
+
emptyPolls: number;
|
|
1676
|
+
}>;
|
|
1677
|
+
/**
|
|
1678
|
+
* ISO 8601 timestamp, UTC.
|
|
1679
|
+
*/
|
|
1680
|
+
createdAt: string;
|
|
1681
|
+
}>;
|
|
1682
|
+
};
|
|
1683
|
+
};
|
|
1684
|
+
type ListKeywordsResponse = ListKeywordsResponses[keyof ListKeywordsResponses];
|
|
1685
|
+
type CreateKeywordData = {
|
|
1686
|
+
body: {
|
|
1687
|
+
/**
|
|
1688
|
+
* The word or phrase to track, matched case-insensitively as a phrase.
|
|
1689
|
+
*/
|
|
1690
|
+
term: string;
|
|
1691
|
+
/**
|
|
1692
|
+
* brand: your own names. competitor: theirs. topic: the space. Drives share of voice and segments.
|
|
1693
|
+
*/
|
|
1694
|
+
kind?: 'brand' | 'competitor' | 'topic';
|
|
1695
|
+
/**
|
|
1696
|
+
* Platforms to track it on; omit or null for every platform.
|
|
1697
|
+
*/
|
|
1698
|
+
platforms?: Array<'bluesky' | 'hackernews' | 'github' | 'stackoverflow' | 'devto' | 'reddit' | 'x' | 'youtube' | 'news' | 'linkedin'> | null;
|
|
1699
|
+
};
|
|
1700
|
+
path?: never;
|
|
1701
|
+
query?: never;
|
|
1702
|
+
url: '/v1/keywords';
|
|
1703
|
+
};
|
|
1704
|
+
type CreateKeywordErrors = {
|
|
1705
|
+
/**
|
|
1706
|
+
* Missing or invalid API key
|
|
1707
|
+
*/
|
|
1708
|
+
401: ErrorResponse;
|
|
1709
|
+
/**
|
|
1710
|
+
* Keyword limit reached for the current plan
|
|
1711
|
+
*/
|
|
1712
|
+
402: ErrorResponse;
|
|
1713
|
+
/**
|
|
1714
|
+
* A keyword with the same normalized term already exists
|
|
1715
|
+
*/
|
|
1716
|
+
409: ErrorResponse;
|
|
1717
|
+
};
|
|
1718
|
+
type CreateKeywordError = CreateKeywordErrors[keyof CreateKeywordErrors];
|
|
1719
|
+
type CreateKeywordResponses = {
|
|
1720
|
+
/**
|
|
1721
|
+
* The created keyword
|
|
1722
|
+
*/
|
|
1723
|
+
201: Keyword;
|
|
1724
|
+
};
|
|
1725
|
+
type CreateKeywordResponse = CreateKeywordResponses[keyof CreateKeywordResponses];
|
|
1726
|
+
type DeleteKeywordData = {
|
|
1727
|
+
body?: never;
|
|
1728
|
+
path: {
|
|
1729
|
+
/**
|
|
1730
|
+
* Keyword id (kw_...).
|
|
1731
|
+
*/
|
|
1732
|
+
id: string;
|
|
1733
|
+
};
|
|
1734
|
+
query?: never;
|
|
1735
|
+
url: '/v1/keywords/{id}';
|
|
1736
|
+
};
|
|
1737
|
+
type DeleteKeywordErrors = {
|
|
1738
|
+
/**
|
|
1739
|
+
* Missing or invalid API key
|
|
1740
|
+
*/
|
|
1741
|
+
401: ErrorResponse;
|
|
1742
|
+
/**
|
|
1743
|
+
* Keyword not found
|
|
1744
|
+
*/
|
|
1745
|
+
404: ErrorResponse;
|
|
1746
|
+
};
|
|
1747
|
+
type DeleteKeywordError = DeleteKeywordErrors[keyof DeleteKeywordErrors];
|
|
1748
|
+
type DeleteKeywordResponses = {
|
|
1749
|
+
/**
|
|
1750
|
+
* Deleted
|
|
1751
|
+
*/
|
|
1752
|
+
204: void;
|
|
1753
|
+
};
|
|
1754
|
+
type DeleteKeywordResponse = DeleteKeywordResponses[keyof DeleteKeywordResponses];
|
|
1755
|
+
type GetKeywordData = {
|
|
1756
|
+
body?: never;
|
|
1757
|
+
path: {
|
|
1758
|
+
/**
|
|
1759
|
+
* Keyword id (kw_...).
|
|
1760
|
+
*/
|
|
1761
|
+
id: string;
|
|
1762
|
+
};
|
|
1763
|
+
query?: never;
|
|
1764
|
+
url: '/v1/keywords/{id}';
|
|
1765
|
+
};
|
|
1766
|
+
type GetKeywordErrors = {
|
|
1767
|
+
/**
|
|
1768
|
+
* Missing or invalid API key
|
|
1769
|
+
*/
|
|
1770
|
+
401: ErrorResponse;
|
|
1771
|
+
/**
|
|
1772
|
+
* Keyword not found
|
|
1773
|
+
*/
|
|
1774
|
+
404: ErrorResponse;
|
|
1775
|
+
};
|
|
1776
|
+
type GetKeywordError = GetKeywordErrors[keyof GetKeywordErrors];
|
|
1777
|
+
type GetKeywordResponses = {
|
|
1778
|
+
/**
|
|
1779
|
+
* The keyword
|
|
1780
|
+
*/
|
|
1781
|
+
200: Keyword;
|
|
1782
|
+
};
|
|
1783
|
+
type GetKeywordResponse = GetKeywordResponses[keyof GetKeywordResponses];
|
|
1784
|
+
type UpdateKeywordData = {
|
|
1785
|
+
/**
|
|
1786
|
+
* Omitted fields are untouched.
|
|
1787
|
+
*/
|
|
1788
|
+
body: {
|
|
1789
|
+
/**
|
|
1790
|
+
* A muted keyword stops polling and matching; its mentions stay.
|
|
1791
|
+
*/
|
|
1792
|
+
muted?: boolean;
|
|
1793
|
+
/**
|
|
1794
|
+
* Replaces the platform list; null means every platform.
|
|
1795
|
+
*/
|
|
1796
|
+
platforms?: Array<'bluesky' | 'hackernews' | 'github' | 'stackoverflow' | 'devto' | 'reddit' | 'x' | 'youtube' | 'news' | 'linkedin'> | null;
|
|
1797
|
+
};
|
|
1798
|
+
path: {
|
|
1799
|
+
/**
|
|
1800
|
+
* Keyword id (kw_...).
|
|
1801
|
+
*/
|
|
1802
|
+
id: string;
|
|
1803
|
+
};
|
|
1804
|
+
query?: never;
|
|
1805
|
+
url: '/v1/keywords/{id}';
|
|
1806
|
+
};
|
|
1807
|
+
type UpdateKeywordErrors = {
|
|
1808
|
+
/**
|
|
1809
|
+
* Missing or invalid API key
|
|
1810
|
+
*/
|
|
1811
|
+
401: ErrorResponse;
|
|
1812
|
+
/**
|
|
1813
|
+
* Unmuting would exceed the keyword limit for the current plan
|
|
1814
|
+
*/
|
|
1815
|
+
402: ErrorResponse;
|
|
1816
|
+
/**
|
|
1817
|
+
* Keyword not found
|
|
1818
|
+
*/
|
|
1819
|
+
404: ErrorResponse;
|
|
1820
|
+
};
|
|
1821
|
+
type UpdateKeywordError = UpdateKeywordErrors[keyof UpdateKeywordErrors];
|
|
1822
|
+
type UpdateKeywordResponses = {
|
|
1823
|
+
/**
|
|
1824
|
+
* The updated keyword
|
|
1825
|
+
*/
|
|
1826
|
+
200: Keyword;
|
|
1827
|
+
};
|
|
1828
|
+
type UpdateKeywordResponse = UpdateKeywordResponses[keyof UpdateKeywordResponses];
|
|
1829
|
+
type GetMentionData = {
|
|
1830
|
+
body?: never;
|
|
1831
|
+
path: {
|
|
1832
|
+
/**
|
|
1833
|
+
* Mention id (mm_...).
|
|
1834
|
+
*/
|
|
1835
|
+
id: string;
|
|
1836
|
+
};
|
|
1837
|
+
query?: never;
|
|
1838
|
+
url: '/v1/mentions/{id}';
|
|
1839
|
+
};
|
|
1840
|
+
type GetMentionErrors = {
|
|
1841
|
+
/**
|
|
1842
|
+
* Missing or invalid API key
|
|
1843
|
+
*/
|
|
1844
|
+
401: ErrorResponse;
|
|
1845
|
+
/**
|
|
1846
|
+
* Mention not found
|
|
1847
|
+
*/
|
|
1848
|
+
404: ErrorResponse;
|
|
1849
|
+
};
|
|
1850
|
+
type GetMentionError = GetMentionErrors[keyof GetMentionErrors];
|
|
1851
|
+
type GetMentionResponses = {
|
|
1852
|
+
/**
|
|
1853
|
+
* The mention
|
|
1854
|
+
*/
|
|
1855
|
+
200: Mention;
|
|
1856
|
+
};
|
|
1857
|
+
type GetMentionResponse = GetMentionResponses[keyof GetMentionResponses];
|
|
1858
|
+
type UpdateMentionData = {
|
|
1859
|
+
/**
|
|
1860
|
+
* Every field is optional; omitted fields are untouched.
|
|
1861
|
+
*/
|
|
1862
|
+
body: {
|
|
1863
|
+
/**
|
|
1864
|
+
* ignored or done to handle it; open to put it back.
|
|
1865
|
+
*/
|
|
1866
|
+
status?: 'open' | 'ignored' | 'done';
|
|
1867
|
+
/**
|
|
1868
|
+
* A workspace member (user id), or null to unassign.
|
|
1869
|
+
*/
|
|
1870
|
+
assigneeId?: string | null;
|
|
1871
|
+
/**
|
|
1872
|
+
* ISO 8601 (or epoch ms) until which the mention leaves the feed; null wakes it.
|
|
1873
|
+
*/
|
|
1874
|
+
snoozedUntil?: number | null;
|
|
1875
|
+
/**
|
|
1876
|
+
* Internal note; null or empty clears it.
|
|
1877
|
+
*/
|
|
1878
|
+
note?: string | null;
|
|
1879
|
+
};
|
|
1880
|
+
path: {
|
|
1881
|
+
/**
|
|
1882
|
+
* Mention id (mm_...).
|
|
1883
|
+
*/
|
|
1884
|
+
id: string;
|
|
1885
|
+
};
|
|
1886
|
+
query?: never;
|
|
1887
|
+
url: '/v1/mentions/{id}';
|
|
1888
|
+
};
|
|
1889
|
+
type UpdateMentionErrors = {
|
|
1890
|
+
/**
|
|
1891
|
+
* Assignee is not a member of this organization
|
|
1892
|
+
*/
|
|
1893
|
+
400: ErrorResponse;
|
|
1894
|
+
/**
|
|
1895
|
+
* Missing or invalid API key
|
|
1896
|
+
*/
|
|
1897
|
+
401: ErrorResponse;
|
|
1898
|
+
/**
|
|
1899
|
+
* Mention not found
|
|
1900
|
+
*/
|
|
1901
|
+
404: ErrorResponse;
|
|
1902
|
+
};
|
|
1903
|
+
type UpdateMentionError = UpdateMentionErrors[keyof UpdateMentionErrors];
|
|
1904
|
+
type UpdateMentionResponses = {
|
|
1905
|
+
/**
|
|
1906
|
+
* The updated mention
|
|
1907
|
+
*/
|
|
1908
|
+
200: Mention;
|
|
1909
|
+
};
|
|
1910
|
+
type UpdateMentionResponse = UpdateMentionResponses[keyof UpdateMentionResponses];
|
|
1911
|
+
type SearchMentionsData = {
|
|
1912
|
+
body?: never;
|
|
1913
|
+
path?: never;
|
|
1914
|
+
query?: {
|
|
1915
|
+
/**
|
|
1916
|
+
* Only matches of this keyword.
|
|
1917
|
+
*/
|
|
1918
|
+
keywordId?: string;
|
|
1919
|
+
/**
|
|
1920
|
+
* Only posts from this platform.
|
|
1921
|
+
*/
|
|
1922
|
+
platform?: 'bluesky' | 'hackernews' | 'github' | 'stackoverflow' | 'devto' | 'reddit' | 'x' | 'youtube' | 'news' | 'linkedin';
|
|
1923
|
+
/**
|
|
1924
|
+
* Only mentions in this status. Omit for every status.
|
|
1925
|
+
*/
|
|
1926
|
+
status?: 'open' | 'ignored' | 'done';
|
|
1927
|
+
/**
|
|
1928
|
+
* true: only mentions the classifier scored relevant; false: only the rest (unclassified included).
|
|
1929
|
+
*/
|
|
1930
|
+
relevant?: boolean;
|
|
1931
|
+
/**
|
|
1932
|
+
* Only this sentiment.
|
|
1933
|
+
*/
|
|
1934
|
+
sentiment?: 'positive' | 'neutral' | 'negative';
|
|
1935
|
+
/**
|
|
1936
|
+
* Only mentions carrying this intent (buy_intent, question, complaint, praise, comparison).
|
|
1937
|
+
*/
|
|
1938
|
+
intent?: string;
|
|
1939
|
+
/**
|
|
1940
|
+
* Only this person (an id from /v1/people), merged accounts included. Implies includeMuted.
|
|
1941
|
+
*/
|
|
1942
|
+
personId?: string;
|
|
1943
|
+
/**
|
|
1944
|
+
* true: include mentions by people you muted, hidden by default.
|
|
1945
|
+
*/
|
|
1946
|
+
includeMuted?: boolean;
|
|
1947
|
+
/**
|
|
1948
|
+
* Only mentions assigned to this workspace member (user id).
|
|
1949
|
+
*/
|
|
1950
|
+
assigneeId?: string;
|
|
1951
|
+
/**
|
|
1952
|
+
* true: only mentions currently snoozed. Otherwise snoozed mentions stay out until they wake.
|
|
1953
|
+
*/
|
|
1954
|
+
snoozed?: boolean;
|
|
1955
|
+
/**
|
|
1956
|
+
* Hide these authors: display names, handles or profile URLs. Repeatable, or one comma-separated value.
|
|
1957
|
+
*/
|
|
1958
|
+
excludeAuthors?: Array<string> | null;
|
|
1959
|
+
/**
|
|
1960
|
+
* Only mentions scored at least this; unclassified ones are excluded.
|
|
1961
|
+
*/
|
|
1962
|
+
minRelevance?: number | null;
|
|
1963
|
+
/**
|
|
1964
|
+
* Only authors with at least this many followers. Unknown reach never passes.
|
|
1965
|
+
*/
|
|
1966
|
+
minFollowers?: number | null;
|
|
1967
|
+
/**
|
|
1968
|
+
* Only authors your workspace tagged with any of these (exact, case-sensitive). Repeatable, or comma-separated.
|
|
1969
|
+
*/
|
|
1970
|
+
tags?: Array<string> | null;
|
|
1971
|
+
/**
|
|
1972
|
+
* Substring search in the post text.
|
|
1973
|
+
*/
|
|
1974
|
+
q?: string;
|
|
1975
|
+
/**
|
|
1976
|
+
* Only posts published at or after this instant (ISO 8601, or epoch ms).
|
|
1977
|
+
*/
|
|
1978
|
+
since?: number;
|
|
1979
|
+
/**
|
|
1980
|
+
* Only posts published at or before this instant (ISO 8601, or epoch ms).
|
|
1981
|
+
*/
|
|
1982
|
+
until?: number;
|
|
1983
|
+
/**
|
|
1984
|
+
* newest: by match time, newest first. priority: by attention score, highest first. Cursors are specific to a sort.
|
|
1985
|
+
*/
|
|
1986
|
+
sort?: 'newest' | 'priority';
|
|
1987
|
+
/**
|
|
1988
|
+
* nextCursor from the previous page; pass the same filters and sort.
|
|
1989
|
+
*/
|
|
1990
|
+
cursor?: string;
|
|
1991
|
+
/**
|
|
1992
|
+
* Page size, 1 to 100.
|
|
1993
|
+
*/
|
|
1994
|
+
limit?: number;
|
|
1995
|
+
};
|
|
1996
|
+
url: '/v1/mentions';
|
|
1997
|
+
};
|
|
1998
|
+
type SearchMentionsErrors = {
|
|
1999
|
+
/**
|
|
2000
|
+
* Invalid query or pagination cursor
|
|
2001
|
+
*/
|
|
2002
|
+
400: ErrorResponse;
|
|
2003
|
+
/**
|
|
2004
|
+
* Missing or invalid API key
|
|
2005
|
+
*/
|
|
2006
|
+
401: ErrorResponse;
|
|
2007
|
+
};
|
|
2008
|
+
type SearchMentionsError = SearchMentionsErrors[keyof SearchMentionsErrors];
|
|
2009
|
+
type SearchMentionsResponses = {
|
|
2010
|
+
/**
|
|
2011
|
+
* One page of mentions in the requested order
|
|
2012
|
+
*/
|
|
2013
|
+
200: {
|
|
2014
|
+
data: Array<Mention>;
|
|
2015
|
+
/**
|
|
2016
|
+
* Pass as cursor for the next page; null on the last page.
|
|
2017
|
+
*/
|
|
2018
|
+
nextCursor: string | null;
|
|
2019
|
+
};
|
|
2020
|
+
};
|
|
2021
|
+
type SearchMentionsResponse = SearchMentionsResponses[keyof SearchMentionsResponses];
|
|
2022
|
+
type ExportMentionsCsvData = {
|
|
2023
|
+
body?: never;
|
|
2024
|
+
path?: never;
|
|
2025
|
+
query?: {
|
|
2026
|
+
/**
|
|
2027
|
+
* Only matches of this keyword.
|
|
2028
|
+
*/
|
|
2029
|
+
keywordId?: string;
|
|
2030
|
+
/**
|
|
2031
|
+
* Only posts from this platform.
|
|
2032
|
+
*/
|
|
2033
|
+
platform?: 'bluesky' | 'hackernews' | 'github' | 'stackoverflow' | 'devto' | 'reddit' | 'x' | 'youtube' | 'news' | 'linkedin';
|
|
2034
|
+
/**
|
|
2035
|
+
* Only mentions in this status. Omit for every status.
|
|
2036
|
+
*/
|
|
2037
|
+
status?: 'open' | 'ignored' | 'done';
|
|
2038
|
+
/**
|
|
2039
|
+
* true: only mentions the classifier scored relevant; false: only the rest (unclassified included).
|
|
2040
|
+
*/
|
|
2041
|
+
relevant?: boolean;
|
|
2042
|
+
/**
|
|
2043
|
+
* Only this sentiment.
|
|
2044
|
+
*/
|
|
2045
|
+
sentiment?: 'positive' | 'neutral' | 'negative';
|
|
2046
|
+
/**
|
|
2047
|
+
* Only mentions carrying this intent (buy_intent, question, complaint, praise, comparison).
|
|
2048
|
+
*/
|
|
2049
|
+
intent?: string;
|
|
2050
|
+
/**
|
|
2051
|
+
* Only this person (an id from /v1/people), merged accounts included. Implies includeMuted.
|
|
2052
|
+
*/
|
|
2053
|
+
personId?: string;
|
|
2054
|
+
/**
|
|
2055
|
+
* true: include mentions by people you muted, hidden by default.
|
|
2056
|
+
*/
|
|
2057
|
+
includeMuted?: boolean;
|
|
2058
|
+
/**
|
|
2059
|
+
* Only mentions assigned to this workspace member (user id).
|
|
2060
|
+
*/
|
|
2061
|
+
assigneeId?: string;
|
|
2062
|
+
/**
|
|
2063
|
+
* true: only mentions currently snoozed. Otherwise snoozed mentions stay out until they wake.
|
|
2064
|
+
*/
|
|
2065
|
+
snoozed?: boolean;
|
|
2066
|
+
/**
|
|
2067
|
+
* Hide these authors: display names, handles or profile URLs. Repeatable, or one comma-separated value.
|
|
2068
|
+
*/
|
|
2069
|
+
excludeAuthors?: Array<string> | null;
|
|
2070
|
+
/**
|
|
2071
|
+
* Only mentions scored at least this; unclassified ones are excluded.
|
|
2072
|
+
*/
|
|
2073
|
+
minRelevance?: number | null;
|
|
2074
|
+
/**
|
|
2075
|
+
* Only authors with at least this many followers. Unknown reach never passes.
|
|
2076
|
+
*/
|
|
2077
|
+
minFollowers?: number | null;
|
|
2078
|
+
/**
|
|
2079
|
+
* Only authors your workspace tagged with any of these (exact, case-sensitive). Repeatable, or comma-separated.
|
|
2080
|
+
*/
|
|
2081
|
+
tags?: Array<string> | null;
|
|
2082
|
+
/**
|
|
2083
|
+
* Substring search in the post text.
|
|
2084
|
+
*/
|
|
2085
|
+
q?: string;
|
|
2086
|
+
/**
|
|
2087
|
+
* Only posts published at or after this instant (ISO 8601, or epoch ms).
|
|
2088
|
+
*/
|
|
2089
|
+
since?: number;
|
|
2090
|
+
/**
|
|
2091
|
+
* Only posts published at or before this instant (ISO 8601, or epoch ms).
|
|
2092
|
+
*/
|
|
2093
|
+
until?: number;
|
|
2094
|
+
};
|
|
2095
|
+
url: '/v1/mentions/export.csv';
|
|
2096
|
+
};
|
|
2097
|
+
type ExportMentionsCsvErrors = {
|
|
2098
|
+
/**
|
|
2099
|
+
* Invalid query
|
|
2100
|
+
*/
|
|
2101
|
+
400: ErrorResponse;
|
|
2102
|
+
/**
|
|
2103
|
+
* Missing or invalid API key
|
|
2104
|
+
*/
|
|
2105
|
+
401: ErrorResponse;
|
|
2106
|
+
};
|
|
2107
|
+
type ExportMentionsCsvError = ExportMentionsCsvErrors[keyof ExportMentionsCsvErrors];
|
|
2108
|
+
type ExportMentionsCsvResponses = {
|
|
2109
|
+
/**
|
|
2110
|
+
* CSV, UTF-8
|
|
2111
|
+
*/
|
|
2112
|
+
200: string;
|
|
2113
|
+
};
|
|
2114
|
+
type ExportMentionsCsvResponse = ExportMentionsCsvResponses[keyof ExportMentionsCsvResponses];
|
|
2115
|
+
type ExportPeopleCsvData = {
|
|
2116
|
+
body?: never;
|
|
2117
|
+
path?: never;
|
|
2118
|
+
query?: {
|
|
2119
|
+
/**
|
|
2120
|
+
* People with an account on this platform.
|
|
2121
|
+
*/
|
|
2122
|
+
platform?: 'bluesky' | 'hackernews' | 'github' | 'stackoverflow' | 'devto' | 'reddit' | 'x' | 'youtube' | 'news' | 'linkedin';
|
|
2123
|
+
/**
|
|
2124
|
+
* Matches the display name or the profile handle or URL, case-insensitively.
|
|
2125
|
+
*/
|
|
2126
|
+
q?: string;
|
|
2127
|
+
/**
|
|
2128
|
+
* Only people carrying this tag (exact, case-sensitive).
|
|
2129
|
+
*/
|
|
2130
|
+
tag?: string;
|
|
2131
|
+
/**
|
|
2132
|
+
* true: only muted people; false: only unmuted; omitted: everyone.
|
|
2133
|
+
*/
|
|
2134
|
+
muted?: boolean;
|
|
2135
|
+
/**
|
|
2136
|
+
* Only people whose first matched mention is at or after this instant (ISO 8601, or epoch ms).
|
|
2137
|
+
*/
|
|
2138
|
+
since?: number;
|
|
2139
|
+
/**
|
|
2140
|
+
* A saved segment applied on top of every other filter here. Unknown id: 404.
|
|
2141
|
+
*/
|
|
2142
|
+
segmentId?: string;
|
|
2143
|
+
/**
|
|
2144
|
+
* People with an account on any of these platforms. Repeatable, or comma-separated.
|
|
2145
|
+
*/
|
|
2146
|
+
platforms?: Array<'bluesky' | 'hackernews' | 'github' | 'stackoverflow' | 'devto' | 'reddit' | 'x' | 'youtube' | 'news' | 'linkedin'>;
|
|
2147
|
+
/**
|
|
2148
|
+
* People carrying any of these tags. Repeatable, or comma-separated.
|
|
2149
|
+
*/
|
|
2150
|
+
tags?: Array<string> | null;
|
|
2151
|
+
/**
|
|
2152
|
+
* At least this many followers. Unknown reach never matches.
|
|
2153
|
+
*/
|
|
2154
|
+
minFollowers?: number | null;
|
|
2155
|
+
/**
|
|
2156
|
+
* At most this many followers.
|
|
2157
|
+
*/
|
|
2158
|
+
maxFollowers?: number | null;
|
|
2159
|
+
/**
|
|
2160
|
+
* At least this many matched mentions.
|
|
2161
|
+
*/
|
|
2162
|
+
minMentions?: number;
|
|
2163
|
+
/**
|
|
2164
|
+
* At least this many negative mentions.
|
|
2165
|
+
*/
|
|
2166
|
+
minNegative?: number;
|
|
2167
|
+
/**
|
|
2168
|
+
* At least one mention carrying any of these intents.
|
|
2169
|
+
*/
|
|
2170
|
+
intents?: Array<string> | null;
|
|
2171
|
+
/**
|
|
2172
|
+
* Mentioned a keyword of any of these kinds.
|
|
2173
|
+
*/
|
|
2174
|
+
keywordKinds?: Array<'brand' | 'competitor' | 'topic'>;
|
|
2175
|
+
/**
|
|
2176
|
+
* Never mentioned a keyword of these kinds.
|
|
2177
|
+
*/
|
|
2178
|
+
neverKeywordKinds?: Array<'brand' | 'competitor' | 'topic'>;
|
|
2179
|
+
/**
|
|
2180
|
+
* First seen within this many days.
|
|
2181
|
+
*/
|
|
2182
|
+
newSinceDays?: number;
|
|
2183
|
+
/**
|
|
2184
|
+
* mentions: most matches first. recent: last seen first. reach: most followers first, unknown last. new: first seen most recently first.
|
|
2185
|
+
*/
|
|
2186
|
+
sort?: 'mentions' | 'recent' | 'reach' | 'new';
|
|
2187
|
+
};
|
|
2188
|
+
url: '/v1/people/export.csv';
|
|
2189
|
+
};
|
|
2190
|
+
type ExportPeopleCsvErrors = {
|
|
2191
|
+
/**
|
|
2192
|
+
* Invalid query
|
|
2193
|
+
*/
|
|
2194
|
+
400: ErrorResponse;
|
|
2195
|
+
/**
|
|
2196
|
+
* Missing or invalid API key
|
|
2197
|
+
*/
|
|
2198
|
+
401: ErrorResponse;
|
|
2199
|
+
/**
|
|
2200
|
+
* No such segment for your workspace
|
|
2201
|
+
*/
|
|
2202
|
+
404: ErrorResponse;
|
|
2203
|
+
};
|
|
2204
|
+
type ExportPeopleCsvError = ExportPeopleCsvErrors[keyof ExportPeopleCsvErrors];
|
|
2205
|
+
type ExportPeopleCsvResponses = {
|
|
2206
|
+
/**
|
|
2207
|
+
* CSV, UTF-8
|
|
2208
|
+
*/
|
|
2209
|
+
200: string;
|
|
2210
|
+
};
|
|
2211
|
+
type ExportPeopleCsvResponse = ExportPeopleCsvResponses[keyof ExportPeopleCsvResponses];
|
|
2212
|
+
type ListPeopleData = {
|
|
2213
|
+
body?: never;
|
|
2214
|
+
path?: never;
|
|
2215
|
+
query?: {
|
|
2216
|
+
/**
|
|
2217
|
+
* People with an account on this platform.
|
|
2218
|
+
*/
|
|
2219
|
+
platform?: 'bluesky' | 'hackernews' | 'github' | 'stackoverflow' | 'devto' | 'reddit' | 'x' | 'youtube' | 'news' | 'linkedin';
|
|
2220
|
+
/**
|
|
2221
|
+
* Matches the display name or the profile handle or URL, case-insensitively.
|
|
2222
|
+
*/
|
|
2223
|
+
q?: string;
|
|
2224
|
+
/**
|
|
2225
|
+
* Only people carrying this tag (exact, case-sensitive).
|
|
2226
|
+
*/
|
|
2227
|
+
tag?: string;
|
|
2228
|
+
/**
|
|
2229
|
+
* true: only muted people; false: only unmuted; omitted: everyone.
|
|
2230
|
+
*/
|
|
2231
|
+
muted?: boolean;
|
|
2232
|
+
/**
|
|
2233
|
+
* Only people whose first matched mention is at or after this instant (ISO 8601, or epoch ms).
|
|
2234
|
+
*/
|
|
2235
|
+
since?: number;
|
|
2236
|
+
/**
|
|
2237
|
+
* A saved segment applied on top of every other filter here. Unknown id: 404.
|
|
2238
|
+
*/
|
|
2239
|
+
segmentId?: string;
|
|
2240
|
+
/**
|
|
2241
|
+
* People with an account on any of these platforms. Repeatable, or comma-separated.
|
|
2242
|
+
*/
|
|
2243
|
+
platforms?: Array<'bluesky' | 'hackernews' | 'github' | 'stackoverflow' | 'devto' | 'reddit' | 'x' | 'youtube' | 'news' | 'linkedin'>;
|
|
2244
|
+
/**
|
|
2245
|
+
* People carrying any of these tags. Repeatable, or comma-separated.
|
|
2246
|
+
*/
|
|
2247
|
+
tags?: Array<string> | null;
|
|
2248
|
+
/**
|
|
2249
|
+
* At least this many followers. Unknown reach never matches.
|
|
2250
|
+
*/
|
|
2251
|
+
minFollowers?: number | null;
|
|
2252
|
+
/**
|
|
2253
|
+
* At most this many followers.
|
|
2254
|
+
*/
|
|
2255
|
+
maxFollowers?: number | null;
|
|
2256
|
+
/**
|
|
2257
|
+
* At least this many matched mentions.
|
|
2258
|
+
*/
|
|
2259
|
+
minMentions?: number;
|
|
2260
|
+
/**
|
|
2261
|
+
* At least this many negative mentions.
|
|
2262
|
+
*/
|
|
2263
|
+
minNegative?: number;
|
|
2264
|
+
/**
|
|
2265
|
+
* At least one mention carrying any of these intents.
|
|
2266
|
+
*/
|
|
2267
|
+
intents?: Array<string> | null;
|
|
2268
|
+
/**
|
|
2269
|
+
* Mentioned a keyword of any of these kinds.
|
|
2270
|
+
*/
|
|
2271
|
+
keywordKinds?: Array<'brand' | 'competitor' | 'topic'>;
|
|
2272
|
+
/**
|
|
2273
|
+
* Never mentioned a keyword of these kinds.
|
|
2274
|
+
*/
|
|
2275
|
+
neverKeywordKinds?: Array<'brand' | 'competitor' | 'topic'>;
|
|
2276
|
+
/**
|
|
2277
|
+
* First seen within this many days.
|
|
2278
|
+
*/
|
|
2279
|
+
newSinceDays?: number;
|
|
2280
|
+
/**
|
|
2281
|
+
* mentions: most matches first. recent: last seen first. reach: most followers first, unknown last. new: first seen most recently first.
|
|
2282
|
+
*/
|
|
2283
|
+
sort?: 'mentions' | 'recent' | 'reach' | 'new';
|
|
2284
|
+
/**
|
|
2285
|
+
* Page size, 1 to 100.
|
|
2286
|
+
*/
|
|
2287
|
+
limit?: number;
|
|
2288
|
+
/**
|
|
2289
|
+
* Skip this many people. Offset paging: a grouped read over hundreds of people, not a stream.
|
|
2290
|
+
*/
|
|
2291
|
+
offset?: number | null;
|
|
2292
|
+
};
|
|
2293
|
+
url: '/v1/people';
|
|
2294
|
+
};
|
|
2295
|
+
type ListPeopleErrors = {
|
|
2296
|
+
/**
|
|
2297
|
+
* Invalid query
|
|
2298
|
+
*/
|
|
2299
|
+
400: ErrorResponse;
|
|
2300
|
+
/**
|
|
2301
|
+
* Missing or invalid API key
|
|
2302
|
+
*/
|
|
2303
|
+
401: ErrorResponse;
|
|
2304
|
+
/**
|
|
2305
|
+
* No such segment for your workspace
|
|
2306
|
+
*/
|
|
2307
|
+
404: ErrorResponse;
|
|
2308
|
+
};
|
|
2309
|
+
type ListPeopleError = ListPeopleErrors[keyof ListPeopleErrors];
|
|
2310
|
+
type ListPeopleResponses = {
|
|
2311
|
+
/**
|
|
2312
|
+
* One page of people
|
|
2313
|
+
*/
|
|
2314
|
+
200: {
|
|
2315
|
+
data: Array<{
|
|
2316
|
+
/**
|
|
2317
|
+
* Person id (aut_...): the canonical account. An account merged into someone resolves to that person.
|
|
2318
|
+
*/
|
|
2319
|
+
id: string;
|
|
2320
|
+
/**
|
|
2321
|
+
* Platform of the canonical account; `accounts` lists every account.
|
|
2322
|
+
*/
|
|
2323
|
+
platform: 'bluesky' | 'hackernews' | 'github' | 'stackoverflow' | 'devto' | 'reddit' | 'x' | 'youtube' | 'news' | 'linkedin';
|
|
2324
|
+
/**
|
|
2325
|
+
* Display name as of their newest post; null when the platform has none.
|
|
2326
|
+
*/
|
|
2327
|
+
name: string | null;
|
|
2328
|
+
/**
|
|
2329
|
+
* Platform handle of the canonical account, formatted as the platform shows it.
|
|
2330
|
+
*/
|
|
2331
|
+
handle: string | null;
|
|
2332
|
+
/**
|
|
2333
|
+
* Profile URL of the canonical account.
|
|
2334
|
+
*/
|
|
2335
|
+
url: string | null;
|
|
2336
|
+
avatarUrl: string | null;
|
|
2337
|
+
/**
|
|
2338
|
+
* Every account this workspace treats as this person, the canonical one first.
|
|
2339
|
+
*/
|
|
2340
|
+
accounts: Array<{
|
|
2341
|
+
/**
|
|
2342
|
+
* The account id (aut_...); the canonical one equals the person id.
|
|
2343
|
+
*/
|
|
2344
|
+
id: string;
|
|
2345
|
+
/**
|
|
2346
|
+
* Platform: bluesky, hackernews, github, stackoverflow, devto, reddit, x, youtube, news, linkedin.
|
|
2347
|
+
*/
|
|
2348
|
+
platform: 'bluesky' | 'hackernews' | 'github' | 'stackoverflow' | 'devto' | 'reddit' | 'x' | 'youtube' | 'news' | 'linkedin';
|
|
2349
|
+
/**
|
|
2350
|
+
* Display name as the platform reports it.
|
|
2351
|
+
*/
|
|
2352
|
+
name: string | null;
|
|
2353
|
+
/**
|
|
2354
|
+
* Platform handle derived from the profile URL, formatted as the platform shows it.
|
|
2355
|
+
*/
|
|
2356
|
+
handle: string | null;
|
|
2357
|
+
/**
|
|
2358
|
+
* Profile URL.
|
|
2359
|
+
*/
|
|
2360
|
+
url: string | null;
|
|
2361
|
+
}>;
|
|
2362
|
+
/**
|
|
2363
|
+
* Platform counts as of their newest post; null where the platform has no such number.
|
|
2364
|
+
*/
|
|
2365
|
+
reach: {
|
|
2366
|
+
followers: number | null;
|
|
2367
|
+
following: number | null;
|
|
2368
|
+
posts: number | null;
|
|
2369
|
+
};
|
|
2370
|
+
/**
|
|
2371
|
+
* Public profile facts; null until looked up.
|
|
2372
|
+
*/
|
|
2373
|
+
profile: {
|
|
2374
|
+
bio: string | null;
|
|
2375
|
+
company: string | null;
|
|
2376
|
+
location: string | null;
|
|
2377
|
+
website: string | null;
|
|
2378
|
+
/**
|
|
2379
|
+
* Only when the person made it public on the platform.
|
|
2380
|
+
*/
|
|
2381
|
+
email: string | null;
|
|
2382
|
+
/**
|
|
2383
|
+
* Other accounts the person lists on their profile.
|
|
2384
|
+
*/
|
|
2385
|
+
links: Array<{
|
|
2386
|
+
provider: string;
|
|
2387
|
+
url: string;
|
|
2388
|
+
}>;
|
|
2389
|
+
/**
|
|
2390
|
+
* When the profile was read.
|
|
2391
|
+
*/
|
|
2392
|
+
fetchedAt: string;
|
|
2393
|
+
} | null;
|
|
2394
|
+
/**
|
|
2395
|
+
* Computed over this workspace's matches.
|
|
2396
|
+
*/
|
|
2397
|
+
stats: {
|
|
2398
|
+
/**
|
|
2399
|
+
* Every match of theirs for this workspace, relevant or not.
|
|
2400
|
+
*/
|
|
2401
|
+
mentions: number;
|
|
2402
|
+
/**
|
|
2403
|
+
* Of those, scored relevant.
|
|
2404
|
+
*/
|
|
2405
|
+
relevant: number;
|
|
2406
|
+
sentiment: {
|
|
2407
|
+
positive: number;
|
|
2408
|
+
neutral: number;
|
|
2409
|
+
negative: number;
|
|
2410
|
+
};
|
|
2411
|
+
/**
|
|
2412
|
+
* Their oldest matched post.
|
|
2413
|
+
*/
|
|
2414
|
+
firstSeenAt: string;
|
|
2415
|
+
/**
|
|
2416
|
+
* Their newest matched post.
|
|
2417
|
+
*/
|
|
2418
|
+
lastSeenAt: string;
|
|
2419
|
+
};
|
|
2420
|
+
/**
|
|
2421
|
+
* What this workspace wrote about the person.
|
|
2422
|
+
*/
|
|
2423
|
+
annotations: {
|
|
2424
|
+
tags: Array<string>;
|
|
2425
|
+
notes: string;
|
|
2426
|
+
/**
|
|
2427
|
+
* Their posts stay out of the feed and every channel; ingest and billing are untouched.
|
|
2428
|
+
*/
|
|
2429
|
+
muted: boolean;
|
|
2430
|
+
};
|
|
2431
|
+
}>;
|
|
2432
|
+
/**
|
|
2433
|
+
* People matching the filters, across all pages.
|
|
2434
|
+
*/
|
|
2435
|
+
total: number;
|
|
2436
|
+
};
|
|
2437
|
+
};
|
|
2438
|
+
type ListPeopleResponse = ListPeopleResponses[keyof ListPeopleResponses];
|
|
2439
|
+
type GetPersonData = {
|
|
2440
|
+
body?: never;
|
|
2441
|
+
path: {
|
|
2442
|
+
/**
|
|
2443
|
+
* Person id (aut_...).
|
|
2444
|
+
*/
|
|
2445
|
+
id: string;
|
|
2446
|
+
};
|
|
2447
|
+
query?: never;
|
|
2448
|
+
url: '/v1/people/{id}';
|
|
2449
|
+
};
|
|
2450
|
+
type GetPersonErrors = {
|
|
2451
|
+
/**
|
|
2452
|
+
* Missing or invalid API key
|
|
2453
|
+
*/
|
|
2454
|
+
401: ErrorResponse;
|
|
2455
|
+
/**
|
|
2456
|
+
* No mention by this person for your workspace
|
|
2457
|
+
*/
|
|
2458
|
+
404: ErrorResponse;
|
|
2459
|
+
};
|
|
2460
|
+
type GetPersonError = GetPersonErrors[keyof GetPersonErrors];
|
|
2461
|
+
type GetPersonResponses = {
|
|
2462
|
+
/**
|
|
2463
|
+
* The person
|
|
2464
|
+
*/
|
|
2465
|
+
200: Person;
|
|
2466
|
+
};
|
|
2467
|
+
type GetPersonResponse = GetPersonResponses[keyof GetPersonResponses];
|
|
2468
|
+
type UpdatePersonData = {
|
|
2469
|
+
/**
|
|
2470
|
+
* Omitted fields are untouched.
|
|
2471
|
+
*/
|
|
2472
|
+
body: {
|
|
2473
|
+
/**
|
|
2474
|
+
* Replaces the whole list.
|
|
2475
|
+
*/
|
|
2476
|
+
tags?: Array<string>;
|
|
2477
|
+
notes?: string;
|
|
2478
|
+
muted?: boolean;
|
|
2479
|
+
};
|
|
2480
|
+
path: {
|
|
2481
|
+
/**
|
|
2482
|
+
* Person id (aut_...).
|
|
2483
|
+
*/
|
|
2484
|
+
id: string;
|
|
2485
|
+
};
|
|
2486
|
+
query?: never;
|
|
2487
|
+
url: '/v1/people/{id}';
|
|
2488
|
+
};
|
|
2489
|
+
type UpdatePersonErrors = {
|
|
2490
|
+
/**
|
|
2491
|
+
* Missing or invalid API key
|
|
2492
|
+
*/
|
|
2493
|
+
401: ErrorResponse;
|
|
2494
|
+
/**
|
|
2495
|
+
* No mention by this person for your workspace
|
|
2496
|
+
*/
|
|
2497
|
+
404: ErrorResponse;
|
|
2498
|
+
};
|
|
2499
|
+
type UpdatePersonError = UpdatePersonErrors[keyof UpdatePersonErrors];
|
|
2500
|
+
type UpdatePersonResponses = {
|
|
2501
|
+
/**
|
|
2502
|
+
* The updated person
|
|
2503
|
+
*/
|
|
2504
|
+
200: Person;
|
|
2505
|
+
};
|
|
2506
|
+
type UpdatePersonResponse = UpdatePersonResponses[keyof UpdatePersonResponses];
|
|
2507
|
+
type MergePeopleData = {
|
|
2508
|
+
body: {
|
|
2509
|
+
/**
|
|
2510
|
+
* The person to fold this account into (their id).
|
|
2511
|
+
*/
|
|
2512
|
+
into: string;
|
|
2513
|
+
};
|
|
2514
|
+
path: {
|
|
2515
|
+
/**
|
|
2516
|
+
* Person id (aut_...).
|
|
2517
|
+
*/
|
|
2518
|
+
id: string;
|
|
2519
|
+
};
|
|
2520
|
+
query?: never;
|
|
2521
|
+
url: '/v1/people/{id}/merge';
|
|
2522
|
+
};
|
|
2523
|
+
type MergePeopleErrors = {
|
|
2524
|
+
/**
|
|
2525
|
+
* Missing or invalid API key
|
|
2526
|
+
*/
|
|
2527
|
+
401: ErrorResponse;
|
|
2528
|
+
/**
|
|
2529
|
+
* Either side is unknown to your workspace
|
|
2530
|
+
*/
|
|
2531
|
+
404: ErrorResponse;
|
|
2532
|
+
};
|
|
2533
|
+
type MergePeopleError = MergePeopleErrors[keyof MergePeopleErrors];
|
|
2534
|
+
type MergePeopleResponses = {
|
|
2535
|
+
/**
|
|
2536
|
+
* The person this account now belongs to
|
|
2537
|
+
*/
|
|
2538
|
+
200: Person;
|
|
2539
|
+
};
|
|
2540
|
+
type MergePeopleResponse = MergePeopleResponses[keyof MergePeopleResponses];
|
|
2541
|
+
type SplitPersonData = {
|
|
2542
|
+
body?: never;
|
|
2543
|
+
path: {
|
|
2544
|
+
/**
|
|
2545
|
+
* Person id (aut_...).
|
|
2546
|
+
*/
|
|
2547
|
+
id: string;
|
|
2548
|
+
};
|
|
2549
|
+
query?: never;
|
|
2550
|
+
url: '/v1/people/{id}/split';
|
|
2551
|
+
};
|
|
2552
|
+
type SplitPersonErrors = {
|
|
2553
|
+
/**
|
|
2554
|
+
* Missing or invalid API key
|
|
2555
|
+
*/
|
|
2556
|
+
401: ErrorResponse;
|
|
2557
|
+
/**
|
|
2558
|
+
* This account was not merged into anyone
|
|
2559
|
+
*/
|
|
2560
|
+
404: ErrorResponse;
|
|
2561
|
+
};
|
|
2562
|
+
type SplitPersonError = SplitPersonErrors[keyof SplitPersonErrors];
|
|
2563
|
+
type SplitPersonResponses = {
|
|
2564
|
+
/**
|
|
2565
|
+
* The account, as its own person
|
|
2566
|
+
*/
|
|
2567
|
+
200: Person;
|
|
2568
|
+
};
|
|
2569
|
+
type SplitPersonResponse = SplitPersonResponses[keyof SplitPersonResponses];
|
|
2570
|
+
type ListSegmentsData = {
|
|
2571
|
+
body?: never;
|
|
2572
|
+
path?: never;
|
|
2573
|
+
query?: never;
|
|
2574
|
+
url: '/v1/segments';
|
|
2575
|
+
};
|
|
2576
|
+
type ListSegmentsErrors = {
|
|
2577
|
+
/**
|
|
2578
|
+
* Missing or invalid API key
|
|
2579
|
+
*/
|
|
2580
|
+
401: ErrorResponse;
|
|
2581
|
+
};
|
|
2582
|
+
type ListSegmentsError = ListSegmentsErrors[keyof ListSegmentsErrors];
|
|
2583
|
+
type ListSegmentsResponses = {
|
|
2584
|
+
/**
|
|
2585
|
+
* Every segment, with presets
|
|
2586
|
+
*/
|
|
2587
|
+
200: {
|
|
2588
|
+
data: Array<{
|
|
2589
|
+
/**
|
|
2590
|
+
* Segment id (seg_...).
|
|
2591
|
+
*/
|
|
2592
|
+
id: string;
|
|
2593
|
+
name: string;
|
|
2594
|
+
description: string;
|
|
2595
|
+
filter: {
|
|
2596
|
+
/**
|
|
2597
|
+
* People with an account on any of these platforms.
|
|
2598
|
+
*/
|
|
2599
|
+
platforms?: Array<'bluesky' | 'hackernews' | 'github' | 'stackoverflow' | 'devto' | 'reddit' | 'x' | 'youtube' | 'news' | 'linkedin'>;
|
|
2600
|
+
/**
|
|
2601
|
+
* People carrying any of these tags.
|
|
2602
|
+
*/
|
|
2603
|
+
tags?: Array<string>;
|
|
2604
|
+
/**
|
|
2605
|
+
* At least this many followers. Unknown reach never matches.
|
|
2606
|
+
*/
|
|
2607
|
+
minFollowers?: number;
|
|
2608
|
+
/**
|
|
2609
|
+
* At most this many followers. Unknown reach never matches.
|
|
2610
|
+
*/
|
|
2611
|
+
maxFollowers?: number;
|
|
2612
|
+
/**
|
|
2613
|
+
* At least this many matched mentions.
|
|
2614
|
+
*/
|
|
2615
|
+
minMentions?: number;
|
|
2616
|
+
/**
|
|
2617
|
+
* At least this many negative mentions.
|
|
2618
|
+
*/
|
|
2619
|
+
minNegative?: number;
|
|
2620
|
+
/**
|
|
2621
|
+
* At least one mention carrying any of these intents.
|
|
2622
|
+
*/
|
|
2623
|
+
intents?: Array<string>;
|
|
2624
|
+
/**
|
|
2625
|
+
* Mentioned a keyword of any of these kinds.
|
|
2626
|
+
*/
|
|
2627
|
+
keywordKinds?: Array<'brand' | 'competitor' | 'topic'>;
|
|
2628
|
+
/**
|
|
2629
|
+
* Never mentioned a keyword of these kinds.
|
|
2630
|
+
*/
|
|
2631
|
+
neverKeywordKinds?: Array<'brand' | 'competitor' | 'topic'>;
|
|
2632
|
+
/**
|
|
2633
|
+
* First seen within this many days.
|
|
2634
|
+
*/
|
|
2635
|
+
newSinceDays?: number;
|
|
2636
|
+
/**
|
|
2637
|
+
* true: only muted people; false: only unmuted.
|
|
2638
|
+
*/
|
|
2639
|
+
muted?: boolean;
|
|
2640
|
+
};
|
|
2641
|
+
/**
|
|
2642
|
+
* People in the segment right now; it is evaluated on every read.
|
|
2643
|
+
*/
|
|
2644
|
+
count: number;
|
|
2645
|
+
/**
|
|
2646
|
+
* ISO 8601 timestamp, UTC.
|
|
2647
|
+
*/
|
|
2648
|
+
createdAt: string;
|
|
2649
|
+
/**
|
|
2650
|
+
* ISO 8601 timestamp, UTC.
|
|
2651
|
+
*/
|
|
2652
|
+
updatedAt: string;
|
|
2653
|
+
}>;
|
|
2654
|
+
/**
|
|
2655
|
+
* Starting points you can save with POST /v1/segments.
|
|
2656
|
+
*/
|
|
2657
|
+
presets: Array<{
|
|
2658
|
+
key: string;
|
|
2659
|
+
name: string;
|
|
2660
|
+
description: string;
|
|
2661
|
+
filter: {
|
|
2662
|
+
/**
|
|
2663
|
+
* People with an account on any of these platforms.
|
|
2664
|
+
*/
|
|
2665
|
+
platforms?: Array<'bluesky' | 'hackernews' | 'github' | 'stackoverflow' | 'devto' | 'reddit' | 'x' | 'youtube' | 'news' | 'linkedin'>;
|
|
2666
|
+
/**
|
|
2667
|
+
* People carrying any of these tags.
|
|
2668
|
+
*/
|
|
2669
|
+
tags?: Array<string>;
|
|
2670
|
+
/**
|
|
2671
|
+
* At least this many followers. Unknown reach never matches.
|
|
2672
|
+
*/
|
|
2673
|
+
minFollowers?: number;
|
|
2674
|
+
/**
|
|
2675
|
+
* At most this many followers. Unknown reach never matches.
|
|
2676
|
+
*/
|
|
2677
|
+
maxFollowers?: number;
|
|
2678
|
+
/**
|
|
2679
|
+
* At least this many matched mentions.
|
|
2680
|
+
*/
|
|
2681
|
+
minMentions?: number;
|
|
2682
|
+
/**
|
|
2683
|
+
* At least this many negative mentions.
|
|
2684
|
+
*/
|
|
2685
|
+
minNegative?: number;
|
|
2686
|
+
/**
|
|
2687
|
+
* At least one mention carrying any of these intents.
|
|
2688
|
+
*/
|
|
2689
|
+
intents?: Array<string>;
|
|
2690
|
+
/**
|
|
2691
|
+
* Mentioned a keyword of any of these kinds.
|
|
2692
|
+
*/
|
|
2693
|
+
keywordKinds?: Array<'brand' | 'competitor' | 'topic'>;
|
|
2694
|
+
/**
|
|
2695
|
+
* Never mentioned a keyword of these kinds.
|
|
2696
|
+
*/
|
|
2697
|
+
neverKeywordKinds?: Array<'brand' | 'competitor' | 'topic'>;
|
|
2698
|
+
/**
|
|
2699
|
+
* First seen within this many days.
|
|
2700
|
+
*/
|
|
2701
|
+
newSinceDays?: number;
|
|
2702
|
+
/**
|
|
2703
|
+
* true: only muted people; false: only unmuted.
|
|
2704
|
+
*/
|
|
2705
|
+
muted?: boolean;
|
|
2706
|
+
};
|
|
2707
|
+
}>;
|
|
2708
|
+
};
|
|
2709
|
+
};
|
|
2710
|
+
type ListSegmentsResponse = ListSegmentsResponses[keyof ListSegmentsResponses];
|
|
2711
|
+
type CreateSegmentData = {
|
|
2712
|
+
body: {
|
|
2713
|
+
name: string;
|
|
2714
|
+
description?: string;
|
|
2715
|
+
filter?: {
|
|
2716
|
+
/**
|
|
2717
|
+
* People with an account on any of these platforms.
|
|
2718
|
+
*/
|
|
2719
|
+
platforms?: Array<'bluesky' | 'hackernews' | 'github' | 'stackoverflow' | 'devto' | 'reddit' | 'x' | 'youtube' | 'news' | 'linkedin'>;
|
|
2720
|
+
/**
|
|
2721
|
+
* People carrying any of these tags.
|
|
2722
|
+
*/
|
|
2723
|
+
tags?: Array<string>;
|
|
2724
|
+
/**
|
|
2725
|
+
* At least this many followers. Unknown reach never matches.
|
|
2726
|
+
*/
|
|
2727
|
+
minFollowers?: number;
|
|
2728
|
+
/**
|
|
2729
|
+
* At most this many followers. Unknown reach never matches.
|
|
2730
|
+
*/
|
|
2731
|
+
maxFollowers?: number;
|
|
2732
|
+
/**
|
|
2733
|
+
* At least this many matched mentions.
|
|
2734
|
+
*/
|
|
2735
|
+
minMentions?: number;
|
|
2736
|
+
/**
|
|
2737
|
+
* At least this many negative mentions.
|
|
2738
|
+
*/
|
|
2739
|
+
minNegative?: number;
|
|
2740
|
+
/**
|
|
2741
|
+
* At least one mention carrying any of these intents.
|
|
2742
|
+
*/
|
|
2743
|
+
intents?: Array<string>;
|
|
2744
|
+
/**
|
|
2745
|
+
* Mentioned a keyword of any of these kinds.
|
|
2746
|
+
*/
|
|
2747
|
+
keywordKinds?: Array<'brand' | 'competitor' | 'topic'>;
|
|
2748
|
+
/**
|
|
2749
|
+
* Never mentioned a keyword of these kinds.
|
|
2750
|
+
*/
|
|
2751
|
+
neverKeywordKinds?: Array<'brand' | 'competitor' | 'topic'>;
|
|
2752
|
+
/**
|
|
2753
|
+
* First seen within this many days.
|
|
2754
|
+
*/
|
|
2755
|
+
newSinceDays?: number;
|
|
2756
|
+
/**
|
|
2757
|
+
* true: only muted people; false: only unmuted.
|
|
2758
|
+
*/
|
|
2759
|
+
muted?: boolean;
|
|
2760
|
+
};
|
|
2761
|
+
};
|
|
2762
|
+
path?: never;
|
|
2763
|
+
query?: never;
|
|
2764
|
+
url: '/v1/segments';
|
|
2765
|
+
};
|
|
2766
|
+
type CreateSegmentErrors = {
|
|
2767
|
+
/**
|
|
2768
|
+
* Invalid body
|
|
2769
|
+
*/
|
|
2770
|
+
400: ErrorResponse;
|
|
2771
|
+
/**
|
|
2772
|
+
* Missing or invalid API key
|
|
2773
|
+
*/
|
|
2774
|
+
401: ErrorResponse;
|
|
2775
|
+
/**
|
|
2776
|
+
* A segment with this name already exists
|
|
2777
|
+
*/
|
|
2778
|
+
409: ErrorResponse;
|
|
2779
|
+
};
|
|
2780
|
+
type CreateSegmentError = CreateSegmentErrors[keyof CreateSegmentErrors];
|
|
2781
|
+
type CreateSegmentResponses = {
|
|
2782
|
+
/**
|
|
2783
|
+
* The saved segment, with its current size
|
|
2784
|
+
*/
|
|
2785
|
+
201: Segment;
|
|
2786
|
+
};
|
|
2787
|
+
type CreateSegmentResponse = CreateSegmentResponses[keyof CreateSegmentResponses];
|
|
2788
|
+
type DeleteSegmentData = {
|
|
2789
|
+
body?: never;
|
|
2790
|
+
path: {
|
|
2791
|
+
/**
|
|
2792
|
+
* Segment id (seg_...).
|
|
2793
|
+
*/
|
|
2794
|
+
id: string;
|
|
2795
|
+
};
|
|
2796
|
+
query?: never;
|
|
2797
|
+
url: '/v1/segments/{id}';
|
|
2798
|
+
};
|
|
2799
|
+
type DeleteSegmentErrors = {
|
|
2800
|
+
/**
|
|
2801
|
+
* Missing or invalid API key
|
|
2802
|
+
*/
|
|
2803
|
+
401: ErrorResponse;
|
|
2804
|
+
/**
|
|
2805
|
+
* No such segment for your workspace
|
|
2806
|
+
*/
|
|
2807
|
+
404: ErrorResponse;
|
|
2808
|
+
};
|
|
2809
|
+
type DeleteSegmentError = DeleteSegmentErrors[keyof DeleteSegmentErrors];
|
|
2810
|
+
type DeleteSegmentResponses = {
|
|
2811
|
+
/**
|
|
2812
|
+
* Deleted
|
|
2813
|
+
*/
|
|
2814
|
+
204: void;
|
|
2815
|
+
};
|
|
2816
|
+
type DeleteSegmentResponse = DeleteSegmentResponses[keyof DeleteSegmentResponses];
|
|
2817
|
+
type GetSegmentData = {
|
|
2818
|
+
body?: never;
|
|
2819
|
+
path: {
|
|
2820
|
+
/**
|
|
2821
|
+
* Segment id (seg_...).
|
|
2822
|
+
*/
|
|
2823
|
+
id: string;
|
|
2824
|
+
};
|
|
2825
|
+
query?: never;
|
|
2826
|
+
url: '/v1/segments/{id}';
|
|
2827
|
+
};
|
|
2828
|
+
type GetSegmentErrors = {
|
|
2829
|
+
/**
|
|
2830
|
+
* Missing or invalid API key
|
|
2831
|
+
*/
|
|
2832
|
+
401: ErrorResponse;
|
|
2833
|
+
/**
|
|
2834
|
+
* No such segment for your workspace
|
|
2835
|
+
*/
|
|
2836
|
+
404: ErrorResponse;
|
|
2837
|
+
};
|
|
2838
|
+
type GetSegmentError = GetSegmentErrors[keyof GetSegmentErrors];
|
|
2839
|
+
type GetSegmentResponses = {
|
|
2840
|
+
/**
|
|
2841
|
+
* One segment, with its current size
|
|
2842
|
+
*/
|
|
2843
|
+
200: Segment;
|
|
2844
|
+
};
|
|
2845
|
+
type GetSegmentResponse = GetSegmentResponses[keyof GetSegmentResponses];
|
|
2846
|
+
type UpdateSegmentData = {
|
|
2847
|
+
/**
|
|
2848
|
+
* Omitted fields are untouched.
|
|
2849
|
+
*/
|
|
2850
|
+
body: {
|
|
2851
|
+
name?: string;
|
|
2852
|
+
description?: string;
|
|
2853
|
+
/**
|
|
2854
|
+
* Replaces the whole filter.
|
|
2855
|
+
*/
|
|
2856
|
+
filter?: {
|
|
2857
|
+
/**
|
|
2858
|
+
* People with an account on any of these platforms.
|
|
2859
|
+
*/
|
|
2860
|
+
platforms?: Array<'bluesky' | 'hackernews' | 'github' | 'stackoverflow' | 'devto' | 'reddit' | 'x' | 'youtube' | 'news' | 'linkedin'>;
|
|
2861
|
+
/**
|
|
2862
|
+
* People carrying any of these tags.
|
|
2863
|
+
*/
|
|
2864
|
+
tags?: Array<string>;
|
|
2865
|
+
/**
|
|
2866
|
+
* At least this many followers. Unknown reach never matches.
|
|
2867
|
+
*/
|
|
2868
|
+
minFollowers?: number;
|
|
2869
|
+
/**
|
|
2870
|
+
* At most this many followers. Unknown reach never matches.
|
|
2871
|
+
*/
|
|
2872
|
+
maxFollowers?: number;
|
|
2873
|
+
/**
|
|
2874
|
+
* At least this many matched mentions.
|
|
2875
|
+
*/
|
|
2876
|
+
minMentions?: number;
|
|
2877
|
+
/**
|
|
2878
|
+
* At least this many negative mentions.
|
|
2879
|
+
*/
|
|
2880
|
+
minNegative?: number;
|
|
2881
|
+
/**
|
|
2882
|
+
* At least one mention carrying any of these intents.
|
|
2883
|
+
*/
|
|
2884
|
+
intents?: Array<string>;
|
|
2885
|
+
/**
|
|
2886
|
+
* Mentioned a keyword of any of these kinds.
|
|
2887
|
+
*/
|
|
2888
|
+
keywordKinds?: Array<'brand' | 'competitor' | 'topic'>;
|
|
2889
|
+
/**
|
|
2890
|
+
* Never mentioned a keyword of these kinds.
|
|
2891
|
+
*/
|
|
2892
|
+
neverKeywordKinds?: Array<'brand' | 'competitor' | 'topic'>;
|
|
2893
|
+
/**
|
|
2894
|
+
* First seen within this many days.
|
|
2895
|
+
*/
|
|
2896
|
+
newSinceDays?: number;
|
|
2897
|
+
/**
|
|
2898
|
+
* true: only muted people; false: only unmuted.
|
|
2899
|
+
*/
|
|
2900
|
+
muted?: boolean;
|
|
2901
|
+
};
|
|
2902
|
+
};
|
|
2903
|
+
path: {
|
|
2904
|
+
/**
|
|
2905
|
+
* Segment id (seg_...).
|
|
2906
|
+
*/
|
|
2907
|
+
id: string;
|
|
2908
|
+
};
|
|
2909
|
+
query?: never;
|
|
2910
|
+
url: '/v1/segments/{id}';
|
|
2911
|
+
};
|
|
2912
|
+
type UpdateSegmentErrors = {
|
|
2913
|
+
/**
|
|
2914
|
+
* Missing or invalid API key
|
|
2915
|
+
*/
|
|
2916
|
+
401: ErrorResponse;
|
|
2917
|
+
/**
|
|
2918
|
+
* No such segment for your workspace
|
|
2919
|
+
*/
|
|
2920
|
+
404: ErrorResponse;
|
|
2921
|
+
/**
|
|
2922
|
+
* A segment with this name already exists
|
|
2923
|
+
*/
|
|
2924
|
+
409: ErrorResponse;
|
|
2925
|
+
};
|
|
2926
|
+
type UpdateSegmentError = UpdateSegmentErrors[keyof UpdateSegmentErrors];
|
|
2927
|
+
type UpdateSegmentResponses = {
|
|
2928
|
+
/**
|
|
2929
|
+
* The updated segment
|
|
2930
|
+
*/
|
|
2931
|
+
200: Segment;
|
|
2932
|
+
};
|
|
2933
|
+
type UpdateSegmentResponse = UpdateSegmentResponses[keyof UpdateSegmentResponses];
|
|
2934
|
+
type GetCompanyData = {
|
|
2935
|
+
body?: never;
|
|
2936
|
+
path?: never;
|
|
2937
|
+
query?: never;
|
|
2938
|
+
url: '/v1/company';
|
|
2939
|
+
};
|
|
2940
|
+
type GetCompanyErrors = {
|
|
2941
|
+
/**
|
|
2942
|
+
* Missing or invalid API key
|
|
2943
|
+
*/
|
|
2944
|
+
401: ErrorResponse;
|
|
2945
|
+
/**
|
|
2946
|
+
* Workspace not found
|
|
2947
|
+
*/
|
|
2948
|
+
404: ErrorResponse;
|
|
2949
|
+
};
|
|
2950
|
+
type GetCompanyError = GetCompanyErrors[keyof GetCompanyErrors];
|
|
2951
|
+
type GetCompanyResponses = {
|
|
2952
|
+
/**
|
|
2953
|
+
* The company profile
|
|
2954
|
+
*/
|
|
2955
|
+
200: Company;
|
|
2956
|
+
};
|
|
2957
|
+
type GetCompanyResponse = GetCompanyResponses[keyof GetCompanyResponses];
|
|
2958
|
+
type UpdateCompanyData = {
|
|
2959
|
+
/**
|
|
2960
|
+
* Omitted fields are untouched.
|
|
2961
|
+
*/
|
|
2962
|
+
body: {
|
|
2963
|
+
name?: string;
|
|
2964
|
+
description?: string;
|
|
2965
|
+
/**
|
|
2966
|
+
* Replaces the whole list.
|
|
2967
|
+
*/
|
|
2968
|
+
useCases?: Array<string>;
|
|
2969
|
+
accounts?: {
|
|
2970
|
+
x?: string | null;
|
|
2971
|
+
linkedin?: string | null;
|
|
2972
|
+
};
|
|
2973
|
+
/**
|
|
2974
|
+
* Overrides the composed context until the next profile edit.
|
|
2975
|
+
*/
|
|
2976
|
+
context?: string;
|
|
2977
|
+
};
|
|
2978
|
+
path?: never;
|
|
2979
|
+
query?: never;
|
|
2980
|
+
url: '/v1/company';
|
|
2981
|
+
};
|
|
2982
|
+
type UpdateCompanyErrors = {
|
|
2983
|
+
/**
|
|
2984
|
+
* Missing or invalid API key
|
|
2985
|
+
*/
|
|
2986
|
+
401: ErrorResponse;
|
|
2987
|
+
/**
|
|
2988
|
+
* Workspace not found
|
|
2989
|
+
*/
|
|
2990
|
+
404: ErrorResponse;
|
|
2991
|
+
};
|
|
2992
|
+
type UpdateCompanyError = UpdateCompanyErrors[keyof UpdateCompanyErrors];
|
|
2993
|
+
type UpdateCompanyResponses = {
|
|
2994
|
+
/**
|
|
2995
|
+
* The updated profile
|
|
2996
|
+
*/
|
|
2997
|
+
200: Company;
|
|
2998
|
+
};
|
|
2999
|
+
type UpdateCompanyResponse = UpdateCompanyResponses[keyof UpdateCompanyResponses];
|
|
3000
|
+
type ListApiKeysData = {
|
|
3001
|
+
body?: never;
|
|
3002
|
+
path?: never;
|
|
3003
|
+
query?: never;
|
|
3004
|
+
url: '/v1/api-keys';
|
|
3005
|
+
};
|
|
3006
|
+
type ListApiKeysErrors = {
|
|
3007
|
+
/**
|
|
3008
|
+
* Missing or invalid API key
|
|
3009
|
+
*/
|
|
3010
|
+
401: ErrorResponse;
|
|
3011
|
+
};
|
|
3012
|
+
type ListApiKeysError = ListApiKeysErrors[keyof ListApiKeysErrors];
|
|
3013
|
+
type ListApiKeysResponses = {
|
|
3014
|
+
/**
|
|
3015
|
+
* Every key, newest first, without the secret part
|
|
3016
|
+
*/
|
|
3017
|
+
200: {
|
|
3018
|
+
data: Array<{
|
|
3019
|
+
/**
|
|
3020
|
+
* Key id (key_...).
|
|
3021
|
+
*/
|
|
3022
|
+
id: string;
|
|
3023
|
+
name: string;
|
|
3024
|
+
/**
|
|
3025
|
+
* The first characters of the key, to tell keys apart.
|
|
3026
|
+
*/
|
|
3027
|
+
prefix: string;
|
|
3028
|
+
/**
|
|
3029
|
+
* read: GET only. write: everything.
|
|
3030
|
+
*/
|
|
3031
|
+
scope: 'read' | 'write';
|
|
3032
|
+
/**
|
|
3033
|
+
* ISO 8601 timestamp, UTC.
|
|
3034
|
+
*/
|
|
3035
|
+
createdAt: string;
|
|
3036
|
+
/**
|
|
3037
|
+
* ISO 8601 timestamp, UTC.
|
|
3038
|
+
*/
|
|
3039
|
+
lastUsedAt: string | null;
|
|
3040
|
+
}>;
|
|
3041
|
+
};
|
|
3042
|
+
};
|
|
3043
|
+
type ListApiKeysResponse = ListApiKeysResponses[keyof ListApiKeysResponses];
|
|
3044
|
+
type CreateApiKeyData = {
|
|
3045
|
+
body: {
|
|
3046
|
+
/**
|
|
3047
|
+
* A label for the key; "default" when omitted.
|
|
3048
|
+
*/
|
|
3049
|
+
name?: string;
|
|
3050
|
+
/**
|
|
3051
|
+
* read: GET only. write: everything.
|
|
3052
|
+
*/
|
|
3053
|
+
scope?: 'read' | 'write';
|
|
3054
|
+
};
|
|
3055
|
+
path?: never;
|
|
3056
|
+
query?: never;
|
|
3057
|
+
url: '/v1/api-keys';
|
|
3058
|
+
};
|
|
3059
|
+
type CreateApiKeyErrors = {
|
|
3060
|
+
/**
|
|
3061
|
+
* Missing or invalid API key
|
|
3062
|
+
*/
|
|
3063
|
+
401: ErrorResponse;
|
|
3064
|
+
};
|
|
3065
|
+
type CreateApiKeyError = CreateApiKeyErrors[keyof CreateApiKeyErrors];
|
|
3066
|
+
type CreateApiKeyResponses = {
|
|
3067
|
+
/**
|
|
3068
|
+
* The new key, shown once
|
|
3069
|
+
*/
|
|
3070
|
+
201: {
|
|
3071
|
+
/**
|
|
3072
|
+
* Key id (key_...).
|
|
3073
|
+
*/
|
|
3074
|
+
id: string;
|
|
3075
|
+
name: string;
|
|
3076
|
+
/**
|
|
3077
|
+
* The first characters of the key, to tell keys apart.
|
|
3078
|
+
*/
|
|
3079
|
+
prefix: string;
|
|
3080
|
+
/**
|
|
3081
|
+
* read: GET only. write: everything.
|
|
3082
|
+
*/
|
|
3083
|
+
scope: 'read' | 'write';
|
|
3084
|
+
/**
|
|
3085
|
+
* ISO 8601 timestamp, UTC.
|
|
3086
|
+
*/
|
|
3087
|
+
createdAt: string;
|
|
3088
|
+
/**
|
|
3089
|
+
* ISO 8601 timestamp, UTC.
|
|
3090
|
+
*/
|
|
3091
|
+
lastUsedAt: string | null;
|
|
3092
|
+
/**
|
|
3093
|
+
* The full key. Shown once; store it now.
|
|
3094
|
+
*/
|
|
3095
|
+
key: string;
|
|
3096
|
+
};
|
|
3097
|
+
};
|
|
3098
|
+
type CreateApiKeyResponse = CreateApiKeyResponses[keyof CreateApiKeyResponses];
|
|
3099
|
+
type RevokeApiKeyData = {
|
|
3100
|
+
body?: never;
|
|
3101
|
+
path: {
|
|
3102
|
+
/**
|
|
3103
|
+
* API key id (key_...).
|
|
3104
|
+
*/
|
|
3105
|
+
id: string;
|
|
3106
|
+
};
|
|
3107
|
+
query?: never;
|
|
3108
|
+
url: '/v1/api-keys/{id}';
|
|
3109
|
+
};
|
|
3110
|
+
type RevokeApiKeyErrors = {
|
|
3111
|
+
/**
|
|
3112
|
+
* Missing or invalid API key
|
|
3113
|
+
*/
|
|
3114
|
+
401: ErrorResponse;
|
|
3115
|
+
/**
|
|
3116
|
+
* API key not found
|
|
3117
|
+
*/
|
|
3118
|
+
404: ErrorResponse;
|
|
3119
|
+
};
|
|
3120
|
+
type RevokeApiKeyError = RevokeApiKeyErrors[keyof RevokeApiKeyErrors];
|
|
3121
|
+
type RevokeApiKeyResponses = {
|
|
3122
|
+
/**
|
|
3123
|
+
* Revoked
|
|
3124
|
+
*/
|
|
3125
|
+
204: void;
|
|
3126
|
+
};
|
|
3127
|
+
type RevokeApiKeyResponse = RevokeApiKeyResponses[keyof RevokeApiKeyResponses];
|
|
3128
|
+
type DeleteAlertData = {
|
|
3129
|
+
body?: never;
|
|
3130
|
+
path: {
|
|
3131
|
+
/**
|
|
3132
|
+
* Alert id (feed_...).
|
|
3133
|
+
*/
|
|
3134
|
+
id: string;
|
|
3135
|
+
};
|
|
3136
|
+
query?: never;
|
|
3137
|
+
url: '/v1/alerts/{id}';
|
|
3138
|
+
};
|
|
3139
|
+
type DeleteAlertErrors = {
|
|
3140
|
+
/**
|
|
3141
|
+
* Missing or invalid API key
|
|
3142
|
+
*/
|
|
3143
|
+
401: ErrorResponse;
|
|
3144
|
+
/**
|
|
3145
|
+
* Rule not found
|
|
3146
|
+
*/
|
|
3147
|
+
404: ErrorResponse;
|
|
3148
|
+
};
|
|
3149
|
+
type DeleteAlertError = DeleteAlertErrors[keyof DeleteAlertErrors];
|
|
3150
|
+
type DeleteAlertResponses = {
|
|
3151
|
+
/**
|
|
3152
|
+
* Deleted
|
|
3153
|
+
*/
|
|
3154
|
+
204: void;
|
|
3155
|
+
};
|
|
3156
|
+
type DeleteAlertResponse = DeleteAlertResponses[keyof DeleteAlertResponses];
|
|
3157
|
+
type GetAlertData = {
|
|
3158
|
+
body?: never;
|
|
3159
|
+
path: {
|
|
3160
|
+
/**
|
|
3161
|
+
* Alert id (feed_...).
|
|
3162
|
+
*/
|
|
3163
|
+
id: string;
|
|
3164
|
+
};
|
|
3165
|
+
query?: never;
|
|
3166
|
+
url: '/v1/alerts/{id}';
|
|
3167
|
+
};
|
|
3168
|
+
type GetAlertErrors = {
|
|
3169
|
+
/**
|
|
3170
|
+
* Missing or invalid API key
|
|
3171
|
+
*/
|
|
3172
|
+
401: ErrorResponse;
|
|
3173
|
+
/**
|
|
3174
|
+
* Alert not found
|
|
3175
|
+
*/
|
|
3176
|
+
404: ErrorResponse;
|
|
3177
|
+
};
|
|
3178
|
+
type GetAlertError = GetAlertErrors[keyof GetAlertErrors];
|
|
3179
|
+
type GetAlertResponses = {
|
|
3180
|
+
/**
|
|
3181
|
+
* The alert
|
|
3182
|
+
*/
|
|
3183
|
+
200: Alert;
|
|
3184
|
+
};
|
|
3185
|
+
type GetAlertResponse = GetAlertResponses[keyof GetAlertResponses];
|
|
3186
|
+
type UpdateAlertData = {
|
|
3187
|
+
/**
|
|
3188
|
+
* Omitted fields are untouched.
|
|
3189
|
+
*/
|
|
3190
|
+
body: {
|
|
3191
|
+
name?: string;
|
|
3192
|
+
enabled?: boolean;
|
|
3193
|
+
mode?: 'instant' | 'daily';
|
|
3194
|
+
/**
|
|
3195
|
+
* Replaces the whole filter.
|
|
3196
|
+
*/
|
|
3197
|
+
filter?: {
|
|
3198
|
+
/**
|
|
3199
|
+
* Only these keywords.
|
|
3200
|
+
*/
|
|
3201
|
+
keywordIds?: Array<string>;
|
|
3202
|
+
/**
|
|
3203
|
+
* Only posts from these platforms.
|
|
3204
|
+
*/
|
|
3205
|
+
platforms?: Array<'bluesky' | 'hackernews' | 'github' | 'stackoverflow' | 'devto' | 'reddit' | 'x' | 'youtube' | 'news' | 'linkedin'>;
|
|
3206
|
+
/**
|
|
3207
|
+
* Only mentions scored at least this; unclassified ones never pass.
|
|
3208
|
+
*/
|
|
3209
|
+
minRelevance?: number;
|
|
3210
|
+
/**
|
|
3211
|
+
* Only these sentiments.
|
|
3212
|
+
*/
|
|
3213
|
+
sentiments?: Array<'positive' | 'neutral' | 'negative'>;
|
|
3214
|
+
/**
|
|
3215
|
+
* At least one of these intents.
|
|
3216
|
+
*/
|
|
3217
|
+
intents?: Array<string>;
|
|
3218
|
+
/**
|
|
3219
|
+
* Never these authors: display names, handles or profile URLs.
|
|
3220
|
+
*/
|
|
3221
|
+
excludeAuthors?: Array<string>;
|
|
3222
|
+
/**
|
|
3223
|
+
* Only authors with at least this many followers. Unknown reach never passes.
|
|
3224
|
+
*/
|
|
3225
|
+
minFollowers?: number;
|
|
3226
|
+
/**
|
|
3227
|
+
* Only authors your workspace tagged with any of these.
|
|
3228
|
+
*/
|
|
3229
|
+
tags?: Array<string>;
|
|
3230
|
+
};
|
|
3231
|
+
schedule?: {
|
|
3232
|
+
hour: number;
|
|
3233
|
+
minute?: number;
|
|
3234
|
+
timezone: string;
|
|
3235
|
+
skipEmpty?: boolean;
|
|
3236
|
+
} | null;
|
|
3237
|
+
event?: string | null;
|
|
3238
|
+
/**
|
|
3239
|
+
* Replaces the whole list.
|
|
3240
|
+
*/
|
|
3241
|
+
channelIds?: Array<string>;
|
|
3242
|
+
};
|
|
3243
|
+
path: {
|
|
3244
|
+
/**
|
|
3245
|
+
* Alert id (feed_...).
|
|
3246
|
+
*/
|
|
3247
|
+
id: string;
|
|
3248
|
+
};
|
|
3249
|
+
query?: never;
|
|
3250
|
+
url: '/v1/alerts/{id}';
|
|
3251
|
+
};
|
|
3252
|
+
type UpdateAlertErrors = {
|
|
3253
|
+
/**
|
|
3254
|
+
* A daily rule without a schedule, or an unknown channel
|
|
3255
|
+
*/
|
|
3256
|
+
400: ErrorResponse;
|
|
3257
|
+
/**
|
|
3258
|
+
* Missing or invalid API key
|
|
3259
|
+
*/
|
|
3260
|
+
401: ErrorResponse;
|
|
3261
|
+
/**
|
|
3262
|
+
* Rule not found
|
|
3263
|
+
*/
|
|
3264
|
+
404: ErrorResponse;
|
|
3265
|
+
};
|
|
3266
|
+
type UpdateAlertError = UpdateAlertErrors[keyof UpdateAlertErrors];
|
|
3267
|
+
type UpdateAlertResponses = {
|
|
3268
|
+
/**
|
|
3269
|
+
* The updated rule
|
|
3270
|
+
*/
|
|
3271
|
+
200: Alert;
|
|
3272
|
+
};
|
|
3273
|
+
type UpdateAlertResponse = UpdateAlertResponses[keyof UpdateAlertResponses];
|
|
3274
|
+
type ListAlertsData = {
|
|
3275
|
+
body?: never;
|
|
3276
|
+
path?: never;
|
|
3277
|
+
query?: never;
|
|
3278
|
+
url: '/v1/alerts';
|
|
3279
|
+
};
|
|
3280
|
+
type ListAlertsErrors = {
|
|
3281
|
+
/**
|
|
3282
|
+
* Missing or invalid API key
|
|
3283
|
+
*/
|
|
3284
|
+
401: ErrorResponse;
|
|
3285
|
+
};
|
|
3286
|
+
type ListAlertsError = ListAlertsErrors[keyof ListAlertsErrors];
|
|
3287
|
+
type ListAlertsResponses = {
|
|
3288
|
+
/**
|
|
3289
|
+
* Every alert rule of the org, newest first
|
|
3290
|
+
*/
|
|
3291
|
+
200: {
|
|
3292
|
+
data: Array<{
|
|
3293
|
+
/**
|
|
3294
|
+
* Alert id (feed_...).
|
|
3295
|
+
*/
|
|
3296
|
+
id: string;
|
|
3297
|
+
name: string;
|
|
3298
|
+
enabled: boolean;
|
|
3299
|
+
/**
|
|
3300
|
+
* instant: each matching mention as it happens. daily: one digest at the scheduled local time.
|
|
3301
|
+
*/
|
|
3302
|
+
mode: 'instant' | 'daily';
|
|
3303
|
+
filter: {
|
|
3304
|
+
/**
|
|
3305
|
+
* Only these keywords.
|
|
3306
|
+
*/
|
|
3307
|
+
keywordIds?: Array<string>;
|
|
3308
|
+
/**
|
|
3309
|
+
* Only posts from these platforms.
|
|
3310
|
+
*/
|
|
3311
|
+
platforms?: Array<'bluesky' | 'hackernews' | 'github' | 'stackoverflow' | 'devto' | 'reddit' | 'x' | 'youtube' | 'news' | 'linkedin'>;
|
|
3312
|
+
/**
|
|
3313
|
+
* Only mentions scored at least this; unclassified ones never pass.
|
|
3314
|
+
*/
|
|
3315
|
+
minRelevance?: number;
|
|
3316
|
+
/**
|
|
3317
|
+
* Only these sentiments.
|
|
3318
|
+
*/
|
|
3319
|
+
sentiments?: Array<'positive' | 'neutral' | 'negative'>;
|
|
3320
|
+
/**
|
|
3321
|
+
* At least one of these intents.
|
|
3322
|
+
*/
|
|
3323
|
+
intents?: Array<string>;
|
|
3324
|
+
/**
|
|
3325
|
+
* Never these authors: display names, handles or profile URLs.
|
|
3326
|
+
*/
|
|
3327
|
+
excludeAuthors?: Array<string>;
|
|
3328
|
+
/**
|
|
3329
|
+
* Only authors with at least this many followers. Unknown reach never passes.
|
|
3330
|
+
*/
|
|
3331
|
+
minFollowers?: number;
|
|
3332
|
+
/**
|
|
3333
|
+
* Only authors your workspace tagged with any of these.
|
|
3334
|
+
*/
|
|
3335
|
+
tags?: Array<string>;
|
|
3336
|
+
};
|
|
3337
|
+
/**
|
|
3338
|
+
* Daily alerts only.
|
|
3339
|
+
*/
|
|
3340
|
+
schedule: {
|
|
3341
|
+
hour: number;
|
|
3342
|
+
minute?: number;
|
|
3343
|
+
timezone: string;
|
|
3344
|
+
skipEmpty?: boolean;
|
|
3345
|
+
} | null;
|
|
3346
|
+
/**
|
|
3347
|
+
* Event name carried in webhook payloads; the mode default unless you set one.
|
|
3348
|
+
*/
|
|
3349
|
+
event: string;
|
|
3350
|
+
/**
|
|
3351
|
+
* Where it sends.
|
|
3352
|
+
*/
|
|
3353
|
+
channels: Array<{
|
|
3354
|
+
id: string;
|
|
3355
|
+
kind: 'slack' | 'email' | 'webhook' | 'telegram';
|
|
3356
|
+
label: string;
|
|
3357
|
+
}>;
|
|
3358
|
+
/**
|
|
3359
|
+
* Computed over this workspace's deliveries.
|
|
3360
|
+
*/
|
|
3361
|
+
stats: {
|
|
3362
|
+
/**
|
|
3363
|
+
* Deliveries in the last 7 days, across channels.
|
|
3364
|
+
*/
|
|
3365
|
+
sentLast7d: number;
|
|
3366
|
+
/**
|
|
3367
|
+
* ISO 8601 timestamp, UTC.
|
|
3368
|
+
*/
|
|
3369
|
+
lastSentAt: string | null;
|
|
3370
|
+
/**
|
|
3371
|
+
* Daily alerts: the next digest; null when disabled or instant.
|
|
3372
|
+
*/
|
|
3373
|
+
nextRunAt: string | null;
|
|
3374
|
+
};
|
|
3375
|
+
/**
|
|
3376
|
+
* ISO 8601 timestamp, UTC.
|
|
3377
|
+
*/
|
|
3378
|
+
createdAt: string;
|
|
3379
|
+
}>;
|
|
3380
|
+
};
|
|
3381
|
+
};
|
|
3382
|
+
type ListAlertsResponse = ListAlertsResponses[keyof ListAlertsResponses];
|
|
3383
|
+
type CreateAlertData = {
|
|
3384
|
+
body: {
|
|
3385
|
+
name: string;
|
|
3386
|
+
enabled?: boolean;
|
|
3387
|
+
mode?: 'instant' | 'daily';
|
|
3388
|
+
filter?: {
|
|
3389
|
+
/**
|
|
3390
|
+
* Only these keywords.
|
|
3391
|
+
*/
|
|
3392
|
+
keywordIds?: Array<string>;
|
|
3393
|
+
/**
|
|
3394
|
+
* Only posts from these platforms.
|
|
3395
|
+
*/
|
|
3396
|
+
platforms?: Array<'bluesky' | 'hackernews' | 'github' | 'stackoverflow' | 'devto' | 'reddit' | 'x' | 'youtube' | 'news' | 'linkedin'>;
|
|
3397
|
+
/**
|
|
3398
|
+
* Only mentions scored at least this; unclassified ones never pass.
|
|
3399
|
+
*/
|
|
3400
|
+
minRelevance?: number;
|
|
3401
|
+
/**
|
|
3402
|
+
* Only these sentiments.
|
|
3403
|
+
*/
|
|
3404
|
+
sentiments?: Array<'positive' | 'neutral' | 'negative'>;
|
|
3405
|
+
/**
|
|
3406
|
+
* At least one of these intents.
|
|
3407
|
+
*/
|
|
3408
|
+
intents?: Array<string>;
|
|
3409
|
+
/**
|
|
3410
|
+
* Never these authors: display names, handles or profile URLs.
|
|
3411
|
+
*/
|
|
3412
|
+
excludeAuthors?: Array<string>;
|
|
3413
|
+
/**
|
|
3414
|
+
* Only authors with at least this many followers. Unknown reach never passes.
|
|
3415
|
+
*/
|
|
3416
|
+
minFollowers?: number;
|
|
3417
|
+
/**
|
|
3418
|
+
* Only authors your workspace tagged with any of these.
|
|
3419
|
+
*/
|
|
3420
|
+
tags?: Array<string>;
|
|
3421
|
+
};
|
|
3422
|
+
/**
|
|
3423
|
+
* Required for daily alerts.
|
|
3424
|
+
*/
|
|
3425
|
+
schedule?: {
|
|
3426
|
+
hour: number;
|
|
3427
|
+
minute?: number;
|
|
3428
|
+
timezone: string;
|
|
3429
|
+
skipEmpty?: boolean;
|
|
3430
|
+
};
|
|
3431
|
+
/**
|
|
3432
|
+
* Custom event name for webhook payloads; null for the mode default.
|
|
3433
|
+
*/
|
|
3434
|
+
event?: string | null;
|
|
3435
|
+
/**
|
|
3436
|
+
* Channel ids from GET /v1/channels.
|
|
3437
|
+
*/
|
|
3438
|
+
channelIds?: Array<string>;
|
|
3439
|
+
};
|
|
3440
|
+
path?: never;
|
|
3441
|
+
query?: never;
|
|
3442
|
+
url: '/v1/alerts';
|
|
3443
|
+
};
|
|
3444
|
+
type CreateAlertErrors = {
|
|
3445
|
+
/**
|
|
3446
|
+
* A daily rule without a schedule, or an unknown channel
|
|
3447
|
+
*/
|
|
3448
|
+
400: ErrorResponse;
|
|
3449
|
+
/**
|
|
3450
|
+
* Missing or invalid API key
|
|
3451
|
+
*/
|
|
3452
|
+
401: ErrorResponse;
|
|
3453
|
+
};
|
|
3454
|
+
type CreateAlertError = CreateAlertErrors[keyof CreateAlertErrors];
|
|
3455
|
+
type CreateAlertResponses = {
|
|
3456
|
+
/**
|
|
3457
|
+
* The created rule
|
|
3458
|
+
*/
|
|
3459
|
+
201: Alert;
|
|
3460
|
+
};
|
|
3461
|
+
type CreateAlertResponse = CreateAlertResponses[keyof CreateAlertResponses];
|
|
3462
|
+
type TestAlertData = {
|
|
3463
|
+
body?: never;
|
|
3464
|
+
path: {
|
|
3465
|
+
/**
|
|
3466
|
+
* Alert id (feed_...).
|
|
3467
|
+
*/
|
|
3468
|
+
id: string;
|
|
3469
|
+
};
|
|
3470
|
+
query?: never;
|
|
3471
|
+
url: '/v1/alerts/{id}/test';
|
|
3472
|
+
};
|
|
3473
|
+
type TestAlertErrors = {
|
|
3474
|
+
/**
|
|
3475
|
+
* Missing or invalid API key
|
|
3476
|
+
*/
|
|
3477
|
+
401: ErrorResponse;
|
|
3478
|
+
/**
|
|
3479
|
+
* Rule not found
|
|
3480
|
+
*/
|
|
3481
|
+
404: ErrorResponse;
|
|
3482
|
+
};
|
|
3483
|
+
type TestAlertError = TestAlertErrors[keyof TestAlertErrors];
|
|
3484
|
+
type TestAlertResponses = {
|
|
3485
|
+
/**
|
|
3486
|
+
* A test message was attempted on every channel of the rule
|
|
3487
|
+
*/
|
|
3488
|
+
200: {
|
|
3489
|
+
outcomes: Array<{
|
|
3490
|
+
channelId: string;
|
|
3491
|
+
ok: boolean;
|
|
3492
|
+
error: string | null;
|
|
3493
|
+
}>;
|
|
3494
|
+
};
|
|
3495
|
+
};
|
|
3496
|
+
type TestAlertResponse = TestAlertResponses[keyof TestAlertResponses];
|
|
3497
|
+
type RunAlertDigestData = {
|
|
3498
|
+
body?: never;
|
|
3499
|
+
path: {
|
|
3500
|
+
/**
|
|
3501
|
+
* Alert id (feed_...).
|
|
3502
|
+
*/
|
|
3503
|
+
id: string;
|
|
3504
|
+
};
|
|
3505
|
+
query?: never;
|
|
3506
|
+
url: '/v1/alerts/{id}/run';
|
|
3507
|
+
};
|
|
3508
|
+
type RunAlertDigestErrors = {
|
|
3509
|
+
/**
|
|
3510
|
+
* Only daily rules have a digest
|
|
3511
|
+
*/
|
|
3512
|
+
400: ErrorResponse;
|
|
3513
|
+
/**
|
|
3514
|
+
* Missing or invalid API key
|
|
3515
|
+
*/
|
|
3516
|
+
401: ErrorResponse;
|
|
3517
|
+
/**
|
|
3518
|
+
* Rule not found
|
|
3519
|
+
*/
|
|
3520
|
+
404: ErrorResponse;
|
|
3521
|
+
};
|
|
3522
|
+
type RunAlertDigestError = RunAlertDigestErrors[keyof RunAlertDigestErrors];
|
|
3523
|
+
type RunAlertDigestResponses = {
|
|
3524
|
+
/**
|
|
3525
|
+
* The digest for the last 24 hours was sent now (the scheduled one still runs)
|
|
3526
|
+
*/
|
|
3527
|
+
200: {
|
|
3528
|
+
/**
|
|
3529
|
+
* Why nothing was sent, if nothing was.
|
|
3530
|
+
*/
|
|
3531
|
+
skipped: 'already_sent' | 'empty';
|
|
3532
|
+
matched: number;
|
|
3533
|
+
relevant: number;
|
|
3534
|
+
outcomes: Array<{
|
|
3535
|
+
channelId: string;
|
|
3536
|
+
ok: boolean;
|
|
3537
|
+
error: string | null;
|
|
3538
|
+
}>;
|
|
3539
|
+
};
|
|
3540
|
+
};
|
|
3541
|
+
type RunAlertDigestResponse = RunAlertDigestResponses[keyof RunAlertDigestResponses];
|
|
3542
|
+
type GetAnalyticsSummaryData = {
|
|
3543
|
+
body?: never;
|
|
3544
|
+
path?: never;
|
|
3545
|
+
query?: {
|
|
3546
|
+
/**
|
|
3547
|
+
* Preset window ending today. Ignored when from or to is given. Default 30d.
|
|
3548
|
+
*/
|
|
3549
|
+
range?: '7d' | '30d' | '90d' | '365d';
|
|
3550
|
+
/**
|
|
3551
|
+
* First day, YYYY-MM-DD, inclusive, in `timezone`.
|
|
3552
|
+
*/
|
|
3553
|
+
from?: string;
|
|
3554
|
+
/**
|
|
3555
|
+
* Last day, YYYY-MM-DD, inclusive, in `timezone`. Default today.
|
|
3556
|
+
*/
|
|
3557
|
+
to?: string;
|
|
3558
|
+
/**
|
|
3559
|
+
* Comma-separated keyword ids; omit for every keyword.
|
|
3560
|
+
*/
|
|
3561
|
+
keywordIds?: string;
|
|
3562
|
+
/**
|
|
3563
|
+
* Comma-separated platforms (bluesky, hackernews, github, ...); omit for every platform.
|
|
3564
|
+
*/
|
|
3565
|
+
platforms?: string;
|
|
3566
|
+
/**
|
|
3567
|
+
* true adds the period of the same length right before the window as `previous`.
|
|
3568
|
+
*/
|
|
3569
|
+
compare?: 'true' | 'false';
|
|
3570
|
+
/**
|
|
3571
|
+
* IANA zone the days are cut in (Europe/Madrid). Default UTC. One offset, the zone's at the end of the window, applies to the whole window.
|
|
3572
|
+
*/
|
|
3573
|
+
timezone?: string;
|
|
3574
|
+
};
|
|
3575
|
+
url: '/v1/analytics/summary';
|
|
3576
|
+
};
|
|
3577
|
+
type GetAnalyticsSummaryErrors = {
|
|
3578
|
+
/**
|
|
3579
|
+
* Invalid query
|
|
3580
|
+
*/
|
|
3581
|
+
400: ErrorResponse;
|
|
3582
|
+
/**
|
|
3583
|
+
* Missing or invalid API key
|
|
3584
|
+
*/
|
|
3585
|
+
401: ErrorResponse;
|
|
3586
|
+
};
|
|
3587
|
+
type GetAnalyticsSummaryError = GetAnalyticsSummaryErrors[keyof GetAnalyticsSummaryErrors];
|
|
3588
|
+
type GetAnalyticsSummaryResponses = {
|
|
3589
|
+
/**
|
|
3590
|
+
* The counts, with `previous` when comparing
|
|
3591
|
+
*/
|
|
3592
|
+
200: AnalyticsSummary;
|
|
3593
|
+
};
|
|
3594
|
+
type GetAnalyticsSummaryResponse = GetAnalyticsSummaryResponses[keyof GetAnalyticsSummaryResponses];
|
|
3595
|
+
type GetAnalyticsSeriesData = {
|
|
3596
|
+
body?: never;
|
|
3597
|
+
path?: never;
|
|
3598
|
+
query?: {
|
|
3599
|
+
/**
|
|
3600
|
+
* Preset window ending today. Ignored when from or to is given. Default 30d.
|
|
3601
|
+
*/
|
|
3602
|
+
range?: '7d' | '30d' | '90d' | '365d';
|
|
3603
|
+
/**
|
|
3604
|
+
* First day, YYYY-MM-DD, inclusive, in `timezone`.
|
|
3605
|
+
*/
|
|
3606
|
+
from?: string;
|
|
3607
|
+
/**
|
|
3608
|
+
* Last day, YYYY-MM-DD, inclusive, in `timezone`. Default today.
|
|
3609
|
+
*/
|
|
3610
|
+
to?: string;
|
|
3611
|
+
/**
|
|
3612
|
+
* Comma-separated keyword ids; omit for every keyword.
|
|
3613
|
+
*/
|
|
3614
|
+
keywordIds?: string;
|
|
3615
|
+
/**
|
|
3616
|
+
* Comma-separated platforms (bluesky, hackernews, github, ...); omit for every platform.
|
|
3617
|
+
*/
|
|
3618
|
+
platforms?: string;
|
|
3619
|
+
/**
|
|
3620
|
+
* true adds the period of the same length right before the window as `previous`.
|
|
3621
|
+
*/
|
|
3622
|
+
compare?: 'true' | 'false';
|
|
3623
|
+
/**
|
|
3624
|
+
* IANA zone the days are cut in (Europe/Madrid). Default UTC. One offset, the zone's at the end of the window, applies to the whole window.
|
|
3625
|
+
*/
|
|
3626
|
+
timezone?: string;
|
|
3627
|
+
/**
|
|
3628
|
+
* Point granularity. Default: day up to 90 days, week beyond. Weeks start on Monday.
|
|
3629
|
+
*/
|
|
3630
|
+
bucket?: 'day' | 'week';
|
|
3631
|
+
/**
|
|
3632
|
+
* Split into one series per platform or per keyword (the top 20 by matched, the rest folded into "other"). Omit for one total series.
|
|
3633
|
+
*/
|
|
3634
|
+
by?: 'platform' | 'keyword';
|
|
3635
|
+
};
|
|
3636
|
+
url: '/v1/analytics/series';
|
|
3637
|
+
};
|
|
3638
|
+
type GetAnalyticsSeriesErrors = {
|
|
3639
|
+
/**
|
|
3640
|
+
* Invalid query
|
|
3641
|
+
*/
|
|
3642
|
+
400: ErrorResponse;
|
|
3643
|
+
/**
|
|
3644
|
+
* Missing or invalid API key
|
|
3645
|
+
*/
|
|
3646
|
+
401: ErrorResponse;
|
|
3647
|
+
};
|
|
3648
|
+
type GetAnalyticsSeriesError = GetAnalyticsSeriesErrors[keyof GetAnalyticsSeriesErrors];
|
|
3649
|
+
type GetAnalyticsSeriesResponses = {
|
|
3650
|
+
/**
|
|
3651
|
+
* Zero-filled series, oldest point first
|
|
3652
|
+
*/
|
|
3653
|
+
200: AnalyticsSeries;
|
|
3654
|
+
};
|
|
3655
|
+
type GetAnalyticsSeriesResponse = GetAnalyticsSeriesResponses[keyof GetAnalyticsSeriesResponses];
|
|
3656
|
+
type GetAnalyticsBreakdownData = {
|
|
3657
|
+
body?: never;
|
|
3658
|
+
path?: never;
|
|
3659
|
+
query: {
|
|
3660
|
+
/**
|
|
3661
|
+
* Preset window ending today. Ignored when from or to is given. Default 30d.
|
|
3662
|
+
*/
|
|
3663
|
+
range?: '7d' | '30d' | '90d' | '365d';
|
|
3664
|
+
/**
|
|
3665
|
+
* First day, YYYY-MM-DD, inclusive, in `timezone`.
|
|
3666
|
+
*/
|
|
3667
|
+
from?: string;
|
|
3668
|
+
/**
|
|
3669
|
+
* Last day, YYYY-MM-DD, inclusive, in `timezone`. Default today.
|
|
3670
|
+
*/
|
|
3671
|
+
to?: string;
|
|
3672
|
+
/**
|
|
3673
|
+
* Comma-separated keyword ids; omit for every keyword.
|
|
3674
|
+
*/
|
|
3675
|
+
keywordIds?: string;
|
|
3676
|
+
/**
|
|
3677
|
+
* Comma-separated platforms (bluesky, hackernews, github, ...); omit for every platform.
|
|
3678
|
+
*/
|
|
3679
|
+
platforms?: string;
|
|
3680
|
+
/**
|
|
3681
|
+
* true adds the period of the same length right before the window as `previous`.
|
|
3682
|
+
*/
|
|
3683
|
+
compare?: 'true' | 'false';
|
|
3684
|
+
/**
|
|
3685
|
+
* IANA zone the days are cut in (Europe/Madrid). Default UTC. One offset, the zone's at the end of the window, applies to the whole window.
|
|
3686
|
+
*/
|
|
3687
|
+
timezone?: string;
|
|
3688
|
+
/**
|
|
3689
|
+
* The dimension to group by: platform, keyword, sentiment (unclassified included), intent (a mention can carry several), status (open, ignored, done), hour (weekday and hour of day in `timezone`), person (who posted; anonymous posts are left out).
|
|
3690
|
+
*/
|
|
3691
|
+
by: 'platform' | 'keyword' | 'sentiment' | 'intent' | 'status' | 'hour' | 'person';
|
|
3692
|
+
};
|
|
3693
|
+
url: '/v1/analytics/breakdown';
|
|
3694
|
+
};
|
|
3695
|
+
type GetAnalyticsBreakdownErrors = {
|
|
3696
|
+
/**
|
|
3697
|
+
* Invalid query
|
|
3698
|
+
*/
|
|
3699
|
+
400: ErrorResponse;
|
|
3700
|
+
/**
|
|
3701
|
+
* Missing or invalid API key
|
|
3702
|
+
*/
|
|
3703
|
+
401: ErrorResponse;
|
|
3704
|
+
};
|
|
3705
|
+
type GetAnalyticsBreakdownError = GetAnalyticsBreakdownErrors[keyof GetAnalyticsBreakdownErrors];
|
|
3706
|
+
type GetAnalyticsBreakdownResponses = {
|
|
3707
|
+
/**
|
|
3708
|
+
* Groups, most matched first
|
|
3709
|
+
*/
|
|
3710
|
+
200: AnalyticsBreakdown;
|
|
3711
|
+
};
|
|
3712
|
+
type GetAnalyticsBreakdownResponse = GetAnalyticsBreakdownResponses[keyof GetAnalyticsBreakdownResponses];
|
|
3713
|
+
type GetShareOfVoiceData = {
|
|
3714
|
+
body?: never;
|
|
3715
|
+
path?: never;
|
|
3716
|
+
query?: {
|
|
3717
|
+
/**
|
|
3718
|
+
* Preset window ending today. Ignored when from or to is given. Default 30d.
|
|
3719
|
+
*/
|
|
3720
|
+
range?: '7d' | '30d' | '90d' | '365d';
|
|
3721
|
+
/**
|
|
3722
|
+
* First day, YYYY-MM-DD, inclusive, in `timezone`.
|
|
3723
|
+
*/
|
|
3724
|
+
from?: string;
|
|
3725
|
+
/**
|
|
3726
|
+
* Last day, YYYY-MM-DD, inclusive, in `timezone`. Default today.
|
|
3727
|
+
*/
|
|
3728
|
+
to?: string;
|
|
3729
|
+
/**
|
|
3730
|
+
* Comma-separated keyword ids; omit for every keyword.
|
|
3731
|
+
*/
|
|
3732
|
+
keywordIds?: string;
|
|
3733
|
+
/**
|
|
3734
|
+
* Comma-separated platforms (bluesky, hackernews, github, ...); omit for every platform.
|
|
3735
|
+
*/
|
|
3736
|
+
platforms?: string;
|
|
3737
|
+
/**
|
|
3738
|
+
* true adds the period of the same length right before the window as `previous`.
|
|
3739
|
+
*/
|
|
3740
|
+
compare?: 'true' | 'false';
|
|
3741
|
+
/**
|
|
3742
|
+
* IANA zone the days are cut in (Europe/Madrid). Default UTC. One offset, the zone's at the end of the window, applies to the whole window.
|
|
3743
|
+
*/
|
|
3744
|
+
timezone?: string;
|
|
3745
|
+
};
|
|
3746
|
+
url: '/v1/analytics/share-of-voice';
|
|
3747
|
+
};
|
|
3748
|
+
type GetShareOfVoiceErrors = {
|
|
3749
|
+
/**
|
|
3750
|
+
* Invalid query
|
|
3751
|
+
*/
|
|
3752
|
+
400: ErrorResponse;
|
|
3753
|
+
/**
|
|
3754
|
+
* Missing or invalid API key
|
|
3755
|
+
*/
|
|
3756
|
+
401: ErrorResponse;
|
|
3757
|
+
};
|
|
3758
|
+
type GetShareOfVoiceError = GetShareOfVoiceErrors[keyof GetShareOfVoiceErrors];
|
|
3759
|
+
type GetShareOfVoiceResponses = {
|
|
3760
|
+
/**
|
|
3761
|
+
* Keywords, most matched first
|
|
3762
|
+
*/
|
|
3763
|
+
200: ShareOfVoice;
|
|
3764
|
+
};
|
|
3765
|
+
type GetShareOfVoiceResponse = GetShareOfVoiceResponses[keyof GetShareOfVoiceResponses];
|
|
3766
|
+
type DeleteChannelData = {
|
|
3767
|
+
body?: never;
|
|
3768
|
+
path: {
|
|
3769
|
+
/**
|
|
3770
|
+
* Channel id (dest_...).
|
|
3771
|
+
*/
|
|
3772
|
+
id: string;
|
|
3773
|
+
};
|
|
3774
|
+
query?: never;
|
|
3775
|
+
url: '/v1/channels/{id}';
|
|
3776
|
+
};
|
|
3777
|
+
type DeleteChannelErrors = {
|
|
3778
|
+
/**
|
|
3779
|
+
* Missing or invalid API key
|
|
3780
|
+
*/
|
|
3781
|
+
401: ErrorResponse;
|
|
3782
|
+
/**
|
|
3783
|
+
* Channel not found
|
|
3784
|
+
*/
|
|
3785
|
+
404: ErrorResponse;
|
|
3786
|
+
};
|
|
3787
|
+
type DeleteChannelError = DeleteChannelErrors[keyof DeleteChannelErrors];
|
|
3788
|
+
type DeleteChannelResponses = {
|
|
3789
|
+
/**
|
|
3790
|
+
* Deleted
|
|
3791
|
+
*/
|
|
3792
|
+
204: void;
|
|
3793
|
+
};
|
|
3794
|
+
type DeleteChannelResponse = DeleteChannelResponses[keyof DeleteChannelResponses];
|
|
3795
|
+
type GetChannelData = {
|
|
3796
|
+
body?: never;
|
|
3797
|
+
path: {
|
|
3798
|
+
/**
|
|
3799
|
+
* Channel id (dest_...).
|
|
3800
|
+
*/
|
|
3801
|
+
id: string;
|
|
3802
|
+
};
|
|
3803
|
+
query?: never;
|
|
3804
|
+
url: '/v1/channels/{id}';
|
|
3805
|
+
};
|
|
3806
|
+
type GetChannelErrors = {
|
|
3807
|
+
/**
|
|
3808
|
+
* Missing or invalid API key
|
|
3809
|
+
*/
|
|
3810
|
+
401: ErrorResponse;
|
|
3811
|
+
/**
|
|
3812
|
+
* Channel not found
|
|
3813
|
+
*/
|
|
3814
|
+
404: ErrorResponse;
|
|
3815
|
+
};
|
|
3816
|
+
type GetChannelError = GetChannelErrors[keyof GetChannelErrors];
|
|
3817
|
+
type GetChannelResponses = {
|
|
3818
|
+
/**
|
|
3819
|
+
* The channel
|
|
3820
|
+
*/
|
|
3821
|
+
200: Channel;
|
|
3822
|
+
};
|
|
3823
|
+
type GetChannelResponse = GetChannelResponses[keyof GetChannelResponses];
|
|
3824
|
+
type UpdateChannelData = {
|
|
3825
|
+
/**
|
|
3826
|
+
* Omitted fields are untouched.
|
|
3827
|
+
*/
|
|
3828
|
+
body: {
|
|
3829
|
+
label?: string;
|
|
3830
|
+
/**
|
|
3831
|
+
* Webhooks only.
|
|
3832
|
+
*/
|
|
3833
|
+
url?: string;
|
|
3834
|
+
/**
|
|
3835
|
+
* Webhooks only; replaces the whole set.
|
|
3836
|
+
*/
|
|
3837
|
+
headers?: {
|
|
3838
|
+
[key: string]: string;
|
|
3839
|
+
};
|
|
3840
|
+
};
|
|
3841
|
+
path: {
|
|
3842
|
+
/**
|
|
3843
|
+
* Channel id (dest_...).
|
|
3844
|
+
*/
|
|
3845
|
+
id: string;
|
|
3846
|
+
};
|
|
3847
|
+
query?: never;
|
|
3848
|
+
url: '/v1/channels/{id}';
|
|
3849
|
+
};
|
|
3850
|
+
type UpdateChannelErrors = {
|
|
3851
|
+
/**
|
|
3852
|
+
* Missing or invalid API key
|
|
3853
|
+
*/
|
|
3854
|
+
401: ErrorResponse;
|
|
3855
|
+
/**
|
|
3856
|
+
* Channel not found
|
|
3857
|
+
*/
|
|
3858
|
+
404: ErrorResponse;
|
|
3859
|
+
};
|
|
3860
|
+
type UpdateChannelError = UpdateChannelErrors[keyof UpdateChannelErrors];
|
|
3861
|
+
type UpdateChannelResponses = {
|
|
3862
|
+
/**
|
|
3863
|
+
* The updated channel
|
|
3864
|
+
*/
|
|
3865
|
+
200: Channel;
|
|
3866
|
+
};
|
|
3867
|
+
type UpdateChannelResponse = UpdateChannelResponses[keyof UpdateChannelResponses];
|
|
3868
|
+
type TestChannelData = {
|
|
3869
|
+
body?: never;
|
|
3870
|
+
path: {
|
|
3871
|
+
/**
|
|
3872
|
+
* Channel id (dest_...).
|
|
3873
|
+
*/
|
|
3874
|
+
id: string;
|
|
3875
|
+
};
|
|
3876
|
+
query?: never;
|
|
3877
|
+
url: '/v1/channels/{id}/test';
|
|
3878
|
+
};
|
|
3879
|
+
type TestChannelErrors = {
|
|
3880
|
+
/**
|
|
3881
|
+
* Missing or invalid API key
|
|
3882
|
+
*/
|
|
3883
|
+
401: ErrorResponse;
|
|
3884
|
+
/**
|
|
3885
|
+
* Channel not found
|
|
3886
|
+
*/
|
|
3887
|
+
404: ErrorResponse;
|
|
3888
|
+
};
|
|
3889
|
+
type TestChannelError = TestChannelErrors[keyof TestChannelErrors];
|
|
3890
|
+
type TestChannelResponses = {
|
|
3891
|
+
/**
|
|
3892
|
+
* A test message was attempted on the channel (webhooks receive event "test")
|
|
3893
|
+
*/
|
|
3894
|
+
200: {
|
|
3895
|
+
outcomes: Array<{
|
|
3896
|
+
channelId: string;
|
|
3897
|
+
ok: boolean;
|
|
3898
|
+
error: string | null;
|
|
3899
|
+
}>;
|
|
3900
|
+
};
|
|
3901
|
+
};
|
|
3902
|
+
type TestChannelResponse = TestChannelResponses[keyof TestChannelResponses];
|
|
3903
|
+
type RotateWebhookSecretData = {
|
|
3904
|
+
body?: never;
|
|
3905
|
+
path: {
|
|
3906
|
+
/**
|
|
3907
|
+
* Channel id (dest_...).
|
|
3908
|
+
*/
|
|
3909
|
+
id: string;
|
|
3910
|
+
};
|
|
3911
|
+
query?: never;
|
|
3912
|
+
url: '/v1/channels/{id}/rotate-secret';
|
|
3913
|
+
};
|
|
3914
|
+
type RotateWebhookSecretErrors = {
|
|
3915
|
+
/**
|
|
3916
|
+
* Missing or invalid API key
|
|
3917
|
+
*/
|
|
3918
|
+
401: ErrorResponse;
|
|
3919
|
+
/**
|
|
3920
|
+
* Webhook channel not found
|
|
3921
|
+
*/
|
|
3922
|
+
404: ErrorResponse;
|
|
3923
|
+
};
|
|
3924
|
+
type RotateWebhookSecretError = RotateWebhookSecretErrors[keyof RotateWebhookSecretErrors];
|
|
3925
|
+
type RotateWebhookSecretResponses = {
|
|
3926
|
+
/**
|
|
3927
|
+
* A new signing secret, shown once. The previous one stops verifying immediately.
|
|
3928
|
+
*/
|
|
3929
|
+
200: Channel;
|
|
3930
|
+
};
|
|
3931
|
+
type RotateWebhookSecretResponse = RotateWebhookSecretResponses[keyof RotateWebhookSecretResponses];
|
|
3932
|
+
type ListChannelDeliveriesData = {
|
|
3933
|
+
body?: never;
|
|
3934
|
+
path: {
|
|
3935
|
+
/**
|
|
3936
|
+
* Channel id (dest_...).
|
|
3937
|
+
*/
|
|
3938
|
+
id: string;
|
|
3939
|
+
};
|
|
3940
|
+
query?: {
|
|
3941
|
+
limit?: number;
|
|
3942
|
+
};
|
|
3943
|
+
url: '/v1/channels/{id}/deliveries';
|
|
3944
|
+
};
|
|
3945
|
+
type ListChannelDeliveriesErrors = {
|
|
3946
|
+
/**
|
|
3947
|
+
* Missing or invalid API key
|
|
3948
|
+
*/
|
|
3949
|
+
401: ErrorResponse;
|
|
3950
|
+
/**
|
|
3951
|
+
* Channel not found
|
|
3952
|
+
*/
|
|
3953
|
+
404: ErrorResponse;
|
|
3954
|
+
};
|
|
3955
|
+
type ListChannelDeliveriesError = ListChannelDeliveriesErrors[keyof ListChannelDeliveriesErrors];
|
|
3956
|
+
type ListChannelDeliveriesResponses = {
|
|
3957
|
+
/**
|
|
3958
|
+
* What the channel received, newest first: instant mentions and digest runs, with status and last error
|
|
3959
|
+
*/
|
|
3960
|
+
200: {
|
|
3961
|
+
data: Array<{
|
|
3962
|
+
/**
|
|
3963
|
+
* Delivery id (dlv_...), also the webhook payload id.
|
|
3964
|
+
*/
|
|
3965
|
+
id: string;
|
|
3966
|
+
kind: 'mention' | 'digest';
|
|
3967
|
+
status: 'pending' | 'delivered' | 'failed';
|
|
3968
|
+
attempts: number;
|
|
3969
|
+
/**
|
|
3970
|
+
* The last failure, when there was one.
|
|
3971
|
+
*/
|
|
3972
|
+
error: string | null;
|
|
3973
|
+
/**
|
|
3974
|
+
* ISO 8601 timestamp, UTC.
|
|
3975
|
+
*/
|
|
3976
|
+
sentAt: string | null;
|
|
3977
|
+
/**
|
|
3978
|
+
* ISO 8601 timestamp, UTC.
|
|
3979
|
+
*/
|
|
3980
|
+
createdAt: string;
|
|
3981
|
+
/**
|
|
3982
|
+
* The alert that produced it; name only, since alerts can be deleted.
|
|
3983
|
+
*/
|
|
3984
|
+
alert: {
|
|
3985
|
+
name: string | null;
|
|
3986
|
+
};
|
|
3987
|
+
/**
|
|
3988
|
+
* For mention deliveries: the post, text cut to 160 characters.
|
|
3989
|
+
*/
|
|
3990
|
+
mention: {
|
|
3991
|
+
id: string;
|
|
3992
|
+
url: string;
|
|
3993
|
+
text: string;
|
|
3994
|
+
} | null;
|
|
3995
|
+
}>;
|
|
3996
|
+
};
|
|
3997
|
+
};
|
|
3998
|
+
type ListChannelDeliveriesResponse = ListChannelDeliveriesResponses[keyof ListChannelDeliveriesResponses];
|
|
3999
|
+
type ListChannelsData = {
|
|
4000
|
+
body?: never;
|
|
4001
|
+
path?: never;
|
|
4002
|
+
query?: never;
|
|
4003
|
+
url: '/v1/channels';
|
|
4004
|
+
};
|
|
4005
|
+
type ListChannelsErrors = {
|
|
4006
|
+
/**
|
|
4007
|
+
* Missing or invalid API key
|
|
4008
|
+
*/
|
|
4009
|
+
401: ErrorResponse;
|
|
4010
|
+
};
|
|
4011
|
+
type ListChannelsError = ListChannelsErrors[keyof ListChannelsErrors];
|
|
4012
|
+
type ListChannelsResponses = {
|
|
4013
|
+
/**
|
|
4014
|
+
* Every channel of the org
|
|
4015
|
+
*/
|
|
4016
|
+
200: {
|
|
4017
|
+
data: Array<{
|
|
4018
|
+
/**
|
|
4019
|
+
* Channel id (dest_...).
|
|
4020
|
+
*/
|
|
4021
|
+
id: string;
|
|
4022
|
+
label: string;
|
|
4023
|
+
/**
|
|
4024
|
+
* Computed over this workspace's deliveries.
|
|
4025
|
+
*/
|
|
4026
|
+
stats: {
|
|
4027
|
+
/**
|
|
4028
|
+
* Alerts sending to this channel.
|
|
4029
|
+
*/
|
|
4030
|
+
alerts: number;
|
|
4031
|
+
/**
|
|
4032
|
+
* Of those, enabled ones; 0 means the channel receives nothing right now.
|
|
4033
|
+
*/
|
|
4034
|
+
activeAlerts: number;
|
|
4035
|
+
/**
|
|
4036
|
+
* Newest delivery attempt, successful or not.
|
|
4037
|
+
*/
|
|
4038
|
+
lastDeliveryAt: string | null;
|
|
4039
|
+
/**
|
|
4040
|
+
* Deliveries in the last 7 days.
|
|
4041
|
+
*/
|
|
4042
|
+
last7d: {
|
|
4043
|
+
total: number;
|
|
4044
|
+
failed: number;
|
|
4045
|
+
};
|
|
4046
|
+
};
|
|
4047
|
+
/**
|
|
4048
|
+
* ISO 8601 timestamp, UTC.
|
|
4049
|
+
*/
|
|
4050
|
+
createdAt: string;
|
|
4051
|
+
kind: 'slack';
|
|
4052
|
+
config: {
|
|
4053
|
+
channelId: string;
|
|
4054
|
+
channelName: string;
|
|
4055
|
+
};
|
|
4056
|
+
} | {
|
|
4057
|
+
/**
|
|
4058
|
+
* Channel id (dest_...).
|
|
4059
|
+
*/
|
|
4060
|
+
id: string;
|
|
4061
|
+
label: string;
|
|
4062
|
+
/**
|
|
4063
|
+
* Computed over this workspace's deliveries.
|
|
4064
|
+
*/
|
|
4065
|
+
stats: {
|
|
4066
|
+
/**
|
|
4067
|
+
* Alerts sending to this channel.
|
|
4068
|
+
*/
|
|
4069
|
+
alerts: number;
|
|
4070
|
+
/**
|
|
4071
|
+
* Of those, enabled ones; 0 means the channel receives nothing right now.
|
|
4072
|
+
*/
|
|
4073
|
+
activeAlerts: number;
|
|
4074
|
+
/**
|
|
4075
|
+
* Newest delivery attempt, successful or not.
|
|
4076
|
+
*/
|
|
4077
|
+
lastDeliveryAt: string | null;
|
|
4078
|
+
/**
|
|
4079
|
+
* Deliveries in the last 7 days.
|
|
4080
|
+
*/
|
|
4081
|
+
last7d: {
|
|
4082
|
+
total: number;
|
|
4083
|
+
failed: number;
|
|
4084
|
+
};
|
|
4085
|
+
};
|
|
4086
|
+
/**
|
|
4087
|
+
* ISO 8601 timestamp, UTC.
|
|
4088
|
+
*/
|
|
4089
|
+
createdAt: string;
|
|
4090
|
+
kind: 'email';
|
|
4091
|
+
config: {
|
|
4092
|
+
recipients: Array<{
|
|
4093
|
+
email: string;
|
|
4094
|
+
/**
|
|
4095
|
+
* Null until the address confirmed through its link; unconfirmed addresses receive nothing.
|
|
4096
|
+
*/
|
|
4097
|
+
confirmedAt: string | null;
|
|
4098
|
+
}>;
|
|
4099
|
+
};
|
|
4100
|
+
} | {
|
|
4101
|
+
/**
|
|
4102
|
+
* Channel id (dest_...).
|
|
4103
|
+
*/
|
|
4104
|
+
id: string;
|
|
4105
|
+
label: string;
|
|
4106
|
+
/**
|
|
4107
|
+
* Computed over this workspace's deliveries.
|
|
4108
|
+
*/
|
|
4109
|
+
stats: {
|
|
4110
|
+
/**
|
|
4111
|
+
* Alerts sending to this channel.
|
|
4112
|
+
*/
|
|
4113
|
+
alerts: number;
|
|
4114
|
+
/**
|
|
4115
|
+
* Of those, enabled ones; 0 means the channel receives nothing right now.
|
|
4116
|
+
*/
|
|
4117
|
+
activeAlerts: number;
|
|
4118
|
+
/**
|
|
4119
|
+
* Newest delivery attempt, successful or not.
|
|
4120
|
+
*/
|
|
4121
|
+
lastDeliveryAt: string | null;
|
|
4122
|
+
/**
|
|
4123
|
+
* Deliveries in the last 7 days.
|
|
4124
|
+
*/
|
|
4125
|
+
last7d: {
|
|
4126
|
+
total: number;
|
|
4127
|
+
failed: number;
|
|
4128
|
+
};
|
|
4129
|
+
};
|
|
4130
|
+
/**
|
|
4131
|
+
* ISO 8601 timestamp, UTC.
|
|
4132
|
+
*/
|
|
4133
|
+
createdAt: string;
|
|
4134
|
+
kind: 'webhook';
|
|
4135
|
+
config: {
|
|
4136
|
+
url: string;
|
|
4137
|
+
/**
|
|
4138
|
+
* Extra request headers you configured.
|
|
4139
|
+
*/
|
|
4140
|
+
headers: {
|
|
4141
|
+
[key: string]: string;
|
|
4142
|
+
};
|
|
4143
|
+
/**
|
|
4144
|
+
* Only on creation and rotation. Signs every body: X-Mentions-Signature is the hex HMAC-SHA256 of the raw bytes.
|
|
4145
|
+
*/
|
|
4146
|
+
secret?: string;
|
|
4147
|
+
};
|
|
4148
|
+
} | {
|
|
4149
|
+
/**
|
|
4150
|
+
* Channel id (dest_...).
|
|
4151
|
+
*/
|
|
4152
|
+
id: string;
|
|
4153
|
+
label: string;
|
|
4154
|
+
/**
|
|
4155
|
+
* Computed over this workspace's deliveries.
|
|
4156
|
+
*/
|
|
4157
|
+
stats: {
|
|
4158
|
+
/**
|
|
4159
|
+
* Alerts sending to this channel.
|
|
4160
|
+
*/
|
|
4161
|
+
alerts: number;
|
|
4162
|
+
/**
|
|
4163
|
+
* Of those, enabled ones; 0 means the channel receives nothing right now.
|
|
4164
|
+
*/
|
|
4165
|
+
activeAlerts: number;
|
|
4166
|
+
/**
|
|
4167
|
+
* Newest delivery attempt, successful or not.
|
|
4168
|
+
*/
|
|
4169
|
+
lastDeliveryAt: string | null;
|
|
4170
|
+
/**
|
|
4171
|
+
* Deliveries in the last 7 days.
|
|
4172
|
+
*/
|
|
4173
|
+
last7d: {
|
|
4174
|
+
total: number;
|
|
4175
|
+
failed: number;
|
|
4176
|
+
};
|
|
4177
|
+
};
|
|
4178
|
+
/**
|
|
4179
|
+
* ISO 8601 timestamp, UTC.
|
|
4180
|
+
*/
|
|
4181
|
+
createdAt: string;
|
|
4182
|
+
kind: 'telegram';
|
|
4183
|
+
config: {
|
|
4184
|
+
chatId: string;
|
|
4185
|
+
chatType: 'private' | 'group' | 'supergroup' | 'channel';
|
|
4186
|
+
};
|
|
4187
|
+
}>;
|
|
4188
|
+
};
|
|
4189
|
+
};
|
|
4190
|
+
type ListChannelsResponse = ListChannelsResponses[keyof ListChannelsResponses];
|
|
4191
|
+
type CreateChannelData = {
|
|
4192
|
+
body: {
|
|
4193
|
+
kind: 'slack';
|
|
4194
|
+
/**
|
|
4195
|
+
* A Slack channel id from the connected workspace.
|
|
4196
|
+
*/
|
|
4197
|
+
channelId: string;
|
|
4198
|
+
channelName: string;
|
|
4199
|
+
} | {
|
|
4200
|
+
kind: 'email';
|
|
4201
|
+
/**
|
|
4202
|
+
* Each address gets a confirmation link; workspace members are confirmed on sight.
|
|
4203
|
+
*/
|
|
4204
|
+
emails: Array<string>;
|
|
4205
|
+
} | {
|
|
4206
|
+
kind: 'webhook';
|
|
4207
|
+
url: string;
|
|
4208
|
+
label?: string;
|
|
4209
|
+
headers?: {
|
|
4210
|
+
[key: string]: string;
|
|
4211
|
+
};
|
|
4212
|
+
};
|
|
4213
|
+
path?: never;
|
|
4214
|
+
query?: never;
|
|
4215
|
+
url: '/v1/channels';
|
|
4216
|
+
};
|
|
4217
|
+
type CreateChannelErrors = {
|
|
4218
|
+
/**
|
|
4219
|
+
* Missing or invalid API key
|
|
4220
|
+
*/
|
|
4221
|
+
401: ErrorResponse;
|
|
4222
|
+
/**
|
|
4223
|
+
* Slack is not connected for this org
|
|
4224
|
+
*/
|
|
4225
|
+
409: ErrorResponse;
|
|
4226
|
+
};
|
|
4227
|
+
type CreateChannelError = CreateChannelErrors[keyof CreateChannelErrors];
|
|
4228
|
+
type CreateChannelResponses = {
|
|
4229
|
+
/**
|
|
4230
|
+
* The created channel. A webhook includes its signing secret, shown only here.
|
|
4231
|
+
*/
|
|
4232
|
+
201: Channel;
|
|
4233
|
+
};
|
|
4234
|
+
type CreateChannelResponse = CreateChannelResponses[keyof CreateChannelResponses];
|
|
4235
|
+
|
|
4236
|
+
type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options$1<TData, ThrowOnError, TResponse> & {
|
|
4237
|
+
/**
|
|
4238
|
+
* You can provide a client instance returned by `createClient()` instead of
|
|
4239
|
+
* individual options. This might be also useful if you want to implement a
|
|
4240
|
+
* custom client.
|
|
4241
|
+
*/
|
|
4242
|
+
client?: Client;
|
|
4243
|
+
/**
|
|
4244
|
+
* You can pass arbitrary values through the `meta` object. This can be
|
|
4245
|
+
* used to access values that aren't defined as part of the SDK function.
|
|
4246
|
+
*/
|
|
4247
|
+
meta?: keyof ClientMeta extends never ? Record<string, unknown> : ClientMeta;
|
|
4248
|
+
};
|
|
4249
|
+
declare const getHealth: <ThrowOnError extends boolean = false>(options?: Options<GetHealthData, ThrowOnError>) => RequestResult<GetHealthResponses, unknown, ThrowOnError>;
|
|
4250
|
+
/**
|
|
4251
|
+
* List keywords
|
|
4252
|
+
*
|
|
4253
|
+
* Every keyword of the workspace, newest first, with its match stats and poll health.
|
|
4254
|
+
*/
|
|
4255
|
+
declare const listKeywords: <ThrowOnError extends boolean = false>(options?: Options<ListKeywordsData, ThrowOnError>) => RequestResult<ListKeywordsResponses, ListKeywordsErrors, ThrowOnError>;
|
|
4256
|
+
/**
|
|
4257
|
+
* Track a keyword
|
|
4258
|
+
*
|
|
4259
|
+
* Start tracking a word or phrase. Matching, classification and delivery begin on the next poll. Free workspaces track 2 keywords; a subscription raises that to 500.
|
|
4260
|
+
*/
|
|
4261
|
+
declare const createKeyword: <ThrowOnError extends boolean = false>(options: Options<CreateKeywordData, ThrowOnError>) => RequestResult<CreateKeywordResponses, CreateKeywordErrors, ThrowOnError>;
|
|
4262
|
+
/**
|
|
4263
|
+
* Delete a keyword
|
|
4264
|
+
*
|
|
4265
|
+
* Removes the keyword and its matches. Posts also matched by another keyword stay.
|
|
4266
|
+
*/
|
|
4267
|
+
declare const deleteKeyword: <ThrowOnError extends boolean = false>(options: Options<DeleteKeywordData, ThrowOnError>) => RequestResult<DeleteKeywordResponses, DeleteKeywordErrors, ThrowOnError>;
|
|
4268
|
+
/**
|
|
4269
|
+
* Get a keyword
|
|
4270
|
+
*/
|
|
4271
|
+
declare const getKeyword: <ThrowOnError extends boolean = false>(options: Options<GetKeywordData, ThrowOnError>) => RequestResult<GetKeywordResponses, GetKeywordErrors, ThrowOnError>;
|
|
4272
|
+
/**
|
|
4273
|
+
* Update a keyword
|
|
4274
|
+
*
|
|
4275
|
+
* Mute or unmute it, or change the platforms it is tracked on.
|
|
4276
|
+
*/
|
|
4277
|
+
declare const updateKeyword: <ThrowOnError extends boolean = false>(options: Options<UpdateKeywordData, ThrowOnError>) => RequestResult<UpdateKeywordResponses, UpdateKeywordErrors, ThrowOnError>;
|
|
4278
|
+
/**
|
|
4279
|
+
* Get a mention
|
|
4280
|
+
*
|
|
4281
|
+
* One mention by id, as it appears in the list: the post, its author with reach and your tags, the classification, the priority score and the triage fields. Ids belong to your organization; any other id is a 404.
|
|
4282
|
+
*/
|
|
4283
|
+
declare const getMention: <ThrowOnError extends boolean = false>(options: Options<GetMentionData, ThrowOnError>) => RequestResult<GetMentionResponses, GetMentionErrors, ThrowOnError>;
|
|
4284
|
+
/**
|
|
4285
|
+
* Update a mention
|
|
4286
|
+
*
|
|
4287
|
+
* The one write on a mention. Set status to ignored or done to handle it (open puts it back), assign it to a workspace member, snooze it out of the feed, or leave an internal note. Null clears a field; omitted fields are untouched. Delivery and billing never change.
|
|
4288
|
+
*/
|
|
4289
|
+
declare const updateMention: <ThrowOnError extends boolean = false>(options: Options<UpdateMentionData, ThrowOnError>) => RequestResult<UpdateMentionResponses, UpdateMentionErrors, ThrowOnError>;
|
|
4290
|
+
/**
|
|
4291
|
+
* List mentions
|
|
4292
|
+
*
|
|
4293
|
+
* Mentions matched to your keywords, filtered and paginated. Default order is newest match first; sort=priority ranks by attention score. Page with nextCursor, passing the same filters and sort. A mention is one post matched to one keyword.
|
|
4294
|
+
*/
|
|
4295
|
+
declare const searchMentions: <ThrowOnError extends boolean = false>(options?: Options<SearchMentionsData, ThrowOnError>) => RequestResult<SearchMentionsResponses, SearchMentionsErrors, ThrowOnError>;
|
|
4296
|
+
/**
|
|
4297
|
+
* Export mentions as CSV
|
|
4298
|
+
*
|
|
4299
|
+
* The same mentions GET /v1/mentions would list for these filters, as CSV, newest published first: id, published_at, platform, keyword, author, author_url, author_followers, relevance, sentiment, intents (pipe-separated), status, relevant, delivered, url, text (first 1,000 characters). Capped at 10,000 rows; the X-Mentions-Truncated header says when the cap cut the list.
|
|
4300
|
+
*/
|
|
4301
|
+
declare const exportMentionsCsv: <ThrowOnError extends boolean = false>(options?: Options<ExportMentionsCsvData, ThrowOnError>) => RequestResult<ExportMentionsCsvResponses, ExportMentionsCsvErrors, ThrowOnError>;
|
|
4302
|
+
/**
|
|
4303
|
+
* Export people as CSV
|
|
4304
|
+
*
|
|
4305
|
+
* The same list as GET /v1/people (segmentId included) as CSV, one row per person with their contact columns: handle, followers, email, website, company, location, tags. Capped at 5,000 people.
|
|
4306
|
+
*/
|
|
4307
|
+
declare const exportPeopleCsv: <ThrowOnError extends boolean = false>(options?: Options<ExportPeopleCsvData, ThrowOnError>) => RequestResult<ExportPeopleCsvResponses, ExportPeopleCsvErrors, ThrowOnError>;
|
|
4308
|
+
/**
|
|
4309
|
+
* List people
|
|
4310
|
+
*
|
|
4311
|
+
* The people behind your mentions: one row per person, with their accounts, reach, public profile, per-workspace stats and your annotations. Filter by platform, tag, follower range, mention counts, intents seen, keyword kinds mentioned or never mentioned, or a saved segment. Offset-paginated with a total.
|
|
4312
|
+
*/
|
|
4313
|
+
declare const listPeople: <ThrowOnError extends boolean = false>(options?: Options<ListPeopleData, ThrowOnError>) => RequestResult<ListPeopleResponses, ListPeopleErrors, ThrowOnError>;
|
|
4314
|
+
/**
|
|
4315
|
+
* Get a person
|
|
4316
|
+
*
|
|
4317
|
+
* One person as your workspace sees them. An account merged into someone resolves to that person.
|
|
4318
|
+
*/
|
|
4319
|
+
declare const getPerson: <ThrowOnError extends boolean = false>(options: Options<GetPersonData, ThrowOnError>) => RequestResult<GetPersonResponses, GetPersonErrors, ThrowOnError>;
|
|
4320
|
+
/**
|
|
4321
|
+
* Update your annotations on a person
|
|
4322
|
+
*
|
|
4323
|
+
* Tags, notes and mute, for your workspace only. Mute hides their posts from your feed and every channel; ingest and billing never change.
|
|
4324
|
+
*/
|
|
4325
|
+
declare const updatePerson: <ThrowOnError extends boolean = false>(options: Options<UpdatePersonData, ThrowOnError>) => RequestResult<UpdatePersonResponses, UpdatePersonErrors, ThrowOnError>;
|
|
4326
|
+
/**
|
|
4327
|
+
* Merge an account into a person
|
|
4328
|
+
*
|
|
4329
|
+
* Declare that this account and another person are the same human, for your workspace only. Their mentions, tags and notes combine under the person named by `into`.
|
|
4330
|
+
*/
|
|
4331
|
+
declare const mergePeople: <ThrowOnError extends boolean = false>(options: Options<MergePeopleData, ThrowOnError>) => RequestResult<MergePeopleResponses, MergePeopleErrors, ThrowOnError>;
|
|
4332
|
+
/**
|
|
4333
|
+
* Undo a merge
|
|
4334
|
+
*
|
|
4335
|
+
* The account becomes its own person again.
|
|
4336
|
+
*/
|
|
4337
|
+
declare const splitPerson: <ThrowOnError extends boolean = false>(options: Options<SplitPersonData, ThrowOnError>) => RequestResult<SplitPersonResponses, SplitPersonErrors, ThrowOnError>;
|
|
4338
|
+
/**
|
|
4339
|
+
* List segments
|
|
4340
|
+
*
|
|
4341
|
+
* Your saved segments, each with the number of people in it right now (segments are evaluated on every read, never materialized), plus presets you can save as a starting point. Pass a segment id to GET /v1/people to list its members.
|
|
4342
|
+
*/
|
|
4343
|
+
declare const listSegments: <ThrowOnError extends boolean = false>(options?: Options<ListSegmentsData, ThrowOnError>) => RequestResult<ListSegmentsResponses, ListSegmentsErrors, ThrowOnError>;
|
|
4344
|
+
/**
|
|
4345
|
+
* Create a segment
|
|
4346
|
+
*/
|
|
4347
|
+
declare const createSegment: <ThrowOnError extends boolean = false>(options: Options<CreateSegmentData, ThrowOnError>) => RequestResult<CreateSegmentResponses, CreateSegmentErrors, ThrowOnError>;
|
|
4348
|
+
/**
|
|
4349
|
+
* Delete a segment
|
|
4350
|
+
*
|
|
4351
|
+
* Nobody in it is affected.
|
|
4352
|
+
*/
|
|
4353
|
+
declare const deleteSegment: <ThrowOnError extends boolean = false>(options: Options<DeleteSegmentData, ThrowOnError>) => RequestResult<DeleteSegmentResponses, DeleteSegmentErrors, ThrowOnError>;
|
|
4354
|
+
/**
|
|
4355
|
+
* Get a segment
|
|
4356
|
+
*/
|
|
4357
|
+
declare const getSegment: <ThrowOnError extends boolean = false>(options: Options<GetSegmentData, ThrowOnError>) => RequestResult<GetSegmentResponses, GetSegmentErrors, ThrowOnError>;
|
|
4358
|
+
/**
|
|
4359
|
+
* Update a segment
|
|
4360
|
+
*/
|
|
4361
|
+
declare const updateSegment: <ThrowOnError extends boolean = false>(options: Options<UpdateSegmentData, ThrowOnError>) => RequestResult<UpdateSegmentResponses, UpdateSegmentErrors, ThrowOnError>;
|
|
4362
|
+
/**
|
|
4363
|
+
* Get the company profile
|
|
4364
|
+
*
|
|
4365
|
+
* What the classifier knows about you: name, description, use cases, your own accounts, and the composed context it reads.
|
|
4366
|
+
*/
|
|
4367
|
+
declare const getCompany: <ThrowOnError extends boolean = false>(options?: Options<GetCompanyData, ThrowOnError>) => RequestResult<GetCompanyResponses, GetCompanyErrors, ThrowOnError>;
|
|
4368
|
+
/**
|
|
4369
|
+
* Update the company profile
|
|
4370
|
+
*
|
|
4371
|
+
* Changing profile fields recomposes the classifier context; setting `context` directly overrides it until the next profile edit. Relevance scores for new mentions follow at once.
|
|
4372
|
+
*/
|
|
4373
|
+
declare const updateCompany: <ThrowOnError extends boolean = false>(options: Options<UpdateCompanyData, ThrowOnError>) => RequestResult<UpdateCompanyResponses, UpdateCompanyErrors, ThrowOnError>;
|
|
4374
|
+
/**
|
|
4375
|
+
* List API keys
|
|
4376
|
+
*/
|
|
4377
|
+
declare const listApiKeys: <ThrowOnError extends boolean = false>(options?: Options<ListApiKeysData, ThrowOnError>) => RequestResult<ListApiKeysResponses, ListApiKeysErrors, ThrowOnError>;
|
|
4378
|
+
/**
|
|
4379
|
+
* Create an API key
|
|
4380
|
+
*
|
|
4381
|
+
* Mint a key for this workspace. The key itself is returned once; only its hash is stored.
|
|
4382
|
+
*/
|
|
4383
|
+
declare const createApiKey: <ThrowOnError extends boolean = false>(options: Options<CreateApiKeyData, ThrowOnError>) => RequestResult<CreateApiKeyResponses, CreateApiKeyErrors, ThrowOnError>;
|
|
4384
|
+
/**
|
|
4385
|
+
* Revoke an API key
|
|
4386
|
+
*
|
|
4387
|
+
* Takes effect at once on the API and within a few minutes on cached verifications.
|
|
4388
|
+
*/
|
|
4389
|
+
declare const revokeApiKey: <ThrowOnError extends boolean = false>(options: Options<RevokeApiKeyData, ThrowOnError>) => RequestResult<RevokeApiKeyResponses, RevokeApiKeyErrors, ThrowOnError>;
|
|
4390
|
+
/**
|
|
4391
|
+
* Delete an alert
|
|
4392
|
+
*/
|
|
4393
|
+
declare const deleteAlert: <ThrowOnError extends boolean = false>(options: Options<DeleteAlertData, ThrowOnError>) => RequestResult<DeleteAlertResponses, DeleteAlertErrors, ThrowOnError>;
|
|
4394
|
+
/**
|
|
4395
|
+
* Get an alert
|
|
4396
|
+
*/
|
|
4397
|
+
declare const getAlert: <ThrowOnError extends boolean = false>(options: Options<GetAlertData, ThrowOnError>) => RequestResult<GetAlertResponses, GetAlertErrors, ThrowOnError>;
|
|
4398
|
+
/**
|
|
4399
|
+
* Update an alert
|
|
4400
|
+
*/
|
|
4401
|
+
declare const updateAlert: <ThrowOnError extends boolean = false>(options: Options<UpdateAlertData, ThrowOnError>) => RequestResult<UpdateAlertResponses, UpdateAlertErrors, ThrowOnError>;
|
|
4402
|
+
/**
|
|
4403
|
+
* List alerts
|
|
4404
|
+
*/
|
|
4405
|
+
declare const listAlerts: <ThrowOnError extends boolean = false>(options?: Options<ListAlertsData, ThrowOnError>) => RequestResult<ListAlertsResponses, ListAlertsErrors, ThrowOnError>;
|
|
4406
|
+
/**
|
|
4407
|
+
* Create an alert
|
|
4408
|
+
*/
|
|
4409
|
+
declare const createAlert: <ThrowOnError extends boolean = false>(options: Options<CreateAlertData, ThrowOnError>) => RequestResult<CreateAlertResponses, CreateAlertErrors, ThrowOnError>;
|
|
4410
|
+
/**
|
|
4411
|
+
* Send a test through an alert's channels
|
|
4412
|
+
*/
|
|
4413
|
+
declare const testAlert: <ThrowOnError extends boolean = false>(options: Options<TestAlertData, ThrowOnError>) => RequestResult<TestAlertResponses, TestAlertErrors, ThrowOnError>;
|
|
4414
|
+
/**
|
|
4415
|
+
* Send a digest now
|
|
4416
|
+
*/
|
|
4417
|
+
declare const runAlertDigest: <ThrowOnError extends boolean = false>(options: Options<RunAlertDigestData, ThrowOnError>) => RequestResult<RunAlertDigestResponses, RunAlertDigestErrors, ThrowOnError>;
|
|
4418
|
+
/**
|
|
4419
|
+
* Headline counts for a window
|
|
4420
|
+
*
|
|
4421
|
+
* Matched and relevant mentions, distinct posts and people, sentiment, buying intent and questions, estimated reach, and where the matches stand in triage. The window is `range` (7d, 30d, 90d, 365d, ending today) or `from` and `to`, cut into days in `timezone` (UTC by default); `keywordIds` and `platforms` narrow it; `compare=true` adds the period of the same length right before it. Time axis is the publish date.
|
|
4422
|
+
*/
|
|
4423
|
+
declare const getAnalyticsSummary: <ThrowOnError extends boolean = false>(options?: Options<GetAnalyticsSummaryData, ThrowOnError>) => RequestResult<GetAnalyticsSummaryResponses, GetAnalyticsSummaryErrors, ThrowOnError>;
|
|
4424
|
+
/**
|
|
4425
|
+
* Mentions over time
|
|
4426
|
+
*
|
|
4427
|
+
* Matched, relevant and sentiment counts per day or week across the window, as one total series or split per platform or per keyword with `by`. The window is `range` (7d, 30d, 90d, 365d, ending today) or `from` and `to`, cut into days in `timezone` (UTC by default); `keywordIds` and `platforms` narrow it; `compare=true` adds the period of the same length right before it. Time axis is the publish date.
|
|
4428
|
+
*/
|
|
4429
|
+
declare const getAnalyticsSeries: <ThrowOnError extends boolean = false>(options?: Options<GetAnalyticsSeriesData, ThrowOnError>) => RequestResult<GetAnalyticsSeriesResponses, GetAnalyticsSeriesErrors, ThrowOnError>;
|
|
4430
|
+
/**
|
|
4431
|
+
* Mentions grouped by one dimension
|
|
4432
|
+
*
|
|
4433
|
+
* One table of matched, relevant and sentiment counts grouped by `by`: platform, keyword, sentiment, intent, status, hour (weekday and hour of day) or person. The window is `range` (7d, 30d, 90d, 365d, ending today) or `from` and `to`, cut into days in `timezone` (UTC by default); `keywordIds` and `platforms` narrow it; `compare=true` adds the period of the same length right before it. Time axis is the publish date.
|
|
4434
|
+
*/
|
|
4435
|
+
declare const getAnalyticsBreakdown: <ThrowOnError extends boolean = false>(options: Options<GetAnalyticsBreakdownData, ThrowOnError>) => RequestResult<GetAnalyticsBreakdownResponses, GetAnalyticsBreakdownErrors, ThrowOnError>;
|
|
4436
|
+
/**
|
|
4437
|
+
* Brand against competitors
|
|
4438
|
+
*
|
|
4439
|
+
* Every keyword matched in the window with its counts and its share of brand plus competitor matches; topic keywords are counted but stay out of the split. The window is `range` (7d, 30d, 90d, 365d, ending today) or `from` and `to`, cut into days in `timezone` (UTC by default); `keywordIds` and `platforms` narrow it; `compare=true` adds the period of the same length right before it. Time axis is the publish date.
|
|
4440
|
+
*/
|
|
4441
|
+
declare const getShareOfVoice: <ThrowOnError extends boolean = false>(options?: Options<GetShareOfVoiceData, ThrowOnError>) => RequestResult<GetShareOfVoiceResponses, GetShareOfVoiceErrors, ThrowOnError>;
|
|
4442
|
+
/**
|
|
4443
|
+
* Delete a channel
|
|
4444
|
+
*/
|
|
4445
|
+
declare const deleteChannel: <ThrowOnError extends boolean = false>(options: Options<DeleteChannelData, ThrowOnError>) => RequestResult<DeleteChannelResponses, DeleteChannelErrors, ThrowOnError>;
|
|
4446
|
+
/**
|
|
4447
|
+
* Get a channel
|
|
4448
|
+
*/
|
|
4449
|
+
declare const getChannel: <ThrowOnError extends boolean = false>(options: Options<GetChannelData, ThrowOnError>) => RequestResult<GetChannelResponses, GetChannelErrors, ThrowOnError>;
|
|
4450
|
+
/**
|
|
4451
|
+
* Update a channel
|
|
4452
|
+
*/
|
|
4453
|
+
declare const updateChannel: <ThrowOnError extends boolean = false>(options: Options<UpdateChannelData, ThrowOnError>) => RequestResult<UpdateChannelResponses, UpdateChannelErrors, ThrowOnError>;
|
|
4454
|
+
/**
|
|
4455
|
+
* Send a test to a channel
|
|
4456
|
+
*/
|
|
4457
|
+
declare const testChannel: <ThrowOnError extends boolean = false>(options: Options<TestChannelData, ThrowOnError>) => RequestResult<TestChannelResponses, TestChannelErrors, ThrowOnError>;
|
|
4458
|
+
/**
|
|
4459
|
+
* Rotate a webhook secret
|
|
4460
|
+
*/
|
|
4461
|
+
declare const rotateWebhookSecret: <ThrowOnError extends boolean = false>(options: Options<RotateWebhookSecretData, ThrowOnError>) => RequestResult<RotateWebhookSecretResponses, RotateWebhookSecretErrors, ThrowOnError>;
|
|
4462
|
+
/**
|
|
4463
|
+
* List deliveries to a channel
|
|
4464
|
+
*/
|
|
4465
|
+
declare const listChannelDeliveries: <ThrowOnError extends boolean = false>(options: Options<ListChannelDeliveriesData, ThrowOnError>) => RequestResult<ListChannelDeliveriesResponses, ListChannelDeliveriesErrors, ThrowOnError>;
|
|
4466
|
+
/**
|
|
4467
|
+
* List channels
|
|
4468
|
+
*/
|
|
4469
|
+
declare const listChannels: <ThrowOnError extends boolean = false>(options?: Options<ListChannelsData, ThrowOnError>) => RequestResult<ListChannelsResponses, ListChannelsErrors, ThrowOnError>;
|
|
4470
|
+
/**
|
|
4471
|
+
* Create a channel
|
|
4472
|
+
*/
|
|
4473
|
+
declare const createChannel: <ThrowOnError extends boolean = false>(options: Options<CreateChannelData, ThrowOnError>) => RequestResult<CreateChannelResponses, CreateChannelErrors, ThrowOnError>;
|
|
4474
|
+
|
|
4475
|
+
type sdk_Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options<TData, ThrowOnError, TResponse>;
|
|
4476
|
+
declare const sdk_createAlert: typeof createAlert;
|
|
4477
|
+
declare const sdk_createApiKey: typeof createApiKey;
|
|
4478
|
+
declare const sdk_createChannel: typeof createChannel;
|
|
4479
|
+
declare const sdk_createKeyword: typeof createKeyword;
|
|
4480
|
+
declare const sdk_createSegment: typeof createSegment;
|
|
4481
|
+
declare const sdk_deleteAlert: typeof deleteAlert;
|
|
4482
|
+
declare const sdk_deleteChannel: typeof deleteChannel;
|
|
4483
|
+
declare const sdk_deleteKeyword: typeof deleteKeyword;
|
|
4484
|
+
declare const sdk_deleteSegment: typeof deleteSegment;
|
|
4485
|
+
declare const sdk_exportMentionsCsv: typeof exportMentionsCsv;
|
|
4486
|
+
declare const sdk_exportPeopleCsv: typeof exportPeopleCsv;
|
|
4487
|
+
declare const sdk_getAlert: typeof getAlert;
|
|
4488
|
+
declare const sdk_getAnalyticsBreakdown: typeof getAnalyticsBreakdown;
|
|
4489
|
+
declare const sdk_getAnalyticsSeries: typeof getAnalyticsSeries;
|
|
4490
|
+
declare const sdk_getAnalyticsSummary: typeof getAnalyticsSummary;
|
|
4491
|
+
declare const sdk_getChannel: typeof getChannel;
|
|
4492
|
+
declare const sdk_getCompany: typeof getCompany;
|
|
4493
|
+
declare const sdk_getHealth: typeof getHealth;
|
|
4494
|
+
declare const sdk_getKeyword: typeof getKeyword;
|
|
4495
|
+
declare const sdk_getMention: typeof getMention;
|
|
4496
|
+
declare const sdk_getPerson: typeof getPerson;
|
|
4497
|
+
declare const sdk_getSegment: typeof getSegment;
|
|
4498
|
+
declare const sdk_getShareOfVoice: typeof getShareOfVoice;
|
|
4499
|
+
declare const sdk_listAlerts: typeof listAlerts;
|
|
4500
|
+
declare const sdk_listApiKeys: typeof listApiKeys;
|
|
4501
|
+
declare const sdk_listChannelDeliveries: typeof listChannelDeliveries;
|
|
4502
|
+
declare const sdk_listChannels: typeof listChannels;
|
|
4503
|
+
declare const sdk_listKeywords: typeof listKeywords;
|
|
4504
|
+
declare const sdk_listPeople: typeof listPeople;
|
|
4505
|
+
declare const sdk_listSegments: typeof listSegments;
|
|
4506
|
+
declare const sdk_mergePeople: typeof mergePeople;
|
|
4507
|
+
declare const sdk_revokeApiKey: typeof revokeApiKey;
|
|
4508
|
+
declare const sdk_rotateWebhookSecret: typeof rotateWebhookSecret;
|
|
4509
|
+
declare const sdk_runAlertDigest: typeof runAlertDigest;
|
|
4510
|
+
declare const sdk_searchMentions: typeof searchMentions;
|
|
4511
|
+
declare const sdk_splitPerson: typeof splitPerson;
|
|
4512
|
+
declare const sdk_testAlert: typeof testAlert;
|
|
4513
|
+
declare const sdk_testChannel: typeof testChannel;
|
|
4514
|
+
declare const sdk_updateAlert: typeof updateAlert;
|
|
4515
|
+
declare const sdk_updateChannel: typeof updateChannel;
|
|
4516
|
+
declare const sdk_updateCompany: typeof updateCompany;
|
|
4517
|
+
declare const sdk_updateKeyword: typeof updateKeyword;
|
|
4518
|
+
declare const sdk_updateMention: typeof updateMention;
|
|
4519
|
+
declare const sdk_updatePerson: typeof updatePerson;
|
|
4520
|
+
declare const sdk_updateSegment: typeof updateSegment;
|
|
4521
|
+
declare namespace sdk {
|
|
4522
|
+
export { type sdk_Options as Options, sdk_createAlert as createAlert, sdk_createApiKey as createApiKey, sdk_createChannel as createChannel, sdk_createKeyword as createKeyword, sdk_createSegment as createSegment, sdk_deleteAlert as deleteAlert, sdk_deleteChannel as deleteChannel, sdk_deleteKeyword as deleteKeyword, sdk_deleteSegment as deleteSegment, sdk_exportMentionsCsv as exportMentionsCsv, sdk_exportPeopleCsv as exportPeopleCsv, sdk_getAlert as getAlert, sdk_getAnalyticsBreakdown as getAnalyticsBreakdown, sdk_getAnalyticsSeries as getAnalyticsSeries, sdk_getAnalyticsSummary as getAnalyticsSummary, sdk_getChannel as getChannel, sdk_getCompany as getCompany, sdk_getHealth as getHealth, sdk_getKeyword as getKeyword, sdk_getMention as getMention, sdk_getPerson as getPerson, sdk_getSegment as getSegment, sdk_getShareOfVoice as getShareOfVoice, sdk_listAlerts as listAlerts, sdk_listApiKeys as listApiKeys, sdk_listChannelDeliveries as listChannelDeliveries, sdk_listChannels as listChannels, sdk_listKeywords as listKeywords, sdk_listPeople as listPeople, sdk_listSegments as listSegments, sdk_mergePeople as mergePeople, sdk_revokeApiKey as revokeApiKey, sdk_rotateWebhookSecret as rotateWebhookSecret, sdk_runAlertDigest as runAlertDigest, sdk_searchMentions as searchMentions, sdk_splitPerson as splitPerson, sdk_testAlert as testAlert, sdk_testChannel as testChannel, sdk_updateAlert as updateAlert, sdk_updateChannel as updateChannel, sdk_updateCompany as updateCompany, sdk_updateKeyword as updateKeyword, sdk_updateMention as updateMention, sdk_updatePerson as updatePerson, sdk_updateSegment as updateSegment };
|
|
4523
|
+
}
|
|
4524
|
+
|
|
4525
|
+
/**
|
|
4526
|
+
* @mentio-dev/sdk: a typed client for the Mentio API. Everything under
|
|
4527
|
+
* ./generated comes from the API's OpenAPI document (`pnpm generate`), one
|
|
4528
|
+
* function per operation; this file adds the constructor that binds a key
|
|
4529
|
+
* and a host once so calls read `mentio.searchMentions({ query })`.
|
|
4530
|
+
*/
|
|
4531
|
+
|
|
4532
|
+
declare const DEFAULT_BASE_URL = "https://api.mentio.dev";
|
|
4533
|
+
interface MentioOptions {
|
|
4534
|
+
/** API key from the dashboard or POST /v1/api-keys (mk_live_...). */
|
|
4535
|
+
apiKey: string;
|
|
4536
|
+
/** Another deployment's host; the hosted API by default. */
|
|
4537
|
+
baseUrl?: string;
|
|
4538
|
+
/** Custom fetch, for tests or runtimes without a global one. */
|
|
4539
|
+
fetch?: typeof fetch;
|
|
4540
|
+
/** Extra headers sent on every request. */
|
|
4541
|
+
headers?: Record<string, string>;
|
|
4542
|
+
}
|
|
4543
|
+
/** Every SDK function, pre-bound to one client, plus the client itself for
|
|
4544
|
+
* interceptors and raw requests. Passing `client` in a call still wins. */
|
|
4545
|
+
type Mentio = typeof sdk & {
|
|
4546
|
+
client: Client;
|
|
4547
|
+
};
|
|
4548
|
+
declare function createMentio(options: MentioOptions): Mentio;
|
|
4549
|
+
|
|
4550
|
+
export { type Alert, type AnalyticsBreakdown, type AnalyticsSeries, type AnalyticsSummary, type Channel, type Client, type ClientOptions, type Company, type Config, type CreateAlertData, type CreateAlertError, type CreateAlertErrors, type CreateAlertResponse, type CreateAlertResponses, type CreateApiKeyData, type CreateApiKeyError, type CreateApiKeyErrors, type CreateApiKeyResponse, type CreateApiKeyResponses, type CreateChannelData, type CreateChannelError, type CreateChannelErrors, type CreateChannelResponse, type CreateChannelResponses, type CreateKeywordData, type CreateKeywordError, type CreateKeywordErrors, type CreateKeywordResponse, type CreateKeywordResponses, type CreateSegmentData, type CreateSegmentError, type CreateSegmentErrors, type CreateSegmentResponse, type CreateSegmentResponses, DEFAULT_BASE_URL, type DeleteAlertData, type DeleteAlertError, type DeleteAlertErrors, type DeleteAlertResponse, type DeleteAlertResponses, type DeleteChannelData, type DeleteChannelError, type DeleteChannelErrors, type DeleteChannelResponse, type DeleteChannelResponses, type DeleteKeywordData, type DeleteKeywordError, type DeleteKeywordErrors, type DeleteKeywordResponse, type DeleteKeywordResponses, type DeleteSegmentData, type DeleteSegmentError, type DeleteSegmentErrors, type DeleteSegmentResponse, type DeleteSegmentResponses, type ErrorResponse, type ExportMentionsCsvData, type ExportMentionsCsvError, type ExportMentionsCsvErrors, type ExportMentionsCsvResponse, type ExportMentionsCsvResponses, type ExportPeopleCsvData, type ExportPeopleCsvError, type ExportPeopleCsvErrors, type ExportPeopleCsvResponse, type ExportPeopleCsvResponses, type GetAlertData, type GetAlertError, type GetAlertErrors, type GetAlertResponse, type GetAlertResponses, type GetAnalyticsBreakdownData, type GetAnalyticsBreakdownError, type GetAnalyticsBreakdownErrors, type GetAnalyticsBreakdownResponse, type GetAnalyticsBreakdownResponses, type GetAnalyticsSeriesData, type GetAnalyticsSeriesError, type GetAnalyticsSeriesErrors, type GetAnalyticsSeriesResponse, type GetAnalyticsSeriesResponses, type GetAnalyticsSummaryData, type GetAnalyticsSummaryError, type GetAnalyticsSummaryErrors, type GetAnalyticsSummaryResponse, type GetAnalyticsSummaryResponses, type GetChannelData, type GetChannelError, type GetChannelErrors, type GetChannelResponse, type GetChannelResponses, type GetCompanyData, type GetCompanyError, type GetCompanyErrors, type GetCompanyResponse, type GetCompanyResponses, type GetHealthData, type GetHealthResponse, type GetHealthResponses, type GetKeywordData, type GetKeywordError, type GetKeywordErrors, type GetKeywordResponse, type GetKeywordResponses, type GetMentionData, type GetMentionError, type GetMentionErrors, type GetMentionResponse, type GetMentionResponses, type GetPersonData, type GetPersonError, type GetPersonErrors, type GetPersonResponse, type GetPersonResponses, type GetSegmentData, type GetSegmentError, type GetSegmentErrors, type GetSegmentResponse, type GetSegmentResponses, type GetShareOfVoiceData, type GetShareOfVoiceError, type GetShareOfVoiceErrors, type GetShareOfVoiceResponse, type GetShareOfVoiceResponses, type Keyword, type ListAlertsData, type ListAlertsError, type ListAlertsErrors, type ListAlertsResponse, type ListAlertsResponses, type ListApiKeysData, type ListApiKeysError, type ListApiKeysErrors, type ListApiKeysResponse, type ListApiKeysResponses, type ListChannelDeliveriesData, type ListChannelDeliveriesError, type ListChannelDeliveriesErrors, type ListChannelDeliveriesResponse, type ListChannelDeliveriesResponses, type ListChannelsData, type ListChannelsError, type ListChannelsErrors, type ListChannelsResponse, type ListChannelsResponses, type ListKeywordsData, type ListKeywordsError, type ListKeywordsErrors, type ListKeywordsResponse, type ListKeywordsResponses, type ListPeopleData, type ListPeopleError, type ListPeopleErrors, type ListPeopleResponse, type ListPeopleResponses, type ListSegmentsData, type ListSegmentsError, type ListSegmentsErrors, type ListSegmentsResponse, type ListSegmentsResponses, type Mentio, type MentioOptions, type Mention, type MergePeopleData, type MergePeopleError, type MergePeopleErrors, type MergePeopleResponse, type MergePeopleResponses, type Options, type Person, type RequestResult, type RevokeApiKeyData, type RevokeApiKeyError, type RevokeApiKeyErrors, type RevokeApiKeyResponse, type RevokeApiKeyResponses, type RotateWebhookSecretData, type RotateWebhookSecretError, type RotateWebhookSecretErrors, type RotateWebhookSecretResponse, type RotateWebhookSecretResponses, type RunAlertDigestData, type RunAlertDigestError, type RunAlertDigestErrors, type RunAlertDigestResponse, type RunAlertDigestResponses, type SearchMentionsData, type SearchMentionsError, type SearchMentionsErrors, type SearchMentionsResponse, type SearchMentionsResponses, type Segment, type ShareOfVoice, type SplitPersonData, type SplitPersonError, type SplitPersonErrors, type SplitPersonResponse, type SplitPersonResponses, type TestAlertData, type TestAlertError, type TestAlertErrors, type TestAlertResponse, type TestAlertResponses, type TestChannelData, type TestChannelError, type TestChannelErrors, type TestChannelResponse, type TestChannelResponses, type UpdateAlertData, type UpdateAlertError, type UpdateAlertErrors, type UpdateAlertResponse, type UpdateAlertResponses, type UpdateChannelData, type UpdateChannelError, type UpdateChannelErrors, type UpdateChannelResponse, type UpdateChannelResponses, type UpdateCompanyData, type UpdateCompanyError, type UpdateCompanyErrors, type UpdateCompanyResponse, type UpdateCompanyResponses, type UpdateKeywordData, type UpdateKeywordError, type UpdateKeywordErrors, type UpdateKeywordResponse, type UpdateKeywordResponses, type UpdateMentionData, type UpdateMentionError, type UpdateMentionErrors, type UpdateMentionResponse, type UpdateMentionResponses, type UpdatePersonData, type UpdatePersonError, type UpdatePersonErrors, type UpdatePersonResponse, type UpdatePersonResponses, type UpdateSegmentData, type UpdateSegmentError, type UpdateSegmentErrors, type UpdateSegmentResponse, type UpdateSegmentResponses, createAlert, createApiKey, createChannel, createClient, createConfig, createKeyword, createMentio, createSegment, deleteAlert, deleteChannel, deleteKeyword, deleteSegment, exportMentionsCsv, exportPeopleCsv, getAlert, getAnalyticsBreakdown, getAnalyticsSeries, getAnalyticsSummary, getChannel, getCompany, getHealth, getKeyword, getMention, getPerson, getSegment, getShareOfVoice, listAlerts, listApiKeys, listChannelDeliveries, listChannels, listKeywords, listPeople, listSegments, mergePeople, revokeApiKey, rotateWebhookSecret, runAlertDigest, searchMentions, splitPerson, testAlert, testChannel, updateAlert, updateChannel, updateCompany, updateKeyword, updateMention, updatePerson, updateSegment };
|