-
Notifications
You must be signed in to change notification settings - Fork 0
p_sync: FileSyncer + CLI + Local File Usage #30
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
Closed
Closed
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
4dd3d1b
Release 0.8.21
fern-api[bot] 94b6276
Merge custom code from old p_sync/pull branch with latest autogenerat…
AlePouroullis 948de3a
refactor(sync): rename SyncClient to FileSyncer and align with Python…
AlePouroullis b00c3b4
refactor(sync): align FileSyncer with Python SDK and improve TypeScri…
AlePouroullis 2cec6e1
Match CLI functionality with Python SDK; Simplify logging
AlePouroullis a3940fa
refactor: implement unified client overloading system
AlePouroullis 175e42b
refactor: extract path normalization in FileSyncer to separate util
AlePouroullis 3216839
Add tests for pathUtils and fix regression found from new tests
AlePouroullis 322759b
tests: Write unit tests for FileSyncer; fix total page calculation bug
AlePouroullis 1230875
test: Write integration tests for FileSyncer:
AlePouroullis 419cacf
Fix broken relative paths in decorators.test.ts
AlePouroullis 8375441
Improve test cleanup; write tests for local file operations
AlePouroullis 7b4b98f
test: Write tests for CLI
AlePouroullis af8cf59
test: Increase timeout of cleanup in slow integration tests
AlePouroullis c08d600
Updated deps needed to successfully run the tests
AlePouroullis 30acd52
test: Increase timeout for pull_basic test as the pagination can be slow
AlePouroullis 38e6dc8
docs: Add Syncing Files section to README
AlePouroullis 142a4c7
test: Add decorator and local file overload interaction tests; increa…
AlePouroullis 1de00ca
chore: Bump version to 0.8.21-beta2
AlePouroullis 63cd603
test: use npx ts-node for CLI integration tests
AlePouroullis d2ac5a2
docs: add comprehensive documentation for CLI test helper
AlePouroullis 29d9ad9
fix: shorten CLI main help text while preserving detailed subcommand …
AlePouroullis 82d4488
fix: Remove duplicate dependencies
AlePouroullis 4e5174f
test: remove skipped API key validation test from CLI integration tests
AlePouroullis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| /** | ||
| * LRU Cache implementation | ||
| */ | ||
| export default class LRUCache<K, V> { | ||
| private cache: Map<K, V>; | ||
| private readonly maxSize: number; | ||
|
|
||
| constructor(maxSize: number) { | ||
| this.cache = new Map<K, V>(); | ||
| this.maxSize = maxSize; | ||
| } | ||
|
|
||
| get(key: K): V | undefined { | ||
| if (!this.cache.has(key)) { | ||
| return undefined; | ||
| } | ||
|
|
||
| // Get the value | ||
| const value = this.cache.get(key); | ||
|
|
||
| // Remove key and re-insert to mark as most recently used | ||
| this.cache.delete(key); | ||
| this.cache.set(key, value!); | ||
|
|
||
| return value; | ||
| } | ||
|
|
||
| set(key: K, value: V): void { | ||
| // If key already exists, refresh its position | ||
| if (this.cache.has(key)) { | ||
| this.cache.delete(key); | ||
| } | ||
| // If cache is full, remove the least recently used item (first item in the map) | ||
| else if (this.cache.size >= this.maxSize) { | ||
| const lruKey = this.cache.keys().next().value; | ||
| if (lruKey) { | ||
| this.cache.delete(lruKey); | ||
| } | ||
| } | ||
|
|
||
| // Add new key-value pair | ||
| this.cache.set(key, value); | ||
| } | ||
|
|
||
| clear(): void { | ||
| this.cache.clear(); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export { default as LRUCache } from './LRUCache'; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.