feat: Console SDK update for version 8.1.1#75
Conversation
Greptile SummaryThis PR bumps the Console SDK from version 8.0.0 to 8.1.1, adding new models and a Key changes:
Confidence Score: 5/5Safe to merge — no logic errors or runtime issues found; all remaining findings are non-blocking style/improvement suggestions. All three inline comments are P2 (style/improvement): a type inconsistency in the variables field that may be intentional, an opportunity to use discriminated overloads for better DX, and deprecated transitive devDependencies that don't affect end users. No P0/P1 issues were found. The core logic — the new getHeaders() shallow copy, the union return types, the new model shapes, and the package.json files field fix — are all correct. src/models.ts — worth confirming whether ProviderRepositoryRuntime.variables: string[] vs DetectionVariable[] is intentional; package-lock.json — deprecated transitive devDependencies worth a follow-up upgrade ticket. Important Files Changed
Reviews (1): Last reviewed commit: "chore: update Console SDK to 8.1.1" | Re-trigger Greptile |
| * VCS (Version Control System) installation ID. | ||
| */ | ||
| providerInstallationId: string; | ||
| /** |
There was a problem hiding this comment.
variables type inconsistency across detection models
ProviderRepositoryRuntime.variables is typed as string[], whereas the structurally related DetectionRuntime.variables and DetectionFramework.variables are both typed as DetectionVariable[]. If these represent the same concept (environment variables surfaced from .env files), having two different representations can surprise callers who work with both types.
If the API genuinely returns raw strings here (e.g. just variable names rather than { name, value } objects), this is intentional — but a comment explaining the distinction would help future maintainers.
| /** | |
| /** | |
| * Environment variables found in .env files (raw variable names). | |
| */ | |
| variables: string[]; |
| * @returns {Promise<Models.DetectionRuntime | Models.DetectionFramework>} | ||
| */ | ||
| createRepositoryDetection(params: { installationId: string, providerRepositoryId: string, type: VCSDetectionType, providerRootDirectory?: string }): Promise<Models.DetectionFramework>; | ||
| createRepositoryDetection(params: { installationId: string, providerRepositoryId: string, type: VCSDetectionType, providerRootDirectory?: string }): Promise<Models.DetectionRuntime | Models.DetectionFramework>; |
There was a problem hiding this comment.
Opportunity to use discriminated overloads for precise return types
Both createRepositoryDetection and listRepositories accept a type parameter whose value ('runtime' vs 'framework') fully determines the response shape, yet the signatures return a union, forcing callers to perform their own type narrowing.
TypeScript overloads keyed on the string literal value would let the compiler infer the correct type automatically:
createRepositoryDetection(params: { ..., type: 'runtime', ... }): Promise<Models.DetectionRuntime>;
createRepositoryDetection(params: { ..., type: 'framework', ... }): Promise<Models.DetectionFramework>;
createRepositoryDetection(params: { ..., type: VCSDetectionType, ... }): Promise<Models.DetectionRuntime | Models.DetectionFramework>;The same pattern applies to listRepositories. This is a non-blocking improvement but would provide a significantly better developer experience for SDK consumers.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| "version": "1.0.0", | ||
| "resolved": "https://registry.npmjs.org/is-module/-/is-module-1.0.0.tgz", | ||
| "integrity": "sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==", | ||
| "dev": true, | ||
| "license": "MIT" | ||
| }, | ||
| "node_modules/is-reference": { | ||
| "version": "1.2.1", | ||
| "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz", | ||
| "integrity": "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==", | ||
| "dev": true, | ||
| "license": "MIT", | ||
| "dependencies": { | ||
| "@types/estree": "*" | ||
| } | ||
| }, | ||
| "node_modules/json-bigint": { | ||
| "version": "1.0.0", | ||
| "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz", | ||
| "integrity": "sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ==", | ||
| "license": "MIT", |
There was a problem hiding this comment.
Deprecated transitive devDependencies with security advisories
The lockfile pins two deprecated transitive devDependencies:
glob@8.1.0(via@rollup/plugin-commonjs) — npm marks this version as containing "widely publicised security vulnerabilities"; the npm registry advisory explicitly recommends upgrading to a current version.inflight@1.0.6(viaglob) — deprecated for memory leaks.
Since these are devDependencies they do not ship to end users, but they run during the build/publish pipeline. It is worth upgrading @rollup/plugin-commonjs to a version that pulls in glob@10+ (where the vulnerabilities are fixed), or at minimum tracking this as a known risk until the upstream plugin ships a fix.
|
Closing in favor of a conflict-free PR |
This PR contains updates to the Console SDK for version 8.1.1.