Home / File/ async.ts — typescript-sdk Source File

async.ts — typescript-sdk Source File

Architecture documentation for async.ts, a typescript file in the typescript-sdk codebase. 3 imports, 0 dependents.

File typescript SupermodelAPI DomainClassification 3 imports 5 functions 3 classes

Entity Profile

Dependency Diagram

graph LR
  dcc90704_6e64_7ec2_9ee4_aaa5200dbd17["async.ts"]
  41b6b5c2_aa5b_90b9_c373_84e0a8cd9918["runtime.ts"]
  dcc90704_6e64_7ec2_9ee4_aaa5200dbd17 --> 41b6b5c2_aa5b_90b9_c373_84e0a8cd9918
  c0819722_6747_b0b6_11ec_944ce6f59300["DefaultApi.ts"]
  dcc90704_6e64_7ec2_9ee4_aaa5200dbd17 --> c0819722_6747_b0b6_11ec_944ce6f59300
  18a9440d_c1f0_418a_c2ac_84b995bb45bf["index.ts"]
  dcc90704_6e64_7ec2_9ee4_aaa5200dbd17 --> 18a9440d_c1f0_418a_c2ac_84b995bb45bf
  style dcc90704_6e64_7ec2_9ee4_aaa5200dbd17 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

/**
 * Async Client Wrapper for Supermodel API
 * 
 * Provides automatic polling for async job endpoints, so you can use them
 * like synchronous APIs without manually implementing polling loops.
 * 
 * @example
 * ```typescript
 * import { DefaultApi, Configuration, SupermodelClient } from '@supermodeltools/sdk';
 * 
 * const api = new DefaultApi(new Configuration({ 
 *   basePath: 'https://api.supermodel.tools',
 *   apiKey: () => 'your-api-key'
 * }));
 * 
 * const client = new SupermodelClient(api);
 * 
 * // Returns the unwrapped result - polling is automatic!
 * const graph = await client.generateDependencyGraph(zipFile);
 * console.log(graph.graph.nodes.length);
 * ```
 */

import type { InitOverrideFunction } from './runtime';
import type { DefaultApi } from './apis/DefaultApi';
import type {
  CodeGraphEnvelope,
  CodeGraphEnvelopeAsync,
  DomainClassificationResponse,
  DomainClassificationResponseAsync,
  SupermodelIR,
  SupermodelIRAsync,
} from './models';

/**
 * Configuration options for the async client.
 */
export interface AsyncClientOptions {
  /**
   * Maximum time to wait for a job to complete (in milliseconds).
   * Default: 900000 (15 minutes)
   */
  timeoutMs?: number;

  /**
   * Default retry interval when server doesn't specify (in milliseconds).
   * Default: 10000 (10 seconds)
   */
  defaultRetryIntervalMs?: number;

  /**
   * Maximum number of polling attempts.
   * Default: 90
   */
  maxPollingAttempts?: number;

  /**
   * Callback for polling progress updates.
   * Useful for showing progress indicators in UIs.
   */
// ... (317 more lines)

Domain

Frequently Asked Questions

What does async.ts do?
async.ts is a source file in the typescript-sdk codebase, written in typescript. It belongs to the SupermodelAPI domain, DomainClassification subdomain.
What functions are defined in async.ts?
async.ts defines 5 function(s): defaultGenerateIdempotencyKey, pollUntilComplete, sleep, sleepWithAbort, status.
What does async.ts depend on?
async.ts imports 3 module(s): DefaultApi.ts, index.ts, runtime.ts.
Where is async.ts in the architecture?
async.ts is located at src/async.ts (domain: SupermodelAPI, subdomain: DomainClassification, directory: src).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free