@devpad/api 2.0.0 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-5X36WMYQ.js +130 -0
- package/dist/chunk-FOO5XXY5.js +318 -0
- package/dist/chunk-WTGVONUB.js +166 -0
- package/dist/errors.d-C73AkrdX.d.ts +159 -0
- package/dist/index.d.ts +541 -13
- package/dist/index.js +1345 -6
- package/dist/media.d-R87HGuRp.d.ts +1047 -0
- package/dist/schema/blog.d.ts +5635 -0
- package/dist/schema/blog.js +348 -0
- package/dist/schema/index.d.ts +7 -0
- package/dist/schema/index.js +186 -0
- package/dist/schema/media.d.ts +1676 -0
- package/dist/schema/media.js +776 -0
- package/dist/schema.d-BceDyQED.d.ts +3187 -0
- package/dist/types.d-1hBObc_N.d.ts +684 -0
- package/dist/types.d-CoHRMrYJ.d.ts +539 -0
- package/dist/types.d-UV8B6hPN.d.ts +6146 -0
- package/package.json +17 -4
- package/dist/api-client.d.ts +0 -470
- package/dist/api-client.d.ts.map +0 -1
- package/dist/api-client.js +0 -530
- package/dist/error-handlers.d.ts +0 -55
- package/dist/error-handlers.d.ts.map +0 -1
- package/dist/error-handlers.js +0 -217
- package/dist/errors.d.ts +0 -19
- package/dist/errors.d.ts.map +0 -1
- package/dist/errors.js +0 -28
- package/dist/index.d.ts.map +0 -1
- package/dist/request.d.ts +0 -49
- package/dist/request.d.ts.map +0 -1
- package/dist/request.js +0 -193
- package/dist/result.d.ts +0 -10
- package/dist/result.d.ts.map +0 -1
- package/dist/result.js +0 -11
- package/dist/tools.d.ts +0 -84
- package/dist/tools.d.ts.map +0 -1
- package/dist/tools.js +0 -474
|
@@ -0,0 +1,776 @@
|
|
|
1
|
+
import {
|
|
2
|
+
apiError,
|
|
3
|
+
authExpired,
|
|
4
|
+
badRequest,
|
|
5
|
+
configureErrorLogging,
|
|
6
|
+
conflict,
|
|
7
|
+
dbError,
|
|
8
|
+
encryptionError,
|
|
9
|
+
errors,
|
|
10
|
+
forbidden,
|
|
11
|
+
githubError,
|
|
12
|
+
isApiError,
|
|
13
|
+
isAuthExpiredError,
|
|
14
|
+
isBadRequestError,
|
|
15
|
+
isConflictError,
|
|
16
|
+
isDatabaseError,
|
|
17
|
+
isEncryptionError,
|
|
18
|
+
isForbiddenError,
|
|
19
|
+
isGithubError,
|
|
20
|
+
isNetworkError,
|
|
21
|
+
isNotFoundError,
|
|
22
|
+
isParseError,
|
|
23
|
+
isRateLimitedError,
|
|
24
|
+
isRetryableError,
|
|
25
|
+
isScanError,
|
|
26
|
+
isServiceError,
|
|
27
|
+
isStoreError,
|
|
28
|
+
isUnauthorizedError,
|
|
29
|
+
isValidationError,
|
|
30
|
+
networkError,
|
|
31
|
+
notFound,
|
|
32
|
+
parseError,
|
|
33
|
+
rateLimited,
|
|
34
|
+
scanError,
|
|
35
|
+
storeError,
|
|
36
|
+
unauthorized,
|
|
37
|
+
validation
|
|
38
|
+
} from "../chunk-5X36WMYQ.js";
|
|
39
|
+
import {
|
|
40
|
+
api_keys
|
|
41
|
+
} from "../chunk-FOO5XXY5.js";
|
|
42
|
+
|
|
43
|
+
// ../schema/dist/database/media.js
|
|
44
|
+
import { index, integer, sqliteTable, text, uniqueIndex } from "drizzle-orm/sqlite-core";
|
|
45
|
+
import { corpus_snapshots } from "@f0rbit/corpus/schema";
|
|
46
|
+
var media_profiles = sqliteTable("media_profiles", {
|
|
47
|
+
id: text("id").primaryKey(),
|
|
48
|
+
user_id: text("user_id").notNull(),
|
|
49
|
+
slug: text("slug").notNull(),
|
|
50
|
+
name: text("name").notNull(),
|
|
51
|
+
description: text("description"),
|
|
52
|
+
theme: text("theme"),
|
|
53
|
+
created_at: text("created_at").notNull(),
|
|
54
|
+
updated_at: text("updated_at").notNull()
|
|
55
|
+
}, (table) => ({
|
|
56
|
+
user_idx: index("idx_media_profiles_user").on(table.user_id),
|
|
57
|
+
user_slug_idx: uniqueIndex("idx_media_profiles_user_slug").on(table.user_id, table.slug)
|
|
58
|
+
}));
|
|
59
|
+
var media_accounts = sqliteTable("media_accounts", {
|
|
60
|
+
id: text("id").primaryKey(),
|
|
61
|
+
profile_id: text("profile_id").notNull().references(() => media_profiles.id, { onDelete: "cascade" }),
|
|
62
|
+
platform: text("platform").notNull().$type(),
|
|
63
|
+
platform_user_id: text("platform_user_id"),
|
|
64
|
+
platform_username: text("platform_username"),
|
|
65
|
+
access_token_encrypted: text("access_token_encrypted").notNull(),
|
|
66
|
+
refresh_token_encrypted: text("refresh_token_encrypted"),
|
|
67
|
+
token_expires_at: text("token_expires_at"),
|
|
68
|
+
is_active: integer("is_active", { mode: "boolean" }).default(true),
|
|
69
|
+
last_fetched_at: text("last_fetched_at"),
|
|
70
|
+
created_at: text("created_at").notNull(),
|
|
71
|
+
updated_at: text("updated_at").notNull()
|
|
72
|
+
}, (table) => ({
|
|
73
|
+
profile_idx: index("idx_media_accounts_profile").on(table.profile_id),
|
|
74
|
+
profile_platform_user_idx: uniqueIndex("idx_media_accounts_profile_platform_user").on(table.profile_id, table.platform, table.platform_user_id)
|
|
75
|
+
}));
|
|
76
|
+
var media_rate_limits = sqliteTable("media_rate_limits", {
|
|
77
|
+
id: text("id").primaryKey(),
|
|
78
|
+
account_id: text("account_id").notNull().references(() => media_accounts.id),
|
|
79
|
+
remaining: integer("remaining"),
|
|
80
|
+
limit_total: integer("limit_total"),
|
|
81
|
+
reset_at: text("reset_at"),
|
|
82
|
+
consecutive_failures: integer("consecutive_failures").default(0),
|
|
83
|
+
last_failure_at: text("last_failure_at"),
|
|
84
|
+
circuit_open_until: text("circuit_open_until"),
|
|
85
|
+
updated_at: text("updated_at").notNull()
|
|
86
|
+
}, (table) => ({
|
|
87
|
+
account_idx: uniqueIndex("idx_media_rate_limits_account").on(table.account_id)
|
|
88
|
+
}));
|
|
89
|
+
var media_account_settings = sqliteTable("media_account_settings", {
|
|
90
|
+
id: text("id").primaryKey(),
|
|
91
|
+
account_id: text("account_id").notNull().references(() => media_accounts.id, { onDelete: "cascade" }),
|
|
92
|
+
setting_key: text("setting_key").notNull(),
|
|
93
|
+
setting_value: text("setting_value").notNull(),
|
|
94
|
+
created_at: text("created_at").notNull(),
|
|
95
|
+
updated_at: text("updated_at").notNull()
|
|
96
|
+
}, (table) => ({
|
|
97
|
+
account_key_idx: uniqueIndex("idx_media_account_settings_unique").on(table.account_id, table.setting_key),
|
|
98
|
+
account_idx: index("idx_media_account_settings_account").on(table.account_id)
|
|
99
|
+
}));
|
|
100
|
+
var media_profile_filters = sqliteTable("media_profile_filters", {
|
|
101
|
+
id: text("id").primaryKey(),
|
|
102
|
+
profile_id: text("profile_id").notNull().references(() => media_profiles.id, { onDelete: "cascade" }),
|
|
103
|
+
account_id: text("account_id").notNull().references(() => media_accounts.id, { onDelete: "cascade" }),
|
|
104
|
+
filter_type: text("filter_type").notNull().$type(),
|
|
105
|
+
filter_key: text("filter_key").notNull(),
|
|
106
|
+
filter_value: text("filter_value").notNull(),
|
|
107
|
+
created_at: text("created_at").notNull(),
|
|
108
|
+
updated_at: text("updated_at").notNull()
|
|
109
|
+
}, (table) => ({
|
|
110
|
+
profile_idx: index("idx_media_profile_filters_profile").on(table.profile_id),
|
|
111
|
+
account_idx: index("idx_media_profile_filters_account").on(table.account_id)
|
|
112
|
+
}));
|
|
113
|
+
var media_platform_credentials = sqliteTable("media_platform_credentials", {
|
|
114
|
+
id: text("id").primaryKey(),
|
|
115
|
+
profile_id: text("profile_id").notNull().references(() => media_profiles.id, { onDelete: "cascade" }),
|
|
116
|
+
platform: text("platform").notNull().$type(),
|
|
117
|
+
client_id: text("client_id").notNull(),
|
|
118
|
+
client_secret_encrypted: text("client_secret_encrypted").notNull(),
|
|
119
|
+
redirect_uri: text("redirect_uri"),
|
|
120
|
+
metadata: text("metadata"),
|
|
121
|
+
is_verified: integer("is_verified", { mode: "boolean" }).default(false),
|
|
122
|
+
created_at: text("created_at").notNull(),
|
|
123
|
+
updated_at: text("updated_at").notNull()
|
|
124
|
+
}, (table) => ({
|
|
125
|
+
profile_platform_idx: uniqueIndex("idx_platform_credentials_unique").on(table.profile_id, table.platform),
|
|
126
|
+
profile_idx: index("idx_platform_credentials_profile").on(table.profile_id)
|
|
127
|
+
}));
|
|
128
|
+
|
|
129
|
+
// ../schema/dist/media/branded.js
|
|
130
|
+
var userId = (id) => id;
|
|
131
|
+
var accountId = (id) => id;
|
|
132
|
+
var profileId = (id) => id;
|
|
133
|
+
var connectionId = (id) => id;
|
|
134
|
+
var isValidId = (id) => typeof id === "string" && id.length > 0;
|
|
135
|
+
|
|
136
|
+
// ../schema/dist/media/platforms/github.js
|
|
137
|
+
import { z } from "zod";
|
|
138
|
+
var GitHubRepoCommitSchema = z.object({
|
|
139
|
+
sha: z.string(),
|
|
140
|
+
message: z.string(),
|
|
141
|
+
author_name: z.string(),
|
|
142
|
+
author_email: z.string(),
|
|
143
|
+
author_date: z.string().datetime(),
|
|
144
|
+
committer_name: z.string(),
|
|
145
|
+
committer_email: z.string(),
|
|
146
|
+
committer_date: z.string().datetime(),
|
|
147
|
+
url: z.string().url(),
|
|
148
|
+
branch: z.string(),
|
|
149
|
+
additions: z.number().optional(),
|
|
150
|
+
deletions: z.number().optional(),
|
|
151
|
+
files_changed: z.number().optional()
|
|
152
|
+
});
|
|
153
|
+
var GitHubRepoCommitsStoreSchema = z.object({
|
|
154
|
+
owner: z.string(),
|
|
155
|
+
repo: z.string(),
|
|
156
|
+
branches: z.array(z.string()),
|
|
157
|
+
commits: z.array(GitHubRepoCommitSchema),
|
|
158
|
+
total_commits: z.number(),
|
|
159
|
+
fetched_at: z.string().datetime()
|
|
160
|
+
});
|
|
161
|
+
var GitHubRepoMetaSchema = z.object({
|
|
162
|
+
owner: z.string(),
|
|
163
|
+
name: z.string(),
|
|
164
|
+
full_name: z.string(),
|
|
165
|
+
default_branch: z.string(),
|
|
166
|
+
branches: z.array(z.string()),
|
|
167
|
+
is_private: z.boolean(),
|
|
168
|
+
pushed_at: z.string().datetime().nullable(),
|
|
169
|
+
updated_at: z.string().datetime()
|
|
170
|
+
});
|
|
171
|
+
var GitHubMetaStoreSchema = z.object({
|
|
172
|
+
username: z.string(),
|
|
173
|
+
repositories: z.array(GitHubRepoMetaSchema),
|
|
174
|
+
total_repos_available: z.number(),
|
|
175
|
+
repos_fetched: z.number(),
|
|
176
|
+
fetched_at: z.string().datetime()
|
|
177
|
+
});
|
|
178
|
+
var GitHubRepoPRSchema = z.object({
|
|
179
|
+
id: z.number(),
|
|
180
|
+
number: z.number(),
|
|
181
|
+
title: z.string(),
|
|
182
|
+
body: z.string().nullable(),
|
|
183
|
+
state: z.enum(["open", "closed", "merged"]),
|
|
184
|
+
url: z.string().url(),
|
|
185
|
+
created_at: z.string().datetime(),
|
|
186
|
+
updated_at: z.string().datetime(),
|
|
187
|
+
closed_at: z.string().datetime().nullable(),
|
|
188
|
+
merged_at: z.string().datetime().nullable(),
|
|
189
|
+
head_ref: z.string(),
|
|
190
|
+
base_ref: z.string(),
|
|
191
|
+
commit_shas: z.array(z.string()),
|
|
192
|
+
merge_commit_sha: z.string().nullable(),
|
|
193
|
+
author_login: z.string(),
|
|
194
|
+
author_avatar_url: z.string().url().optional(),
|
|
195
|
+
additions: z.number().optional(),
|
|
196
|
+
deletions: z.number().optional(),
|
|
197
|
+
changed_files: z.number().optional()
|
|
198
|
+
});
|
|
199
|
+
var GitHubRepoPRsStoreSchema = z.object({
|
|
200
|
+
owner: z.string(),
|
|
201
|
+
repo: z.string(),
|
|
202
|
+
pull_requests: z.array(GitHubRepoPRSchema),
|
|
203
|
+
total_prs: z.number(),
|
|
204
|
+
fetched_at: z.string().datetime()
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
// ../schema/dist/media/platforms/reddit.js
|
|
208
|
+
import { z as z2 } from "zod";
|
|
209
|
+
var RedditCommentSchema = z2.object({
|
|
210
|
+
id: z2.string(),
|
|
211
|
+
name: z2.string(),
|
|
212
|
+
body: z2.string(),
|
|
213
|
+
body_html: z2.string().optional(),
|
|
214
|
+
permalink: z2.string(),
|
|
215
|
+
link_id: z2.string(),
|
|
216
|
+
link_title: z2.string(),
|
|
217
|
+
link_permalink: z2.string(),
|
|
218
|
+
subreddit: z2.string(),
|
|
219
|
+
subreddit_prefixed: z2.string(),
|
|
220
|
+
author: z2.string(),
|
|
221
|
+
created_utc: z2.number(),
|
|
222
|
+
score: z2.number(),
|
|
223
|
+
is_submitter: z2.boolean().default(false),
|
|
224
|
+
stickied: z2.boolean().default(false),
|
|
225
|
+
edited: z2.union([z2.boolean(), z2.number()]).default(false),
|
|
226
|
+
parent_id: z2.string()
|
|
227
|
+
});
|
|
228
|
+
var RedditCommentsStoreSchema = z2.object({
|
|
229
|
+
username: z2.string(),
|
|
230
|
+
comments: z2.array(RedditCommentSchema),
|
|
231
|
+
total_comments: z2.number(),
|
|
232
|
+
fetched_at: z2.string().datetime()
|
|
233
|
+
});
|
|
234
|
+
var RedditMetaStoreSchema = z2.object({
|
|
235
|
+
username: z2.string(),
|
|
236
|
+
user_id: z2.string(),
|
|
237
|
+
icon_img: z2.string().url().optional(),
|
|
238
|
+
total_karma: z2.number(),
|
|
239
|
+
link_karma: z2.number(),
|
|
240
|
+
comment_karma: z2.number(),
|
|
241
|
+
created_utc: z2.number(),
|
|
242
|
+
is_gold: z2.boolean().default(false),
|
|
243
|
+
subreddits_active: z2.array(z2.string()).default([]),
|
|
244
|
+
fetched_at: z2.string().datetime()
|
|
245
|
+
});
|
|
246
|
+
var RedditPostSchema = z2.object({
|
|
247
|
+
id: z2.string(),
|
|
248
|
+
name: z2.string(),
|
|
249
|
+
title: z2.string(),
|
|
250
|
+
selftext: z2.string().default(""),
|
|
251
|
+
url: z2.string().url(),
|
|
252
|
+
permalink: z2.string(),
|
|
253
|
+
subreddit: z2.string(),
|
|
254
|
+
subreddit_prefixed: z2.string(),
|
|
255
|
+
author: z2.string(),
|
|
256
|
+
created_utc: z2.number(),
|
|
257
|
+
score: z2.number(),
|
|
258
|
+
upvote_ratio: z2.number().optional(),
|
|
259
|
+
num_comments: z2.number(),
|
|
260
|
+
is_self: z2.boolean(),
|
|
261
|
+
is_video: z2.boolean().default(false),
|
|
262
|
+
thumbnail: z2.string().optional(),
|
|
263
|
+
link_flair_text: z2.string().nullable().optional(),
|
|
264
|
+
over_18: z2.boolean().default(false),
|
|
265
|
+
spoiler: z2.boolean().default(false),
|
|
266
|
+
stickied: z2.boolean().default(false),
|
|
267
|
+
locked: z2.boolean().default(false),
|
|
268
|
+
archived: z2.boolean().default(false)
|
|
269
|
+
});
|
|
270
|
+
var RedditPostsStoreSchema = z2.object({
|
|
271
|
+
username: z2.string(),
|
|
272
|
+
posts: z2.array(RedditPostSchema),
|
|
273
|
+
total_posts: z2.number(),
|
|
274
|
+
fetched_at: z2.string().datetime()
|
|
275
|
+
});
|
|
276
|
+
|
|
277
|
+
// ../schema/dist/media/platforms/twitter.js
|
|
278
|
+
import { z as z3 } from "zod";
|
|
279
|
+
var TwitterUserMetricsSchema = z3.object({
|
|
280
|
+
followers_count: z3.number(),
|
|
281
|
+
following_count: z3.number(),
|
|
282
|
+
tweet_count: z3.number(),
|
|
283
|
+
listed_count: z3.number()
|
|
284
|
+
});
|
|
285
|
+
var TwitterMetaStoreSchema = z3.object({
|
|
286
|
+
id: z3.string(),
|
|
287
|
+
username: z3.string(),
|
|
288
|
+
name: z3.string(),
|
|
289
|
+
description: z3.string().optional(),
|
|
290
|
+
profile_image_url: z3.string().url().optional(),
|
|
291
|
+
profile_banner_url: z3.string().url().optional(),
|
|
292
|
+
url: z3.string().url().optional(),
|
|
293
|
+
location: z3.string().optional(),
|
|
294
|
+
created_at: z3.string().datetime(),
|
|
295
|
+
verified: z3.boolean().default(false),
|
|
296
|
+
verified_type: z3.enum(["blue", "business", "government", "none"]).default("none"),
|
|
297
|
+
protected: z3.boolean().default(false),
|
|
298
|
+
public_metrics: TwitterUserMetricsSchema,
|
|
299
|
+
pinned_tweet_id: z3.string().optional(),
|
|
300
|
+
fetched_at: z3.string().datetime()
|
|
301
|
+
});
|
|
302
|
+
var TweetMetricsSchema = z3.object({
|
|
303
|
+
retweet_count: z3.number().default(0),
|
|
304
|
+
reply_count: z3.number().default(0),
|
|
305
|
+
like_count: z3.number().default(0),
|
|
306
|
+
quote_count: z3.number().default(0),
|
|
307
|
+
impression_count: z3.number().optional(),
|
|
308
|
+
bookmark_count: z3.number().optional()
|
|
309
|
+
});
|
|
310
|
+
var TweetMediaSchema = z3.object({
|
|
311
|
+
media_key: z3.string(),
|
|
312
|
+
type: z3.enum(["photo", "video", "animated_gif"]),
|
|
313
|
+
url: z3.string().url().optional(),
|
|
314
|
+
preview_image_url: z3.string().url().optional(),
|
|
315
|
+
alt_text: z3.string().optional(),
|
|
316
|
+
duration_ms: z3.number().optional(),
|
|
317
|
+
width: z3.number().optional(),
|
|
318
|
+
height: z3.number().optional()
|
|
319
|
+
});
|
|
320
|
+
var TweetUrlSchema = z3.object({
|
|
321
|
+
start: z3.number(),
|
|
322
|
+
end: z3.number(),
|
|
323
|
+
url: z3.string(),
|
|
324
|
+
expanded_url: z3.string().optional(),
|
|
325
|
+
display_url: z3.string().optional(),
|
|
326
|
+
title: z3.string().optional(),
|
|
327
|
+
description: z3.string().optional()
|
|
328
|
+
});
|
|
329
|
+
var TwitterTweetSchema = z3.object({
|
|
330
|
+
id: z3.string(),
|
|
331
|
+
text: z3.string(),
|
|
332
|
+
created_at: z3.string().datetime(),
|
|
333
|
+
author_id: z3.string(),
|
|
334
|
+
conversation_id: z3.string().optional(),
|
|
335
|
+
in_reply_to_user_id: z3.string().optional(),
|
|
336
|
+
public_metrics: TweetMetricsSchema,
|
|
337
|
+
possibly_sensitive: z3.boolean().default(false),
|
|
338
|
+
lang: z3.string().optional(),
|
|
339
|
+
source: z3.string().optional(),
|
|
340
|
+
referenced_tweets: z3.array(z3.object({
|
|
341
|
+
type: z3.enum(["retweeted", "quoted", "replied_to"]),
|
|
342
|
+
id: z3.string()
|
|
343
|
+
})).optional(),
|
|
344
|
+
attachments: z3.object({
|
|
345
|
+
media_keys: z3.array(z3.string()).optional(),
|
|
346
|
+
poll_ids: z3.array(z3.string()).optional()
|
|
347
|
+
}).optional(),
|
|
348
|
+
entities: z3.object({
|
|
349
|
+
urls: z3.array(TweetUrlSchema).optional(),
|
|
350
|
+
mentions: z3.array(z3.object({
|
|
351
|
+
start: z3.number(),
|
|
352
|
+
end: z3.number(),
|
|
353
|
+
username: z3.string(),
|
|
354
|
+
id: z3.string()
|
|
355
|
+
})).optional(),
|
|
356
|
+
hashtags: z3.array(z3.object({
|
|
357
|
+
start: z3.number(),
|
|
358
|
+
end: z3.number(),
|
|
359
|
+
tag: z3.string()
|
|
360
|
+
})).optional()
|
|
361
|
+
}).optional()
|
|
362
|
+
});
|
|
363
|
+
var TwitterTweetsStoreSchema = z3.object({
|
|
364
|
+
user_id: z3.string(),
|
|
365
|
+
username: z3.string(),
|
|
366
|
+
tweets: z3.array(TwitterTweetSchema),
|
|
367
|
+
media: z3.array(TweetMediaSchema).default([]),
|
|
368
|
+
total_tweets: z3.number(),
|
|
369
|
+
oldest_tweet_id: z3.string().optional(),
|
|
370
|
+
newest_tweet_id: z3.string().optional(),
|
|
371
|
+
fetched_at: z3.string().datetime()
|
|
372
|
+
});
|
|
373
|
+
|
|
374
|
+
// ../schema/dist/media/platforms.js
|
|
375
|
+
import { z as z4 } from "zod";
|
|
376
|
+
var PLATFORMS = ["github", "bluesky", "youtube", "devpad", "reddit", "twitter"];
|
|
377
|
+
var PlatformSchema = z4.enum(PLATFORMS);
|
|
378
|
+
var MULTI_STORE_PLATFORMS = ["github", "reddit", "twitter"];
|
|
379
|
+
var isMultiStorePlatform = (p) => MULTI_STORE_PLATFORMS.includes(p);
|
|
380
|
+
var FetchedAtSchema = z4.object({
|
|
381
|
+
fetched_at: z4.string().datetime()
|
|
382
|
+
});
|
|
383
|
+
var GitHubRepoSchema = z4.object({
|
|
384
|
+
id: z4.number(),
|
|
385
|
+
name: z4.string(),
|
|
386
|
+
url: z4.string()
|
|
387
|
+
});
|
|
388
|
+
var GitHubBaseEventSchema = z4.object({
|
|
389
|
+
id: z4.string(),
|
|
390
|
+
type: z4.string(),
|
|
391
|
+
created_at: z4.string(),
|
|
392
|
+
repo: GitHubRepoSchema,
|
|
393
|
+
payload: z4.record(z4.unknown())
|
|
394
|
+
});
|
|
395
|
+
var GitHubEventSchema = GitHubBaseEventSchema;
|
|
396
|
+
var GitHubExtendedCommitSchema = z4.object({
|
|
397
|
+
sha: z4.string(),
|
|
398
|
+
message: z4.string(),
|
|
399
|
+
date: z4.string(),
|
|
400
|
+
url: z4.string(),
|
|
401
|
+
repo: z4.string(),
|
|
402
|
+
branch: z4.string()
|
|
403
|
+
});
|
|
404
|
+
var GitHubPullRequestSchema = z4.object({
|
|
405
|
+
id: z4.number(),
|
|
406
|
+
number: z4.number(),
|
|
407
|
+
title: z4.string(),
|
|
408
|
+
state: z4.enum(["open", "closed", "merged"]),
|
|
409
|
+
action: z4.string(),
|
|
410
|
+
url: z4.string(),
|
|
411
|
+
repo: z4.string(),
|
|
412
|
+
created_at: z4.string(),
|
|
413
|
+
merged_at: z4.string().optional(),
|
|
414
|
+
head_ref: z4.string(),
|
|
415
|
+
base_ref: z4.string(),
|
|
416
|
+
commit_shas: z4.array(z4.string()).default([]),
|
|
417
|
+
merge_commit_sha: z4.string().optional()
|
|
418
|
+
});
|
|
419
|
+
var GitHubRawSchema = FetchedAtSchema.extend({
|
|
420
|
+
events: z4.array(GitHubEventSchema),
|
|
421
|
+
commits: z4.array(GitHubExtendedCommitSchema).default([]),
|
|
422
|
+
pull_requests: z4.array(GitHubPullRequestSchema).default([])
|
|
423
|
+
});
|
|
424
|
+
var BlueskyAuthorSchema = z4.object({
|
|
425
|
+
did: z4.string(),
|
|
426
|
+
handle: z4.string(),
|
|
427
|
+
displayName: z4.string().optional(),
|
|
428
|
+
avatar: z4.string().url().optional()
|
|
429
|
+
});
|
|
430
|
+
var BlueskyPostSchema = z4.object({
|
|
431
|
+
uri: z4.string(),
|
|
432
|
+
cid: z4.string(),
|
|
433
|
+
author: BlueskyAuthorSchema,
|
|
434
|
+
record: z4.object({
|
|
435
|
+
text: z4.string(),
|
|
436
|
+
createdAt: z4.string(),
|
|
437
|
+
reply: z4.object({
|
|
438
|
+
parent: z4.object({ uri: z4.string() }),
|
|
439
|
+
root: z4.object({ uri: z4.string() })
|
|
440
|
+
}).optional()
|
|
441
|
+
}),
|
|
442
|
+
replyCount: z4.number().default(0),
|
|
443
|
+
repostCount: z4.number().default(0),
|
|
444
|
+
likeCount: z4.number().default(0),
|
|
445
|
+
embed: z4.object({
|
|
446
|
+
images: z4.array(z4.object({
|
|
447
|
+
thumb: z4.string(),
|
|
448
|
+
fullsize: z4.string()
|
|
449
|
+
})).optional()
|
|
450
|
+
}).optional()
|
|
451
|
+
});
|
|
452
|
+
var BlueskyFeedItemSchema = z4.object({
|
|
453
|
+
post: BlueskyPostSchema,
|
|
454
|
+
reason: z4.object({
|
|
455
|
+
$type: z4.string(),
|
|
456
|
+
by: BlueskyAuthorSchema.optional()
|
|
457
|
+
}).optional()
|
|
458
|
+
});
|
|
459
|
+
var BlueskyRawSchema = FetchedAtSchema.extend({
|
|
460
|
+
feed: z4.array(BlueskyFeedItemSchema),
|
|
461
|
+
cursor: z4.string().optional()
|
|
462
|
+
});
|
|
463
|
+
var YouTubeThumbnailSchema = z4.object({
|
|
464
|
+
url: z4.string().url(),
|
|
465
|
+
width: z4.number().optional(),
|
|
466
|
+
height: z4.number().optional()
|
|
467
|
+
});
|
|
468
|
+
var YouTubeVideoSchema = z4.object({
|
|
469
|
+
kind: z4.string(),
|
|
470
|
+
etag: z4.string(),
|
|
471
|
+
id: z4.object({
|
|
472
|
+
kind: z4.string(),
|
|
473
|
+
videoId: z4.string()
|
|
474
|
+
}),
|
|
475
|
+
snippet: z4.object({
|
|
476
|
+
publishedAt: z4.string(),
|
|
477
|
+
channelId: z4.string(),
|
|
478
|
+
title: z4.string(),
|
|
479
|
+
description: z4.string(),
|
|
480
|
+
thumbnails: z4.object({
|
|
481
|
+
default: YouTubeThumbnailSchema.optional(),
|
|
482
|
+
medium: YouTubeThumbnailSchema.optional(),
|
|
483
|
+
high: YouTubeThumbnailSchema.optional()
|
|
484
|
+
}),
|
|
485
|
+
channelTitle: z4.string()
|
|
486
|
+
})
|
|
487
|
+
});
|
|
488
|
+
var YouTubeRawSchema = FetchedAtSchema.extend({
|
|
489
|
+
items: z4.array(YouTubeVideoSchema),
|
|
490
|
+
nextPageToken: z4.string().optional(),
|
|
491
|
+
pageInfo: z4.object({
|
|
492
|
+
totalResults: z4.number(),
|
|
493
|
+
resultsPerPage: z4.number()
|
|
494
|
+
}).optional()
|
|
495
|
+
});
|
|
496
|
+
var DevpadTaskSchema = z4.object({
|
|
497
|
+
id: z4.string(),
|
|
498
|
+
title: z4.string(),
|
|
499
|
+
status: z4.enum(["todo", "in_progress", "done", "archived"]),
|
|
500
|
+
priority: z4.enum(["low", "medium", "high"]).optional(),
|
|
501
|
+
project: z4.string().optional(),
|
|
502
|
+
tags: z4.array(z4.string()).default([]),
|
|
503
|
+
created_at: z4.string(),
|
|
504
|
+
updated_at: z4.string(),
|
|
505
|
+
due_date: z4.string().optional(),
|
|
506
|
+
completed_at: z4.string().optional()
|
|
507
|
+
});
|
|
508
|
+
var DevpadRawSchema = FetchedAtSchema.extend({
|
|
509
|
+
tasks: z4.array(DevpadTaskSchema)
|
|
510
|
+
});
|
|
511
|
+
|
|
512
|
+
// ../schema/dist/media/profiles.js
|
|
513
|
+
import { z as z5 } from "zod";
|
|
514
|
+
var slugRegex = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
515
|
+
var SlugSchema = z5.string().min(3, "Slug must be at least 3 characters").max(50, "Slug must be at most 50 characters").regex(slugRegex, "Slug must be lowercase alphanumeric with hyphens, no leading/trailing hyphens");
|
|
516
|
+
var CreateProfileSchema = z5.object({
|
|
517
|
+
slug: SlugSchema,
|
|
518
|
+
name: z5.string().min(1, "Name is required").max(100, "Name must be at most 100 characters"),
|
|
519
|
+
description: z5.string().max(500, "Description must be at most 500 characters").optional(),
|
|
520
|
+
theme: z5.string().max(50).optional()
|
|
521
|
+
});
|
|
522
|
+
var UpdateProfileSchema = z5.object({
|
|
523
|
+
slug: SlugSchema.optional(),
|
|
524
|
+
name: z5.string().min(1).max(100).optional(),
|
|
525
|
+
description: z5.string().max(500).nullable().optional(),
|
|
526
|
+
theme: z5.string().max(50).nullable().optional()
|
|
527
|
+
});
|
|
528
|
+
var FilterTypeSchema = z5.enum(["include", "exclude"]);
|
|
529
|
+
var FilterKeySchema = z5.enum(["repo", "subreddit", "keyword", "twitter_account"]);
|
|
530
|
+
var AddFilterSchema = z5.object({
|
|
531
|
+
account_id: z5.string(),
|
|
532
|
+
filter_type: FilterTypeSchema,
|
|
533
|
+
filter_key: FilterKeySchema,
|
|
534
|
+
filter_value: z5.string().min(1, "Filter value is required").max(200, "Filter value too long")
|
|
535
|
+
});
|
|
536
|
+
|
|
537
|
+
// ../schema/dist/media/settings.js
|
|
538
|
+
import { z as z6 } from "zod";
|
|
539
|
+
var GitHubSettingsSchema = z6.object({
|
|
540
|
+
hidden_repos: z6.array(z6.string()).default([])
|
|
541
|
+
});
|
|
542
|
+
var BlueskySettingsSchema = z6.object({
|
|
543
|
+
include_replies: z6.boolean().default(true),
|
|
544
|
+
include_reposts: z6.boolean().default(false)
|
|
545
|
+
});
|
|
546
|
+
var YouTubeSettingsSchema = z6.object({
|
|
547
|
+
include_watch_history: z6.boolean().default(true),
|
|
548
|
+
include_liked: z6.boolean().default(false)
|
|
549
|
+
});
|
|
550
|
+
var DevpadSettingsSchema = z6.object({
|
|
551
|
+
hidden_projects: z6.array(z6.string()).default([])
|
|
552
|
+
});
|
|
553
|
+
var PlatformSettingsSchemaMap = {
|
|
554
|
+
github: GitHubSettingsSchema,
|
|
555
|
+
bluesky: BlueskySettingsSchema,
|
|
556
|
+
youtube: YouTubeSettingsSchema,
|
|
557
|
+
devpad: DevpadSettingsSchema
|
|
558
|
+
};
|
|
559
|
+
|
|
560
|
+
// ../schema/dist/media/timeline.js
|
|
561
|
+
import { z as z7 } from "zod";
|
|
562
|
+
var TimelineTypeSchema = z7.enum(["commit", "post", "video", "task", "pull_request", "comment"]);
|
|
563
|
+
var CommitPayloadSchema = z7.object({
|
|
564
|
+
type: z7.literal("commit"),
|
|
565
|
+
sha: z7.string(),
|
|
566
|
+
message: z7.string(),
|
|
567
|
+
repo: z7.string(),
|
|
568
|
+
branch: z7.string(),
|
|
569
|
+
additions: z7.number().optional(),
|
|
570
|
+
deletions: z7.number().optional(),
|
|
571
|
+
files_changed: z7.number().optional()
|
|
572
|
+
});
|
|
573
|
+
var PostPayloadSchema = z7.object({
|
|
574
|
+
type: z7.literal("post"),
|
|
575
|
+
content: z7.string(),
|
|
576
|
+
author_handle: z7.string(),
|
|
577
|
+
author_name: z7.string().optional(),
|
|
578
|
+
author_avatar: z7.string().url().optional(),
|
|
579
|
+
reply_count: z7.number().default(0),
|
|
580
|
+
repost_count: z7.number().default(0),
|
|
581
|
+
like_count: z7.number().default(0),
|
|
582
|
+
has_media: z7.boolean().default(false),
|
|
583
|
+
is_reply: z7.boolean().default(false),
|
|
584
|
+
is_repost: z7.boolean().default(false),
|
|
585
|
+
subreddit: z7.string().optional()
|
|
586
|
+
});
|
|
587
|
+
var VideoPayloadSchema = z7.object({
|
|
588
|
+
type: z7.literal("video"),
|
|
589
|
+
channel_id: z7.string(),
|
|
590
|
+
channel_title: z7.string(),
|
|
591
|
+
description: z7.string().optional(),
|
|
592
|
+
thumbnail_url: z7.string().url().optional(),
|
|
593
|
+
duration: z7.string().optional(),
|
|
594
|
+
view_count: z7.number().optional(),
|
|
595
|
+
like_count: z7.number().optional()
|
|
596
|
+
});
|
|
597
|
+
var TaskPayloadSchema = z7.object({
|
|
598
|
+
type: z7.literal("task"),
|
|
599
|
+
status: z7.enum(["todo", "in_progress", "done", "archived"]),
|
|
600
|
+
priority: z7.enum(["low", "medium", "high"]).optional(),
|
|
601
|
+
project: z7.string().optional(),
|
|
602
|
+
tags: z7.array(z7.string()).default([]),
|
|
603
|
+
due_date: z7.string().datetime().optional(),
|
|
604
|
+
completed_at: z7.string().datetime().optional()
|
|
605
|
+
});
|
|
606
|
+
var PRCommitSchema = z7.object({
|
|
607
|
+
sha: z7.string(),
|
|
608
|
+
message: z7.string(),
|
|
609
|
+
url: z7.string()
|
|
610
|
+
});
|
|
611
|
+
var PullRequestPayloadSchema = z7.object({
|
|
612
|
+
type: z7.literal("pull_request"),
|
|
613
|
+
repo: z7.string(),
|
|
614
|
+
number: z7.number(),
|
|
615
|
+
title: z7.string(),
|
|
616
|
+
state: z7.enum(["open", "closed", "merged"]),
|
|
617
|
+
action: z7.string(),
|
|
618
|
+
head_ref: z7.string(),
|
|
619
|
+
base_ref: z7.string(),
|
|
620
|
+
additions: z7.number().optional(),
|
|
621
|
+
deletions: z7.number().optional(),
|
|
622
|
+
changed_files: z7.number().optional(),
|
|
623
|
+
commit_shas: z7.array(z7.string()).default([]),
|
|
624
|
+
merge_commit_sha: z7.string().nullable().optional(),
|
|
625
|
+
commits: z7.array(PRCommitSchema).default([])
|
|
626
|
+
});
|
|
627
|
+
var CommentPayloadSchema = z7.object({
|
|
628
|
+
type: z7.literal("comment"),
|
|
629
|
+
content: z7.string(),
|
|
630
|
+
author_handle: z7.string(),
|
|
631
|
+
parent_title: z7.string(),
|
|
632
|
+
parent_url: z7.string(),
|
|
633
|
+
subreddit: z7.string(),
|
|
634
|
+
score: z7.number(),
|
|
635
|
+
is_op: z7.boolean().default(false)
|
|
636
|
+
});
|
|
637
|
+
var PayloadSchema = z7.discriminatedUnion("type", [CommitPayloadSchema, PostPayloadSchema, VideoPayloadSchema, TaskPayloadSchema, PullRequestPayloadSchema, CommentPayloadSchema]);
|
|
638
|
+
var TimelineItemSchema = z7.object({
|
|
639
|
+
id: z7.string(),
|
|
640
|
+
platform: PlatformSchema,
|
|
641
|
+
type: TimelineTypeSchema,
|
|
642
|
+
timestamp: z7.string().datetime(),
|
|
643
|
+
title: z7.string(),
|
|
644
|
+
url: z7.string().url(),
|
|
645
|
+
payload: PayloadSchema
|
|
646
|
+
});
|
|
647
|
+
var CommitGroupSchema = z7.object({
|
|
648
|
+
type: z7.literal("commit_group"),
|
|
649
|
+
repo: z7.string(),
|
|
650
|
+
branch: z7.string(),
|
|
651
|
+
date: z7.string(),
|
|
652
|
+
commits: z7.array(TimelineItemSchema),
|
|
653
|
+
total_additions: z7.number().default(0),
|
|
654
|
+
total_deletions: z7.number().default(0),
|
|
655
|
+
total_files_changed: z7.number().default(0)
|
|
656
|
+
});
|
|
657
|
+
var DateGroupSchema = z7.object({
|
|
658
|
+
date: z7.string(),
|
|
659
|
+
items: z7.array(z7.union([TimelineItemSchema, CommitGroupSchema]))
|
|
660
|
+
});
|
|
661
|
+
var TimelineSchema = z7.object({
|
|
662
|
+
user_id: z7.string(),
|
|
663
|
+
generated_at: z7.string().datetime(),
|
|
664
|
+
groups: z7.array(DateGroupSchema)
|
|
665
|
+
});
|
|
666
|
+
export {
|
|
667
|
+
AddFilterSchema,
|
|
668
|
+
BlueskyAuthorSchema,
|
|
669
|
+
BlueskyFeedItemSchema,
|
|
670
|
+
BlueskyPostSchema,
|
|
671
|
+
BlueskyRawSchema,
|
|
672
|
+
BlueskySettingsSchema,
|
|
673
|
+
CommentPayloadSchema,
|
|
674
|
+
CommitGroupSchema,
|
|
675
|
+
CommitPayloadSchema,
|
|
676
|
+
CreateProfileSchema,
|
|
677
|
+
DateGroupSchema,
|
|
678
|
+
DevpadRawSchema,
|
|
679
|
+
DevpadSettingsSchema,
|
|
680
|
+
DevpadTaskSchema,
|
|
681
|
+
FilterKeySchema,
|
|
682
|
+
FilterTypeSchema,
|
|
683
|
+
GitHubBaseEventSchema,
|
|
684
|
+
GitHubEventSchema,
|
|
685
|
+
GitHubExtendedCommitSchema,
|
|
686
|
+
GitHubMetaStoreSchema,
|
|
687
|
+
GitHubPullRequestSchema,
|
|
688
|
+
GitHubRawSchema,
|
|
689
|
+
GitHubRepoCommitSchema,
|
|
690
|
+
GitHubRepoCommitsStoreSchema,
|
|
691
|
+
GitHubRepoMetaSchema,
|
|
692
|
+
GitHubRepoPRSchema,
|
|
693
|
+
GitHubRepoPRsStoreSchema,
|
|
694
|
+
GitHubRepoSchema,
|
|
695
|
+
GitHubSettingsSchema,
|
|
696
|
+
MULTI_STORE_PLATFORMS,
|
|
697
|
+
PLATFORMS,
|
|
698
|
+
PayloadSchema,
|
|
699
|
+
PlatformSchema,
|
|
700
|
+
PlatformSettingsSchemaMap,
|
|
701
|
+
PostPayloadSchema,
|
|
702
|
+
PullRequestPayloadSchema,
|
|
703
|
+
RedditCommentSchema,
|
|
704
|
+
RedditCommentsStoreSchema,
|
|
705
|
+
RedditMetaStoreSchema,
|
|
706
|
+
RedditPostSchema,
|
|
707
|
+
RedditPostsStoreSchema,
|
|
708
|
+
SlugSchema,
|
|
709
|
+
TaskPayloadSchema,
|
|
710
|
+
TimelineItemSchema,
|
|
711
|
+
TimelineSchema,
|
|
712
|
+
TimelineTypeSchema,
|
|
713
|
+
TweetMediaSchema,
|
|
714
|
+
TweetMetricsSchema,
|
|
715
|
+
TweetUrlSchema,
|
|
716
|
+
TwitterMetaStoreSchema,
|
|
717
|
+
TwitterTweetSchema,
|
|
718
|
+
TwitterTweetsStoreSchema,
|
|
719
|
+
TwitterUserMetricsSchema,
|
|
720
|
+
UpdateProfileSchema,
|
|
721
|
+
VideoPayloadSchema,
|
|
722
|
+
YouTubeRawSchema,
|
|
723
|
+
YouTubeSettingsSchema,
|
|
724
|
+
YouTubeThumbnailSchema,
|
|
725
|
+
YouTubeVideoSchema,
|
|
726
|
+
accountId,
|
|
727
|
+
media_account_settings as accountSettings,
|
|
728
|
+
media_accounts as accounts,
|
|
729
|
+
apiError,
|
|
730
|
+
api_keys as apiKeys,
|
|
731
|
+
authExpired,
|
|
732
|
+
badRequest,
|
|
733
|
+
configureErrorLogging,
|
|
734
|
+
conflict,
|
|
735
|
+
connectionId,
|
|
736
|
+
corpus_snapshots,
|
|
737
|
+
dbError,
|
|
738
|
+
encryptionError,
|
|
739
|
+
errors,
|
|
740
|
+
forbidden,
|
|
741
|
+
githubError,
|
|
742
|
+
isApiError,
|
|
743
|
+
isAuthExpiredError,
|
|
744
|
+
isBadRequestError,
|
|
745
|
+
isConflictError,
|
|
746
|
+
isDatabaseError,
|
|
747
|
+
isEncryptionError,
|
|
748
|
+
isForbiddenError,
|
|
749
|
+
isGithubError,
|
|
750
|
+
isMultiStorePlatform,
|
|
751
|
+
isNetworkError,
|
|
752
|
+
isNotFoundError,
|
|
753
|
+
isParseError,
|
|
754
|
+
isRateLimitedError,
|
|
755
|
+
isRetryableError,
|
|
756
|
+
isScanError,
|
|
757
|
+
isServiceError,
|
|
758
|
+
isStoreError,
|
|
759
|
+
isUnauthorizedError,
|
|
760
|
+
isValidId,
|
|
761
|
+
isValidationError,
|
|
762
|
+
networkError,
|
|
763
|
+
notFound,
|
|
764
|
+
parseError,
|
|
765
|
+
media_platform_credentials as platformCredentials,
|
|
766
|
+
media_profile_filters as profileFilters,
|
|
767
|
+
profileId,
|
|
768
|
+
media_profiles as profiles,
|
|
769
|
+
rateLimited,
|
|
770
|
+
media_rate_limits as rateLimits,
|
|
771
|
+
scanError,
|
|
772
|
+
storeError,
|
|
773
|
+
unauthorized,
|
|
774
|
+
userId,
|
|
775
|
+
validation
|
|
776
|
+
};
|