feat: sync JS client with C++ backend#262
Open
AhmedOsman101 wants to merge 1 commit into
Open
Conversation
- Add missing process, locale, and window badge methods - Add `envs` field to `ExecCommandOptions` and `SpawnedProcessOptions` - Add 23 missing error codes + organize with section comments - Add 6 missing Window globals - Fix `NetworkInterfaceInfo` value type to array - Fix `storage.setData` null crash: omit data field when null/undefined
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.
Sync JS Client with C++ Backend
Summary
All 63 C++ API methods, 46 error codes, and 21 injected globals are now declared in the JS client. This PR ships 3 missing functions, 8 type/param fixes, 23 new error codes, and 6 missing
Windowglobals — closing every gap identified in the C++->JS sync audit.Fixes
storage.setDatanull-crash bug where C++ throws on"data": null(now omits the field).Changes
Missing Native Functions (3)
app.getProcessId()—src/api/app.tswindow.setBadge(count)—src/api/window.tsos.getLocale()—src/api/os.ts+LocaleInfotype (src/types/api/os.ts)Parameter / Return Type Fixes (6)
src/types/api/os.tsExecCommandOptions.envs,SpawnedProcessOptions.envssrc/types/api/os.tsKnownPath— added'desktop' | 'home'src/types/enums.tsLoggerType— addedDEBUGsrc/types/api/computer.tsNetworkInterfaceInfo— values areNetworkInterfaceAddress[](was singular)src/types/api/clipboard.tsClipboardImage— addedalphaShift,alphaMaskBug Fix
src/api/storage.ts—setDatano longer sendsdata: nullwhen value is null/undefined, avoiding C++ nlohmann crash. Uses conditional payload.Error Codes — 23 new, 46 total (
src/types/api/protocol.ts)Added all codes from C++
errors.h:NE_FS_REMVERR,NE_FS_NOTADIR,NE_FS_COPYERR,NE_FS_MOVEERR,NE_FS_FILOPER,NE_FS_UNLTOUP,NE_FS_UNLTFOP,NE_FS_UNLCWAT,NE_FS_NOWATID,NE_FS_UNLSTPR,NE_FS_ACSFAIL,NE_FS_CHMDERR,NE_FS_CHWNERRNE_OS_UNLTOUP,NE_OS_INVNOTA,NE_OS_TRAYIER,NE_OS_UNLTRASNE_ST_NOSTKEX,NE_ST_STKEYRE,NE_ST_NOSTDIRNE_CO_UNLTOSC,NE_CO_UNLTOMG,NE_CO_UNLTONI,NE_CO_UNLTOSKNE_WI_UNBSWSRNE_RS_TREEGER,NE_RS_UNBLDRE,NE_RS_NOPATHE,NE_RS_FILEXTF,NE_RS_DIREXTFNE_SR_UNBSEND,NE_SR_UNBPARS,NE_SR_MPINUSE,NE_SR_NOMTPTHNE_CF_UNBLDCF,NE_CF_UNBPRCF,NE_CF_UNSUPMD,NE_CF_UNBLWCFAlso organized all codes under named section comments and removed a duplicate
NE_ST_STKEYWE.Missing Window Globals (6)
Added to
declare global { interface Window { ... } }insrc/index.ts:NL_COMMIT— server commit hashNL_CONFIGFILE— config file pathNL_COMPDATA— compilation dataNL_LOCALE— system localeNL_SINJECTED— server-side injection flagNL_WSAVSTLOADED— window saved-state loaded flag