Skip to content

Add content resource sync SDK support#56

Open
basit3407 wants to merge 2 commits into
mainfrom
codex/content-sync-sdk
Open

Add content resource sync SDK support#56
basit3407 wants to merge 2 commits into
mainfrom
codex/content-sync-sdk

Conversation

@basit3407
Copy link
Copy Markdown
Collaborator

@basit3407 basit3407 commented May 11, 2026

Summary

  • Adds typed client.resources.sync(options) and client.resources.findSnapshot(resourceGroup, id, options?) helpers.
  • Exposes the same helpers under client.content.v4.resources.
  • Adds content sync response, mutation, snapshot, resource group, and option types.
  • Adds MSW coverage and resource tests for request serialization and response camel-casing.
  • Updates SDK resources docs and adds a changeset.

Docs dependency

Validation

  • pnpm --filter @quranjs/api generate:operation-catalogs

  • pnpm --filter @quranjs/api check:operation-catalogs

  • pnpm --filter @quranjs/api exec vitest run test/resources.test.ts

  • pnpm --filter @quranjs/api build

  • GitHub CI rerun passed: Operation Catalogs, Test, Build, Typecheck, Lint, and Size.

  • C:\Code\qf-user-poc production smoke using the SDK PR build (createServerClient from C:\Code\api-js-content-sync-sdk\packages\api\dist\server.min.mjs): verified client.resources.sync, client.resources.findSnapshot, client.content.v4.resources.sync, and client.content.v4.resources.findSnapshot; translations:158 bootstrap returned sequence 4, snapshot returned 6236 records, and 46:15 record 1089266 was present.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 11, 2026

size-limit report 📦

Path Size
dist/index.min.js 4.47 KB (+0.75% 🔺)
dist/index.min.mjs 4.52 KB (+0.74% 🔺)
dist/server.min.js 10.42 KB (+1.06% 🔺)
dist/public.min.js 5.84 KB (0%)

@basit3407 basit3407 marked this pull request as ready for review May 12, 2026 03:02
@basit3407 basit3407 requested a review from Copilot May 12, 2026 03:09
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds SDK support for v4 content resource synchronization, enabling clients to incrementally sync public content resources and fetch full resource snapshots, with accompanying types, mocks/tests, docs, and a changeset.

Changes:

  • Add typed helpers: client.resources.sync(options) and client.resources.findSnapshot(resourceGroup, id, options?), also exposed via client.content.v4.resources.
  • Introduce new content sync and snapshot TypeScript types and update MSW handlers/tests to validate query/path serialization and response camel-casing.
  • Update docs for the new sync workflow and add a minor-version changeset.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/api/test/resources.test.ts Adds tests for sync/snapshot param serialization, camel-casing, and namespaced exposure.
packages/api/src/types/api/Resources.ts Adds new sync/snapshot option and response/mutation/snapshot types.
packages/api/src/sdk/resources.ts Implements sync() and findSnapshot() on QuranResources.
packages/api/src/runtime/create-client.ts Exposes new helpers under client.content.v4.resources.
packages/api/src/generated/specs/operation-catalog.json Updates generated catalog to include resources sync/snapshot (and additional content ops from regen).
packages/api/mocks/handlers.ts Adds MSW handlers for resources sync and snapshot endpoints.
apps/docs/content/docs/resources.mdx Documents the content resource sync workflow and references new types.
.changeset/content-resource-sync.md Adds a minor changeset for the new SDK surface area.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread apps/docs/content/docs/resources.mdx Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 8 changed files in this pull request and generated no new comments.

@basit3407 basit3407 requested a review from osamasayed May 12, 2026 04:21
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.

2 participants