feat(editor): complete the apis block and drop the removed snippets
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -306,6 +306,54 @@ const BLOCK_COMPLETIONS = [
|
||||
"}",
|
||||
].join("\n"),
|
||||
},
|
||||
{
|
||||
label: "apis",
|
||||
detail: "Page-level API call declarations block",
|
||||
documentation:
|
||||
"Declare the API calls available to this page as named entries, each callable via api.<name>() from functions and the `api=` view binding.",
|
||||
snippet: [
|
||||
"apis {",
|
||||
" ${1:searchUsers} ${2|GET,POST,PUT,PATCH,DELETE|} ${3:/api/users} {",
|
||||
" request {",
|
||||
" body {",
|
||||
" ${4:name}?: ${5:string}",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" response {",
|
||||
" return ${6:data}",
|
||||
" }",
|
||||
"",
|
||||
" error {",
|
||||
" return ${7:null}",
|
||||
" }",
|
||||
" }",
|
||||
"}",
|
||||
].join("\n"),
|
||||
},
|
||||
{
|
||||
label: "apis entry",
|
||||
detail: "Single API call declaration",
|
||||
documentation:
|
||||
"Declare a single named API call inside an apis { } block: <name> <METHOD> <path> { request/response/error }.",
|
||||
snippet: [
|
||||
"${1:searchUsers} ${2|GET,POST,PUT,PATCH,DELETE|} ${3:/api/users} {",
|
||||
" request {",
|
||||
" body {",
|
||||
" ${4:name}?: ${5:string}",
|
||||
" }",
|
||||
" }",
|
||||
"",
|
||||
" response {",
|
||||
" return ${6:data}",
|
||||
" }",
|
||||
"",
|
||||
" error {",
|
||||
" return ${7:null}",
|
||||
" }",
|
||||
"}",
|
||||
].join("\n"),
|
||||
},
|
||||
{
|
||||
label: "persist",
|
||||
detail: "Include-only store persistence",
|
||||
|
||||
Reference in New Issue
Block a user