You can access search results via JSON API by adding format=json
to your query:
https://codesearch.val.run/$%7Burl%7D?q=api&page=66&format=json
For typeahead suggestions, use the /typeahead
endpoint:
https://codesearch.val.run/typeahead?q=api
Returns an array of strings in format "username" or "username/projectName"
Found 11499 results for "api"(1118ms)
129130try {
131const url = `https://api.github.com/repos/${repo}/issues/${prNumber}/assignees`;
132console.log("🔍 Sending assignee request to:", url);
133145});
146147console.log("🔍 GitHub API response status:", response.status);
148149if (response.ok) {
155try {
156const error = await response.json();
157console.error("❌ GitHub API error:", JSON.stringify(error));
158errorMessage = error.message || errorMessage;
159168} catch (e) {
169const errorText = await response.text();
170console.error("❌ GitHub API error text:", errorText);
171}
172return { success: false, message: errorMessage };
173}
174} catch (error) {
175console.error("❌ Exception during API call:", error);
176return { success: false, message: error.message };
177}
34};
3536// Types for Slack API
37type SlackMessage = {
38blocks: any[];
323324// Get PR details
325const url = `https://api.github.com/repos/${repo}/pulls/${prNumber}`;
326console.log("🔍 Fetching from GitHub API URL:", url);
327328let response;
335},
336});
337console.log("🔍 GitHub API response received");
338console.log("🔍 Response status:", response.status);
339console.log("🔍 Response status text:", response.statusText);
346347if (!response.ok) {
348console.error(`❌ GitHub API error: ${response.status} ${response.statusText}`);
349350let errorText;
351try {
352errorText = await response.text();
353console.error("❌ GitHub API error response:", errorText);
354355try {
356// Try to parse as JSON for more details
357const errorJson = JSON.parse(errorText);
358console.error("❌ GitHub API error details:", JSON.stringify(errorJson));
359} catch (e) {
360// Not JSON, that's fine
370try {
371data = await response.json();
372console.log("🔍 Successfully parsed GitHub API response");
373} catch (jsonError) {
374console.error("❌ Failed to parse GitHub API response:", jsonError);
375376try {
384}
385386throw new Error(`Failed to parse GitHub API response: ${jsonError.message}`);
387}
388400}
401402// Merge a PR via GitHub API
403async function mergePR(repo: string, prNumber: number) {
404console.log(`🔍 Starting mergePR for PR #${prNumber} in ${repo}`);
448449// Proceed with merge
450const url = `https://api.github.com/repos/${repo}/pulls/${prNumber}/merge`;
451console.log("🔍 Sending merge request to:", url);
452468body: mergeBody,
469});
470console.log("🔍 Merge API response received");
471console.log("🔍 Response status:", response.status);
472console.log("🔍 Response status text:", response.statusText);
638body: JSON.stringify(message),
639});
640console.log("🔍 Slack API response received");
641console.log("🔍 Response status:", response.status);
642console.log("🔍 Response status text:", response.statusText);
649650if (!response.ok) {
651console.error(`❌ Slack API error: ${response.status} ${response.statusText}`);
652653let errorText;
654try {
655errorText = await response.text();
656console.error("❌ Slack API error response:", errorText);
657} catch (e) {
658console.error("❌ Could not read error response:", e);