
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@deepcode/tsc
Advanced tools
Typescript consumer of public API
$ npm install --save @deepcode/tsc
import tsc from '@deepcode/tsc';
// An address of server which will be used in order to send code and analyse it.
// Default: 'https://www.deepcode.ai'.
const baseURL = 'https://www.deepcode.ai';
const loginResponse = await tsc.startSession({
baseURL,
// An identificator for the editor using the DeepCode APIs
source: 'atom',
});
if (loginResponse.type === 'error') {
// Handle error and alert user
}
const { sessionToken, loginURL } = loginResponse.value;
const sessionResponse = await tsc.checkSession({ baseURL, sessionToken });
if (sessionResponse.type === 'error') {
// Handle error and alert user
}
const isLoggedIn = sessionResponse.value; // boolean
/** Building bundle process started with provided data */
tsc.emitter.on('scanFilesProgress', (processed: number) = {
console.log(`Indexed ${processed} files`);
});
/** Bundle upload process is started with provided data */
tsc.emitter.on('uploadBundleProgress', (processed: number, total: number) => {
console.log(`Upload bundle progress: ${processed}/${total}`);
});
/** Receives an error object and logs an error message */
tsc.emitter.on('sendError', error => {
console.log(error);
});
Complete list of events:
const bundle = await tsc.analyzeFolders(baseURL, sessionToken, false, 1, ['/home/user/repo']);
// bundle implements interface IFileBundle:
// readonly baseURL: string;
// readonly sessionToken: string;
// readonly includeLint: boolean;
// readonly severity: AnalysisSeverity;
// readonly bundleId: string;
// readonly analysisResults: IAnalysisResult;
// readonly analysisURL: string;
// readonly baseDir: string;
// readonly paths: string[];
// readonly supportedFiles: ISupportedFiles;
const result = await tsc.extendBundle({
sessionToken,
bundleId,
files: {
'/home/user/repo/main.js': '3e297985...',
'/home/user/repo/app.js': 'c8bc6452...',
},
removedFiles: [],
});
const { bundleId, missingFiles, uploadURL } = result;
const bundle = await analyzeGit(baseURL, sessionToken, false, 1, 'git@github.com:DeepCodeAI/cli.git@320d98a6896f5376efe6cefefb6e70b46b97d566');
// bundle implements interface IGitBundle
// readonly baseURL: string;
// readonly sessionToken: string;
// readonly oAuthToken?: string;
// readonly includeLint: boolean;
// readonly severity: AnalysisSeverity;
// readonly bundleId: string;
// readonly analysisResults: IAnalysisResult;
// readonly analysisURL: string;
// readonly sarifResults?: Log;
// readonly gitUri: string;
If there are any errors the result of every call will contain the following:
const { error, statusCode, statusText } = result;
FAQs
Typescript consumer of Deepcode public API (deprecated)
We found that @deepcode/tsc demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.