Commit 0f9034b
Bot
feat: implement webhook integration, markdown parser, decentralized storage, and multi-sig timelock
Closes #682 - Webhook integration for lesson completions
Closes #676 - Markdown/MDX content parser service
Closes #681 - Decentralized storage endpoint for lesson content
Closes #691 - Multi-sig timelock contract upgrade to Soroban SDK v22
## Changes
### Issue #682 — Webhook Integration (backend)
- Added WebhookSubscription model to Prisma schema with workspaceId, url,
secret, events (JSON), and active fields
- Added StudentActivity model for webhook event payloads
- Implemented webhook subscription CRUD routes (POST/GET/DELETE
/api/v1/webhooks/subscriptions) in backend/src/routes/webhooks.ts
- Mounted webhook router at /api/v1/webhooks in routes/index.ts
- Triggered lesson.completed webhook events in updateStudentProgress when
a student completes a new lesson for the first time
- Fixed Jest mock queue pollution bug in progress.unit.test.ts
### Issue #676 — Markdown/MDX Parser Service (backend)
- Implemented MarkdownParserService in src/services/markdownParser.service.ts
using marked (v15) for parsing and sanitize-html for XSS protection
- Extracts code blocks, strips MDX JSX components, and returns structured
{ html, codeBlocks, readingTimeMinutes } output
### Issue #681 — Decentralized Storage Endpoint (backend)
- Added GET /api/v1/learning/courses/:courseId/lessons/:lessonId/content route
that resolves IPFS CIDs from DecentralizedAsset records in the database
- Fetches content from configurable IPFS gateway with Redis caching (1-hour TTL)
- Parses fetched Markdown content through MarkdownParserService before returning
### Issue #691 — Multi-Sig Timelock Contract (contracts)
- Added multisig_wallet_timelock crate to workspace Cargo.toml
- Implemented Soroban SDK v22 compatible multisig timelock contract:
* submit_proposal, approve_proposal, execute_proposal with configurable
signer threshold and timelock delay
* require_auth() instead of deprecated env.invoker()
* Bytes storage instead of Vec<u8> for SDK v22 compatibility
- Added 9 comprehensive tests covering full proposal lifecycle
### Additional Fixes
- Fixed Soroban SDK v22 test failures in proxy contract by registering real
compiled WASM via env.deployer().upload_contract_wasm() instead of dummy hashes
- Fixed smart_vault tests that triggered archived-instance errors by reducing
ledger sequence increments to stay within the default test TTL window
- Made database SSL connection optional for local/test environments1 parent 4a91a64 commit 0f9034b
27 files changed
Lines changed: 1202 additions & 88 deletions
File tree
- backend
- prisma
- src
- db
- middleware
- routes
- certificates
- learning
- services
- utils
- tests
- contracts
- multisig_wallet_timelock
- proxy/src
- smart_vault/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
6 | 10 | | |
7 | 11 | | |
8 | 12 | | |
9 | 13 | | |
10 | 14 | | |
11 | 15 | | |
12 | | - | |
13 | 16 | | |
14 | 17 | | |
15 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| 45 | + | |
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
| |||
58 | 60 | | |
59 | 61 | | |
60 | 62 | | |
| 63 | + | |
61 | 64 | | |
62 | 65 | | |
63 | 66 | | |
| |||
0 commit comments