@@ -588,7 +588,7 @@ export class Qiita {
588
588
* @param title 生成される投稿のタイトルの雛形
589
589
* @return テンプレート
590
590
*/
591
- public createTemplate = ( body : string , name : string , tags : Qiita . Tagging , title : string ) : Promise < Qiita . Template > => {
591
+ public createTemplate = ( body : string , name : string , tags : Qiita . Tagging [ ] , title : string ) : Promise < Qiita . Template > => {
592
592
return this . post ( `${ this . endpoint } ${ this . version } /templates` , { body, name, tags, title } ) ;
593
593
}
594
594
@@ -600,8 +600,63 @@ export class Qiita {
600
600
* @param title 生成される投稿のタイトルの雛形
601
601
* @return テンプレート
602
602
*/
603
- public updateTempalte = ( body : string , name : string , tags : Qiita . Tagging , title : string ) : Promise < Qiita . Template > => {
603
+ public updateTempalte = ( body : string , name : string , tags : Qiita . Tagging [ ] , title : string ) : Promise < Qiita . Template > => {
604
604
return this . patch ( `${ this . endpoint } ${ this . version } /templates` , { body, name, tags, title } ) ;
605
605
}
606
606
607
+ /**
608
+ * チーム内に存在するプロジェクト一覧をプロジェクト作成日時の降順で返します。
609
+ * @param page ページ番号 (1から100まで)
610
+ * @param perPage 1ページあたりに含まれる要素数 (1から100まで)
611
+ * @return プロジェクト一覧
612
+ */
613
+ public fetchProjects = ( page : string , perPage : string ) : Promise < Qiita . Project [ ] > => {
614
+ return this . get ( `${ this . endpoint } ${ this . version } /projects` , {
615
+ page,
616
+ per_page : perPage ,
617
+ } ) ;
618
+ }
619
+
620
+ /**
621
+ * プロジェクトを新たに作成します。
622
+ * @param archived このプロジェクトが進行中かどうか
623
+ * @param body Markdown形式の本文
624
+ * @param name プロジェクト名
625
+ * @param tags 投稿に付いたタグ一覧
626
+ * @return プロジェクト
627
+ */
628
+ public createProject = ( archived : boolean , body : string , name : string , tags : Qiita . Tagging [ ] ) : Promise < Qiita . Project > => {
629
+ return this . post ( `${ this . endpoint } ${ this . version } /projects` , { archived, body, name, tags } ) ;
630
+ }
631
+
632
+ /**
633
+ * プロジェクトを削除します。
634
+ * @param projectId プロジェクトID
635
+ * @return 空のオブジェクト
636
+ */
637
+ public deleteProject = ( projectId : string ) : Promise < { } > => {
638
+ return this . delete ( `${ this . endpoint } ${ this . version } /projects/${ projectId } ` ) ;
639
+ }
640
+
641
+ /**
642
+ * プロジェクトを返します。
643
+ * @param projectId プロジェクトID
644
+ * @return プロジェクト
645
+ */
646
+ public fetchProject = ( projectId : string ) : Promise < Qiita . Project > => {
647
+ return this . get ( `${ this . endpoint } ${ this . version } /projects/${ projectId } ` ) ;
648
+ }
649
+
650
+ /**
651
+ * プロジェクトを更新します。
652
+ * @param archived このプロジェクトが進行中かどうか
653
+ * @param body Markdown形式の本文
654
+ * @param name プロジェクト名
655
+ * @param tags 投稿に付いたタグ一覧
656
+ * @return プロジェクト
657
+ */
658
+ public updateProject = ( archived : boolean , body : string , name : string , tags : Qiita . Tagging [ ] ) : Promise < Qiita . Project > => {
659
+ return this . patch ( `${ this . endpoint } ${ this . version } /projects` , { archived, body, name, tags } ) ;
660
+ }
661
+
607
662
}
0 commit comments