Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/new-yaks-sneeze.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'e2b': patch
---

Add v2 template update endpoint with TemplateUpdateResponse containing namespaced names
5 changes: 5 additions & 0 deletions .changeset/nine-lies-show.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@e2b/cli': minor
---

Use v2 template update endpoint and display namespaced template name after publishing
10 changes: 7 additions & 3 deletions packages/cli/src/commands/template/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { handleE2BRequestError } from '../../utils/errors'
import { getUserConfig } from 'src/user'

async function publishTemplate(templateID: string, publish: boolean) {
const res = await client.api.PATCH('/templates/{templateID}', {
const res = await client.api.PATCH('/v2/templates/{templateID}', {
params: {
path: {
templateID,
Expand All @@ -40,7 +40,8 @@ async function publishTemplate(templateID: string, publish: boolean) {
res,
`Error ${publish ? 'publishing' : 'unpublishing'} sandbox template`
)
return

return res.data?.names ?? []
}

async function templateAction(
Expand Down Expand Up @@ -181,7 +182,10 @@ async function templateAction(
e.configPath
)}`
)
await publishTemplate(e.template_id, publish)
const names = await publishTemplate(e.template_id, publish)
if (publish && names.length > 0) {
console.log(` Published as: ${asBold(names.join(', '))}`)
}
})
)
process.stdout.write('\n')
Expand Down
68 changes: 65 additions & 3 deletions packages/js-sdk/src/api/schema.gen.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions packages/python-sdk/e2b/api/client/models/__init__.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading