Val Town Code SearchReturn to Val Town

API Access

You can access search results via JSON API by adding format=json to your query:

https://codesearch.val.run/$%7BsvgDataUrl%7D?q=api&page=56&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 19620 results for "api"(6820ms)

api_ianmenethil_comapiServerGenerator.ts27 matches

@ianmenethilโ€ขUpdated 2 days ago
1#!/usr/bin/env -S deno run --allow-read --allow-write --allow-net
2/**
3 * api-server-generator.ts โ€” Template generator for creating new API servers from OpenAPI specs.
4 * Generates controller stubs, registry configuration, and basic server structure.
5 */
11interface ServerTemplate {
12 name: string;
13 openApiSpecPath: string;
14 outputDirectory: string;
15 controllers: ControllerInfo[];
31}
32
33export class APIServerGenerator {
34 /**
35 * Generate a new API server from OpenAPI specification
36 */
37 static async generateServer(template: ServerTemplate): Promise<void> {
38 console.log(`๐Ÿš€ Generating API server: ${template.name}`);
39 console.log(`๐Ÿ“‹ OpenAPI Spec: ${template.openApiSpecPath}`);
40 console.log(`๐Ÿ“ Output Directory: ${template.outputDirectory}`);
41
42 // 1. Parse OpenAPI spec
43 const spec = await this.parseOpenAPISpec(template.openApiSpecPath);
44
45 // 2. Extract controller information
61 await this.copyBaseFiles(template.outputDirectory);
62
63 console.log(`โœ… API server generated successfully in ${template.outputDirectory}`);
64 console.log(`๐Ÿ“ Next steps:`);
65 console.log(` 1. cd ${template.outputDirectory}`);
70
71 /**
72 * Parse OpenAPI specification file
73 */
74 private static async parseOpenAPISpec(specPath: string): Promise<any> {
75 try {
76 const content = await Deno.readTextFile(specPath);
85 } catch (error) {
86 const errorMessage = error instanceof Error ? error.message : String(error);
87 throw new Error(`Failed to parse OpenAPI spec: ${errorMessage}`);
88 }
89 }
90
91 /**
92 * Extract controller information from OpenAPI spec
93 */
94 private static extractControllers(spec: any): ControllerInfo[] {
96
97 if (!spec.paths) {
98 console.warn("No paths found in OpenAPI spec");
99 return [];
100 }
138
139 /**
140 * Create directory structure for new API server
141 */
142 private static async createDirectoryStructure(outputDir: string): Promise<void> {
145 "src/core",
146 "src/middleware",
147 "src/openapi",
148 "src/utils",
149 "src/types",
150 "src/external-apis",
151 "src/tests",
152 ];
362 ): string {
363 return `/**
364 * main.tsx โ€” Generated API server entry point
365 * Server: ${template.name}
366 */
369import { cors } from 'hono/cors';
370import { logger } from 'hono/logger';
371import { OpenAPIRouteGenerator } from './src/openapi/route.generator.ts';
372
373const app = new Hono();
386});
387
388// Initialize OpenAPI routes
389try {
390\tconst routeGenerator = new OpenAPIRouteGenerator(app);
391\tawait routeGenerator.loadAndGenerateRoutes('./src/openapi');
392\tconsole.log('โœ… Routes loaded successfully');
393} catch (error) {
417
418console.log(\`๐Ÿš€ Starting \${' ${template.name}'} server on port \${port}\`);
419console.log(\`๐Ÿ“š API Documentation: http://localhost:\${port}/docs\`);
420
421Deno.serve({ port }, app.fetch);
430 if (args.length < 3) {
431 console.log(
432 "Usage: deno run --allow-read --allow-write api-server-generator.ts <name> <openapi-spec> <output-dir>",
433 );
434 console.log(
435 "Example: deno run --allow-read --allow-write api-server-generator.ts MyAPI ./openapi.yaml ./my-api-server",
436 );
437 Deno.exit(1);
441
442 try {
443 await APIServerGenerator.generateServer({
444 name,
445 openApiSpecPath: specPath,
446 outputDirectory: outputDir,
447 controllers: [], // Will be extracted from spec

api_ianmenethil_comtokenEncryption.ts1 match

@ianmenethilโ€ขUpdated 2 days ago
1/**
2 * token.encryption.ts โ€” Token encryption/decryption utilities for OAuth tokens.
3 * Uses Web Crypto API for AES-GCM encryption to secure sensitive token data.
4 */
5

api_ianmenethil_comtableFormatter.ts2 matches

@ianmenethilโ€ขUpdated 2 days ago
7 * Formats a single table row for route display
8 * @param method - HTTP method (GET, POST, etc.)
9 * @param path - API endpoint path
10 * @param operationId - OpenAPI operation identifier
11 * @param security - Security scheme information
12 * @returns Formatted table row string

api_ianmenethil_comresponseFormatter.ts6 matches

@ianmenethilโ€ขUpdated 2 days ago
1// F:\zApps\valtown.servers\APIServer\src\utils\response.formatter.ts
2/**
3 * response-formatter.ts โ€” Consistent API response formatting with security headers.
4 * Handles standardized response creation for the secure API server.
5 */
6
9 SECURITY_HEADERS_CONFIG as SECURITY_HEADERS,
10} from "@/config/index.ts";
11import { ApiResponse } from "@/types/index.ts";
12import { getSydneyTimestamp } from "./dateUtils.ts";
13
14/**
15 * Creates a standardized API response with security headers.
16 * @param data - Response data or error message
17 * @param status - HTTP status code
33 const isSuccess = status >= 200 && status < 300;
34
35 const responseBody: ApiResponse = {
36 success: isSuccess,
37 meta: {

api_ianmenethil_compathUtils.ts1 match

@ianmenethilโ€ขUpdated 2 days ago
1/**
2 * path.helper.ts โ€” Core path matching and manipulation utilities.
3 * Focused on path handling without OpenAPI-specific logic.
4 */
5

api_ianmenethil_commiddlewareMapper.ts3 matches

@ianmenethilโ€ขUpdated 2 days ago
43/**
44 * Extract security scheme names from operation security
45 * @param security - Security requirements from OpenAPI operation
46 * @returns Array of security scheme names
47 */
56/**
57 * Check if operation requires authentication
58 * @param security - Security requirements from OpenAPI operation
59 * @returns True if authentication is required
60 */
70/**
71 * Get security summary for an operation
72 * @param security - Security requirements from OpenAPI operation
73 * @returns Security summary object
74 */

api_ianmenethil_comjwtUtils.ts1 match

@ianmenethilโ€ขUpdated 2 days ago
1/**
2 * F:\zApps\valtown.servers\APIServer\src\utils\jwt.helpers.ts
3 * Shared utility functions for JWT generation and verification using 'jose'.
4 */

api_ianmenethil_comindex.ts1 match

@ianmenethilโ€ขUpdated 2 days ago
1// F:\zApps\valtown.servers\APIServer\src\types\index.ts
2/**
3 * Central export file for all types

api_ianmenethil_comworkflowService.ts1 match

@ianmenethilโ€ขUpdated 2 days ago
89
90 getDescription(): string {
91 return "Converts Swagger/OpenAPI specifications to Postman collections";
92 }
93

api_ianmenethil_cominternalJWTService.ts2 matches

@ianmenethilโ€ขUpdated 2 days ago
1// F:\zApps\valtown.servers\APIServer\src\services\internalJWT.service.ts
2import { Context } from "hono";
3import { joseErrors, signJwt, verifyJwt } from "@/utils/jwtUtils.ts";
15 *
16 * This service provides:
17 * - JWT token generation for internal API calls (using jose via jwt.helpers)
18 * - Token validation and verification (using jose via jwt.helpers)
19 * - Request correlation and audit trails
Plantfo

Plantfo8 file matches

@Lladโ€ขUpdated 4 hours ago
API for AI plant info

researchAgent2 file matches

@thesephistโ€ขUpdated 1 day ago
This is a lightweight wrapper around Perplexity's web search API
apiv1
apiry