fix(core): Fixed module name inconsistencies and documentation links
This commit is contained in:
34
ts/medium.classes.post.ts
Normal file
34
ts/medium.classes.post.ts
Normal file
@@ -0,0 +1,34 @@
|
||||
import { MediumPublication } from './medium.classes.publication.js';
|
||||
import * as plugins from './medium.plugins.js';
|
||||
|
||||
export interface IPostData {
|
||||
title: string;
|
||||
contentFormat: 'html' | 'markdown';
|
||||
content: string;
|
||||
canonicalUrl: string;
|
||||
tags: string[];
|
||||
publishStatus: 'public' | 'draft' | 'unlisted';
|
||||
}
|
||||
|
||||
export class MediumPost implements IPostData {
|
||||
// STATIC
|
||||
public static async createPost(mediumPublicationArg: MediumPublication, dataArg: IPostData) {
|
||||
const response = await mediumPublicationArg.mediumAccountRef.request(`/publications/${mediumPublicationArg.id}/posts`, 'POST', dataArg);
|
||||
const post = new MediumPost(mediumPublicationArg, response.body.data);
|
||||
return post;
|
||||
}
|
||||
|
||||
// INSTANCE
|
||||
mediumPublicationRef: MediumPublication;
|
||||
|
||||
title: string;
|
||||
contentFormat: 'html' | 'markdown';
|
||||
content: string;
|
||||
canonicalUrl: string;
|
||||
tags: string[];
|
||||
publishStatus: 'public' | 'draft' | 'unlisted';
|
||||
|
||||
constructor(mediumPublication: MediumPublication, dataArg: IPostData) {
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user