topgg-api-types 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +73 -0
- package/dist/index-BzCAuhll.d.ts +6 -0
- package/dist/index-Dj7klI6c.d.cts +6 -0
- package/dist/index.cjs +28 -0
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +4 -0
- package/dist/v0/validators.cjs +176 -0
- package/dist/v0/validators.cjs.map +1 -0
- package/dist/v0/validators.d.cts +605 -0
- package/dist/v0/validators.d.ts +605 -0
- package/dist/v0/validators.js +162 -0
- package/dist/v0/validators.js.map +1 -0
- package/dist/v0.cjs +0 -0
- package/dist/v0.d.cts +407 -0
- package/dist/v0.d.ts +407 -0
- package/dist/v0.js +0 -0
- package/dist/v1/validators.cjs +231 -0
- package/dist/v1/validators.cjs.map +1 -0
- package/dist/v1/validators.d.cts +687 -0
- package/dist/v1/validators.d.ts +687 -0
- package/dist/v1/validators.js +206 -0
- package/dist/v1/validators.js.map +1 -0
- package/dist/v1.cjs +0 -0
- package/dist/v1.d.cts +333 -0
- package/dist/v1.d.ts +333 -0
- package/dist/v1.js +0 -0
- package/dist/validators-B3dxgWHu.cjs +54 -0
- package/dist/validators-B3dxgWHu.cjs.map +1 -0
- package/dist/validators-Mlu16sBg.js +9 -0
- package/dist/validators-Mlu16sBg.js.map +1 -0
- package/package.json +64 -0
|
@@ -0,0 +1,687 @@
|
|
|
1
|
+
import * as z from "zod/mini";
|
|
2
|
+
|
|
3
|
+
//#region src/v1/validators.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The type of a webhook event. This is used to identify the type of the event that is being delivered to your webhook endpoint.
|
|
7
|
+
*
|
|
8
|
+
* Not all webhook events are allowed to be set by an integration - use the `IntegrationSupportedWebhookScopesSchema` to find out which events you can subscribe to as an integration.
|
|
9
|
+
*/
|
|
10
|
+
declare const WebhookEventTypeSchema: z.ZodMiniEnum<{
|
|
11
|
+
"webhook.test": "webhook.test";
|
|
12
|
+
"integration.create": "integration.create";
|
|
13
|
+
"integration.delete": "integration.delete";
|
|
14
|
+
"vote.create": "vote.create";
|
|
15
|
+
}>;
|
|
16
|
+
/**
|
|
17
|
+
* The type of a project helps top.gg synchronize features.
|
|
18
|
+
* For example, a discord bot may have a support server, but this would not make any sense for a discord server.
|
|
19
|
+
*
|
|
20
|
+
* You can use this to further find out the specificity of the project.
|
|
21
|
+
*/
|
|
22
|
+
declare const ProjectTypeSchema: z.ZodMiniEnum<{
|
|
23
|
+
bot: "bot";
|
|
24
|
+
server: "server";
|
|
25
|
+
game: "game";
|
|
26
|
+
}>;
|
|
27
|
+
/**
|
|
28
|
+
* A Platform is used to identify where the corresponding ID links towards.
|
|
29
|
+
*/
|
|
30
|
+
declare const ProjectPlatformTypeSchema: z.ZodMiniEnum<{
|
|
31
|
+
discord: "discord";
|
|
32
|
+
roblox: "roblox";
|
|
33
|
+
}>;
|
|
34
|
+
/**
|
|
35
|
+
* A User Source is an enum that represents a user account from an external platform that is linked to a Top.gg user account.
|
|
36
|
+
* Each source has a unique identifer type that we might validate against.
|
|
37
|
+
*
|
|
38
|
+
* If none is passed to any endpoint that accepts a source parameter, it will default to topgg.
|
|
39
|
+
*/
|
|
40
|
+
declare const UserSourceSchema: z.ZodMiniEnum<{
|
|
41
|
+
discord: "discord";
|
|
42
|
+
topgg: "topgg";
|
|
43
|
+
}>;
|
|
44
|
+
/**
|
|
45
|
+
* Webhook scopes that are supported for integrations.
|
|
46
|
+
*/
|
|
47
|
+
declare const IntegrationSupportedWebhookScopesSchema: z.ZodMiniEnum<{
|
|
48
|
+
"webhook.test": "webhook.test";
|
|
49
|
+
"vote.create": "vote.create";
|
|
50
|
+
}>;
|
|
51
|
+
/**
|
|
52
|
+
* All error responses follow the [`application/problem+json`](https://datatracker.ietf.org/doc/html/rfc7807) specification.
|
|
53
|
+
*/
|
|
54
|
+
declare const ErrorSchema: z.ZodMiniObject<{
|
|
55
|
+
type: z.ZodMiniString<string>;
|
|
56
|
+
title: z.ZodMiniString<string>;
|
|
57
|
+
status: z.ZodMiniNumber<number>;
|
|
58
|
+
detail: z.ZodMiniString<string>;
|
|
59
|
+
}, z.core.$strip>;
|
|
60
|
+
/**
|
|
61
|
+
* Represents a user on Top.gg.
|
|
62
|
+
*/
|
|
63
|
+
declare const UserSchema: z.ZodMiniObject<{
|
|
64
|
+
/**
|
|
65
|
+
* The user's Top.gg ID.
|
|
66
|
+
*/
|
|
67
|
+
id: z.ZodMiniString<string>;
|
|
68
|
+
/**
|
|
69
|
+
* The user's platform ID (e.g., Discord ID).
|
|
70
|
+
*/
|
|
71
|
+
platform_id: z.ZodMiniString<string>;
|
|
72
|
+
/**
|
|
73
|
+
* The user's username.
|
|
74
|
+
*/
|
|
75
|
+
name: z.ZodMiniString<string>;
|
|
76
|
+
/**
|
|
77
|
+
* The URL of the user's avatar.
|
|
78
|
+
*/
|
|
79
|
+
avatar_url: z.ZodMiniURL;
|
|
80
|
+
}, z.core.$strip>;
|
|
81
|
+
/**
|
|
82
|
+
* Base project information shared across all project-related responses.
|
|
83
|
+
*/
|
|
84
|
+
declare const BaseProjectSchema: z.ZodMiniObject<{
|
|
85
|
+
/**
|
|
86
|
+
* The project's Top.gg ID.
|
|
87
|
+
*/
|
|
88
|
+
id: z.ZodMiniString<string>;
|
|
89
|
+
/**
|
|
90
|
+
* The platform the project is on (e.g., "discord").
|
|
91
|
+
*/
|
|
92
|
+
platform: z.ZodMiniEnum<{
|
|
93
|
+
discord: "discord";
|
|
94
|
+
roblox: "roblox";
|
|
95
|
+
}>;
|
|
96
|
+
/**
|
|
97
|
+
* The platform-specific ID of the project (e.g., Discord Bot ID).
|
|
98
|
+
*/
|
|
99
|
+
platform_id: z.ZodMiniString<string>;
|
|
100
|
+
/**
|
|
101
|
+
* The type of project (e.g., "bot").
|
|
102
|
+
*/
|
|
103
|
+
type: z.ZodMiniEnum<{
|
|
104
|
+
bot: "bot";
|
|
105
|
+
server: "server";
|
|
106
|
+
game: "game";
|
|
107
|
+
}>;
|
|
108
|
+
}, z.core.$strip>;
|
|
109
|
+
/**
|
|
110
|
+
* Represents a vote on Top.gg.
|
|
111
|
+
*/
|
|
112
|
+
declare const VoteSchema: z.ZodMiniObject<{
|
|
113
|
+
/**
|
|
114
|
+
* The Top.gg ID of the user who voted.
|
|
115
|
+
*/
|
|
116
|
+
user_id: z.ZodMiniString<string>;
|
|
117
|
+
/**
|
|
118
|
+
* The user's ID on the project's platform (e.g., Discord ID).
|
|
119
|
+
*/
|
|
120
|
+
platform_id: z.ZodMiniString<string>;
|
|
121
|
+
/**
|
|
122
|
+
* The amount of votes this vote counted for.
|
|
123
|
+
*/
|
|
124
|
+
weight: z.ZodMiniNumber<number>;
|
|
125
|
+
/**
|
|
126
|
+
* The timestamp of when the user voted.
|
|
127
|
+
*/
|
|
128
|
+
created_at: z.iso.ZodMiniISODate;
|
|
129
|
+
/**
|
|
130
|
+
* The timestamp of when the vote expires (i.e., when the user can vote again).
|
|
131
|
+
* This is typically 12 hours after the `created_at` timestamp, but may vary based on the user's voting history and other factors.
|
|
132
|
+
*/
|
|
133
|
+
expires_at: z.iso.ZodMiniISODate;
|
|
134
|
+
}, z.core.$strip>;
|
|
135
|
+
/**
|
|
136
|
+
* Represents a vote for a specific project.
|
|
137
|
+
*/
|
|
138
|
+
declare const ProjectVoteSchema: z.ZodMiniObject<{
|
|
139
|
+
/**
|
|
140
|
+
* The Top.gg ID of the user who voted.
|
|
141
|
+
*/
|
|
142
|
+
user_id: z.ZodMiniString<string>;
|
|
143
|
+
/**
|
|
144
|
+
* The user's ID on the project's platform (e.g., Discord ID).
|
|
145
|
+
*/
|
|
146
|
+
platform_id: z.ZodMiniString<string>;
|
|
147
|
+
/**
|
|
148
|
+
* The amount of votes this vote counted for.
|
|
149
|
+
*/
|
|
150
|
+
weight: z.ZodMiniNumber<number>;
|
|
151
|
+
/**
|
|
152
|
+
* The timestamp of when the user voted.
|
|
153
|
+
*/
|
|
154
|
+
created_at: z.iso.ZodMiniISODate;
|
|
155
|
+
/**
|
|
156
|
+
* The timestamp of when the vote expires (i.e., when the user can vote again).
|
|
157
|
+
* This is typically 12 hours after the `created_at` timestamp, but may vary based on the user's voting history and other factors.
|
|
158
|
+
*/
|
|
159
|
+
expires_at: z.iso.ZodMiniISODate;
|
|
160
|
+
}, z.core.$strip>;
|
|
161
|
+
declare const WebhookPayloadBaseSchema: <T extends z.infer<typeof WebhookEventTypeSchema>, Data extends z.ZodMiniObject>(type: T, data: Data) => z.ZodMiniObject<{
|
|
162
|
+
type: z.ZodMiniLiteral<T>;
|
|
163
|
+
data: Data;
|
|
164
|
+
}, z.core.$strip>;
|
|
165
|
+
/**
|
|
166
|
+
* Data included when an integration connection is created.
|
|
167
|
+
*/
|
|
168
|
+
declare const IntegrationCreateDataSchema: z.ZodMiniObject<{
|
|
169
|
+
/**
|
|
170
|
+
* The unique identifier for this integration connection.
|
|
171
|
+
*/
|
|
172
|
+
connection_id: z.ZodMiniString<string>;
|
|
173
|
+
/**
|
|
174
|
+
* The webhook secret used to verify webhook requests from Top.gg for this connection.
|
|
175
|
+
*/
|
|
176
|
+
webhook_secret: z.ZodMiniString<string>;
|
|
177
|
+
/**
|
|
178
|
+
* The project this integration is connected to.
|
|
179
|
+
*/
|
|
180
|
+
project: z.ZodMiniObject<{
|
|
181
|
+
/**
|
|
182
|
+
* The project's Top.gg ID.
|
|
183
|
+
*/
|
|
184
|
+
id: z.ZodMiniString<string>;
|
|
185
|
+
/**
|
|
186
|
+
* The platform the project is on (e.g., "discord").
|
|
187
|
+
*/
|
|
188
|
+
platform: z.ZodMiniEnum<{
|
|
189
|
+
discord: "discord";
|
|
190
|
+
roblox: "roblox";
|
|
191
|
+
}>;
|
|
192
|
+
/**
|
|
193
|
+
* The platform-specific ID of the project (e.g., Discord Bot ID).
|
|
194
|
+
*/
|
|
195
|
+
platform_id: z.ZodMiniString<string>;
|
|
196
|
+
/**
|
|
197
|
+
* The type of project (e.g., "bot").
|
|
198
|
+
*/
|
|
199
|
+
type: z.ZodMiniEnum<{
|
|
200
|
+
bot: "bot";
|
|
201
|
+
server: "server";
|
|
202
|
+
game: "game";
|
|
203
|
+
}>;
|
|
204
|
+
}, z.core.$strip>;
|
|
205
|
+
/**
|
|
206
|
+
* The user who created this integration connection.
|
|
207
|
+
*/
|
|
208
|
+
user: z.ZodMiniObject<{
|
|
209
|
+
/**
|
|
210
|
+
* The user's Top.gg ID.
|
|
211
|
+
*/
|
|
212
|
+
id: z.ZodMiniString<string>;
|
|
213
|
+
/**
|
|
214
|
+
* The user's platform ID (e.g., Discord ID).
|
|
215
|
+
*/
|
|
216
|
+
platform_id: z.ZodMiniString<string>;
|
|
217
|
+
/**
|
|
218
|
+
* The user's username.
|
|
219
|
+
*/
|
|
220
|
+
name: z.ZodMiniString<string>;
|
|
221
|
+
/**
|
|
222
|
+
* The URL of the user's avatar.
|
|
223
|
+
*/
|
|
224
|
+
avatar_url: z.ZodMiniURL;
|
|
225
|
+
}, z.core.$strip>;
|
|
226
|
+
}, z.core.$strip>;
|
|
227
|
+
/**
|
|
228
|
+
* The payload delivered to your webhook endpoint when an integration connection is created.
|
|
229
|
+
* This will be sent if a user clicks "Connect" for your integration on the dashboard.
|
|
230
|
+
*
|
|
231
|
+
* @see https://docs.top.gg/docs/API/v1/integrations#2-topgg-sends-integrationcreate
|
|
232
|
+
*/
|
|
233
|
+
declare const IntegrationCreateWebhookPayloadSchema: z.ZodMiniObject<{
|
|
234
|
+
type: z.ZodMiniLiteral<"integration.create">;
|
|
235
|
+
data: z.ZodMiniObject<{
|
|
236
|
+
/**
|
|
237
|
+
* The unique identifier for this integration connection.
|
|
238
|
+
*/
|
|
239
|
+
connection_id: z.ZodMiniString<string>;
|
|
240
|
+
/**
|
|
241
|
+
* The webhook secret used to verify webhook requests from Top.gg for this connection.
|
|
242
|
+
*/
|
|
243
|
+
webhook_secret: z.ZodMiniString<string>;
|
|
244
|
+
/**
|
|
245
|
+
* The project this integration is connected to.
|
|
246
|
+
*/
|
|
247
|
+
project: z.ZodMiniObject<{
|
|
248
|
+
/**
|
|
249
|
+
* The project's Top.gg ID.
|
|
250
|
+
*/
|
|
251
|
+
id: z.ZodMiniString<string>;
|
|
252
|
+
/**
|
|
253
|
+
* The platform the project is on (e.g., "discord").
|
|
254
|
+
*/
|
|
255
|
+
platform: z.ZodMiniEnum<{
|
|
256
|
+
discord: "discord";
|
|
257
|
+
roblox: "roblox";
|
|
258
|
+
}>;
|
|
259
|
+
/**
|
|
260
|
+
* The platform-specific ID of the project (e.g., Discord Bot ID).
|
|
261
|
+
*/
|
|
262
|
+
platform_id: z.ZodMiniString<string>;
|
|
263
|
+
/**
|
|
264
|
+
* The type of project (e.g., "bot").
|
|
265
|
+
*/
|
|
266
|
+
type: z.ZodMiniEnum<{
|
|
267
|
+
bot: "bot";
|
|
268
|
+
server: "server";
|
|
269
|
+
game: "game";
|
|
270
|
+
}>;
|
|
271
|
+
}, z.core.$strip>;
|
|
272
|
+
/**
|
|
273
|
+
* The user who created this integration connection.
|
|
274
|
+
*/
|
|
275
|
+
user: z.ZodMiniObject<{
|
|
276
|
+
/**
|
|
277
|
+
* The user's Top.gg ID.
|
|
278
|
+
*/
|
|
279
|
+
id: z.ZodMiniString<string>;
|
|
280
|
+
/**
|
|
281
|
+
* The user's platform ID (e.g., Discord ID).
|
|
282
|
+
*/
|
|
283
|
+
platform_id: z.ZodMiniString<string>;
|
|
284
|
+
/**
|
|
285
|
+
* The user's username.
|
|
286
|
+
*/
|
|
287
|
+
name: z.ZodMiniString<string>;
|
|
288
|
+
/**
|
|
289
|
+
* The URL of the user's avatar.
|
|
290
|
+
*/
|
|
291
|
+
avatar_url: z.ZodMiniURL;
|
|
292
|
+
}, z.core.$strip>;
|
|
293
|
+
}, z.core.$strip>;
|
|
294
|
+
}, z.core.$strip>;
|
|
295
|
+
/**
|
|
296
|
+
* The response you must return from your webhook endpoint when you receive an `integration.create` event.
|
|
297
|
+
* This tells Top.gg where to deliver webhook events for this integration connection and which events to deliver.
|
|
298
|
+
*
|
|
299
|
+
* @see https://docs.top.gg/docs/API/v1/integrations#3-respond-with-configuration
|
|
300
|
+
*/
|
|
301
|
+
declare const IntegrationCreateResponseSchema: z.ZodMiniObject<{
|
|
302
|
+
/**
|
|
303
|
+
* The URL where Top.gg should deliver webhook events for this connection.
|
|
304
|
+
*/
|
|
305
|
+
webhook_url: z.ZodMiniURL;
|
|
306
|
+
/**
|
|
307
|
+
* An array of webhook scopes to subscribe to.
|
|
308
|
+
*
|
|
309
|
+
* @see https://docs.top.gg/docs/API/v1/webhooks#supported-scopes
|
|
310
|
+
*/
|
|
311
|
+
routes: z.ZodMiniArray<z.ZodMiniEnum<{
|
|
312
|
+
"webhook.test": "webhook.test";
|
|
313
|
+
"vote.create": "vote.create";
|
|
314
|
+
}>>;
|
|
315
|
+
}, z.core.$strip>;
|
|
316
|
+
/**
|
|
317
|
+
* Data included when an integration connection is deleted.
|
|
318
|
+
*/
|
|
319
|
+
declare const IntegrationDeleteDataSchema: z.ZodMiniObject<{
|
|
320
|
+
/**
|
|
321
|
+
* The unique identifier for the integration connection that was deleted.
|
|
322
|
+
*/
|
|
323
|
+
connection_id: z.ZodMiniString<string>;
|
|
324
|
+
}, z.core.$strip>;
|
|
325
|
+
/**
|
|
326
|
+
* The payload delivered to your webhook endpoint when an integration connection is deleted.
|
|
327
|
+
*/
|
|
328
|
+
declare const IntegrationDeleteWebhookPayloadSchema: z.ZodMiniObject<{
|
|
329
|
+
type: z.ZodMiniLiteral<"integration.delete">;
|
|
330
|
+
data: z.ZodMiniObject<{
|
|
331
|
+
/**
|
|
332
|
+
* The unique identifier for the integration connection that was deleted.
|
|
333
|
+
*/
|
|
334
|
+
connection_id: z.ZodMiniString<string>;
|
|
335
|
+
}, z.core.$strip>;
|
|
336
|
+
}, z.core.$strip>;
|
|
337
|
+
/**
|
|
338
|
+
* Data included when a vote is created.
|
|
339
|
+
*/
|
|
340
|
+
declare const VoteCreateDataSchema: z.ZodMiniObject<{
|
|
341
|
+
user_id: z.ZodMiniString<string>;
|
|
342
|
+
platform_id: z.ZodMiniString<string>;
|
|
343
|
+
weight: z.ZodMiniNumber<number>;
|
|
344
|
+
created_at: z.iso.ZodMiniISODate;
|
|
345
|
+
expires_at: z.iso.ZodMiniISODate;
|
|
346
|
+
project: z.ZodMiniObject<{
|
|
347
|
+
/**
|
|
348
|
+
* The project's Top.gg ID.
|
|
349
|
+
*/
|
|
350
|
+
id: z.ZodMiniString<string>;
|
|
351
|
+
/**
|
|
352
|
+
* The platform the project is on (e.g., "discord").
|
|
353
|
+
*/
|
|
354
|
+
platform: z.ZodMiniEnum<{
|
|
355
|
+
discord: "discord";
|
|
356
|
+
roblox: "roblox";
|
|
357
|
+
}>;
|
|
358
|
+
/**
|
|
359
|
+
* The platform-specific ID of the project (e.g., Discord Bot ID).
|
|
360
|
+
*/
|
|
361
|
+
platform_id: z.ZodMiniString<string>;
|
|
362
|
+
/**
|
|
363
|
+
* The type of project (e.g., "bot").
|
|
364
|
+
*/
|
|
365
|
+
type: z.ZodMiniEnum<{
|
|
366
|
+
bot: "bot";
|
|
367
|
+
server: "server";
|
|
368
|
+
game: "game";
|
|
369
|
+
}>;
|
|
370
|
+
}, z.core.$strip>;
|
|
371
|
+
user: z.ZodMiniObject<{
|
|
372
|
+
/**
|
|
373
|
+
* The user's Top.gg ID.
|
|
374
|
+
*/
|
|
375
|
+
id: z.ZodMiniString<string>;
|
|
376
|
+
/**
|
|
377
|
+
* The user's platform ID (e.g., Discord ID).
|
|
378
|
+
*/
|
|
379
|
+
platform_id: z.ZodMiniString<string>;
|
|
380
|
+
/**
|
|
381
|
+
* The user's username.
|
|
382
|
+
*/
|
|
383
|
+
name: z.ZodMiniString<string>;
|
|
384
|
+
/**
|
|
385
|
+
* The URL of the user's avatar.
|
|
386
|
+
*/
|
|
387
|
+
avatar_url: z.ZodMiniURL;
|
|
388
|
+
}, z.core.$strip>;
|
|
389
|
+
}, z.core.$strip>;
|
|
390
|
+
/**
|
|
391
|
+
* The payload delivered to your webhook endpoint when a user votes for your project and you have subscribed to the `vote.create` event.
|
|
392
|
+
*/
|
|
393
|
+
declare const VoteCreateWebhookPayloadSchema: z.ZodMiniObject<{
|
|
394
|
+
type: z.ZodMiniLiteral<"vote.create">;
|
|
395
|
+
data: z.ZodMiniObject<{
|
|
396
|
+
user_id: z.ZodMiniString<string>;
|
|
397
|
+
platform_id: z.ZodMiniString<string>;
|
|
398
|
+
weight: z.ZodMiniNumber<number>;
|
|
399
|
+
created_at: z.iso.ZodMiniISODate;
|
|
400
|
+
expires_at: z.iso.ZodMiniISODate;
|
|
401
|
+
project: z.ZodMiniObject<{
|
|
402
|
+
/**
|
|
403
|
+
* The project's Top.gg ID.
|
|
404
|
+
*/
|
|
405
|
+
id: z.ZodMiniString<string>;
|
|
406
|
+
/**
|
|
407
|
+
* The platform the project is on (e.g., "discord").
|
|
408
|
+
*/
|
|
409
|
+
platform: z.ZodMiniEnum<{
|
|
410
|
+
discord: "discord";
|
|
411
|
+
roblox: "roblox";
|
|
412
|
+
}>;
|
|
413
|
+
/**
|
|
414
|
+
* The platform-specific ID of the project (e.g., Discord Bot ID).
|
|
415
|
+
*/
|
|
416
|
+
platform_id: z.ZodMiniString<string>;
|
|
417
|
+
/**
|
|
418
|
+
* The type of project (e.g., "bot").
|
|
419
|
+
*/
|
|
420
|
+
type: z.ZodMiniEnum<{
|
|
421
|
+
bot: "bot";
|
|
422
|
+
server: "server";
|
|
423
|
+
game: "game";
|
|
424
|
+
}>;
|
|
425
|
+
}, z.core.$strip>;
|
|
426
|
+
user: z.ZodMiniObject<{
|
|
427
|
+
/**
|
|
428
|
+
* The user's Top.gg ID.
|
|
429
|
+
*/
|
|
430
|
+
id: z.ZodMiniString<string>;
|
|
431
|
+
/**
|
|
432
|
+
* The user's platform ID (e.g., Discord ID).
|
|
433
|
+
*/
|
|
434
|
+
platform_id: z.ZodMiniString<string>;
|
|
435
|
+
/**
|
|
436
|
+
* The user's username.
|
|
437
|
+
*/
|
|
438
|
+
name: z.ZodMiniString<string>;
|
|
439
|
+
/**
|
|
440
|
+
* The URL of the user's avatar.
|
|
441
|
+
*/
|
|
442
|
+
avatar_url: z.ZodMiniURL;
|
|
443
|
+
}, z.core.$strip>;
|
|
444
|
+
}, z.core.$strip>;
|
|
445
|
+
}, z.core.$strip>;
|
|
446
|
+
/**
|
|
447
|
+
* Data included in a webhook test event.
|
|
448
|
+
*/
|
|
449
|
+
declare const WebhookTestDataSchema: z.ZodMiniObject<{
|
|
450
|
+
/**
|
|
451
|
+
* A test user.
|
|
452
|
+
*/
|
|
453
|
+
user: z.ZodMiniObject<{
|
|
454
|
+
/**
|
|
455
|
+
* The user's Top.gg ID.
|
|
456
|
+
*/
|
|
457
|
+
id: z.ZodMiniString<string>;
|
|
458
|
+
/**
|
|
459
|
+
* The user's platform ID (e.g., Discord ID).
|
|
460
|
+
*/
|
|
461
|
+
platform_id: z.ZodMiniString<string>;
|
|
462
|
+
/**
|
|
463
|
+
* The user's username.
|
|
464
|
+
*/
|
|
465
|
+
name: z.ZodMiniString<string>;
|
|
466
|
+
/**
|
|
467
|
+
* The URL of the user's avatar.
|
|
468
|
+
*/
|
|
469
|
+
avatar_url: z.ZodMiniURL;
|
|
470
|
+
}, z.core.$strip>;
|
|
471
|
+
/**
|
|
472
|
+
* A test project.
|
|
473
|
+
*/
|
|
474
|
+
project: z.ZodMiniObject<{
|
|
475
|
+
/**
|
|
476
|
+
* The project's Top.gg ID.
|
|
477
|
+
*/
|
|
478
|
+
id: z.ZodMiniString<string>;
|
|
479
|
+
/**
|
|
480
|
+
* The platform the project is on (e.g., "discord").
|
|
481
|
+
*/
|
|
482
|
+
platform: z.ZodMiniEnum<{
|
|
483
|
+
discord: "discord";
|
|
484
|
+
roblox: "roblox";
|
|
485
|
+
}>;
|
|
486
|
+
/**
|
|
487
|
+
* The platform-specific ID of the project (e.g., Discord Bot ID).
|
|
488
|
+
*/
|
|
489
|
+
platform_id: z.ZodMiniString<string>;
|
|
490
|
+
/**
|
|
491
|
+
* The type of project (e.g., "bot").
|
|
492
|
+
*/
|
|
493
|
+
type: z.ZodMiniEnum<{
|
|
494
|
+
bot: "bot";
|
|
495
|
+
server: "server";
|
|
496
|
+
game: "game";
|
|
497
|
+
}>;
|
|
498
|
+
}, z.core.$strip>;
|
|
499
|
+
}, z.core.$strip>;
|
|
500
|
+
/**
|
|
501
|
+
* The payload delivered to your webhook endpoint when you send a test webhook from the dashboard or via the API.
|
|
502
|
+
*/
|
|
503
|
+
declare const WebhookTestWebhookPayloadSchema: z.ZodMiniObject<{
|
|
504
|
+
type: z.ZodMiniLiteral<"webhook.test">;
|
|
505
|
+
data: z.ZodMiniObject<{
|
|
506
|
+
/**
|
|
507
|
+
* A test user.
|
|
508
|
+
*/
|
|
509
|
+
user: z.ZodMiniObject<{
|
|
510
|
+
/**
|
|
511
|
+
* The user's Top.gg ID.
|
|
512
|
+
*/
|
|
513
|
+
id: z.ZodMiniString<string>;
|
|
514
|
+
/**
|
|
515
|
+
* The user's platform ID (e.g., Discord ID).
|
|
516
|
+
*/
|
|
517
|
+
platform_id: z.ZodMiniString<string>;
|
|
518
|
+
/**
|
|
519
|
+
* The user's username.
|
|
520
|
+
*/
|
|
521
|
+
name: z.ZodMiniString<string>;
|
|
522
|
+
/**
|
|
523
|
+
* The URL of the user's avatar.
|
|
524
|
+
*/
|
|
525
|
+
avatar_url: z.ZodMiniURL;
|
|
526
|
+
}, z.core.$strip>;
|
|
527
|
+
/**
|
|
528
|
+
* A test project.
|
|
529
|
+
*/
|
|
530
|
+
project: z.ZodMiniObject<{
|
|
531
|
+
/**
|
|
532
|
+
* The project's Top.gg ID.
|
|
533
|
+
*/
|
|
534
|
+
id: z.ZodMiniString<string>;
|
|
535
|
+
/**
|
|
536
|
+
* The platform the project is on (e.g., "discord").
|
|
537
|
+
*/
|
|
538
|
+
platform: z.ZodMiniEnum<{
|
|
539
|
+
discord: "discord";
|
|
540
|
+
roblox: "roblox";
|
|
541
|
+
}>;
|
|
542
|
+
/**
|
|
543
|
+
* The platform-specific ID of the project (e.g., Discord Bot ID).
|
|
544
|
+
*/
|
|
545
|
+
platform_id: z.ZodMiniString<string>;
|
|
546
|
+
/**
|
|
547
|
+
* The type of project (e.g., "bot").
|
|
548
|
+
*/
|
|
549
|
+
type: z.ZodMiniEnum<{
|
|
550
|
+
bot: "bot";
|
|
551
|
+
server: "server";
|
|
552
|
+
game: "game";
|
|
553
|
+
}>;
|
|
554
|
+
}, z.core.$strip>;
|
|
555
|
+
}, z.core.$strip>;
|
|
556
|
+
}, z.core.$strip>;
|
|
557
|
+
/**
|
|
558
|
+
* Response schema for getting the authenticated project.
|
|
559
|
+
*
|
|
560
|
+
* - GET `/v1/projects/@me`
|
|
561
|
+
*
|
|
562
|
+
* @see https://docs.top.gg/docs/API/v1/projects#get-current-project
|
|
563
|
+
*/
|
|
564
|
+
declare const GetProjectResponseSchema: z.ZodMiniObject<{
|
|
565
|
+
id: z.ZodMiniString<string>;
|
|
566
|
+
platform: z.ZodMiniEnum<{
|
|
567
|
+
discord: "discord";
|
|
568
|
+
roblox: "roblox";
|
|
569
|
+
}>;
|
|
570
|
+
platform_id: z.ZodMiniString<string>;
|
|
571
|
+
type: z.ZodMiniEnum<{
|
|
572
|
+
bot: "bot";
|
|
573
|
+
server: "server";
|
|
574
|
+
game: "game";
|
|
575
|
+
}>;
|
|
576
|
+
name: z.ZodMiniString<string>;
|
|
577
|
+
headline: z.ZodMiniString<string>;
|
|
578
|
+
tags: z.ZodMiniArray<z.ZodMiniString<string>>;
|
|
579
|
+
votes: z.ZodMiniNumber<number>;
|
|
580
|
+
votes_total: z.ZodMiniNumber<number>;
|
|
581
|
+
review_score: z.ZodMiniNumber<number>;
|
|
582
|
+
review_count: z.ZodMiniNumber<number>;
|
|
583
|
+
}, z.core.$strip>;
|
|
584
|
+
/**
|
|
585
|
+
* Query parameters for getting project votes.
|
|
586
|
+
*
|
|
587
|
+
* - GET `/v1/projects/@me/votes`
|
|
588
|
+
*
|
|
589
|
+
* Either `cursor` or `startDate` must be provided.
|
|
590
|
+
*
|
|
591
|
+
* @see https://docs.top.gg/docs/API/v1/projects/#get-votes
|
|
592
|
+
*/
|
|
593
|
+
declare const GetProjectVotesQuerySchema: z.ZodMiniObject<{
|
|
594
|
+
/**
|
|
595
|
+
* Pagination cursor for fetching the next page of votes. if provided, `startDate` is ignored.
|
|
596
|
+
*
|
|
597
|
+
* From the previous response.
|
|
598
|
+
*/
|
|
599
|
+
cursor: z.ZodMiniOptional<z.ZodMiniString<string>>;
|
|
600
|
+
/**
|
|
601
|
+
* The start date for fetching votes. Only votes created after this date will be returned. Required if `cursor` is not provided.
|
|
602
|
+
*
|
|
603
|
+
* Maximum 1 year in the past.
|
|
604
|
+
*
|
|
605
|
+
* ISO 8601 date string.
|
|
606
|
+
*/
|
|
607
|
+
startDate: z.ZodMiniOptional<z.iso.ZodMiniISODate>;
|
|
608
|
+
}, z.core.$strip>;
|
|
609
|
+
/**
|
|
610
|
+
* Response schema for the Get Project Votes endpoint.
|
|
611
|
+
*
|
|
612
|
+
* - GET `/v1/projects/@me/votes`
|
|
613
|
+
*
|
|
614
|
+
* @see https://docs.top.gg/docs/API/v1/projects/#get-votes
|
|
615
|
+
*/
|
|
616
|
+
declare const GetProjectVotesResponseSchema: z.ZodMiniObject<{
|
|
617
|
+
/**
|
|
618
|
+
* Cursor for fetching the next page of votes.
|
|
619
|
+
*/
|
|
620
|
+
cursor: z.ZodMiniString<string>;
|
|
621
|
+
/**
|
|
622
|
+
* An array of votes for the project.
|
|
623
|
+
*/
|
|
624
|
+
data: z.ZodMiniArray<z.ZodMiniObject<{
|
|
625
|
+
/**
|
|
626
|
+
* The Top.gg ID of the user who voted.
|
|
627
|
+
*/
|
|
628
|
+
user_id: z.ZodMiniString<string>;
|
|
629
|
+
/**
|
|
630
|
+
* The user's ID on the project's platform (e.g., Discord ID).
|
|
631
|
+
*/
|
|
632
|
+
platform_id: z.ZodMiniString<string>;
|
|
633
|
+
/**
|
|
634
|
+
* The amount of votes this vote counted for.
|
|
635
|
+
*/
|
|
636
|
+
weight: z.ZodMiniNumber<number>;
|
|
637
|
+
/**
|
|
638
|
+
* The timestamp of when the user voted.
|
|
639
|
+
*/
|
|
640
|
+
created_at: z.iso.ZodMiniISODate;
|
|
641
|
+
/**
|
|
642
|
+
* The timestamp of when the vote expires (i.e., when the user can vote again).
|
|
643
|
+
* This is typically 12 hours after the `created_at` timestamp, but may vary based on the user's voting history and other factors.
|
|
644
|
+
*/
|
|
645
|
+
expires_at: z.iso.ZodMiniISODate;
|
|
646
|
+
}, z.core.$strip>>;
|
|
647
|
+
}, z.core.$strip>;
|
|
648
|
+
/**
|
|
649
|
+
* Query parameters for getting vote status by user.
|
|
650
|
+
*
|
|
651
|
+
* - GET `/v1/projects/@me/votes/:user_id`
|
|
652
|
+
*
|
|
653
|
+
* @see https://docs.top.gg/docs/API/v1/projects/#get-vote-status-by-user
|
|
654
|
+
*/
|
|
655
|
+
declare const GetVoteStatusByUserQuerySchema: z.ZodMiniObject<{
|
|
656
|
+
/**
|
|
657
|
+
* The source of the user ID. Defaults to "topgg".
|
|
658
|
+
*/
|
|
659
|
+
source: z.ZodMiniOptional<z.ZodMiniEnum<{
|
|
660
|
+
discord: "discord";
|
|
661
|
+
topgg: "topgg";
|
|
662
|
+
}>>;
|
|
663
|
+
}, z.core.$strip>;
|
|
664
|
+
/**
|
|
665
|
+
* Response schema for the Get Vote Status By User endpoint.
|
|
666
|
+
*
|
|
667
|
+
* - GET `/v1/projects/@me/votes/:user_id`
|
|
668
|
+
*
|
|
669
|
+
* @see https://docs.top.gg/docs/API/v1/projects/#get-vote-status-by-user
|
|
670
|
+
*/
|
|
671
|
+
declare const GetVoteStatusByUserResponseSchema: z.ZodMiniObject<{
|
|
672
|
+
/**
|
|
673
|
+
* The timestamp of when the user last voted.
|
|
674
|
+
*/
|
|
675
|
+
created_at: z.iso.ZodMiniISODate;
|
|
676
|
+
/**
|
|
677
|
+
* The timestamp of when the user's vote expires (i.e., when they can vote again).
|
|
678
|
+
*/
|
|
679
|
+
expires_at: z.iso.ZodMiniISODate;
|
|
680
|
+
/**
|
|
681
|
+
* The amount of votes this vote counted for.
|
|
682
|
+
*/
|
|
683
|
+
weight: z.ZodMiniNumber<number>;
|
|
684
|
+
}, z.core.$strip>;
|
|
685
|
+
//#endregion
|
|
686
|
+
export { BaseProjectSchema, ErrorSchema, GetProjectResponseSchema, GetProjectVotesQuerySchema, GetProjectVotesResponseSchema, GetVoteStatusByUserQuerySchema, GetVoteStatusByUserResponseSchema, IntegrationCreateDataSchema, IntegrationCreateResponseSchema, IntegrationCreateWebhookPayloadSchema, IntegrationDeleteDataSchema, IntegrationDeleteWebhookPayloadSchema, IntegrationSupportedWebhookScopesSchema, ProjectPlatformTypeSchema, ProjectTypeSchema, ProjectVoteSchema, UserSchema, UserSourceSchema, VoteCreateDataSchema, VoteCreateWebhookPayloadSchema, VoteSchema, WebhookEventTypeSchema, WebhookPayloadBaseSchema, WebhookTestDataSchema, WebhookTestWebhookPayloadSchema };
|
|
687
|
+
//# sourceMappingURL=validators.d.ts.map
|