-
Notifications
You must be signed in to change notification settings - Fork 1
Add auth provider (TE-320) #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds authentication provider support to the task management library. The changes introduce an optional authProvider parameter throughout the API, with 'telegram' as the default provider, allowing the library to support multiple authentication mechanisms.
- Introduces new
optionstypes (TrackOptions,ProcessMethodOptions,ClaimOptions) to pass authentication provider information - Updates method signatures across the codebase to accept optional
optionsparameters - Implements default auth provider fallback logic in HTTP client methods
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/core/src/types/options.ts | New file defining option types with authProvider field and DefaultAuthProvider constant |
| packages/core/src/types/plugin.ts | Updated PluginProcessMethod signature and added new PluginVerifyMethod type to support options |
| packages/core/src/types/index.ts | Added export for the new options module |
| packages/core/src/services/TaskProcessor.ts | Updated goProcess and claimProcess methods to accept and forward options parameters |
| packages/core/src/services/PluginsManager.ts | Changed return type of getVerifyEndpointByID to use new PluginVerifyMethod type |
| packages/core/src/services/HttpClient.ts | Added auth provider support to getTasks, trackEvent, and claimProcess methods with default fallback |
| packages/core/src/index.ts | Updated public API methods to accept options parameters while maintaining backward compatibility |
| packages/core/package.json | Version bump to 0.3.4 and updated types path to reflect build output structure |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| export * from "./plugins/action-based"; | ||
| export * from "./plugins/interfaces"; | ||
| export * from "./plugins/interfaces"; | ||
| export * from "./options" |
Copilot
AI
Dec 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon at the end of the export statement. All other export statements in this file end with semicolons, so this should be consistent.
| export * from "./options" | |
| export * from "./options"; |
| authProvider?: string; | ||
| } | ||
|
|
||
| export interface ClaimOptions { |
Copilot
AI
Dec 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent type definitions: TrackOptions and ProcessMethodOptions use type while ClaimOptions uses interface. Since all three types have the same structure (a single optional authProvider field), they should use the same declaration style for consistency. Consider using type for all three or interface for all three.
| export interface ClaimOptions { | |
| export type ClaimOptions = { |
| import {PluginsManager} from "./PluginsManager"; | ||
| import {EventRegister} from "./EventRegister"; | ||
| import {HttpClient} from "./HttpClient"; | ||
| import { HttpClient} from "./HttpClient"; |
Copilot
AI
Dec 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent import formatting: there's an extra space after the opening brace. Compare with line 1 which doesn't have this spacing. The import should be import {HttpClient} from "./HttpClient"; to match the style of other imports.
| import { HttpClient} from "./HttpClient"; | |
| import {HttpClient} from "./HttpClient"; |
| import {Plugin, PluginProcessMethod, PluginVerifyMethod} from "../types"; | ||
| import {HttpClient} from "./HttpClient"; | ||
|
|
||
|
|
Copilot
AI
Dec 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra blank line added. This introduces unnecessary whitespace that's not consistent with the rest of the file structure.
| export * from "./types/index"; | ||
| import {Config, EventPayloadMap} from "./types"; | ||
| import {HttpClient, TaskFilters} from "./services/HttpClient"; | ||
| import { HttpClient, TaskFilters} from "./services/HttpClient"; |
Copilot
AI
Dec 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent import formatting: there's an extra space after the opening brace. The import should be import {HttpClient, TaskFilters} from "./services/HttpClient"; to match the style of other imports in this file.
| import { HttpClient, TaskFilters} from "./services/HttpClient"; | |
| import {HttpClient, TaskFilters} from "./services/HttpClient"; |
No description provided.