@supermodeltools/sdk 0.6.3 → 0.7.0
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/README.md +278 -26
- package/dist/apis/DefaultApi.d.ts +1 -1
- package/dist/apis/DefaultApi.js +1 -1
- package/dist/esm/apis/DefaultApi.d.ts +1 -1
- package/dist/esm/apis/DefaultApi.js +1 -1
- package/dist/esm/models/ClassificationStats.d.ts +49 -3
- package/dist/esm/models/ClassificationStats.js +32 -4
- package/dist/esm/models/CodeGraphEnvelope.d.ts +8 -1
- package/dist/esm/models/CodeGraphEnvelope.js +4 -1
- package/dist/esm/models/CodeGraphEnvelopeAsync.d.ts +1 -1
- package/dist/esm/models/CodeGraphEnvelopeAsync.js +1 -1
- package/dist/esm/models/CodeGraphEnvelopeGraph.d.ts +1 -1
- package/dist/esm/models/CodeGraphEnvelopeGraph.js +1 -1
- package/dist/esm/models/CodeGraphEnvelopeMetadata.d.ts +49 -0
- package/dist/esm/models/CodeGraphEnvelopeMetadata.js +44 -0
- package/dist/esm/models/CodeGraphNode.d.ts +1 -1
- package/dist/esm/models/CodeGraphNode.js +1 -1
- package/dist/esm/models/CodeGraphRelationship.d.ts +1 -1
- package/dist/esm/models/CodeGraphRelationship.js +1 -1
- package/dist/esm/models/CodeGraphStats.d.ts +29 -1
- package/dist/esm/models/CodeGraphStats.js +9 -1
- package/dist/esm/models/DomainClassAssignment.d.ts +1 -1
- package/dist/esm/models/DomainClassAssignment.js +1 -1
- package/dist/esm/models/DomainClassificationResponse.d.ts +15 -1
- package/dist/esm/models/DomainClassificationResponse.js +11 -1
- package/dist/esm/models/DomainClassificationResponseAsync.d.ts +1 -1
- package/dist/esm/models/DomainClassificationResponseAsync.js +1 -1
- package/dist/esm/models/DomainClassificationResponseGraph.d.ts +39 -0
- package/dist/esm/models/DomainClassificationResponseGraph.js +46 -0
- package/dist/esm/models/DomainFileAssignment.d.ts +1 -1
- package/dist/esm/models/DomainFileAssignment.js +1 -1
- package/dist/esm/models/DomainFunctionAssignment.d.ts +1 -1
- package/dist/esm/models/DomainFunctionAssignment.js +1 -1
- package/dist/esm/models/DomainRelationship.d.ts +1 -1
- package/dist/esm/models/DomainRelationship.js +1 -1
- package/dist/esm/models/DomainSummary.d.ts +1 -1
- package/dist/esm/models/DomainSummary.js +1 -1
- package/dist/esm/models/ErrorDetailsInner.d.ts +1 -1
- package/dist/esm/models/ErrorDetailsInner.js +1 -1
- package/dist/esm/models/FunctionDescription.d.ts +1 -1
- package/dist/esm/models/FunctionDescription.js +1 -1
- package/dist/esm/models/JobStatus.d.ts +1 -1
- package/dist/esm/models/JobStatus.js +1 -1
- package/dist/esm/models/ModelError.d.ts +1 -1
- package/dist/esm/models/ModelError.js +1 -1
- package/dist/esm/models/SubdomainSummary.d.ts +19 -1
- package/dist/esm/models/SubdomainSummary.js +13 -1
- package/dist/esm/models/SupermodelArtifact.d.ts +1 -1
- package/dist/esm/models/SupermodelArtifact.js +1 -1
- package/dist/esm/models/SupermodelIR.d.ts +22 -1
- package/dist/esm/models/SupermodelIR.js +16 -1
- package/dist/esm/models/SupermodelIRAsync.d.ts +1 -1
- package/dist/esm/models/SupermodelIRAsync.js +1 -1
- package/dist/esm/models/SupermodelIRGraph.d.ts +1 -1
- package/dist/esm/models/SupermodelIRGraph.js +1 -1
- package/dist/esm/models/SupermodelIRStats.d.ts +53 -0
- package/dist/esm/models/SupermodelIRStats.js +44 -0
- package/dist/esm/models/UnassignedFunction.d.ts +1 -1
- package/dist/esm/models/UnassignedFunction.js +1 -1
- package/dist/esm/models/index.d.ts +3 -0
- package/dist/esm/models/index.js +3 -0
- package/dist/esm/runtime.d.ts +1 -1
- package/dist/esm/runtime.js +1 -1
- package/dist/models/ClassificationStats.d.ts +49 -3
- package/dist/models/ClassificationStats.js +32 -4
- package/dist/models/CodeGraphEnvelope.d.ts +8 -1
- package/dist/models/CodeGraphEnvelope.js +4 -1
- package/dist/models/CodeGraphEnvelopeAsync.d.ts +1 -1
- package/dist/models/CodeGraphEnvelopeAsync.js +1 -1
- package/dist/models/CodeGraphEnvelopeGraph.d.ts +1 -1
- package/dist/models/CodeGraphEnvelopeGraph.js +1 -1
- package/dist/models/CodeGraphEnvelopeMetadata.d.ts +49 -0
- package/dist/models/CodeGraphEnvelopeMetadata.js +50 -0
- package/dist/models/CodeGraphNode.d.ts +1 -1
- package/dist/models/CodeGraphNode.js +1 -1
- package/dist/models/CodeGraphRelationship.d.ts +1 -1
- package/dist/models/CodeGraphRelationship.js +1 -1
- package/dist/models/CodeGraphStats.d.ts +29 -1
- package/dist/models/CodeGraphStats.js +9 -1
- package/dist/models/DomainClassAssignment.d.ts +1 -1
- package/dist/models/DomainClassAssignment.js +1 -1
- package/dist/models/DomainClassificationResponse.d.ts +15 -1
- package/dist/models/DomainClassificationResponse.js +11 -1
- package/dist/models/DomainClassificationResponseAsync.d.ts +1 -1
- package/dist/models/DomainClassificationResponseAsync.js +1 -1
- package/dist/models/DomainClassificationResponseGraph.d.ts +39 -0
- package/dist/models/DomainClassificationResponseGraph.js +52 -0
- package/dist/models/DomainFileAssignment.d.ts +1 -1
- package/dist/models/DomainFileAssignment.js +1 -1
- package/dist/models/DomainFunctionAssignment.d.ts +1 -1
- package/dist/models/DomainFunctionAssignment.js +1 -1
- package/dist/models/DomainRelationship.d.ts +1 -1
- package/dist/models/DomainRelationship.js +1 -1
- package/dist/models/DomainSummary.d.ts +1 -1
- package/dist/models/DomainSummary.js +1 -1
- package/dist/models/ErrorDetailsInner.d.ts +1 -1
- package/dist/models/ErrorDetailsInner.js +1 -1
- package/dist/models/FunctionDescription.d.ts +1 -1
- package/dist/models/FunctionDescription.js +1 -1
- package/dist/models/JobStatus.d.ts +1 -1
- package/dist/models/JobStatus.js +1 -1
- package/dist/models/ModelError.d.ts +1 -1
- package/dist/models/ModelError.js +1 -1
- package/dist/models/SubdomainSummary.d.ts +19 -1
- package/dist/models/SubdomainSummary.js +13 -1
- package/dist/models/SupermodelArtifact.d.ts +1 -1
- package/dist/models/SupermodelArtifact.js +1 -1
- package/dist/models/SupermodelIR.d.ts +22 -1
- package/dist/models/SupermodelIR.js +16 -1
- package/dist/models/SupermodelIRAsync.d.ts +1 -1
- package/dist/models/SupermodelIRAsync.js +1 -1
- package/dist/models/SupermodelIRGraph.d.ts +1 -1
- package/dist/models/SupermodelIRGraph.js +1 -1
- package/dist/models/SupermodelIRStats.d.ts +53 -0
- package/dist/models/SupermodelIRStats.js +50 -0
- package/dist/models/UnassignedFunction.d.ts +1 -1
- package/dist/models/UnassignedFunction.js +1 -1
- package/dist/models/index.d.ts +3 -0
- package/dist/models/index.js +3 -0
- package/dist/runtime.d.ts +1 -1
- package/dist/runtime.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
# Supermodel TypeScript SDK
|
|
2
2
|
|
|
3
|
-
[
|
|
4
|
-
[](https://www.typescriptlang.org/)
|
|
5
|
-
[](https://github.com/supermodeltools/typescript-sdk/actions/workflows/ci.yml)
|
|
3
|
+
Official TypeScript/JavaScript SDK for the [Supermodel API](https://supermodeltools.com).
|
|
6
4
|
|
|
7
|
-
|
|
5
|
+
Generate code graphs, dependency analysis, and domain models from your source code repositories.
|
|
8
6
|
|
|
9
|
-
##
|
|
7
|
+
## Installation
|
|
10
8
|
|
|
11
9
|
```bash
|
|
12
10
|
npm install @supermodeltools/sdk
|
|
@@ -14,43 +12,297 @@ npm install @supermodeltools/sdk
|
|
|
14
12
|
|
|
15
13
|
## Quick Start
|
|
16
14
|
|
|
17
|
-
|
|
15
|
+
### Basic Usage (Auto-Polling)
|
|
16
|
+
|
|
17
|
+
The SDK provides a high-level `SupermodelClient` that automatically handles async job polling:
|
|
18
18
|
|
|
19
19
|
```typescript
|
|
20
|
-
import {
|
|
20
|
+
import { SupermodelClient, DefaultApi, Configuration } from '@supermodeltools/sdk';
|
|
21
21
|
import { readFile } from 'node:fs/promises';
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
// Configure the API client
|
|
24
|
+
const api = new DefaultApi(new Configuration({
|
|
24
25
|
basePath: 'https://api.supermodeltools.com',
|
|
25
|
-
apiKey: process.env.SUPERMODEL_API_KEY
|
|
26
|
+
apiKey: () => process.env.SUPERMODEL_API_KEY || ''
|
|
27
|
+
}));
|
|
28
|
+
|
|
29
|
+
// Create the async client wrapper
|
|
30
|
+
const client = new SupermodelClient(api);
|
|
31
|
+
|
|
32
|
+
// Generate a code graph (polling handled automatically)
|
|
33
|
+
const zipBuffer = await readFile('./my-repo.zip');
|
|
34
|
+
const zipBlob = new Blob([zipBuffer]);
|
|
35
|
+
|
|
36
|
+
const result = await client.generateSupermodelGraph(zipBlob);
|
|
37
|
+
console.log(`Generated graph with ${result.graph.nodes.length} nodes`);
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Advanced Configuration
|
|
41
|
+
|
|
42
|
+
Configure polling behavior for long-running operations:
|
|
43
|
+
|
|
44
|
+
```typescript
|
|
45
|
+
const client = new SupermodelClient(api, {
|
|
46
|
+
// Maximum time to wait for job completion
|
|
47
|
+
timeoutMs: 900000, // 15 minutes (default)
|
|
48
|
+
|
|
49
|
+
// Polling interval when server doesn't specify
|
|
50
|
+
defaultRetryIntervalMs: 10000, // 10 seconds (default)
|
|
51
|
+
|
|
52
|
+
// Maximum number of polling attempts
|
|
53
|
+
maxPollingAttempts: 90, // (default)
|
|
54
|
+
|
|
55
|
+
// Progress callback
|
|
56
|
+
onPollingProgress: (progress) => {
|
|
57
|
+
console.log(`Job ${progress.jobId}: ${progress.status} ` +
|
|
58
|
+
`(${progress.attempt}/${progress.maxAttempts})`);
|
|
59
|
+
},
|
|
60
|
+
|
|
61
|
+
// Cancellation support
|
|
62
|
+
signal: abortController.signal,
|
|
63
|
+
});
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Per-Request Configuration
|
|
67
|
+
|
|
68
|
+
Override client defaults for specific requests:
|
|
69
|
+
|
|
70
|
+
```typescript
|
|
71
|
+
// Use a custom idempotency key
|
|
72
|
+
const result = await client.generateDependencyGraph(zipBlob, {
|
|
73
|
+
idempotencyKey: 'my-repo:dependency:abc123',
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
// Add custom headers (e.g., for different auth)
|
|
77
|
+
const result = await client.generateCallGraph(zipBlob, {
|
|
78
|
+
initOverrides: {
|
|
79
|
+
headers: { 'Authorization': 'Bearer custom-token' }
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
// Cancel a specific request
|
|
84
|
+
const controller = new AbortController();
|
|
85
|
+
const promise = client.generateParseGraph(zipBlob, {
|
|
86
|
+
signal: controller.signal
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
// Later: controller.abort();
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Available Methods
|
|
93
|
+
|
|
94
|
+
### SupermodelClient (Async Wrapper)
|
|
95
|
+
|
|
96
|
+
All methods automatically handle polling until job completion:
|
|
97
|
+
|
|
98
|
+
- `generateSupermodelGraph(file, options?)` - Full Supermodel IR with all analysis
|
|
99
|
+
- `generateDependencyGraph(file, options?)` - Module/package dependencies
|
|
100
|
+
- `generateCallGraph(file, options?)` - Function-level call relationships
|
|
101
|
+
- `generateDomainGraph(file, options?)` - High-level domain model
|
|
102
|
+
- `generateParseGraph(file, options?)` - AST-level parse tree
|
|
103
|
+
|
|
104
|
+
### Raw API (Manual Polling)
|
|
105
|
+
|
|
106
|
+
Access the underlying API for manual control:
|
|
107
|
+
|
|
108
|
+
```typescript
|
|
109
|
+
const rawApi = client.rawApi;
|
|
110
|
+
|
|
111
|
+
// Make initial request
|
|
112
|
+
let response = await rawApi.generateDependencyGraph({
|
|
113
|
+
idempotencyKey: 'my-key',
|
|
114
|
+
file: zipBlob
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
// Poll manually
|
|
118
|
+
while (response.status === 'pending' || response.status === 'processing') {
|
|
119
|
+
await sleep(response.retryAfter * 1000);
|
|
120
|
+
response = await rawApi.generateDependencyGraph({
|
|
121
|
+
idempotencyKey: 'my-key',
|
|
122
|
+
file: zipBlob
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
if (response.status === 'completed') {
|
|
127
|
+
console.log(response.result);
|
|
128
|
+
}
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Configuration Options
|
|
132
|
+
|
|
133
|
+
### AsyncClientOptions
|
|
134
|
+
|
|
135
|
+
| Option | Type | Default | Description |
|
|
136
|
+
|--------|------|---------|-------------|
|
|
137
|
+
| `timeoutMs` | `number` | `900000` (15 min) | Maximum time to wait for job completion |
|
|
138
|
+
| `defaultRetryIntervalMs` | `number` | `10000` (10 sec) | Polling interval when server doesn't specify |
|
|
139
|
+
| `maxPollingAttempts` | `number` | `90` | Maximum number of polling attempts |
|
|
140
|
+
| `onPollingProgress` | `function` | `undefined` | Callback for polling progress updates |
|
|
141
|
+
| `generateIdempotencyKey` | `function` | `crypto.randomUUID()` | Custom idempotency key generator |
|
|
142
|
+
| `signal` | `AbortSignal` | `undefined` | AbortSignal for cancelling operations |
|
|
143
|
+
|
|
144
|
+
### GraphRequestOptions
|
|
145
|
+
|
|
146
|
+
| Option | Type | Default | Description |
|
|
147
|
+
|--------|------|---------|-------------|
|
|
148
|
+
| `idempotencyKey` | `string` | auto-generated | Idempotency key for request deduplication |
|
|
149
|
+
| `initOverrides` | `RequestInit` | `undefined` | Custom fetch options (headers, etc.) |
|
|
150
|
+
| `signal` | `AbortSignal` | `undefined` | Request-specific abort signal |
|
|
151
|
+
|
|
152
|
+
## Error Handling
|
|
153
|
+
|
|
154
|
+
```typescript
|
|
155
|
+
import { JobFailedError, PollingTimeoutError } from '@supermodeltools/sdk';
|
|
156
|
+
|
|
157
|
+
try {
|
|
158
|
+
const result = await client.generateDependencyGraph(zipBlob);
|
|
159
|
+
} catch (error) {
|
|
160
|
+
if (error instanceof JobFailedError) {
|
|
161
|
+
console.error(`Job ${error.jobId} failed: ${error.errorMessage}`);
|
|
162
|
+
} else if (error instanceof PollingTimeoutError) {
|
|
163
|
+
console.error(`Job ${error.jobId} timed out after ${error.timeoutMs}ms`);
|
|
164
|
+
} else if (error.name === 'AbortError') {
|
|
165
|
+
console.log('Operation cancelled');
|
|
166
|
+
} else {
|
|
167
|
+
throw error;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
## Idempotency
|
|
173
|
+
|
|
174
|
+
The API uses idempotency keys to prevent duplicate processing. The same key will always return the same result:
|
|
175
|
+
|
|
176
|
+
```typescript
|
|
177
|
+
// Generate a stable key from your repo state
|
|
178
|
+
import crypto from 'crypto';
|
|
179
|
+
import { execSync } from 'child_process';
|
|
180
|
+
|
|
181
|
+
const gitHash = execSync('git rev-parse --short HEAD').toString().trim();
|
|
182
|
+
const idempotencyKey = `my-project:supermodel:${gitHash}`;
|
|
183
|
+
|
|
184
|
+
// This will generate once, then return cached result on subsequent calls
|
|
185
|
+
const result = await client.generateSupermodelGraph(zipBlob, {
|
|
186
|
+
idempotencyKey
|
|
26
187
|
});
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
## Preparing Repository Archives
|
|
191
|
+
|
|
192
|
+
### For Git Repositories (Recommended)
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
cd /path/to/your/repo
|
|
196
|
+
git archive -o /tmp/repo.zip HEAD
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
This automatically respects `.gitignore` and creates clean, reproducible archives.
|
|
200
|
+
|
|
201
|
+
### For Any Directory
|
|
202
|
+
|
|
203
|
+
```bash
|
|
204
|
+
cd /path/to/your/repo
|
|
205
|
+
zip -r /tmp/repo.zip . \
|
|
206
|
+
-x "node_modules/*" \
|
|
207
|
+
-x ".git/*" \
|
|
208
|
+
-x "dist/*" \
|
|
209
|
+
-x "*.pyc" \
|
|
210
|
+
-x "__pycache__/*"
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
### What to Include
|
|
214
|
+
|
|
215
|
+
- ✅ Source code files (`.py`, `.js`, `.ts`, `.java`, etc.)
|
|
216
|
+
- ✅ Configuration files (`package.json`, `pyproject.toml`, etc.)
|
|
217
|
+
- ✅ Type definitions (`.d.ts`, `.pyi`)
|
|
218
|
+
- ❌ Dependencies (`node_modules/`, `venv/`, `target/`)
|
|
219
|
+
- ❌ Build outputs (`dist/`, `build/`, `.next/`)
|
|
220
|
+
- ❌ Large binaries, images, datasets
|
|
221
|
+
|
|
222
|
+
### Size Limits
|
|
27
223
|
|
|
28
|
-
|
|
224
|
+
Archives should be under 50MB. If larger:
|
|
225
|
+
- Ensure dependencies are excluded
|
|
226
|
+
- Consider analyzing a subdirectory
|
|
227
|
+
- Check for accidentally committed binaries
|
|
29
228
|
|
|
30
|
-
|
|
31
|
-
const file = new Blob([await readFile('/tmp/repo.zip')], { type: 'application/zip' });
|
|
229
|
+
## TypeScript Support
|
|
32
230
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
231
|
+
Full TypeScript definitions are included. Types are automatically resolved via `package.json`.
|
|
232
|
+
|
|
233
|
+
```typescript
|
|
234
|
+
import type {
|
|
235
|
+
SupermodelIR,
|
|
236
|
+
CodeGraphEnvelope,
|
|
237
|
+
DomainClassificationResponse,
|
|
238
|
+
} from '@supermodeltools/sdk';
|
|
239
|
+
|
|
240
|
+
// Types are available for all request/response models
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
## Environment Support
|
|
244
|
+
|
|
245
|
+
- ✅ Node.js (18+)
|
|
246
|
+
- ✅ Modern browsers (with Blob support)
|
|
247
|
+
- ✅ Webpack, Vite, Rollup
|
|
248
|
+
- ✅ ES6 modules and CommonJS
|
|
249
|
+
|
|
250
|
+
## Authentication
|
|
251
|
+
|
|
252
|
+
Get your API key from the [Supermodel Dashboard](https://dashboard.supermodeltools.com).
|
|
253
|
+
|
|
254
|
+
```typescript
|
|
255
|
+
const api = new DefaultApi(new Configuration({
|
|
256
|
+
basePath: 'https://api.supermodeltools.com',
|
|
257
|
+
apiKey: () => process.env.SUPERMODEL_API_KEY || ''
|
|
258
|
+
}));
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
## Rate Limiting
|
|
262
|
+
|
|
263
|
+
The API includes rate limiting headers in responses:
|
|
264
|
+
|
|
265
|
+
```typescript
|
|
266
|
+
const response = await rawApi.generateDependencyGraphRaw({
|
|
267
|
+
idempotencyKey: 'key',
|
|
268
|
+
file: blob
|
|
36
269
|
});
|
|
37
270
|
|
|
38
|
-
console.log(
|
|
271
|
+
console.log(response.raw.headers.get('RateLimit-Limit'));
|
|
272
|
+
console.log(response.raw.headers.get('RateLimit-Remaining'));
|
|
273
|
+
console.log(response.raw.headers.get('RateLimit-Reset'));
|
|
39
274
|
```
|
|
40
275
|
|
|
41
|
-
##
|
|
276
|
+
## Examples
|
|
277
|
+
|
|
278
|
+
### Integration with mcpbr
|
|
42
279
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
| `generateDependencyGraph` | File-level dependency graph |
|
|
46
|
-
| `generateCallGraph` | Function-level call graph |
|
|
47
|
-
| `generateDomainGraph` | Domain model classification |
|
|
48
|
-
| `generateParseGraph` | AST parse tree relationships |
|
|
49
|
-
| `generateSupermodelGraph` | Full Supermodel IR bundle |
|
|
280
|
+
```typescript
|
|
281
|
+
import { SupermodelClient, DefaultApi, Configuration } from '@supermodeltools/sdk';
|
|
50
282
|
|
|
51
|
-
|
|
283
|
+
const api = new DefaultApi(new Configuration({
|
|
284
|
+
basePath: process.env.SUPERMODEL_BASE_URL || 'https://api.supermodeltools.com',
|
|
285
|
+
apiKey: () => process.env.SUPERMODEL_API_KEY || ''
|
|
286
|
+
}));
|
|
287
|
+
|
|
288
|
+
// Configure for long-running benchmark operations
|
|
289
|
+
const client = new SupermodelClient(api, {
|
|
290
|
+
timeoutMs: 900000, // 15 minutes
|
|
291
|
+
maxPollingAttempts: 90, // 90 attempts
|
|
292
|
+
onPollingProgress: (progress) => {
|
|
293
|
+
console.log(`[${progress.jobId}] ${progress.status} - ` +
|
|
294
|
+
`attempt ${progress.attempt}/${progress.maxAttempts}`);
|
|
295
|
+
}
|
|
296
|
+
});
|
|
297
|
+
```
|
|
52
298
|
|
|
53
299
|
## Links
|
|
54
300
|
|
|
55
301
|
- [API Documentation](https://docs.supermodeltools.com)
|
|
56
|
-
- [
|
|
302
|
+
- [GitHub Repository](https://github.com/supermodeltools/supermodel-public-api)
|
|
303
|
+
- [Dashboard](https://dashboard.supermodeltools.com)
|
|
304
|
+
- [Terms of Service](https://supermodeltools.com/legal/api-terms)
|
|
305
|
+
|
|
306
|
+
## License
|
|
307
|
+
|
|
308
|
+
This SDK is licensed under the MIT License. See the main repository for details.
|
package/dist/apis/DefaultApi.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Supermodel
|
|
3
3
|
* Code Graphing & Analysis API
|
|
4
4
|
*
|
|
5
|
-
* The version of the OpenAPI document: 0.
|
|
5
|
+
* The version of the OpenAPI document: 0.7.0
|
|
6
6
|
*
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -15,6 +15,34 @@
|
|
|
15
15
|
* @interface ClassificationStats
|
|
16
16
|
*/
|
|
17
17
|
export interface ClassificationStats {
|
|
18
|
+
/**
|
|
19
|
+
* Total number of nodes in the graph
|
|
20
|
+
* @type {number}
|
|
21
|
+
* @memberof ClassificationStats
|
|
22
|
+
*/
|
|
23
|
+
nodeCount: number;
|
|
24
|
+
/**
|
|
25
|
+
* Total number of relationships in the graph
|
|
26
|
+
* @type {number}
|
|
27
|
+
* @memberof ClassificationStats
|
|
28
|
+
*/
|
|
29
|
+
relationshipCount: number;
|
|
30
|
+
/**
|
|
31
|
+
* Count of nodes by type
|
|
32
|
+
* @type {{ [key: string]: number; }}
|
|
33
|
+
* @memberof ClassificationStats
|
|
34
|
+
*/
|
|
35
|
+
nodeTypes: {
|
|
36
|
+
[key: string]: number;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Count of relationships by type
|
|
40
|
+
* @type {{ [key: string]: number; }}
|
|
41
|
+
* @memberof ClassificationStats
|
|
42
|
+
*/
|
|
43
|
+
relationshipTypes: {
|
|
44
|
+
[key: string]: number;
|
|
45
|
+
};
|
|
18
46
|
/**
|
|
19
47
|
* Number of domains discovered
|
|
20
48
|
* @type {number}
|
|
@@ -22,11 +50,29 @@ export interface ClassificationStats {
|
|
|
22
50
|
*/
|
|
23
51
|
domainCount: number;
|
|
24
52
|
/**
|
|
25
|
-
* Number of
|
|
53
|
+
* Number of subdomains discovered
|
|
26
54
|
* @type {number}
|
|
27
55
|
* @memberof ClassificationStats
|
|
28
56
|
*/
|
|
29
|
-
|
|
57
|
+
subdomainCount: number;
|
|
58
|
+
/**
|
|
59
|
+
* Number of files assigned to domains/subdomains
|
|
60
|
+
* @type {number}
|
|
61
|
+
* @memberof ClassificationStats
|
|
62
|
+
*/
|
|
63
|
+
assignedFileCount: number;
|
|
64
|
+
/**
|
|
65
|
+
* Number of functions assigned to domains/subdomains
|
|
66
|
+
* @type {number}
|
|
67
|
+
* @memberof ClassificationStats
|
|
68
|
+
*/
|
|
69
|
+
assignedFunctionCount: number;
|
|
70
|
+
/**
|
|
71
|
+
* Number of classes assigned to domains/subdomains
|
|
72
|
+
* @type {number}
|
|
73
|
+
* @memberof ClassificationStats
|
|
74
|
+
*/
|
|
75
|
+
assignedClassCount: number;
|
|
30
76
|
/**
|
|
31
77
|
* Count of file assignments
|
|
32
78
|
* @type {number}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Supermodel
|
|
5
5
|
* Code Graphing & Analysis API
|
|
6
6
|
*
|
|
7
|
-
* The version of the OpenAPI document: 0.
|
|
7
|
+
* The version of the OpenAPI document: 0.7.0
|
|
8
8
|
*
|
|
9
9
|
*
|
|
10
10
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -15,10 +15,24 @@
|
|
|
15
15
|
* Check if a given object implements the ClassificationStats interface.
|
|
16
16
|
*/
|
|
17
17
|
export function instanceOfClassificationStats(value) {
|
|
18
|
-
if (!('
|
|
18
|
+
if (!('nodeCount' in value) || value['nodeCount'] === undefined)
|
|
19
19
|
return false;
|
|
20
20
|
if (!('relationshipCount' in value) || value['relationshipCount'] === undefined)
|
|
21
21
|
return false;
|
|
22
|
+
if (!('nodeTypes' in value) || value['nodeTypes'] === undefined)
|
|
23
|
+
return false;
|
|
24
|
+
if (!('relationshipTypes' in value) || value['relationshipTypes'] === undefined)
|
|
25
|
+
return false;
|
|
26
|
+
if (!('domainCount' in value) || value['domainCount'] === undefined)
|
|
27
|
+
return false;
|
|
28
|
+
if (!('subdomainCount' in value) || value['subdomainCount'] === undefined)
|
|
29
|
+
return false;
|
|
30
|
+
if (!('assignedFileCount' in value) || value['assignedFileCount'] === undefined)
|
|
31
|
+
return false;
|
|
32
|
+
if (!('assignedFunctionCount' in value) || value['assignedFunctionCount'] === undefined)
|
|
33
|
+
return false;
|
|
34
|
+
if (!('assignedClassCount' in value) || value['assignedClassCount'] === undefined)
|
|
35
|
+
return false;
|
|
22
36
|
if (!('fileAssignments' in value) || value['fileAssignments'] === undefined)
|
|
23
37
|
return false;
|
|
24
38
|
if (!('functionAssignments' in value) || value['functionAssignments'] === undefined)
|
|
@@ -37,8 +51,15 @@ export function ClassificationStatsFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
37
51
|
return json;
|
|
38
52
|
}
|
|
39
53
|
return {
|
|
40
|
-
'
|
|
54
|
+
'nodeCount': json['nodeCount'],
|
|
41
55
|
'relationshipCount': json['relationshipCount'],
|
|
56
|
+
'nodeTypes': json['nodeTypes'],
|
|
57
|
+
'relationshipTypes': json['relationshipTypes'],
|
|
58
|
+
'domainCount': json['domainCount'],
|
|
59
|
+
'subdomainCount': json['subdomainCount'],
|
|
60
|
+
'assignedFileCount': json['assignedFileCount'],
|
|
61
|
+
'assignedFunctionCount': json['assignedFunctionCount'],
|
|
62
|
+
'assignedClassCount': json['assignedClassCount'],
|
|
42
63
|
'fileAssignments': json['fileAssignments'],
|
|
43
64
|
'functionAssignments': json['functionAssignments'],
|
|
44
65
|
'unassignedFunctions': json['unassignedFunctions'],
|
|
@@ -50,8 +71,15 @@ export function ClassificationStatsToJSON(value) {
|
|
|
50
71
|
return value;
|
|
51
72
|
}
|
|
52
73
|
return {
|
|
53
|
-
'
|
|
74
|
+
'nodeCount': value['nodeCount'],
|
|
54
75
|
'relationshipCount': value['relationshipCount'],
|
|
76
|
+
'nodeTypes': value['nodeTypes'],
|
|
77
|
+
'relationshipTypes': value['relationshipTypes'],
|
|
78
|
+
'domainCount': value['domainCount'],
|
|
79
|
+
'subdomainCount': value['subdomainCount'],
|
|
80
|
+
'assignedFileCount': value['assignedFileCount'],
|
|
81
|
+
'assignedFunctionCount': value['assignedFunctionCount'],
|
|
82
|
+
'assignedClassCount': value['assignedClassCount'],
|
|
55
83
|
'fileAssignments': value['fileAssignments'],
|
|
56
84
|
'functionAssignments': value['functionAssignments'],
|
|
57
85
|
'unassignedFunctions': value['unassignedFunctions'],
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Supermodel
|
|
3
3
|
* Code Graphing & Analysis API
|
|
4
4
|
*
|
|
5
|
-
* The version of the OpenAPI document: 0.
|
|
5
|
+
* The version of the OpenAPI document: 0.7.0
|
|
6
6
|
*
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import type { CodeGraphStats } from './CodeGraphStats';
|
|
13
13
|
import type { CodeGraphEnvelopeGraph } from './CodeGraphEnvelopeGraph';
|
|
14
|
+
import type { CodeGraphEnvelopeMetadata } from './CodeGraphEnvelopeMetadata';
|
|
14
15
|
/**
|
|
15
16
|
*
|
|
16
17
|
* @export
|
|
@@ -35,6 +36,12 @@ export interface CodeGraphEnvelope {
|
|
|
35
36
|
* @memberof CodeGraphEnvelope
|
|
36
37
|
*/
|
|
37
38
|
stats?: CodeGraphStats;
|
|
39
|
+
/**
|
|
40
|
+
*
|
|
41
|
+
* @type {CodeGraphEnvelopeMetadata}
|
|
42
|
+
* @memberof CodeGraphEnvelope
|
|
43
|
+
*/
|
|
44
|
+
metadata?: CodeGraphEnvelopeMetadata;
|
|
38
45
|
/**
|
|
39
46
|
*
|
|
40
47
|
* @type {CodeGraphEnvelopeGraph}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Supermodel
|
|
5
5
|
* Code Graphing & Analysis API
|
|
6
6
|
*
|
|
7
|
-
* The version of the OpenAPI document: 0.
|
|
7
|
+
* The version of the OpenAPI document: 0.7.0
|
|
8
8
|
*
|
|
9
9
|
*
|
|
10
10
|
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
*/
|
|
14
14
|
import { CodeGraphStatsFromJSON, CodeGraphStatsToJSON, } from './CodeGraphStats';
|
|
15
15
|
import { CodeGraphEnvelopeGraphFromJSON, CodeGraphEnvelopeGraphToJSON, } from './CodeGraphEnvelopeGraph';
|
|
16
|
+
import { CodeGraphEnvelopeMetadataFromJSON, CodeGraphEnvelopeMetadataToJSON, } from './CodeGraphEnvelopeMetadata';
|
|
16
17
|
/**
|
|
17
18
|
* Check if a given object implements the CodeGraphEnvelope interface.
|
|
18
19
|
*/
|
|
@@ -32,6 +33,7 @@ export function CodeGraphEnvelopeFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
32
33
|
'generatedAt': json['generatedAt'] == null ? undefined : (new Date(json['generatedAt'])),
|
|
33
34
|
'message': json['message'] == null ? undefined : json['message'],
|
|
34
35
|
'stats': json['stats'] == null ? undefined : CodeGraphStatsFromJSON(json['stats']),
|
|
36
|
+
'metadata': json['metadata'] == null ? undefined : CodeGraphEnvelopeMetadataFromJSON(json['metadata']),
|
|
35
37
|
'graph': CodeGraphEnvelopeGraphFromJSON(json['graph']),
|
|
36
38
|
};
|
|
37
39
|
}
|
|
@@ -43,6 +45,7 @@ export function CodeGraphEnvelopeToJSON(value) {
|
|
|
43
45
|
'generatedAt': value['generatedAt'] == null ? undefined : ((value['generatedAt']).toISOString()),
|
|
44
46
|
'message': value['message'],
|
|
45
47
|
'stats': CodeGraphStatsToJSON(value['stats']),
|
|
48
|
+
'metadata': CodeGraphEnvelopeMetadataToJSON(value['metadata']),
|
|
46
49
|
'graph': CodeGraphEnvelopeGraphToJSON(value['graph']),
|
|
47
50
|
};
|
|
48
51
|
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Supermodel
|
|
3
|
+
* Code Graphing & Analysis API
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 0.7.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Analysis metadata including timing and file information
|
|
14
|
+
* @export
|
|
15
|
+
* @interface CodeGraphEnvelopeMetadata
|
|
16
|
+
*/
|
|
17
|
+
export interface CodeGraphEnvelopeMetadata {
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
* @type {Date}
|
|
21
|
+
* @memberof CodeGraphEnvelopeMetadata
|
|
22
|
+
*/
|
|
23
|
+
analysisStartTime?: Date;
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @type {Date}
|
|
27
|
+
* @memberof CodeGraphEnvelopeMetadata
|
|
28
|
+
*/
|
|
29
|
+
analysisEndTime?: Date;
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* @type {number}
|
|
33
|
+
* @memberof CodeGraphEnvelopeMetadata
|
|
34
|
+
*/
|
|
35
|
+
fileCount?: number;
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
* @type {Array<string>}
|
|
39
|
+
* @memberof CodeGraphEnvelopeMetadata
|
|
40
|
+
*/
|
|
41
|
+
languages?: Array<string>;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Check if a given object implements the CodeGraphEnvelopeMetadata interface.
|
|
45
|
+
*/
|
|
46
|
+
export declare function instanceOfCodeGraphEnvelopeMetadata(value: object): value is CodeGraphEnvelopeMetadata;
|
|
47
|
+
export declare function CodeGraphEnvelopeMetadataFromJSON(json: any): CodeGraphEnvelopeMetadata;
|
|
48
|
+
export declare function CodeGraphEnvelopeMetadataFromJSONTyped(json: any, ignoreDiscriminator: boolean): CodeGraphEnvelopeMetadata;
|
|
49
|
+
export declare function CodeGraphEnvelopeMetadataToJSON(value?: CodeGraphEnvelopeMetadata | null): any;
|