Conversation
PLAN.md outlines the full rewrite from CoffeeScript to TypeScript: tsdown build, native fetch, async/await, Proxy-based dynamic methods, Vitest tests, Node 24+, and reduction from 9 to 3 runtime deps.
- Rewrite CoffeeScript → TypeScript (strict, ESM + CJS dual output) - Replace `request` with native `fetch` (Node 24+) - Async/await only, callbacks removed - Proxy-based dynamic method generation (replaces `new Function()` + `__proto__` mutation) - Add DSM 7.x API definitions (778 APIs extracted from real SPK packages) - Add Synology Photos station (SYNO.Foto / SYNO.FotoTeam) for DSM 7.x - Add two-factor auth (OTP), session reuse, binary response handling - Add automated SPK fetcher (scripts/fetch-definitions.ts) - CLI rewrite with Commander v12, single parseAsync() - Fix SurveillanceStation error resolver CoffeeScript `or` bug - Fix SID stored as string instead of object (re-auth every call) - Fix CLI missing process.exit(1) on unknown method - Drop browser support, DSM 5.x support - Runtime deps: 3 (down from 9) - Add CI workflow, Dependabot config, branch protection
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Full rewrite of syno from CoffeeScript to modern TypeScript for v3.0.0.
fetch(Node 24+) replaces deprecatedrequestpackagenew Function()+__proto__mutationSYNO.Foto.*/SYNO.FotoTeam.*for DSM 7.xscripts/fetch-definitions.ts) — downloads, decrypts (XChaCha20-Poly1305), extracts definitionscommander,js-yaml,pluralizeBug Fixes
orbug (always truthy)process.exit(1)on unknown methodprogram.parsecalled twiceBreaking Changes
6.0.2to7.2Closes
#73, #72, #75, #77, #42, #40, #29, #48, #39, #41
Test plan
npm run typecheck— zero errorsnpm run lint— zero errorsnpm run build— produces dist/index.js, dist/index.cjs, dist/index.d.ts, dist/cli.cjsnpm test— 89 tests passnode -e "const { Syno } = require('./dist/index.cjs')"node -e "import('./dist/index.js')"node dist/cli.cjs --help