StepPost class
Represents a step for retrieving a post by its URI. Extends PostMixins for post-related operations.
Signature:
typescript
export declare class StepPost<P = StepBuilder, C = null, O extends StepPostOutput = StepPostOutput> extends PostMixins<P, C, O>Extends: PostMixins<P, C, O>
Example 1
Get a specific post:
ts
await Trotsky.init(agent)
.post("at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3l6oveex3ii2l")
.tap((step) => {
console.log(step.context.record.text)
console.log(`Likes: ${step.context.likeCount}`)
})
.run()Example 2
Like a specific post:
ts
await Trotsky.init(agent)
.post("at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.post/3l6oveex3ii2l")
.like()
.run()Constructors
Constructor | Modifiers | Description |
|---|---|---|
Initializes the StepPost instance with the given agent, parent, and URI. |
Properties
Property | Modifiers | Type | Description |
|---|---|---|---|
Resolvable<StepPostUri> | The URI of the post to retrieve, which can be resolved dynamically at runtime. |
Methods
Method | Modifiers | Description |
|---|---|---|
Applies the step logic to retrieve the post and sets the output to the retrieved post's data. If no posts are found, the output is set to | ||
Clones the current step and returns a new instance with the same parameters. | ||
Resolves the query parameters for retrieving the post, including its URI. |