feat: add getTags/get_tags to list all tags for a template#1132
feat: add getTags/get_tags to list all tags for a template#1132mishushakov merged 5 commits intomainfrom
Conversation
Add support for listing all tags for a template, matching the existing infra API endpoint. Includes OpenAPI spec update, regenerated clients, SDK methods, types, and unit tests for both SDKs.
- Add explicit type for `item` parameter in getTemplateTags .map() to fix TS7006 error in CLI build - Rewrite generated Python files to match CI's openapi-python-client output style (Union/Optional syntax, f-strings, no __future__ import)
🦋 Changeset detectedLatest commit: b17e297 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
mishushakov
left a comment
There was a problem hiding this comment.
looks very very good, some minor nits. also pls. update the docs
| TemplateBuildStatus, | ||
| TemplateBuildStatusResponse, | ||
| TemplateClass, | ||
| TemplateTag, |
There was a problem hiding this comment.
you need to export this from index.ts as well
There was a problem hiding this comment.
In index.ts there is
94: export * from './template'
Which probably takes care of this? Everything works for me when testing it.
import pkg from './packages/js-sdk/dist/index.js'
const { Template, TemplateTag } = pkg
console.log('TemplateTag:', TemplateTag)
const tags = await Template.getTags('w8h2fkcozzr3bz100iyl')
console.log(`Found ${tags.length} tags:`)
for (const tag of tags) {
console.log(` Tag: ${tag.tag}, Build: ${tag.buildId}, Created: ${tag.createdAt}`)
}
# Conflicts: # packages/js-sdk/src/api/schema.gen.ts # packages/python-sdk/e2b/api/client/api/tags/get_templates_template_id_tags.py # packages/python-sdk/e2b/api/client/models/template_tag.py # spec/openapi.yml
Package ArtifactsBuilt from 355b87e. Download artifacts from this workflow run. JS SDK ( npm install ./e2b-2.13.1-get-template-tags.0.tgzCLI ( npm install ./e2b-cli-2.7.4-get-template-tags.0.tgzPython SDK ( pip install ./e2b-2.14.0+get.template.tags-py3-none-any.whl |
Summary
GET /templates/{templateID}/tagsendpoint to the OpenAPI specTemplate.getTags()to JS/TS SDKTemplate.get_tags()(sync) andAsyncTemplate.get_tags()(async) to Python SDKTemplateTagobjects withtag,buildId, andcreatedAtfieldsTest plan
Template.getTagshappy path + 404 error)