Content methods: draft, publish
The Content Verbs draft, publish as typed SDK methods, with inputs, result, refusals and an example.
Reference for Content, one group of Content methods.
Content.draft
Draft writes Content of one kind from a brief, such as an article for a question the help center could not answer. Verb page.
interface ContentVerbs {
draft(input: ContentDraftInput, options?: SB.CallOptions): SB.Call<Content>
}Emits Content.drafted.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
kind | string | required | What to write. |
brief | text | required | The question or brief it answers. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
content | Content | required | The draft. |
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The key is valid, but its scopes do not allow this operation. | forbidden | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
Example
import { $ } from 'startup-builder'
const content = await $.Content.draft({ kind: 'article', brief: 'Example brief' })Content.publish
Publish puts a Content draft live on its Site and every Interface, once it passes the Evals for its kind. Verb page.
interface ContentVerbs {
publish(input: ContentPublishInput, options?: SB.CallOptions): SB.Call<Content>
}Emits Content.published.
Inputs
| Input | Type | Required | Description |
|---|---|---|---|
content | Content | required | The draft to publish. |
Returns
| Output | Type | Required | Description |
|---|---|---|---|
content | Content | required | The published Content. |
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The key is valid, but its scopes do not allow this operation. | forbidden | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
Example
import { $ } from 'startup-builder'
const content = await $.Content.publish({ content: 'content_HYlnoorBdP' })