mirror of
https://github.com/personamanagmentlayer/pcl.git
synced 2026-09-14 15:40:22 +08:00
fix: address Copilot PR review comments
- Add missing Resource import to telemetry.ts - Fix inconsistent Secret type in JWT signRefreshToken - Replace 'any' with 'unknown' for better type safety in skill registry - Fix UUID validation to match actual ID format (user_timestamp_random) Resolves 6 of 8 Copilot review comments for improved type safety
This commit is contained in:
@@ -62,7 +62,7 @@ export type RefreshTokenRequest = z.infer<typeof RefreshTokenSchema>;
|
||||
* User response schema (public user data)
|
||||
*/
|
||||
export const UserResponseSchema = z.object({
|
||||
id: z.string().uuid(),
|
||||
id: z.string().min(1),
|
||||
username: z.string(),
|
||||
email: z.string().email(),
|
||||
fullName: z.string().optional(),
|
||||
|
||||
@@ -91,8 +91,8 @@ export function signRefreshToken(
|
||||
const secret = config?.secret || jwtConfig.secret;
|
||||
const expiresIn = config?.refreshExpiresIn || jwtConfig.refreshExpiresIn;
|
||||
|
||||
// @ts-expect-error - jwt.sign overload resolution issue
|
||||
return jwt.sign({ ...payload, jti: generateJTI() }, secret as string, {
|
||||
// @ts-expect-error - jwt.sign overload resolution issue with Secret type
|
||||
return jwt.sign({ ...payload, jti: generateJTI() }, secret as Secret, {
|
||||
expiresIn,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ export class FormattingProvider {
|
||||
? ' '.repeat(options.tabSize || 2)
|
||||
: '\t';
|
||||
|
||||
for (let line of lines) {
|
||||
for (const line of lines) {
|
||||
const trimmed = line.trim();
|
||||
|
||||
// Skip empty lines
|
||||
|
||||
@@ -146,7 +146,6 @@ export function initTelemetry(config: Partial<TelemetryConfig> = {}): void {
|
||||
}
|
||||
|
||||
// Create resource identifying this service
|
||||
// @ts-expect-error - Resource import issue
|
||||
const resource = new Resource({
|
||||
[ATTR_SERVICE_NAME]: fullConfig.serviceName,
|
||||
[ATTR_SERVICE_VERSION]: fullConfig.serviceVersion || '1.0.0',
|
||||
|
||||
+1
-1
@@ -1090,7 +1090,7 @@ export class Parser {
|
||||
|
||||
// Bidirectional operator (<->)
|
||||
private parseWorkflowBidirectional(): AST.WorkflowExpression {
|
||||
let left = this.parseWorkflowAsyncPipe();
|
||||
const left = this.parseWorkflowAsyncPipe();
|
||||
|
||||
if (this.match(TokenType.LT_MINUS_GT)) {
|
||||
const right = this.parseWorkflowAsyncPipe();
|
||||
|
||||
@@ -139,7 +139,7 @@ export interface SkillRegistry {
|
||||
* Skill Registry Implementation
|
||||
*/
|
||||
export class SkillRegistryImpl implements SkillRegistry {
|
||||
constructor(private backend: any) {}
|
||||
constructor(private backend: unknown) {}
|
||||
|
||||
/**
|
||||
* Search for skills with advanced filters
|
||||
@@ -570,6 +570,6 @@ export class SkillRegistryImpl implements SkillRegistry {
|
||||
/**
|
||||
* Create skill registry instance
|
||||
*/
|
||||
export function createSkillRegistry(backend: any): SkillRegistry {
|
||||
export function createSkillRegistry(backend: unknown): SkillRegistry {
|
||||
return new SkillRegistryImpl(backend);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user