Commit Graph

5 Commits

Author SHA1 Message Date
beo3000 dc52f64ed4 feat: activate MSAL auto-login in get-token.ps1
Azure Portal config done:
- Added redirect URI: https://login.microsoftonline.com/common/oauth2/nativeclient
- Allow public client flows: Yes

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-21 22:21:49 +01:00
beo3000 a67dc06b30 feat: set-token.ps1 + JF LANdata import script
- get-token.ps1: reads token from ~/.ka-note/token.txt, validates JWT expiry
- set-token.ps1: stores token (from arg or clipboard) to ~/.ka-note/token.txt with expiry display
- import-jf-landata.ps1: idempotent import for JF LANdata context (12 topics, 14 history entries)
- MSAL auto-login blocked by missing redirect URI in app registration (documented in get-token.ps1)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-21 22:18:18 +01:00
beo3000 3b6ae8c92b feat: auto token acquisition + import helpers for Ka-Note scripts
- get-token.ps1: MSAL.PS-based token acquisition (browser popup once, then cached refresh token)
- download/upload/unlock.ps1: auto-call get-token.ps1 when no -Token/-env provided
- import-helpers.ps1: reusable functions (Upsert-Context, Add-Topic, Add-HistoryEntry) with correct schema
- import-jf-sysadmins.ps1: idempotent import script using helpers

Fixes:
- Token file no longer stored in work/ (deleted on download)
- Upsert-Context resurrects soft-deleted contexts (500 was caused by uploading topics for deleted context)
- History uses topicId + YYYY-MM-DD date (not contextId + timestamp)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-21 22:08:12 +01:00
beo3000 58c990d4e6 feat: ZIP workspace + image blob sync
Phase 1 - ImageBlob sync:
- shared: add ImageBlob type (SyncEntity + contentHash + base64 data)
- shared: add imageBlobs to SyncChanges
- server: image_blobs table (drizzle migration 0005)
- server: sync-service push/pull for imageBlobs (base64 transport)
- client: Dexie v8 schema with SyncEntity-compatible ImageBlob
- client: storeImage computes SHA-256 contentHash
- client: syncService push (Blob→base64) and pull (base64→Blob)

Phase 2 - ZIP AI workspace:
- server: fflate dependency
- server: exportWorkspaceZip() replaces exportBundle()
- server: applyUploadFromZip() with contentHash dedup for images
- server: legacy JSON applyUpload() kept for backward compat
- server: ai-export routes support application/zip upload
- server: README updated for ZIP workspace structure
- scripts: download.ps1 extracts ZIP → work/ subdirs
- scripts: upload.ps1 compresses work/ → ZIP, posts octet-stream
- scripts: unlock.ps1 reads work/manifest.json (also supports legacy bundle)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-21 19:35:12 +01:00
beo3000 04983c2a05 dev 2026-02-21 19:25:43 +01:00