feat: Templates endpoint (public templates)#55
feat: Templates endpoint (public templates)#55Patrik Simek (patriksimek) merged 19 commits intomainfrom
Conversation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Use direct property access pattern instead of destructuring in listPublic method. Improve JSDoc on list and listPublic. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove conditional expect calls in integration tests to satisfy jest/no-conditional-expect. Apply prettier formatting. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Public templates use URL slugs (e.g. "12289-add-webhook-data-to-a-google-sheet"), not numeric IDs, so the private getBlueprint endpoint returns 404 for them. Add dedicated methods hitting /templates/public/:templateUrl and /templates/public/:templateUrl/blueprint plus matching MCP tools. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove the private-template surface (Template/list/get/getBlueprint addressable by numeric ID) and rename the public variants (TemplatePublic/listPublic/getPublic/getPublicBlueprint) to the base names. Tests, mocks, MCP tools, index exports, and the live smoke script are updated to match. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Second CLI arg is now a comma-separated list of app identifiers
forwarded as templates.list({ usedApps }). Example:
node scripts/test-templates.mjs webhook google-sheets
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds a new public Templates API surface to the SDK (list/get/blueprint by URL slug) and exposes it via MCP tools, with mocked unit tests plus live integration tests.
Changes:
- Introduce
Templatesendpoint (list,get,getBlueprint) and export associated types. - Register 3 MCP tools:
templates_list,templates_get,templates_get-blueprint. - Add unit test coverage with JSON fixtures plus new live integration tests and a local smoke script.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| test/templates.spec.ts | Adds mocked unit tests for templates list/get/blueprint. |
| test/templates.integration.test.ts | Adds live API integration tests for templates endpoints. |
| test/mocks/templates/list.json | Mock response fixture for listing public templates. |
| test/mocks/templates/get.json | Mock response fixture for fetching a single public template. |
| test/mocks/templates/blueprint.json | Mock fixture for blueprint payload shape returned by the API. |
| src/mcp.ts | Registers the new templates MCP tool module. |
| src/make.ts | Wires make.templates into the main SDK entrypoint. |
| src/index.ts | Exports template-related types from the package entrypoint. |
| src/endpoints/templates.ts | Implements the Templates endpoint and its types. |
| src/endpoints/templates.mcp.ts | Implements MCP tool wrappers for templates endpoints. |
| scripts/test-templates.mjs | Adds a local smoke script to exercise the new endpoint against live API. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ted types and imports
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
# Conflicts: # src/mcp.ts
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Adds a new public Templates API surface to the SDK (list/get/blueprint by URL slug) and exposes it via MCP tools, with mocked unit tests plus live integration tests.