UNPKG

@inkwell.ar/sdk

Version:

SDK for interacting with the Inkwell Blog CRUD AO process using aoconnect

94 lines 3.17 kB
import { BlogSDK, BlogSDKConfig, ApiResponse, BlogPost, BlogDetails, BlogInfo, UpdateBlogDetailsData, GetPostsOptions, GetPostOptions, CreatePostOptions, UpdatePostOptions, DeletePostOptions, RoleManagementOptions, RoleUpdateResult, DeployOptions, DeployResult } from '../types'; export declare class InkwellBlogSDK implements BlogSDK { private processId; private aoconnect; constructor(config: BlogSDKConfig); /** * Get the appropriate signer for the wallet */ private getSigner; /** * Get the result of a message using its message ID */ private getMessageResult; /** * Deploy a new Inkwell Blog process */ static deploy(options?: DeployOptions): Promise<DeployResult>; /** * Get blog information */ getInfo(): Promise<ApiResponse<BlogInfo>>; /** * Get all posts from the blog */ getAllPosts(options?: GetPostsOptions): Promise<ApiResponse<BlogPost[]>>; /** * Get a specific post by ID */ getPost(options: GetPostOptions): Promise<ApiResponse<BlogPost>>; /** * Get user roles for the current wallet */ getUserRoles(walletAddress: string): Promise<ApiResponse<string[]>>; /** * Create a new post (Editor role required) */ createPost(options: CreatePostOptions): Promise<ApiResponse<BlogPost | string>>; /** * Update an existing post (Editor role required) */ updatePost(options: UpdatePostOptions): Promise<ApiResponse<BlogPost | string>>; /** * Delete a post (Editor role required) */ deletePost(options: DeletePostOptions): Promise<ApiResponse<string>>; /** * Add editors to the blog (Admin role required) */ addEditors(options: RoleManagementOptions): Promise<ApiResponse<RoleUpdateResult[] | string>>; /** * Remove editors from the blog (Admin role required) */ removeEditors(options: RoleManagementOptions): Promise<ApiResponse<RoleUpdateResult[] | string>>; /** * Add admins to the blog (Admin role required) */ addAdmins(options: RoleManagementOptions): Promise<ApiResponse<RoleUpdateResult[] | string>>; /** * Remove admins from the blog (Admin role required) */ removeAdmins(options: RoleManagementOptions): Promise<ApiResponse<RoleUpdateResult[] | string>>; /** * Get all editors (Admin role required) */ getEditors(): Promise<ApiResponse<string[]>>; /** * Get all admins (Admin role required) */ getAdmins(): Promise<ApiResponse<string[]>>; /** * Set blog details (Admin role required) */ setBlogDetails(options: { data: UpdateBlogDetailsData; wallet?: any; }): Promise<ApiResponse<BlogDetails | string>>; /** * Parse the response */ private parseResponse; /** * Parse the response from dryrun operations */ private parseDryrunResponse; /** * Parse the response from message result operations */ private parseMessageResponse; /** * Parse the Info response from the AO process */ private parseInfoResponse; } //# sourceMappingURL=blog-sdk.d.ts.map