Skip to content

Conversation

@marcrupt
Copy link
Collaborator

@marcrupt marcrupt commented Nov 20, 2025

Summary by CodeRabbit

  • Documentation

    • Updated SDK examples to use default import and simpler constructor; updated inbox/message usage and example addresses. Removed several "Essentials" docs (Markdown, Code Blocks, Prose Components, Images & Embeds). API docs now show list responses as raw arrays and return resource bodies for delete operations.
  • New Features

    • Added Domains and Webhook Attempts docs; introduced attachments schema for messages.
  • Refactor

    • Reorganized inbox/message API surface for a more granular inbox namespace.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Nov 20, 2025

Walkthrough

The PR updates SDK usage and docs to import Sendook as a default export from @sendook/node, simplifies the constructor to new Sendook(apiKey), renames client paths from inboxes/messages to inbox/inbox.message, changes example addresses, adjusts OpenAPI list/delete responses, adds Domains/WebhookAttempt/Attachment schemas, and removes several Essentials docs.

Changes

Cohort / File(s) Summary
SDK API surface & examples
README.md, landing/app/components/HeroCodeDemo.vue, landing/content/1.docs/1.getting-started/{1.index.md,2.installation.md,3.usage.md}, node-sdk/README.md, node-sdk/package.json
Switched imports to default (import Sendook from "@sendook/node"), changed constructor new Sendook({ apiKey })new Sendook(apiKey), renamed client paths client.inboxes.*client.inbox.* and client.messages.*client.inbox.message.*, updated example inbox addresses, and bumped node-sdk version.
Docs rendering / template tweaks
landing/app/pages/docs/[...slug].vue, landing/app/pages/index.vue
TOC mapping now ensures children: [] on links; minor refactor of async-data usage and template formatting with no behavioral change.
Documentation removals
landing/content/1.docs/2.essentials/{1.markdown-syntax.md,2.code-blocks.md,3.prose-components.md,4.images-embeds.md}
Deleted four "Essentials" documentation pages (Markdown syntax, code blocks, prose components, images/embeds).
Navigation config
landing/content/1.docs/2.essentials/.navigation.yml
Removed the title field for the Essentials navigation file.
API docs & OpenAPI changes
landing/content/1.docs/2.api/*, node-sdk/openapi.yaml, landing/content/1.docs/2.api/{2.api-keys.md,3.domains.md,4.inboxes.md,5.messages.md,6.threads.md,7.webhooks.md}
Converted many list responses from { data: [...] } to raw arrays, changed delete/mutation responses from 204 to 200 with resource bodies, added Domains/DNS endpoints and schemas, added WebhookAttempt/Attachment/DnsRecord schemas, and added attachments to Message schema.
Build/config
landing/nuxt.config.ts
Repositioned devtools config block (structural change only; no functional difference).

Sequence Diagram(s)

sequenceDiagram
  participant Dev as Developer
  participant SDK as Sendook SDK
  participant API as Sendook HTTP API

  Dev->>SDK: import Sendook from "@sendook/node"\nconst client = new Sendook(apiKey)
  Dev->>SDK: client.inbox.create(payload)
  SDK->>API: POST /v1/inboxes
  API-->>SDK: 201 Created (inbox object)
  SDK-->>Dev: returns inbox

  Dev->>SDK: client.inbox.message.send(inboxId, message)
  SDK->>API: POST /v1/inboxes/{id}/messages
  API-->>SDK: 200 OK (message object)
  SDK-->>Dev: returns message
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Check consistency of import/constructor updates across all docs and examples.
  • Verify all client path renames (inboxesinbox, messagesinbox.message) are exhaustive.
  • Review OpenAPI changes for response-shape impacts and new Domain/WebhookAttempt/Attachment schemas.

Possibly related PRs

Suggested reviewers

  • ahmedmawiri

Poem

🐰 I hopped from named to default, quick and bright,
New inbox paths now gleam in morning light,
One-string API keys snug and lean,
Docs trimmed tidy — fresh and clean. ✨📬

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Title check ⚠️ Warning The pull request title is overly broad and fails to capture the substantial API changes made throughout the codebase, including import changes, constructor signature updates, method path refactoring, and removal of documentation sections. Use a more specific title that reflects the major changes, such as 'Refactor SDK API surface: migrate to default exports, update constructor signatures, and reorganize method namespaces' or similar that captures the extent of the changes.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch marc/rup-892-docs-polishing-remove-unwanted-stuff

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 60eb054 and fa03232.

📒 Files selected for processing (2)
  • node-sdk/README.md (1 hunks)
  • node-sdk/package.json (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • node-sdk/README.md
🔇 Additional comments (1)
node-sdk/package.json (1)

3-3: Version bump is appropriate for the breaking API changes in this PR.

The minor version increment (0.5.0 → 0.6.0) aligns with the significant API surface changes mentioned in the PR (export pattern changes, renamed client paths, constructor simplification). For 0.x pre-release packages, bumping the minor version for breaking changes follows semver conventions.

Ensure that a changelog or release notes document these breaking changes so users upgrading from 0.5.0 understand the migration path (e.g., updating imports from named exports to default export, renaming inboxes/messages to inbox/inbox.message).


Comment @coderabbitai help to get the list of available commands and usage tips.

@vercel
Copy link

vercel bot commented Nov 20, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
sendook Ready Ready Preview Comment Nov 20, 2025 3:22pm
sendook-app Ready Ready Preview Comment Nov 20, 2025 3:22pm

@marcrupt marcrupt marked this pull request as ready for review November 20, 2025 15:03
@marcrupt marcrupt requested a review from ahmedmawiri November 20, 2025 15:03
@marcrupt marcrupt changed the title [WIP] Update api documentation examples and layout Update api documentation examples and layout Nov 20, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
landing/content/1.docs/2.api/7.webhooks.md (1)

78-100: Critical: Webhook field naming inconsistency.

Line 94 uses "_id" while the create webhook response (line 50), list webhooks response (line 69), delete webhook response (line 136), and webhook attempts (line 162) all use "id". This inconsistency will confuse API consumers and contradicts the broader PR changes renaming _id to id.

Apply this diff to fix the field name:

 ### Response `200 OK`
 
 ```json
 {
-  "_id": "wh_01J3ZP8K9M2N3O4P5Q6R7S8T9U",
+  "id": "wh_01J3ZP8K9M2N3O4P5Q6R7S8T9U",
   "url": "https://example.com/webhooks/sendook",
   "events": ["message.received", "message.delivered"],
   "createdAt": "2024-10-10T19:30:15Z",
   "updatedAt": "2024-10-10T19:30:15Z"
 }
🧹 Nitpick comments (3)
landing/app/pages/docs/[...slug].vue (1)

54-54: Replace any type with proper type annotation.

Using any type annotation bypasses TypeScript's type checking. Consider defining or importing a proper type for TOC links to maintain type safety.

Apply this diff to improve type safety:

-      <UContentToc :links="page.body.toc.links?.map((link: any) => ({ ...link, children: [] }))" />
+      <UContentToc :links="page.body.toc.links?.map((link) => ({ ...link, children: [] }))" />

Alternatively, if a specific type is available from the content/UI library:

// Add proper type import at the top
import type { TocLink } from '#ui/types'  // or wherever the type is defined
-      <UContentToc :links="page.body.toc.links?.map((link: any) => ({ ...link, children: [] }))" />
+      <UContentToc :links="page.body.toc.links?.map((link: TocLink) => ({ ...link, children: [] }))" />

Note: The transformation forces all TOC links to have empty children arrays, effectively flattening nested table of contents. If this is intentional for the layout update, consider adding a comment explaining this behavior.

landing/content/1.docs/2.api/5.messages.md (1)

33-52: Clarify required vs. optional attachment fields in table format.

Line 52 documents attachments with mixed formatting. The inline description clarifies that content is required while name and contentType are optional, but a table format like other complex fields would improve consistency and scannability.

For improved consistency with other field documentation, consider expanding line 52 to a mini-table or formatted list:

-| `attachments` | object[] | No | Array of file attachments. Each attachment must include `content` (base64-encoded), optional `name` (filename), and optional `contentType` (MIME type). |
+| `attachments` | object[] | No | Array of file attachments (see attachment schema below). |
+
+**Attachment schema:**
+| Field | Type | Required | Description |
+| ----- | ---- | -------- | ----------- |
+| `content` | string | Yes | Base64-encoded file content. |
+| `name` | string | No | Filename for the attachment. |
+| `contentType` | string | No | MIME type of the attachment. |
node-sdk/openapi.yaml (1)

54-56: Consider adding maxItems constraints to array responses.

Per static analysis (CKV_OPENAPI_21), array responses should have a maximum item count to prevent excessive payloads. Currently, array responses for webhooks (line 54), webhook attempts (lines 140-142), domains (lines 269-271), DNS records (lines 352-354), inboxes (lines 399-401), messages (lines 518-520), and threads (lines 563-565) lack maxItems constraints.

This is a security hardening measure to prevent abuse. Consider adding maxItems to each array response. For example:

  responses:
    "200":
      description: A collection of webhooks
      content:
        application/json:
          schema:
            type: array
+           maxItems: 1000
            items:
              $ref: '#/components/schemas/Webhook'

Determine the appropriate maxItems limit for each endpoint based on your API's design (typically 100-1000 for list endpoints).

Also applies to: 126-148, 258-277, 338-362

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5ae0306 and 60eb054.

📒 Files selected for processing (8)
  • landing/app/pages/docs/[...slug].vue (1 hunks)
  • landing/content/1.docs/2.api/2.api-keys.md (2 hunks)
  • landing/content/1.docs/2.api/3.domains.md (1 hunks)
  • landing/content/1.docs/2.api/4.inboxes.md (2 hunks)
  • landing/content/1.docs/2.api/5.messages.md (3 hunks)
  • landing/content/1.docs/2.api/6.threads.md (1 hunks)
  • landing/content/1.docs/2.api/7.webhooks.md (4 hunks)
  • node-sdk/openapi.yaml (16 hunks)
🧰 Additional context used
🪛 Checkov (3.2.334)
node-sdk/openapi.yaml

[medium] 54-58: Ensure that arrays have a maximum number of items

(CKV_OPENAPI_21)

🔇 Additional comments (3)
landing/content/1.docs/2.api/7.webhooks.md (1)

144-197: Well-documented new webhook attempts endpoint.

The new "List webhook attempts" section is comprehensive, with clear path parameters, response structure, and detailed field descriptions. The attempt schema is well-defined and aligns with the OpenAPI specification.

landing/content/1.docs/2.api/3.domains.md (1)

1-206: Comprehensive domain API documentation.

The new domains file is well-structured with clear endpoint documentation, proper formatting, and consistent response patterns aligned with the PR's API surface updates. All endpoints (create, list, retrieve, delete, verify, get DNS records) are properly documented with appropriate HTTP methods, paths, request/response bodies, and field descriptions.

node-sdk/openapi.yaml (1)

636-642: Well-structured webhook and domain schema additions.

The new WebhookCreateRequest, Webhook, WebhookAttempt, Attachment, and DnsRecord schemas are properly defined with clear field descriptions. The WebhookId parameter follows the existing parameter naming convention. Domain schema enhancements (adding verified, records, updatedAt fields) align with the documentation changes.

Also applies to: 846-951

Comment on lines +90 to +95
"200":
description: Webhook deleted
content:
application/json:
schema:
$ref: '#/components/schemas/Webhook'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Webhook field naming inconsistency propagated to OpenAPI spec.

While the OpenAPI schemas correctly use id in the Webhook definition, the documentation for the "Retrieve webhook details" response in landing/content/1.docs/2.api/7.webhooks.md line 94 uses _id. This creates a mismatch between the specification and documentation. The OpenAPI spec is correct; the documentation needs to be fixed (see separate critical issue flag in webhooks.md review).

Verify that the actual webhook responses from the backend always use id (not _id) before merging this PR.

Also applies to: 221-226, 305-310, 435-440

@ahmedmawiri ahmedmawiri merged commit 060a1fc into main Nov 20, 2025
4 checks passed
@ahmedmawiri ahmedmawiri deleted the marc/rup-892-docs-polishing-remove-unwanted-stuff branch November 20, 2025 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants