SupermodelClient Class — typescript-sdk Architecture
Architecture documentation for the SupermodelClient class in async.ts from the typescript-sdk codebase.
Entity Profile
Dependency Diagram
graph TD 6d526024_bbf1_efc9_e652_5fd9c4256a6d["SupermodelClient"] dcc90704_6e64_7ec2_9ee4_aaa5200dbd17["async.ts"] 6d526024_bbf1_efc9_e652_5fd9c4256a6d -->|defined in| dcc90704_6e64_7ec2_9ee4_aaa5200dbd17 e76c7737_7cf4_3026_1c8c_2844a5704bd0["constructor()"] 6d526024_bbf1_efc9_e652_5fd9c4256a6d -->|method| e76c7737_7cf4_3026_1c8c_2844a5704bd0 45aa409f_84ea_312b_1166_2d4c4a0292c0["generateDependencyGraph()"] 6d526024_bbf1_efc9_e652_5fd9c4256a6d -->|method| 45aa409f_84ea_312b_1166_2d4c4a0292c0 e6cda218_73c8_d747_b018_d8be45dc79c1["generateCallGraph()"] 6d526024_bbf1_efc9_e652_5fd9c4256a6d -->|method| e6cda218_73c8_d747_b018_d8be45dc79c1 191f7884_c2be_7af0_de3d_5f6088bddb69["generateDomainGraph()"] 6d526024_bbf1_efc9_e652_5fd9c4256a6d -->|method| 191f7884_c2be_7af0_de3d_5f6088bddb69 cf77e19b_0687_7535_763f_59fb1d8b1271["generateParseGraph()"] 6d526024_bbf1_efc9_e652_5fd9c4256a6d -->|method| cf77e19b_0687_7535_763f_59fb1d8b1271 cc5c6926_bf5c_740d_2aaf_7308e181bd0a["generateSupermodelGraph()"] 6d526024_bbf1_efc9_e652_5fd9c4256a6d -->|method| cc5c6926_bf5c_740d_2aaf_7308e181bd0a aa96a3b8_638d_c793_00ab_91c4a4002bca["rawApi()"] 6d526024_bbf1_efc9_e652_5fd9c4256a6d -->|method| aa96a3b8_638d_c793_00ab_91c4a4002bca
Relationship Graph
Source Code
src/async.ts lines 274–376
export class SupermodelClient {
private api: DefaultApi;
private options: AsyncClientOptions;
private generateIdempotencyKey: () => string;
constructor(api: DefaultApi, options: AsyncClientOptions = {}) {
this.api = api;
this.options = options;
this.generateIdempotencyKey = options.generateIdempotencyKey || defaultGenerateIdempotencyKey;
}
/**
* Generate a dependency graph from a zip file.
* Automatically handles polling until the job completes.
*
* @param file - Zip file containing the repository
* @param options - Optional request options
* @returns The dependency graph result
*/
async generateDependencyGraph(
file: Blob,
options?: GraphRequestOptions
): Promise<CodeGraphEnvelope> {
const key = options?.idempotencyKey || this.generateIdempotencyKey();
const pollOptions = options?.signal ? { ...this.options, signal: options.signal } : this.options;
return pollUntilComplete<CodeGraphEnvelope, CodeGraphEnvelopeAsync>(
() => this.api.generateDependencyGraph({ idempotencyKey: key, file }, options?.initOverrides),
pollOptions
);
}
/**
* Generate a call graph from a zip file.
* Automatically handles polling until the job completes.
*/
async generateCallGraph(
file: Blob,
options?: GraphRequestOptions
): Promise<CodeGraphEnvelope> {
const key = options?.idempotencyKey || this.generateIdempotencyKey();
const pollOptions = options?.signal ? { ...this.options, signal: options.signal } : this.options;
return pollUntilComplete<CodeGraphEnvelope, CodeGraphEnvelopeAsync>(
() => this.api.generateCallGraph({ idempotencyKey: key, file }, options?.initOverrides),
pollOptions
);
}
/**
* Generate a domain graph from a zip file.
* Automatically handles polling until the job completes.
*/
async generateDomainGraph(
file: Blob,
options?: GraphRequestOptions
): Promise<DomainClassificationResponse> {
const key = options?.idempotencyKey || this.generateIdempotencyKey();
const pollOptions = options?.signal ? { ...this.options, signal: options.signal } : this.options;
return pollUntilComplete<DomainClassificationResponse, DomainClassificationResponseAsync>(
() => this.api.generateDomainGraph({ idempotencyKey: key, file }, options?.initOverrides),
pollOptions
);
}
/**
* Generate a parse graph from a zip file.
* Automatically handles polling until the job completes.
*/
async generateParseGraph(
file: Blob,
options?: GraphRequestOptions
): Promise<CodeGraphEnvelope> {
const key = options?.idempotencyKey || this.generateIdempotencyKey();
const pollOptions = options?.signal ? { ...this.options, signal: options.signal } : this.options;
return pollUntilComplete<CodeGraphEnvelope, CodeGraphEnvelopeAsync>(
() => this.api.generateParseGraph({ idempotencyKey: key, file }, options?.initOverrides),
pollOptions
);
}
/**
* Generate a Supermodel IR from a zip file.
Domain
Defined In
Source
Frequently Asked Questions
What is the SupermodelClient class?
SupermodelClient is a class in the typescript-sdk codebase, defined in src/async.ts.
Where is SupermodelClient defined?
SupermodelClient is defined in src/async.ts at line 274.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free