Add content resource sync SDK support#56
Open
basit3407 wants to merge 2 commits into
Open
Conversation
Contributor
size-limit report 📦
|
There was a problem hiding this comment.
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)andclient.resources.findSnapshot(resourceGroup, id, options?), also exposed viaclient.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.
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.
Summary
client.resources.sync(options)andclient.resources.findSnapshot(resourceGroup, id, options?)helpers.client.content.v4.resources.Docs dependency
qf-api-docs/main.qf-api-docs/mainsuccessfully; rerunning generation produced no branch diff.Validation
pnpm --filter @quranjs/api generate:operation-catalogspnpm --filter @quranjs/api check:operation-catalogspnpm --filter @quranjs/api exec vitest run test/resources.test.tspnpm --filter @quranjs/api buildGitHub CI rerun passed: Operation Catalogs, Test, Build, Typecheck, Lint, and Size.
C:\Code\qf-user-pocproduction smoke using the SDK PR build (createServerClientfromC:\Code\api-js-content-sync-sdk\packages\api\dist\server.min.mjs): verifiedclient.resources.sync,client.resources.findSnapshot,client.content.v4.resources.sync, andclient.content.v4.resources.findSnapshot;translations:158bootstrap returned sequence4, snapshot returned6236records, and46:15record1089266was present.